Graph Definitions
REST endpoints for graph definitions. Bearer-auth required.
GET /api/graph-definitions
List graph definitions.
Query parameters
limit(optional): Page size (1–100, default 100).after(optional): Keyset cursor — return the page after this row (next page).before(optional): Keyset cursor — return the page before this row (prev page).ids(optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).filter(optional): Nested filter expression (<Entity>Filter): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.orderBy(optional): Multi-key sort (<Entity>OrderBy[]): array of{ field: direction }applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.workspace_id(optional): Filter graph definitions to this workspace.include_deleted(optional): Soft-deleted graph definition visibility.false(default) — active rows only.true— active plus soft-deleted.only— soft-deleted only (trash view).created_by(optional): Shorthand: filter wherecreatedByequals this value.retention_tier(optional): Shorthand: filter whereretentionTierequals this value.
Response
JSON
{
"data": [
{
"id": "<...>",
"workspaceId": "<...>",
"name": "<...>",
"slug": "<...>",
"description": "<...>",
"nodeDefinitions?": "<...>",
"edgeDefinitions?": "<...>",
"graphCount?": "<...>",
"createdBy": "<...>",
"deletedAt": "<...>",
"retentionTier": "<...>",
"createdAt": "<...>",
"updatedAt": "<...>"
}
],
"pageInfo": {
"total": "number",
"hasNextPage": "boolean",
"hasPreviousPage": "boolean",
"startCursor": "string",
"endCursor": "string"
}
}GET /api/graph-definitions/{id}
Get a graph definition by ID, including node + edge definitions.
Path parameters
id(required): Graph definition to retrieve.
Response
JSON
{
"id": "string",
"workspaceId": "string",
"name": "string",
"slug": "string",
"description": "string",
"nodeDefinitions?": ["<...>"],
"edgeDefinitions?": ["<...>"],
"graphCount?": "number",
"createdBy": "string",
"deletedAt": "string",
"retentionTier": "any",
"createdAt": "string",
"updatedAt": "string"
}DELETE /api/graph-definitions/{id}
Soft-delete a graph definition and all its instances.
Path parameters
id(required): Graph definition to soft-delete.
Response
JSON
{
"success": "boolean"
}DELETE /api/graph-definitions/{id}/purge
Permanently delete a soft-deleted graph definition.
Path parameters
id(required): Soft-deleted graph definition to permanently delete.
Response
JSON
{
"success": "boolean"
}POST /api/graph-definitions/{id}/restore
Restore a soft-deleted graph definition.
Path parameters
id(required): Soft-deleted graph definition to restore.
Response
JSON
{
"id": "string",
"workspaceId": "string",
"name": "string",
"slug": "string",
"description": "string",
"nodeDefinitions?": ["<...>"],
"edgeDefinitions?": ["<...>"],
"graphCount?": "number",
"createdBy": "string",
"deletedAt": "string",
"retentionTier": "any",
"createdAt": "string",
"updatedAt": "string"
}