Elements

REST endpoints for elements. Bearer-auth required.

GET /api/elements

List elements.

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 elements to this workspace.
  • include_deleted (optional): Soft-deleted element visibility. false (default) — active rows only. true — active plus soft-deleted. only — soft-deleted only.
  • name (optional): Case-insensitive substring match on name.
  • source (optional): Narrow by source. workspace = this workspace's elements plus those visible via installed integrations; integration = only elements made visible by installed integrations; omit = union.
  • status (optional): Shorthand: filter where status equals this value.
  • default_version_id (optional): Shorthand: filter where defaultVersionId equals this value.
  • created_by (optional): Shorthand: filter where createdBy equals this value.
  • retention_tier (optional): Shorthand: filter where retentionTier equals this value.

Response

JSON
{
  "data": [
    {
      "id": "<...>",
      "workspaceId": "<...>",
      "name": "<...>",
      "description": "<...>",
      "status": "<...>",
      "visibility": "<...>",
      "defaultVersionId": "<...>",
      "defaultExportName": "<...>",
      "createdBy": "<...>",
      "deletedAt": "<...>",
      "retentionTier": "<...>",
      "createdAt": "<...>",
      "updatedAt": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}

POST /api/elements

Create element

Request body

JSON
{
  "workspaceId": "string",
  "name": "string",
  "description?": "string",
  "visibility?": "private | public",
  "files?": [
    {
      "path": "<...>",
      "content": "<...>"
    }
  ]
}

Response

JSON
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "status": "draft | live",
  "visibility": "private | public",
  "defaultVersionId": "string",
  "defaultExportName": "string",
  "createdBy": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}

GET /api/elements/{id}

Get a single element.

Path parameters

  • id (required): Element to retrieve.

Response

JSON
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "status": "draft | live",
  "visibility": "private | public",
  "defaultVersionId": "string",
  "defaultExportName": "string",
  "createdBy": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}

PATCH /api/elements/{id}

Update element

Path parameters

  • id (required):

Request body

JSON
{
  "name?": "string",
  "description?": "string",
  "visibility?": "private | public",
  "defaultVersionId?": "string"
}

Response

JSON
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "status": "draft | live",
  "visibility": "private | public",
  "defaultVersionId": "string",
  "defaultExportName": "string",
  "createdBy": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}

DELETE /api/elements/{id}

Soft-delete an element.

Path parameters

  • id (required): Element to soft-delete.

Response

JSON
{
  "success": "boolean"
}

DELETE /api/elements/{id}/purge

Permanently delete a soft-deleted element.

Path parameters

  • id (required): Soft-deleted element to permanently delete.

Response

JSON
{
  "success": "boolean"
}

POST /api/elements/{id}/restore

Restore a soft-deleted element.

Path parameters

  • id (required): Soft-deleted element to restore.

Response

JSON
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "status": "draft | live",
  "visibility": "private | public",
  "defaultVersionId": "string",
  "defaultExportName": "string",
  "createdBy": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}