List graphs - 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 \
 --header "Authorization: Bearer <token>"

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"),
)
page = client.graphs.list()
page = page.data[0]
print(page.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() {
  // Automatically fetches more pages as needed.
  for await (const graph of client.graphs.list()) {
    console.log(graph.id);
  }
}

main();

Sample Response

{
  "data": [
    {
      "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": 11
      },
      "type": "manual",
      "urls": null
    },
    {
      "id": "e7392337-1c4e-4bc9-aaf5-b719bf1e938a",
      "created_at": "2024-07-10T15:03:39.881370Z",
      "name": "Another example Knowledge Graph",
      "description": "Another example description",
      "file_status": {
        "in_progress": 0,
        "completed": 0,
        "failed": 0,
        "total": 0
      },
      "type": "web",
      "urls": [
        {
          "url": "https://docs.example.com",
          "status": {
            "status": "success",
            "error_type": null
          },
          "type": "single_page"
        }
      ]
    }
  ],
  "first_id": "50daa3d0-e7d9-44a4-be42-b53e2379ebf7",
  "last_id": "e7392337-1c4e-4bc9-aaf5-b719bf1e938a",
  "has_more": true
}

Knowledge Graphs

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

Query Parameters

Response