---
title: "Create graph"
method: POST
path: "/v1/graphs"
tags: ["KG API"]
---

# Create graph

`POST /v1/graphs`

## Request

- Base URL: `https://api.writer.com`
- URL: `https://api.writer.com/v1/graphs`
- Auth: HTTP bearer

Create a new Knowledge Graph.

By default, the new Knowledge Graph is org-wide (accessible to every team in the organization). To deploy the Knowledge Graph to specific teams instead, provide a `team_ids` array in the request body. When the request is authenticated with a team-scoped API key, the new Knowledge Graph is automatically assigned to that key's team and `team_ids` in the body is not accepted.

## Request body

- GraphRequest
  - `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.
  - `team_ids` integer[]: Optional list of team IDs to deploy the Knowledge Graph to. Omit the field or pass an empty array to create an org-wide Knowledge Graph (accessible to every team in the organization), which is the default. Provide one or more team IDs to scope the Knowledge Graph to those teams. Only applies when using an org-scoped API key; requests made with a team-scoped API key ignore this field and always assign the graph to that key's team.

## Response `200`

- GraphResponse
  - `id` string, uuid, required: A unique identifier of the Knowledge Graph.
  - `created_at` string, date-time, 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` WebConnectorUrl[]: An array of web connector URLs associated with this Knowledge Graph.
    - `url` string, required: The URL to be processed by the web connector.
    - `status` WebConnectorUrlState, required: The state of a web connector URL processing.
      - `status` 'validating' | 'success' | 'error', required: The status of web connector URL processing.
      - `error_type` 'invalid_url' | 'not_searchable' | 'not_found' | 'paywall_or_login_page' | 'unexpected_error': The type of error that can occur during web connector URL processing.
    - `exclude_urls` string[]: An array of URLs to exclude from processing within this web connector.
    - `type` 'single_page' | 'sub_pages', required: The type of web connector processing for a URL.
  - `team_ids` integer[]: The team IDs the Knowledge Graph is deployed to. An empty array indicates an org-wide Knowledge Graph accessible to every team in the organization.

## Changes

- **2026-08-28** `55e7d6385506`: 2 info
  - added the new optional request property `team_ids`
  - added the optional property `team_ids` to the response with the `200` status
- **2025-08-12** `0bbaae2a6920`: 1 info
  - added the optional property `urls` to the response with the `200` status
- **2025-02-25** `3d3b2fe43375`: 1 info
  - the request property `name` became optional
- **2024-10-03** `4a11c63c7cb5`: 1 breaking
  - the request property `name` became required
- **2024-08-08** `4a89aa730a0c`: 1 info
  - the request property `name` became optional

[Operation history](https://skmtc.dev/writer/apis/writer-api/changes/v1/graphs/post.md)

---

[API](https://skmtc.dev/writer/apis/writer-api.md) - [All operations](https://skmtc.dev/writer/apis/writer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/writer/apis/writer-api/revisions/59865afc5779?raw)
