Retrieve 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 GET https://api.writer.com/v1/graphs/{graph_id} \
 --header "Authorization: Bearer <token>"
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.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(graph.id)
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.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(graph.id);
}

main();

Response

{
  "id": "50daa3d0-e7d9-44a4-be42-b53e2379ebf7",
  "created_at": "2024-07-10T15:03:48.785843Z",
  "name": "Example Knowledge Graph",
  "description": "Example description",
  "file_status": {
    "in_progress": 0,
    "completed": 0,
    "failed": 0,
    "total": 0
  },
  "type": "web",
  "urls": [
    {
      "url": "https://example.com/docs",
      "status": {
        "status": "success",
        "error_type": null
      },
      "type": "sub_pages"
    },
    {
      "url": "https://docs.example.com",
      "status": {
        "status": "error",
        "error_type": "invalid_url"
      },
      "type": "single_page"
    }
  ]
}

Knowledge Graphs deployed to a specific team aren’t accessible via the API or SDK. To use a Knowledge Graph via the API or SDK, configure it with “All Teams” access in AI Studio.

Authorizations

Authorization
string
header
required
Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key.

Path Parameters

graph_id
string
required
The unique identifier of the Knowledge Graph.

Response

200 - application/json
id
string
required
The 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.
file_status
graph_file_status · object
required
The processing status of files in the Knowledge Graph.
type
enum
required
The type of Knowledge Graph.

Available options: manual,
connector,
web
description
string
A description of the Knowledge Graph.
urls
web_connector_url · object[]
An array of web connector URLs associated with this Knowledge Graph.