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();{
"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"
}
],
"team_ids": []
}Knowledge Graphs API
Retrieve graph
Retrieve a Knowledge Graph.
GET
/
v1
/
graphs
/
{graph_id}
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();{
"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"
}
],
"team_ids": []
}Knowledge Graphs can be deployed org-wide (accessible to every team in the organization) or deployed to specific teams. Both are accessible via the API and SDK.
- 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.
Path Parameters
The unique identifier of the Knowledge Graph.
Response
200 - application/json
The unique identifier of the Knowledge Graph.
The timestamp when the Knowledge Graph was created.
The name of the Knowledge Graph.
The processing status of files in the Knowledge Graph.
Show child attributes
Show child attributes
The type of Knowledge Graph.
manual: files are uploaded via UI or APIconnector: files are uploaded via a data connector such as Google Drive or Confluenceweb: URLs are connected to the Knowledge Graph
Available options:
manual, connector, web A description of the Knowledge Graph.
An array of web connector URLs associated with this Knowledge Graph.
Show child attributes
Show child attributes
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.
Was this page helpful?