Create graph - Writer AI Studio

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

cURL

curl --location --request POST https://api.writer.com/v1/graphs \
 --header "Authorization: Bearer <token>" \
 --header "Content-Type: application/json" \
--data-raw '{"name":"string"}'

Python Example

import os
from writerai import Writer

client = Writer(
    # This is the default and can be omitted
    api_key=os.environ.get("WRITER_API_KEY"),
)
graph = client.graphs.create(
    name="name",
)
print(graph.id)

JavaScript Example

import Writer from 'writer-sdk';

const client = new Writer({
  apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const graph = await client.graphs.create({ name: 'name' });

console.log(graph.id);
}

main();

Response Example

{
  "id": "50daa3d0-e7d9-44a4-be42-b53e2379ebf7",
  "created_at": "2024-07-10T13:34:28.301201Z",
  "name": "Example Knowledge Graph",
  "description": "Example description",
  "urls": null
}

Authorizations

Authorization

string
header
required
Bearer authentication header of the form `Bearer <token>`, where `<token>` is your [Writer API key](https://dev.writer.com/api-reference/api-keys).

Body

application/json

Response

200 - application/json