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
name: string
The name of the Knowledge Graph (max 255 characters). Omitting this field leaves the name unchanged.description: string
A description of the Knowledge Graph (max 255 characters). Omitting this field leaves the description unchanged.
Response
200 - application/json
id: string
(required)
A unique identifier of the Knowledge Graph.created_at: string
(required)
The timestamp when the Knowledge Graph was created.name: string (required)
The name of the Knowledge Graph (max 255 characters).description: string
A description of the Knowledge Graph (max 255 characters).urls: web_connector_url · object[]
An array of web connector URLs associated with this Knowledge Graph.