curl --location --request PUT https://api.writer.com/v1/graphs/{graph_id} \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"name":"string", "description":"string", "urls":[{"url":"https://example.com/docs", "type":"sub_pages", "exclude_urls":["https://example.com/docs/private"]}]}'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.update(
graph_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
name="name",
description="description",
)
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.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ name: 'name', description: 'description' }
);
console.log(graph.id);
}
main();{
"id": "50daa3d0-e7d9-44a4-be42-b53e2379ebf7",
"created_at": "2024-07-10T15:03:48.785843Z",
"name": "Updated graph name",
"description": "Updated graph description",
"urls": [
{
"url": "https://example.com/docs",
"status": {
"status": "success",
"error_type": null
},
"type": "sub_pages"
}
],
"team_ids": []
}Update graph
Update the name, description, web connector URLs, or team assignment of a Knowledge Graph.
Including a team_ids array replaces the whole team assignment: an empty array makes the Knowledge Graph org-wide, one or more team IDs scope it to exactly those teams. Omitting team_ids leaves the current team assignment unchanged. Team-scoped API keys cannot change the team assignment of a Knowledge Graph.
curl --location --request PUT https://api.writer.com/v1/graphs/{graph_id} \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"name":"string", "description":"string", "urls":[{"url":"https://example.com/docs", "type":"sub_pages", "exclude_urls":["https://example.com/docs/private"]}]}'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.update(
graph_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
name="name",
description="description",
)
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.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ name: 'name', description: 'description' }
);
console.log(graph.id);
}
main();{
"id": "50daa3d0-e7d9-44a4-be42-b53e2379ebf7",
"created_at": "2024-07-10T15:03:48.785843Z",
"name": "Updated graph name",
"description": "Updated graph description",
"urls": [
{
"url": "https://example.com/docs",
"status": {
"status": "success",
"error_type": null
},
"type": "sub_pages"
}
],
"team_ids": []
}- With an org-scoped API key, control team scope from the request body: pass
team_idson create or update, or filter list with theteam_idsquery parameter. Omitteam_idson list to see only org-wide Knowledge Graphs. - With a team-scoped API key, every request is automatically restricted to the key’s team. Create assigns to that team; list and retrieve return only that team’s Knowledge Graphs; body
team_idsis not accepted.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key.
Body
Optional list of team IDs the Knowledge Graph is deployed to. Omitting this field leaves the current team assignment unchanged. Passing an array replaces the whole team assignment: an empty array makes the graph org-wide, one or more team IDs scope it to exactly those teams. Not accepted from team-scoped API keys.
Response
Was this page helpful?