cURL
curl --location --request DELETE https://api.writer.com/v1/graphs/{graph_id}/file/{file_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"),
)
response = client.graphs.remove_file_from_graph(
file_id="file_id",
graph_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.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 response = await client.graphs.removeFileFromGraph('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 'file_id');
console.log(response.id);
}
main();{
"id": "7c36a365-392f-43ba-840d-8f3103b42572",
"deleted": true
}Knowledge Graphs API
Remove file from graph
Remove a file from a Knowledge Graph.
DELETE
/
v1
/
graphs
/
{graph_id}
/
file
/
{file_id}
cURL
curl --location --request DELETE https://api.writer.com/v1/graphs/{graph_id}/file/{file_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"),
)
response = client.graphs.remove_file_from_graph(
file_id="file_id",
graph_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.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 response = await client.graphs.removeFileFromGraph('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 'file_id');
console.log(response.id);
}
main();{
"id": "7c36a365-392f-43ba-840d-8f3103b42572",
"deleted": true
}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 to which the files belong.
The unique identifier of the file.
Was this page helpful?