# Logging Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/backoffice-api/logging Retrieve Zylon platform logs manually from the Backoffice API. The Backoffice Logging endpoints let authorized Backoffice users retrieve stored Zylon logs for investigation, review, export, or integration jobs. This page covers manual retrieval only. For external syslog or HTTP delivery, see [Log Delivery and Storage configuration](/en/v1.57/operator-manual/configuration/features/log-delivery-storage). These endpoints are read-only. The documented API exposes `GET` operations for listing stored logs and usage data; it does not expose per-record update, patch, or delete operations. ## Authentication and permissions | Requirement | Value | | - | - | | Authentication | Account token or account session | | Role | At least the `operator` role | ```bash theme={null} curl "https://{BASE_URL}/v1/platform/logs?page=0&page_size=50" \ -H "Authorization: Bearer {API_TOKEN}" ``` Workspace-only tokens are not enough for these endpoints. For operator-facing guidance on governance, evidence preservation, and SIEM delivery, see [Auditability & AI Governance: Logging, Evidence, and SIEM Delivery](/en/v1.57/operator-manual/backoffice/log-delivery-storage). ## Endpoints | Endpoint | Purpose | | - | - | | `GET /v1/platform/logs` | List stored platform logs across gateway, workspace, security, and backoffice event families. | | `GET /v1/platform/gateway/{gatewayId}/logs` | List stored logs for one gateway. | | `GET /v1/platform/usage` | Return limited AI usage data for usage charts and token/tool analysis. | ## Pagination The two log list endpoints return a page envelope: ```json theme={null} { "data": [], "next_cursor": "01985a54-2f4d-7000-8001-4d7f7a6d9a10", "previous_cursor": null, "has_next_page": true, "has_previous_page": false, "total_count": null } ``` Supported page parameters: | Parameter | Description | | - | - | | `page` | Zero-based absolute page index. Cannot be combined with cursor pagination. | | `page_size` | Absolute page size. Default is `50`. | | `page_order` | ID tie-breaker order used by pagination. | | `after` | Cursor for forward pagination. | | `before` | Cursor for backward pagination. | | `first` | Forward cursor page size. Default is `50`. | | `last` | Backward cursor page size. | | `total_count` | Set to `true` to include `total_count`. | Logs are ordered by `start_timestamp` descending. The backend adds log ID ordering as a stable tie-breaker. ## Shared log filters `GET /v1/platform/logs` and `GET /v1/platform/gateway/{gatewayId}/logs` support these query parameters: | Parameter | Description | | - | - | | `gatewayId` | Match logs for one gateway. On the gateway route, the path value overrides this query value. | | `tokenId` or `token_id` | Match logs created through one API token. | | `event` | Match one event family: `zylon.gateway.http`, `zylon.gateway.chat`, `zylon.gateway.embed`, `zylon.gateway.ingest`, `zylon.workspace`, `zylon.security`, or `zylon.backoffice`. | | `action` | Match one action, such as `ws.project.create`, `ws.interaction.create`, `backoffice.api_token.create`, or `security.auth.invalid_token`. | | `organizationId` | Match one organization. | | `projectId` | Match project-linked workspace or security logs. | | `start_date` | Unix epoch milliseconds. Matches logs with `start_timestamp >= start_date`. | | `end_date` | Unix epoch milliseconds. Matches logs with `end_timestamp <= end_date`. | | `include` | Comma-separated list of heavier fields: `InputPayload`, `Payload`, `Data`, `ChatRequestParameters`, `ChatRequestMessages`, `ChatResponse`. | Without `include`, `input_payload` and `payload` are returned as empty objects and `data` is omitted. Use `include=Data` for structured per-event data. Add chat-specific include values only when needed. The `include` parameter controls retrieval shape only. It does not enable or disable collection. If request messages or responses are present in stored chat logs, they are returned only when the caller requests the corresponding include value. Retrieving very large chat logs can take time, especially when the requested scope is large or when messages and responses are included. ## Event families and actions | Event | Description | | - | - | | `zylon.gateway.http` | Gateway HTTP request logs. | | `zylon.gateway.chat` | Gateway chat usage logs. | | `zylon.gateway.embed` | Gateway embedding usage logs. | | `zylon.gateway.ingest` | Gateway ingestion usage logs. | | `zylon.workspace` | Workspace audit logs for projects, users, files, chats, integrations, and hard delete activity. | | `zylon.security` | Authentication and authorization security logs. | | `zylon.backoffice` | Backoffice account, API token, and log retrieval audit logs. | | Action | Category | Description | | - | - | - | | `ws.project.create` | Workspace | Project created. | | `ws.project.update` | Workspace | Project updated. | | `ws.project.delete` | Workspace | Project deleted. | | `ws.project.member.add` | Workspace | Project member added. | | `ws.project.member.leave` | Workspace | Project member left. | | `ws.project.member.remove` | Workspace | Project member removed. | | `ws.project.member.role.update` | Workspace | Project member role updated. | | `ws.project.ownership.transfer` | Workspace | Project ownership transferred. | | `ws.hard_delete` | Workspace | Hard delete cleanup action. | | `ws.artifact.create` | Workspace | File or artifact created. | | `ws.artifact.update` | Workspace | File or artifact updated. | | `ws.artifact.delete` | Workspace | File or artifact deleted. | | `ws.artifact.download` | Workspace | File or artifact downloaded. | | `ws.thread.create` | Workspace | Chat created. | | `ws.thread.update` | Workspace | Chat updated. | | `ws.thread.delete` | Workspace | Chat deleted. | | `ws.interaction.create` | Workspace | Chat message or response created. | | `ws.org.update` | Workspace | Organization settings updated. | | `ws.user.create` | Workspace | User created. | | `ws.user.enable` | Workspace | User enabled. | | `ws.user.disable` | Workspace | User disabled. | | `ws.user.role.update` | Workspace | User role updated. | | `ws.integration.create` | Workspace | Integration created. | | `ws.integration.configure` | Workspace | Integration configured. | | `ws.integration.sync.complete` | Workspace | Integration sync completed. | | `ws.integration.sync.failed` | Workspace | Integration sync failed. | | `backoffice.account.create` | Backoffice | Account created. | | `backoffice.account.login` | Backoffice | Account login. | | `backoffice.account.pwd.reset` | Backoffice | Account password reset. | | `backoffice.account.pwd.change` | Backoffice | Account password changed. | | `backoffice.api_token.create` | Backoffice | API token created. | | `backoffice.api_token.delete` | Backoffice | API token deleted. | | `backoffice.gateway_logs.read` | Backoffice | Gateway-scoped logs retrieved. | | `backoffice.logs.read` | Backoffice | Platform logs retrieved. | | `security.auth.no_credentials` | Security | Authentication attempted without credentials. | | `security.auth.failed_login` | Security | Login failed. | | `security.auth.invalid_token` | Security | Invalid token used. | | `security.auth.expired_token` | Security | Expired token used. | | `security.auth.invalid_session` | Security | Invalid session used. | | `security.auth.malformed_header` | Security | Malformed authentication header received. | This event list covers documented application events. Helm-level logging configuration changes, such as changing retention or delivery destinations, should also be captured through customer change-management, GitOps, Kubernetes audit, or infrastructure audit controls. ## Log record schema Each item returned by the log list endpoints is a `ZylonLogDTO`. | Field | Notes | | - | - | | `id` | Log ID. | | `gateway_id` | Gateway context when available. | | `system_event` | Whether the backend marked the event as system-originated. | | `request_id` | Request or generated correlation ID. | | `event` | Event family. | | `action` | Action name when available. | | `organization_id` | Organization context when available. | | `user_id` | Workspace user context when available. | | `account_id`, `account_email` | Account context when available. | | `token_id` | API token context when available. | | `start_timestamp`, `end_timestamp` | ISO timestamps. | | `ip_address` | Source IP when available. | | `metadata` | Additional backend metadata. | | `input_payload`, `payload` | Included only when requested. Sensitive request keys are masked before storage. | | `error` | Error message or class name when logged. | | `data` | Included only with `include=Data`; shape depends on `event`. | Structured `data` can include workspace, HTTP, security, chat, embed, or ingest fields. Chat data can include model, token counts, request metadata, optional request messages, optional response, latency metrics, and `tools_used`. Sensitive request keys such as passwords, tokens, API keys, secrets, credentials, cookies, and connection strings are masked before request input payloads are stored. Do not build export workflows that require recovering masked values from logs. ## List platform logs ```http theme={null} GET /v1/platform/logs ``` Retrieves stored logs across gateway, workspace, backoffice, and security event families. ### Example request ```bash theme={null} curl "https://{BASE_URL}/v1/platform/logs?event=zylon.workspace&action=ws.project.create&organizationId={ORG_ID}&page=0&page_size=50&total_count=true&include=Data,Payload" \ -H "Authorization: Bearer {API_TOKEN}" ``` ### Example response ```json theme={null} { "data": [ { "id": "01985a54-2f4d-7000-8001-4d7f7a6d9a10", "gateway_id": "01985a50-6a8f-7000-8002-2149efc07b20", "system_event": false, "request_id": "req-01HZX9P6J8P5E2V0XQW7C9A2M4", "event": "zylon.workspace", "action": "ws.project.create", "organization_id": "01985a4d-3c21-7000-8003-0e10dd81d901", "user_id": "01985a4e-9811-7000-8004-d8f56e017c11", "account_id": "01985a4f-a802-7000-8005-cd0c96f1a221", "account_email": "operator@example.com", "token_id": null, "start_timestamp": "2026-05-19T09:21:43.120Z", "end_timestamp": "2026-05-19T09:21:43.120Z", "ip_address": "203.0.113.10", "metadata": {}, "input_payload": {}, "payload": { "project_id": "01985a55-d4e5-7000-8006-41ce955b14a0", "name": "Customer Insights" }, "error": null, "data": { "type": "workspace", "id": "01985a54-2f4d-7000-8001-4d7f7a6d9a10", "node_id": "01985a55-d4e5-7000-8006-41ce955b14a0", "project_id": "01985a55-d4e5-7000-8006-41ce955b14a0" } } ], "next_cursor": "01985a54-2f4d-7000-8001-4d7f7a6d9a10", "previous_cursor": null, "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` ## List gateway logs ```http theme={null} GET /v1/platform/gateway/{gatewayId}/logs ``` Retrieves stored logs for one gateway. The `{gatewayId}` path parameter is applied by the backend and overrides any `gatewayId` query parameter. | Path parameter | Description | | - | - | | `gatewayId` | Gateway whose logs should be returned. | ### Example request ```bash theme={null} curl "https://{BASE_URL}/v1/platform/gateway/{GATEWAY_ID}/logs?event=zylon.gateway.chat&tokenId={TOKEN_ID}&first=25&include=Data,ChatRequestMessages,ChatResponse" \ -H "Authorization: Bearer {API_TOKEN}" ``` ## List AI usage logs ```http theme={null} GET /v1/platform/usage ``` Returns a non-paginated list of limited AI usage records. This endpoint is optimized for usage charts. It returns data related to AI usage only: token consumption, tools used, and usage events for chat, embedding, and ingestion activity. It does not return full log payloads, request prompts, full responses, security events, workspace audit records, or backoffice events. Use the log list endpoints with `include` when you need full stored log records. ### Usage filters | Parameter | Description | | - | - | | `gatewayId` | Comma-separated gateway IDs. | | `tokenId` | Match one API token. | ### Usage response schema | Field | Notes | | - | - | | `id` | Log ID. | | `gateway_id` | Gateway ID. | | `token_id` | API token ID when available. | | `start_timestamp` | ISO timestamp. | | `event` | Usage event family. | | `data` | Usage payload. Chat data includes request tokens, response tokens, and tools used. Ingest data includes artifact ID. Embed records currently return usage event metadata without an extra data payload. | ### Example request ```bash theme={null} curl "https://{BASE_URL}/v1/platform/usage?gatewayId={GATEWAY_ID}&tokenId={TOKEN_ID}" \ -H "Authorization: Bearer {API_TOKEN}" ``` ### Example response ```json theme={null} [ { "id": "01985a64-7e31-7000-8001-4f52b1dd2a89", "gateway_id": "01985a50-6a8f-7000-8002-2149efc07b20", "token_id": "01985a62-bbe7-7000-8007-828344268abc", "start_timestamp": "2026-05-19T09:30:12.004Z", "event": "zylon.gateway.chat", "data": { "type": "chat", "id": "01985a64-7e31-7000-8001-4f52b1dd2a89", "request_tokens": 14, "response_tokens": 5, "tools_used": [] } } ] ``` ## Errors and limitations | Case | Result | | - | - | | Missing or invalid authentication | Request is rejected by authentication middleware. | | Authenticated account without at least the `operator` role | Request is rejected by the permission check. | | Invalid UUID, enum value, or pagination combination | Request is rejected before logs are returned. | | Internal storage disabled | New logs are not persisted to Zylon log storage. Manual retrieval returns only already stored records. | | Per-record modification or deletion | Not supported by the documented Logging API. Stored log retention is controlled by cleanup configuration. | ## Export chain of custody When using these endpoints for a manual export, preserve evidence outside the response body: * operator account or token identity; * request timestamp, source IP, and request ID when available; * exact URL filters, pagination values, and `include` values; * number of records exported; * incident, ticket, or legal hold reference. Log retrieval calls are also logged as Backoffice actions: `/v1/platform/gateway/{gatewayId}/logs` emits `backoffice.gateway_logs.read`, and `/v1/platform/logs` emits `backoffice.logs.read`. Preserve those events together with the exported response when a review, incident, or legal hold requires evidence of who accessed log records. ## Related documentation * [Backoffice API overview](/en/v1.57/developer-manual/build-with-zylon/backoffice-api/overview) * [Auditability & AI Governance: Logging, Evidence, and SIEM Delivery](/en/v1.57/operator-manual/backoffice/log-delivery-storage) * [Configuration: Log Delivery and Storage](/en/v1.57/operator-manual/configuration/features/log-delivery-storage) # Overview Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/backoffice-api/overview Backoffice API endpoints for operational and platform-level workflows. The Backoffice API exposes platform-level endpoints for authorized operators and automation jobs. Use it for operational workflows that are outside the Workspace API, such as manually retrieving Zylon logs for investigation or export. ## Base URL Backoffice endpoints are served from the platform root: ```http theme={null} https://{BASE_URL} ``` Unlike Workspace API routes, Backoffice routes documented here do not use the `/api/v1/app` workspace prefix. ## Authentication and permissions Backoffice API requests require an account token or account session with at least the `operator` role. ```bash theme={null} -H "Authorization: Bearer {API_TOKEN}" ``` Workspace-only tokens are not enough for Backoffice endpoints. ## Available sections Retrieve stored platform, gateway, security, workspace, and AI usage logs. For governance, auditability, evidence preservation, and retention guidance, see [Auditability & AI Governance: Logging, Evidence, and SIEM Delivery](/en/v1.57/operator-manual/backoffice/log-delivery-storage). # Database Query tool Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/tools/built-in/database-query-tool Query a SQL database from natural language. Use Database Query when you want the assistant to translate natural language into SQL over a configured database connection. ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). * A database connection string you can share with Zylon. ## Requirements * Tool spec: `{ "name": "database_query", "type": "database_query_v1" }` * `tool_context`: one `sql_database` context with `connection_string` ## Basic request and response This example validates a request that enables database query. For validation, it sets `tool_choice` to `none` so the validator doesn’t try to connect. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 128, "messages": [ { "role": "user", "content": "What were total Q1 subscriptions by plan?" } ], "tools": [ { "name": "database_query", "type": "database_query_v1" } ], "tool_choice": { "type": "none" }, "tool_context": [ { "type": "sql_database", "connection_string": "postgresql://{username}:{password}@db.example.com:5432/analytics", "schemas": ["public"], "ssl": true } ] }' ``` Example response: ```json theme={null} { "valid": true, "errors": null } ``` To run the request, send the same body to `POST /messages` and set `tool_choice` to `{ \"type\": \"auto\" }`. ## Tips * Use a read-only database user. * Limit schemas to reduce inspection time. ## Next steps * Learn how messages return tool blocks: [Messages](/en/v1.57/developer-manual/build-with-zylon/working-with-messages) # Semantic Search tool Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/tools/built-in/semantic-search-tool Search your ingested artifacts for relevant chunks during a message. Use Semantic Search when you want the assistant to retrieve information from previously ingested artifacts (documents, notes, PDFs, HTML, and more). ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). * Ingested artifacts to search (see [Artifacts](/en/v1.57/developer-manual/build-with-zylon/working-with-artifacts)). ## Requirements * Tool spec: `{ "name": "semantic_search", "type": "semantic_search_v1" }` * `tool_context`: at least one `ingested_artifact` with a `context_filter` ## Basic request and response This example validates a request that enables semantic search over a collection: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 128, "messages": [ { "role": "user", "content": "What shipped in the latest billing dashboard release?" } ], "tools": [ { "name": "semantic_search", "type": "semantic_search_v1" } ], "tool_choice": { "type": "auto" }, "tool_context": [ { "type": "ingested_artifact", "context_filter": { "collection": "{collectionID}" } } ] }' ``` Example response: ```json theme={null} { "valid": true, "errors": null } ``` To run the request, send the same body to `POST /messages`. ## Tips * Keep `tool_context` narrow (use a single collection and the smallest set of artifacts you need). * If you’re not getting relevant results, ingest cleaner source text (or split large documents into smaller artifacts). ## Next steps * Ingest and manage artifacts: [Artifacts](/en/v1.57/developer-manual/build-with-zylon/working-with-artifacts) * Learn how messages return tool blocks: [Messages](/en/v1.57/developer-manual/build-with-zylon/working-with-messages) # Tabular Analysis tool Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/tools/built-in/tabular-analysis-tool Analyze ingested tabular artifacts during a message. Use Tabular Analysis when you want the assistant to perform calculations over tabular data (CSV, TSV, or tables extracted from documents). ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). * Ingested tabular artifacts to analyze. ## Requirements * Tool spec: `{ "name": "tabular_analysis", "type": "tabular_analysis_v1" }` * `tool_context`: at least one `ingested_artifact` with a `context_filter` ## Basic request and response This example validates a request that enables tabular analysis over a collection: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 128, "messages": [ { "role": "user", "content": "What is the average of the Q1 revenue column?" } ], "tools": [ { "name": "tabular_analysis", "type": "tabular_analysis_v1" } ], "tool_choice": { "type": "auto" }, "tool_context": [ { "type": "ingested_artifact", "context_filter": { "collection": "{collectionID}" } } ] }' ``` Example response: ```json theme={null} { "valid": true, "errors": null } ``` To run the request, send the same body to `POST /messages`. ## Tips * Ensure the artifact content is a clean table (CSV/TSV is best). * Keep the table small enough for quick analysis. ## Next steps * Ingest and manage artifacts: [Artifacts](/en/v1.57/developer-manual/build-with-zylon/working-with-artifacts) * Learn how messages return tool blocks: [Messages](/en/v1.57/developer-manual/build-with-zylon/working-with-messages) # Web Fetch tool Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/tools/built-in/web-fetch-tool Fetch and extract a URL mentioned in the message. Use Web Fetch when you need the assistant to retrieve content from a URL. ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). ## Requirements * Tool spec: `{ "name": "web_extract", "type": "web_extract_v1" }` * No `tool_context` required ## Basic request and response This example validates a request that enables the web fetch tool: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 64, "messages": [ { "role": "user", "content": "Summarize https://example.com/" } ], "tools": [ { "name": "web_extract", "type": "web_extract_v1" } ], "tool_choice": { "type": "auto" } }' ``` Example response: ```json theme={null} { "valid": true, "errors": null } ``` To run the request, send the same body to `POST /messages`. ## Tips * The URL must appear in the user message. * Keep the prompt concise to reduce extraction time. ## Next steps * Learn how messages return tool blocks: [Messages](/en/v1.57/developer-manual/build-with-zylon/working-with-messages) # Web Search tool Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/tools/built-in/web-search-tool Search the web from a natural language query. Use Web Search when you need the assistant to run a quick web query and return results. ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). ## Requirements * Tool spec: `{ "name": "web_search", "type": "web_search_v1" }` * No `tool_context` required ## Basic request and response This example validates a request that enables the web search tool: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 64, "messages": [ { "role": "user", "content": "Find recent updates about the EU AI Act." } ], "tools": [ { "name": "web_search", "type": "web_search_v1" } ], "tool_choice": { "type": "auto" } }' ``` Example response: ```json theme={null} { "valid": true, "errors": null } ``` To run the request, send the same body to `POST /messages`. ## Tips * Use a focused query to reduce noisy results. * Combine with a system prompt to control summarization style. ## Next steps * Learn how messages return tool blocks: [Messages](/en/v1.57/developer-manual/build-with-zylon/working-with-messages) # Custom tools Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/tools/custom/custom-tools Define your own tools using JSON Schema. Custom tools let you define a tool interface (name + JSON schema) and let the assistant choose when to call it. When it calls your tool, it returns a `tool_use` content block with structured `input`. ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). ## Requirements In the `tools` array, provide: * `name`: unique tool name * `description`: what the tool does * `inputSchema`: JSON Schema describing the tool input ## Basic request and response This example validates a request that defines a tiny calculator tool and forces its use. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 64, "messages": [ { "role": "user", "content": "Add 5 and 7." } ], "tools": [ { "name": "simple_calculator", "description": "Add two numbers.", "inputSchema": { "type": "object", "additionalProperties": false, "properties": { "a": { "type": "number" }, "b": { "type": "number" } }, "required": ["a", "b"] } } ], "tool_choice": { "type": "tool", "name": "simple_calculator" } }' ``` Example response: ```json theme={null} { "valid": true, "errors": null } ``` To run the request, send the same body to `POST /messages`. When the assistant returns a `tool_use` block, execute your tool and include a `tool_result` block in the next message. # Overview Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/tools/introduction-to-tools Enable built-in and custom tools in Messages. Tools let the assistant run targeted operations (like searching artifacts, analyzing tabular data, or extracting a web page) as part of a message response. You enable tools by adding three fields to a `POST /messages` request: | Field | Purpose | | - | - | | `tools` | Which tools are allowed. | | `tool_choice` | How the assistant should choose tools (`auto`, force a specific tool, or `none`). | | `tool_context` | Optional context artifacts (documents or database connections). | ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). * Your Zylon hostname (replace `{BASE_URL}` in the examples). ## Basic request and response When you’re iterating on tool configuration, start with `POST /messages/validate` to validate your request body without running a model. This example enables the **web fetch** tool: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 64, "messages": [ { "role": "user", "content": "Summarize: https://example.com/" } ], "tools": [ { "name": "web_extract", "type": "web_extract_v1" } ], "tool_choice": { "type": "auto" } }' ``` ```json theme={null} { "valid": true, "errors": null } ``` To actually run the request, send the same body to `POST /messages`. ## Built-in tools Zylon includes a set of built-in tools you can enable by name + type: | Tool type | What it does | Requires `tool_context` | | - | - | - | | `semantic_search_v1` | Search ingested artifacts | Yes (`ingested_artifact`) | | `tabular_analysis_v1` | Analyze tabular artifacts | Yes (`ingested_artifact`) | | `web_extract_v1` | Fetch and extract a URL mentioned in the message | No | | `web_search_v1` | Search the web from a natural language query | No | | `database_query_v1` | Query a SQL database from natural language | Yes (`sql_database`) | Guides: * [Semantic Search tool](/en/v1.57/developer-manual/build-with-zylon/tools/built-in/semantic-search-tool) * [Tabular Analysis tool](/en/v1.57/developer-manual/build-with-zylon/tools/built-in/tabular-analysis-tool) * [Web Fetch tool](/en/v1.57/developer-manual/build-with-zylon/tools/built-in/web-fetch-tool) * [Web Search tool](/en/v1.57/developer-manual/build-with-zylon/tools/built-in/web-search-tool) * [Database Query tool](/en/v1.57/developer-manual/build-with-zylon/tools/built-in/database-query-tool) ## Custom tools Custom tools let you define your own tool interface using JSON Schema. When the assistant chooses your tool, it returns a `tool_use` content block with structured `input`. See: [Custom tools](/en/v1.57/developer-manual/build-with-zylon/tools/custom/custom-tools) ## Common mistakes * **Using the wrong field name**: tool schemas use `inputSchema` (not `input_schema`). * **Missing tool context**: `semantic_search_v1`, `tabular_analysis_v1`, and `database_query_v1` need `tool_context`. * **Forgetting auth**: include `Authorization: Bearer ...` on every request. ## Next steps * Learn the Messages request format: [Messages](/en/v1.57/developer-manual/build-with-zylon/working-with-messages) * Ingest content for retrieval and analysis: [Artifacts](/en/v1.57/developer-manual/build-with-zylon/working-with-artifacts) # Artifacts Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/working-with-artifacts Create and ingest ZylonGPT artifacts for retrieval and context. An **artifact** is a piece of information (or tool-ready resource) you ingest into Zylon so it can be used as context for queries and operations. Artifacts live inside a **collection**, and each artifact has a stable `artifact` ID. Artifacts can be created from: | Type | Input | Notes | | - | - | - | | **Text** | Raw string | Provide content directly. | | **File** | Base64 bytes | For files like `.txt` or `.pdf`. | | **URI** | URL | Zylon fetches and ingests the content. | ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). * Your Zylon hostname (replace `{BASE_URL}` in the examples). ## Basic request and response Use `POST /artifacts/ingest` when you want the ingest to complete in the same request. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/ingest" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "collection": "{collectionID}", "artifact": "{artifactID}", "input": { "type": "text", "value": "Release notes: Shipped billing dashboard and fixed three bugs." }, "metadata": { "file_name": "release_notes.txt", "source": "docs" } }' ``` ```json theme={null} { "object": "list", "model": "private-gpt", "data": [ { "object": "ingest.document", "artifact": "docs_text_artifact_sync", "doc_metadata": { "file_name": "release_notes.txt", "source": "docs", "headers": [], "artifact_id": "docs_text_artifact_sync", "collection": "019c7569-f1f3-74da-8017-35d4a11f93ca", "llm_model": "default", "embed_model": "default", "hash": "faf6da679814136cb7cef94532397948cd2cd303b25f91a527af53227e9da99d" } } ] } ``` ## Async ingest Use `POST /artifacts/ingest/async` for larger payloads or when ingest may take longer. The payload is the same as sync ingest, wrapped in `ingest_body`, and the response returns a `task_id` you can poll. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/ingest/async" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "ingest_body": { "collection": "{collectionID}", "artifact": "{artifactID}", "input": { "type": "text", "value": "Release notes: We shipped a new billing dashboard and fixed three bugs." }, "metadata": { "file_name": "release_notes.txt", "source": "docs" } } }' ``` ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/ingest/async" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "ingest_body": { "collection": "{collectionID}", "artifact": "{artifactID}", "input": { "type": "file", "value": "SGVsbG8gZnJvbSBmaWxlIGFydGlmYWN0Lgo=" }, "metadata": { "file_name": "onboarding_checklist.txt", "source": "docs" } } }' ``` ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/ingest/async" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "ingest_body": { "collection": "{collectionID}", "artifact": "{artifactID}", "input": { "type": "uri", "value": "https://example.com/" }, "metadata": { "file_name": "example.html", "source": "docs" } } }' ``` ```json theme={null} { "task_id": "f04e0709-131a-4a9d-b884-78872a4e63d7" } ``` Check task status: ```bash theme={null} curl "https://{BASE_URL}/api/gpt/v1/artifacts/ingest/async/{task_id}" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} { "task_id": "f04e0709-131a-4a9d-b884-78872a4e63d7", "task_status": "PENDING", "task_result": null } ``` ## Listing ingested artifacts ```bash theme={null} curl "https://{BASE_URL}/api/gpt/v1/artifacts/list?collection={collectionID}" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} { "object": "list", "model": "private-gpt", "data": [ { "object": "ingest.document", "artifact": "docs_file_artifact", "doc_metadata": { "file_name": "docs_file_artifact.txt", "artifact_id": "docs_file_artifact", "collection": "019c7569-f1f3-74da-8017-35d4a11f93ca" } } ] } ``` ## Retrieving content ### Full content Use `POST /artifacts/content` to fetch complete document text: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/content" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "context_filter": { "collection": "{collectionID}" } }' ``` ```json theme={null} { "data": [ { "artifact_id": "docs_file_artifact", "content": "Hello from file artifact.\n\n" } ] } ``` ### Chunked content (chat-optimized) Use `POST /artifacts/chunked-content` to retrieve content split into chat-friendly blocks: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/chunked-content" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "context_filter": { "collection": "{collectionID}" }, "max_tokens": 50 }' ``` ```json theme={null} { "data": [ { "artifact_id": "docs_file_artifact", "content": [ { "type": "source", "sources": [{ "object": "context.chunk", "id": "c5f20f0f-56e6-44e0-99e8-0d4ff4bb87eb" }] }, { "type": "text", "text": "**Context Information**:\nBelow is important information..." } ] } ] } ``` ## Deleting artifacts Delete (sync): ```bash theme={null} curl -i -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/delete" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "collection": "{collectionID}", "artifact": "{artifactID}" }' ``` ```text theme={null} HTTP/2 200 null ``` Delete (async): ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/artifacts/delete/async" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "delete_body": { "collection": "{collectionID}", "artifact": "{artifactID}" } }' ``` ```json theme={null} { "task_id": "2d48e74f-3eff-474e-b338-a931390ac218" } ``` Check task status: ```bash theme={null} curl "https://{BASE_URL}/api/gpt/v1/artifacts/delete/async/{task_id}" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} { "task_id": "2d48e74f-3eff-474e-b338-a931390ac218", "task_status": "PENDING", "task_result": null } ``` Keep polling until `task_status` becomes `"SUCCESS"` or `"FAILURE"`. If deletion fails while an index is still being populated, retry after a short delay. ## Errors and edge cases * **401/403**: missing token or insufficient permissions. * **404**: collection or artifact not found. * **409**: ingest/delete task already in progress. * **413**: input too large for a single ingest. * **422**: invalid payload shape. * **Async failures**: when `task_status` becomes `FAILURE`, check `task_result` (for example `routing_key_error: "ingest.failed"` or `delete.failed`) and retry after fixing the input. # Messages Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/working-with-messages Message requests with sync, streaming, and async patterns. Messages is the core of ZylonGPT. You send a conversation history, and Zylon returns the next assistant message as a **list of content blocks** (text, tool calls, tool results, and more). ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). * Your Zylon hostname (replace `{BASE_URL}` in the examples). ## Basic request and response Send one user message and get back one assistant message. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 32, "temperature": 0, "messages": [ { "role": "user", "content": "Write a one-sentence status update about deploying a billing dashboard and fixing three bugs." } ] }' ``` ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 32, "temperature": 0, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Write a one-sentence status update about deploying a billing dashboard and fixing three bugs." } ] } ] }' ``` ```json theme={null} { "id": "msg_abf981cf3f1c449eacb7a85c064ca505", "type": "message", "role": "assistant", "content": [ { "type": "text", "start_timestamp": "2026-02-06T13:23:16.876744Z", "stop_timestamp": "2026-02-06T13:23:16.975362Z", "text": "Deployed the new billing dashboard and resolved three bugs successfully." } ], "model": "private-gpt", "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 95, "output_tokens": 16 } } ``` To render plain text, concatenate the `text` values from any blocks where `type` is `"text"`. ## Messages shape At minimum, send: | Field | Required | Description | | - | - | - | | `model` | Yes | Model name to use (commonly `"default"`). | | `messages` | Yes | Conversation history. | | `max_tokens` | Yes | Maximum tokens to generate. | Each message has: | Field | Description | | - | - | | `role` | `"user"` or `"assistant"`. | | `content` | A string, or an array of content blocks. | ## Validate a request Use `/messages/validate` to check payload shape before sending a real request. It returns `valid: true` or a list of validation errors. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 32, "messages": [ { "role": "user", "content": "Validate this payload." } ] }' ``` Example response: ```json theme={null} { "valid": true, "errors": null } ``` ## Multi-turn conversations To continue a conversation, include the prior turns in `messages`: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 16, "temperature": 0, "messages": [ { "role": "user", "content": "My name is Ada." }, { "role": "assistant", "content": "Nice to meet you." }, { "role": "user", "content": "What is my name? Reply with only the name, no punctuation." } ] }' ``` ```json theme={null} { "id": "msg_9b14c8fd514741d29a0dff8996ca9213", "type": "message", "role": "assistant", "content": [ { "type": "text", "start_timestamp": "2026-02-06T10:34:12.924887Z", "stop_timestamp": "2026-02-06T10:34:12.974785Z", "text": "Ada" } ], "model": "private-gpt", "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 135, "output_tokens": 2 } } ``` ## System prompts Use the top-level `system` field to control assistant behavior (instead of a `"system"` role message): Prefer the top-level system field for system instructions so they are applied consistently across the whole request. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 8, "temperature": 0, "system": { "text": "You are a support agent. Reply with only a short ticket title.", "use_default_prompt": false }, "messages": [ { "role": "user", "content": "The login button on mobile does not work." } ] }' ``` ```json theme={null} { "id": "msg_4e328dc4baeb42b8a18dc0c4abd89468", "type": "message", "role": "assistant", "content": [ { "type": "text", "start_timestamp": "2026-02-06T13:37:36.368426Z", "stop_timestamp": "2026-02-06T13:37:36.446733Z", "text": "Mobile login button not working" } ], "model": "private-gpt", "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 100, "output_tokens": 6 } } ``` ## Structured JSON output (json\_schema) If you need machine-readable output, set `response_format.type` to `json_schema` and provide a schema. Zylon returns JSON as text in a `text` content block. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 128, "response_format": { "type": "json_schema", "json_schema": { "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string" }, "next_step": { "type": "string" } }, "required": ["status", "next_step"] } }, "system": { "text": "Return ONLY valid JSON.", "use_default_prompt": false }, "messages": [ { "role": "user", "content": "We deployed the billing dashboard. Return a status and the next step." } ] }' ``` ```json theme={null} { "id": "msg_eaf35004b4654234be5e767ea09e72e6", "type": "message", "role": "assistant", "content": [ { "type": "text", "start_timestamp": "2026-02-06T13:39:44.864978Z", "stop_timestamp": "2026-02-06T13:39:45.412991Z", "text": "{\"status\":\"success\",\"next_step\":\"Monitor adoption and collect feedback.\"}" } ], "model": "private-gpt", "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 98, "output_tokens": 16 } } ``` ## Streaming (SSE) Set `stream: true` to receive a `text/event-stream` response containing events like `content_block_delta` (token deltas). ```bash theme={null} curl -N -X POST "https://{BASE_URL}/api/gpt/v1/messages" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{ "model": "default", "stream": true, "max_tokens": 32, "messages": [ { "role": "user", "content": "Give a three-word tagline for a productivity app." } ] }' ``` ```text theme={null} event: message_start data: {"type":"message_start","message":{"id":"msg_b55d29718361410bad4f80f8f67c6b72","type":"message","role":"assistant","content":[],"model":"private-gpt","usage":{}}} event: content_block_start data: {"type":"content_block_start","index":0,"block_id":"block_019c331ac11375cea03f7e0fb7a2a044","content_block":{"type":"text","start_timestamp":"2026-02-06T13:18:37.331257Z","text":""}} event: content_block_delta data: {"type":"content_block_delta","index":0,"block_id":"block_019c331ac11375cea03f7e0fb7a2a044","delta":{"type":"text_delta","text":"Focus"}} event: content_block_delta data: {"type":"content_block_delta","index":0,"block_id":"block_019c331ac11375cea03f7e0fb7a2a044","delta":{"type":"text_delta","text":" fast daily"}} event: content_block_stop data: {"type":"content_block_stop","stop_timestamp":"2026-02-06T13:18:37.417617Z","index":0,"block_id":"block_019c331ac11375cea03f7e0fb7a2a044"} event: message_delta data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"input_tokens":90,"output_tokens":3}} event: message_stop data: {"type":"message_stop"} ``` ## Async messages Async messages use the **same request body** as sync messages—you just call a different endpoint. The main difference is the **response shape**: sync returns a full message, async returns a `message_id` you can stream or poll later. ```json theme={null} { "id": "msg_abf981cf3f1c449eacb7a85c064ca505", "type": "message", "role": "assistant", "content": [ { "type": "text", "start_timestamp": "2026-02-06T13:23:16.876744Z", "stop_timestamp": "2026-02-06T13:23:16.975362Z", "text": "Deployed the new billing dashboard and resolved three bugs successfully." } ], "model": "private-gpt", "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 95, "output_tokens": 16 } } ``` ```json theme={null} { "message_id": "1cc8ed5e-fc7a-45e1-baf4-0b916ed32290", "status": "pending", "message": "Request initiated successfully" } ``` ### Start an async message ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/async" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "model": "default", "max_tokens": 32, "messages": [ { "role": "user", "content": "Say only: async ok" } ] }' ``` ### Stream or poll status Stream events: ```bash theme={null} curl -N "https://{BASE_URL}/api/gpt/v1/messages/async/{message_id}/stream" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Accept: text/event-stream" ``` Poll status: ```bash theme={null} curl "https://{BASE_URL}/api/gpt/v1/messages/async/{message_id}/status" \ -H "Authorization: Bearer {API_TOKEN}" ``` ### Cancel or delete * Cancel: `POST /messages/async/{message_id}/cancel` * Delete: `DELETE /messages/async/{message_id}/delete` ## Common mistakes * **Wrong method**: `/messages` is `POST`, not `GET`. * **Missing auth header**: include `Authorization: Bearer ...`. * **Wrong base URL**: use `https://{BASE_URL}/api/gpt/v1/`. * **Invalid request body**: use `POST /messages/validate` to catch schema mistakes early. * **Unexpected stops or errors**: see [Handling stop reasons](/en/v1.57/developer-manual/build-with-zylon/zylon-gpt-api/handling-stop-reasons) for causes and fixes. ## Next steps Let Zylon use built-in and custom tools during a message. Ingest text, files, or URIs into collections for retrieval. # Auth Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/authentication/auth Log in and end sessions for Workspace API access. Use these endpoints to exchange credentials for a session and log out. For SSO login redirects (Google/Microsoft) and integration OAuth, see [OpenID & OAuth](/en/v1.57/developer-manual/build-with-zylon/workspace-api/authentication/openid). ## Account creation Use `POST /api/v1/auth/register` to create a new credentials-based account. To use that account in Workspace, complete one of these operations: * Create a workspace user with the account ID in [Users - Create a user](/en/v1.57/developer-manual/build-with-zylon/workspace-api/users/user). * Join directly to an organization through `POST /api/v1/account/organization/{orgId}/join`. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/auth/register" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "name": "Sasha Patel", "email": "sasha@example.com", "password": "{password}", "roles": ["Admin"] }' ``` | Field | Type | Required | Description | | - | - | - | - | | `name` | string | No | Account display name. | | `email` | string | Yes | Account email. | | `password` | string | Yes | Credentials password. | | `roles` | string\[] | Yes | Account-level roles. At least one valid role is required. | ```json theme={null} { "id": "acct_6c8a1f3b2d4e5f7a", "state": "Active", "email": "sasha@example.com", "name": "Sasha Patel", "given_name": null, "family_name": null, "profile_picture": null, "provider": "Credentials", "users": null, "roles": ["Admin"], "created_at": "2026-02-08T14:12:45Z", "updated_at": "2026-02-08T14:12:45Z" } ``` ## Log in with credentials ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/auth/login" \ -H "Content-Type: application/json" \ -d '{ "email": "{username}", "password": "{password}" }' ``` ```json theme={null} "ok" ``` Successful login creates an account session. When LDAP is enabled, the server first tries LDAP authentication and then falls back to local credentials. ## Log out ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/auth/logout" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} "ok" ``` ## Manage API tokens Use these endpoints to manage API tokens for the authenticated account. Token secrets are returned only when a token is created; after that, list responses include metadata and the token hash. ### List tokens | Query parameter | Type | Required | Description | | - | - | - | - | | `page_size` | integer | No | Maximum number of tokens to return. | | `after` / `before` | string | No | Cursor pagination controls when available. | | `gateway_id` | string | No | Filter tokens by gateway ID. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/account/token?page_size=20" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} { "data": [ { "id": "tok_7f1a9c2d4b6e", "name": "workspace-sync", "token": null, "scopes": ["Workspace.ReadWrite.All"], "gateway_id": null, "hashed_token": "{token_hash}", "token_email": "workspace-sync@example.com", "last_used_at": "2026-05-10T08:31:12Z", "created_at": "2026-05-01T10:00:00Z", "valid_until": "2026-12-31T23:59:59Z" } ], "next_cursor": null, "previous_cursor": null, "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` ### Create a token ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/account/token" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "name": "workspace-sync", "revoke_existing": false, "valid_until": "2026-12-31T23:59:59Z", "scopes": ["Workspace.ReadWrite.All"] }' ``` | Field | Type | Required | Description | | - | - | - | - | | `name` | string | No | Human-readable token name. | | `revoke_existing` | boolean | No | When `true`, revokes existing tokens according to server policy. Defaults to `false`. | | `valid_until` | timestamp | No | Expiration timestamp. Use `null` or omit for no explicit expiration. | | `scopes` | string\[] | No | Allowed values: `ReadWrite.All`, `Workspace.ReadWrite.All`, `PrivateGPT.ReadWrite.All`. Defaults to `Workspace.ReadWrite.All`. | | `gateway_id` | string | No | Gateway ID when creating a gateway-scoped token. | ```json theme={null} { "id": "tok_7f1a9c2d4b6e", "name": "workspace-sync", "token": "{API_TOKEN}", "scopes": ["Workspace.ReadWrite.All"], "gateway_id": null, "hashed_token": "{token_hash}", "token_email": "workspace-sync@example.com", "last_used_at": null, "created_at": "2026-05-01T10:00:00Z", "valid_until": "2026-12-31T23:59:59Z" } ``` Copy the `token` value immediately. It is returned only once and cannot be recovered later. ### Delete a token Delete uses the stored token hash, not the clear token secret. ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/account/token/{token_hash}" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} "Token deleted" ``` ## Errors and edge cases * **401/403**: missing or invalid API token. * **429**: too many login attempts. * **400**: register payload missing required account roles, email, or password. # OpenID & OAuth Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/authentication/openid Start SSO logins and integration OAuth flows for Confluence and SharePoint. Use these endpoints to initiate OAuth/OpenID flows. Login endpoints are browser-oriented and return redirects; callback endpoints receive the provider response. > Integrations must be enabled before you use their OAuth endpoints. See the operator guides for [Confluence](/en/v1.57/operator-manual/knowledge-base/confluence) and [SharePoint](/en/v1.57/operator-manual/knowledge-base/sharepoint). ## Basic request and response Start a login flow by calling a provider login endpoint and following the redirect. ### User SSO login redirects ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/auth/google/login" ``` ```text theme={null} HTTP/1.1 302 Found Location: https://accounts.google.com/o/oauth2/v2/auth?client_id=...&redirect_uri=... ``` ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/auth/microsoft/login" ``` ```text theme={null} HTTP/1.1 302 Found Location: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=...&redirect_uri=... ``` ### Integration OAuth login redirects ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/app/integration/confluence/login" ``` ```text theme={null} HTTP/1.1 302 Found Location: https://auth.atlassian.com/authorize?client_id=...&redirect_uri=... ``` ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/app/integration/sharepoint/login" ``` ```text theme={null} HTTP/1.1 302 Found Location: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=...&redirect_uri=... ``` ### Login with a specific integration instance ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/app/integration/confluence/{integrationID}/login" ``` ```text theme={null} HTTP/1.1 302 Found Location: https://auth.atlassian.com/authorize?client_id=...&state=conf_8a7b6c5d4e3f2a1b ``` ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/app/integration/sharepoint/{integrationID}/login" ``` ```text theme={null} HTTP/1.1 302 Found Location: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=...&state=sp_1c2d3e4f5a6b7c8d ``` ### Refresh an integration token ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/confluence/{integrationID}/refresh_token" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} "ok" ``` ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/sharepoint/{integrationID}/refresh_token" \ -H "Authorization: Bearer {API_TOKEN}" ``` ```json theme={null} "ok" ``` ### Callback endpoints | Type | Name | Required | Notes | | - | - | - | - | | Query | `code` | Yes | OAuth authorization code. | | Query | `state` | Yes | OAuth state value returned by the provider. | ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/auth/microsoft/callback?code=...&state=..." ``` ```text theme={null} HTTP/1.1 302 Found Location: https://{BASE_URL}/app/login/success ``` | Type | Name | Required | Notes | | - | - | - | - | | Query | `code` | Yes | OAuth authorization code. | | Query | `state` | Yes | OAuth state value returned by the provider. | ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/app/integration/confluence/callback?code=...&state=..." ``` ```text theme={null} HTTP/1.1 302 Found Location: https://{BASE_URL}/app/integrations/confluence ``` | Type | Name | Required | Notes | | - | - | - | - | | Query | `code` | Yes | OAuth authorization code. | | Query | `state` | Yes | OAuth state value returned by the provider. | ```bash theme={null} curl -i "https://{BASE_URL}/api/v1/app/integration/sharepoint/callback?code=...&state=..." ``` ```text theme={null} HTTP/1.1 302 Found Location: https://{BASE_URL}/app/integrations/sharepoint ``` ## Errors and edge cases * **302 redirect**: expected for login and callback routes. * **401/403**: token missing for refresh. * **404**: integration ID not found. # Chats Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/chats/threads Threads, interactions, and one-shot chat endpoints. Chats in the Workspace API are organized around **threads** and **interactions**: | Concept | Meaning | | - | - | | **Thread** | A conversation container within a project. | | **Interaction** | A single exchange inside a thread. | | **Chat** | A one‑shot request that does **not** create a thread. | Use threads when you want history and follow‑ups. Use interactions to send a new turn into a thread. Use the chat endpoint for single‑turn requests. ## Basic request and response Create a thread interaction with `POST /api/v1/app/thread/{threadId}/interaction`. | Type | Name | Required | Notes | | - | - | - | - | | Path | `threadID` | Yes | Thread identifier. | | Body | `thread_id` | Yes | Thread identifier. | | Body | `pgpt` | Yes | Chat request body. | | Body | `artifact_ids` | No | Artifact IDs to use as context. | | Body | `all_artifacts` | No | Include all available artifacts when `true`. | | Body | `agent` | No | Agent preset to use. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/thread/{threadID}/interaction" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "thread_id": "{threadID}", "artifact_ids": ["{artifactID}"], "all_artifacts": false, "agent": "Default", "pgpt": { "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Summarize the artifact in three bullets." } ] } ], "max_tokens": 120, "temperature": 0.2 } }' ``` ```json theme={null} { "id": "inter_5a7b9c1d3e5f7a9b", "project_id": "proj_7a5c3e1b9d2f4a6c", "thread_id": "thread_3f2a1c4d5b6e7f8a", "state": "Completed", "artifact_ids": ["artifact_2b4d6f8a1c3e5a7b"], "all_artifacts": false, "user_input": { "role": "user", "content": [ { "type": "text", "text": "Summarize the artifact in three bullets." } ] }, "assistant_output": { "id": "msg_3d2c1b4a5f6e7d8c", "created": 1739036500, "model": "default", "stop_reason": "end_turn", "content": [ { "type": "text", "text": "• Ticket volume rose 12% week-over-week\n• Billing issues drove 38% of cases\n• Priority bugs were resolved within 48 hours" } ], "usage": { "input_tokens": 180, "output_tokens": 52 } }, "created_at": "2026-02-08T14:41:10Z" } ``` ## Adding media to the chat If the selected model supports multimodal input, you can send media in `pgpt.messages[].content[]` (the same request shape used by both thread interactions and one-shot chat). You can mix multiple content blocks in one message. Supported block types in the schema: | Type | Typical use | Required fields | Notes | | - | - | - | - | | `text` | Plain text prompt/input | none | Uses `text`; supports optional `citations` metadata. | | `image` | Image attachment | `data` | `data` can be base64 or URL; optional `mime_type`. | | `audio` | Audio attachment | `data` | `data` can be base64 or URL; optional `mime_type`. | | `binary` | Generic binary payload | `data`, `mime_type` | Optional `filename`. | | `file` | File/document content block | `content` | Optional `content_type`, `doc_metadata`. | | `tool_use` | Tool call request | `id`, `name`, `input` | Internal/tool orchestration block. | `start_timestamp`, `stop_timestamp`, and `_meta` are optional on all blocks. ```json theme={null} [ { "type": "text", "text": "Summarize this image." }, { "type": "image", "data": "", "mime_type": "image/png" }, { "type": "audio", "data": "", "mime_type": "audio/mpeg" }, { "type": "binary", "data": "", "mime_type": "application/octet-stream", "filename": "blob.bin" }, { "type": "file", "content": "", "content_type": "application/pdf", "doc_metadata": { "file_name": "contract.pdf", "file_type": "pdf" } }, { "type": "source", "sources": [ { "type": "context.website", "url": "https://example.com/report", "title": "Quarterly Report", "description": "Public report page" }, { "type": "context.chunk", "id": "chunk_01", "score": 0.92, "text": "Support backlog dropped 8% week-over-week", "document": { "object": "artifact", "artifact": "artifact_123", "doc_metadata": { "file_name": "support.csv", "file_type": "csv" } } } ] }, { "type": "tool_use", "id": "toolu_123", "name": "semantic_search", "input": { "query": "billing issues" } }, { "type": "tool_result", "tool_use_id": "toolu_123", "content": [{ "type": "text", "text": "Found 5 matching passages." }], "is_error": false }, { "type": "thinking", "thinking": "I should compare the latest week to the previous one." }, { "type": "tldr", "content": [ { "type": "text", "text": "User: Analyze support trend" }, { "type": "text", "text": "Assistant: Backlog decreased 8%" } ] } ] ``` Example interaction request with image + text and runtime flags: | Type | Name | Required | Notes | | - | - | - | - | | Path | `threadID` | Yes | Thread identifier. | | Body | `thread_id` | Yes | Thread identifier. | | Body | `pgpt` | Yes | Chat request body. | | Body | `artifact_ids` | No | Artifact IDs to use as context. | | Body | `all_artifacts` | No | Include all available artifacts when `true`. | | Body | `agent` | No | Agent preset to use. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/thread/{threadID}/interaction" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "thread_id": "{threadID}", "all_artifacts": true, "artifact_ids": [], "agent": "Default", "pgpt": { "messages": [ { "role": "user", "content": [ { "type": "image", "data": "", "mime_type": "image/png" }, { "type": "text", "text": "What do you see here?" } ] } ], "system": { "use_default_prompt": true, "citations": { "enabled": true } }, "thinking": { "enabled": true } } }' ``` * `system.citations.enabled`: asks the model to include citation references when available. * `thinking.enabled`: enables deep thinking mode; responses can take longer but are typically better reasoned. ## Create or list threads Create a new thread in a project: | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `name` | Yes | Thread name. | | Body | `visibility` | Yes | `Public` or `Private`. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/thread" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Weekly Support Brief", "visibility": "Private" }' ``` List threads in a project: | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Query | `page` | No | Absolute page number to fetch, 1-based. | | Query | `page_size` | No | Number of items per page. | | Query | `page_order` | No | `ASC` or `DESC`. | | Query | `after` | No | Cursor or value to paginate after. | | Query | `before` | No | Cursor or value to paginate before. | | Query | `first` | No | Limit to the first N items after a cursor. | | Query | `last` | No | Limit to the last N items before a cursor. | | Query | `total_count` | No | Include total count in the response. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/thread?page=1&page_size=20" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "data": [ { "id": "thread_3f2a1c4d5b6e7f8a", "name": "Weekly Support Brief", "visibility": "Private", "created_at": "2026-02-08T14:40:00Z" } ], "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` Create a thread and first interaction in one request: | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `name` | Yes | New thread name. | | Body | `visibility` | Yes | `Public` or `Private`. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/thread/interaction" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Weekly Support Brief", "visibility": "Private" }' ``` ## Update or delete a thread ```bash theme={null} curl -X PUT "https://{BASE_URL}/api/v1/app/thread/{threadID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Weekly Support Brief", "visibility": "Private" }' ``` Delete a thread: ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/app/thread/{threadID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ## List or fetch interactions List interactions for a thread: | Type | Name | Required | Notes | | - | - | - | - | | Path | `threadID` | Yes | Thread identifier. | | Query | `page` | No | Absolute page number to fetch, 1-based. | | Query | `page_size` | No | Number of items per page. | | Query | `page_order` | No | `ASC` or `DESC`. | | Query | `after` | No | Cursor or value to paginate after. | | Query | `before` | No | Cursor or value to paginate before. | | Query | `first` | No | Limit to the first N items after a cursor. | | Query | `last` | No | Limit to the last N items before a cursor. | | Query | `total_count` | No | Include total count in the response. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/thread/{threadID}/interaction?page=1&page_size=20" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` Fetch a specific interaction: ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/interaction/{interactionID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ## Delete or stream an interaction Cancel a running interaction: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/interaction/{interactionID}/cancel" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` Delete an interaction: ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/app/interaction/{interactionID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` Stream interaction output: ```bash theme={null} curl -N "https://{BASE_URL}/api/v1/app/interaction/{interactionID}/stream" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Accept: text/event-stream" ``` ```text theme={null} event: message_start data: {"type":"message_start","message":{"id":"msg_3d2c1b4a5f6e7d8c","role":"assistant","content":[]}} event: content_block_delta data: {"type":"content_block_delta","delta":{"type":"text_delta","text":"• Ticket volume rose 12%"}} event: message_stop data: {"type":"message_stop"} ``` ## One‑shot chat If you don’t need a thread, call the chat endpoint directly: ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/chat" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Draft a 2-sentence update on this week’s support backlog." } ] } ], "max_tokens": 64, "temperature": 0.3 }' ``` ```json theme={null} { "id": "msg_5f2e1d3c4b6a7c8d", "role": "assistant", "content": [ { "type": "text", "text": "Backlog volume dipped 8% this week after closing high-priority billing cases. We’ll focus next on resolving long-tail authentication issues." } ] } ``` ## Validate a chat request ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/chat/validate" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Give me a three-bullet summary of the Q1 support plan." } ] } ], "max_tokens": 64, "temperature": 0.3 }' ``` ## Available tools Pass tools in `pgpt.tools` as `{ "name": "...", "type": "..." }`. | Name | Type | What it does | | - | - | - | | `semantic_search` | `semantic_search_v1` | Searches indexed project/workspace knowledge by semantic similarity. | | `file_sematic_search` | `file_semantic_search_v1` | Searches file-based content and attachments semantically. | | `tabular_analysis` | `tabular_analysis_v1` | Analyzes tabular datasets and returns computed insights. | | `database_query` | `database_query_v1` | Runs database lookups/queries through configured data sources. | | `web_search` | `web_search_v1` | Performs web search for external/public information. | | `web_extract` | `web_extract_v1` | Extracts structured text/content from URLs. | | `list_project_files` | `list_project_files_v1` | Lists files in the current project for downstream tool usage. | ## Errors and edge cases * **400**: invalid message schema (use `/chat/validate`). * **404**: thread or interaction not found. * **409**: interaction already completed when canceling. # Artifacts Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/content/artifacts Workspace artifacts for documents, AI Documents, and connectors. An artifact is a piece of information **or tool** you provide to Zylon so it can be used as context for queries and operations. The Workspace API groups artifacts into **document artifacts**, **AI Documents**, and **other artifacts**. ## Prerequisites * An API token. See [Workspace Token Management](/en/v1.57/developer-manual/get-started/token-management). * Your Zylon hostname (replace `{BASE_URL}` in the examples). ## Artifacts | Category | Includes | When to use | | - | - | - | | **Document artifacts** | Documents, folders, links | Store or organize content inside a project. | | **AI Documents** | Summary, composition, extraction flows | Run workflows across artifacts to produce outputs. | | **Other artifacts** | MCP servers, SQL databases | Provide external tools or data sources. | ### Artifact request fields Use `POST /api/v1/app/project/{projectID}/artifact` to create any artifact type. The path provides the project; the body provides shared artifact metadata plus a type-specific `props` object. | Field | Type | Required | Description | | - | - | - | - | | `projectID` | path | Yes | Project identifier. | | `type` | string | Yes | Artifact type. Client-facing create types include `Document`, `Folder`, `Link`, `Summary`, `Composition`, `BulkQA`, `ReadAndExtract`, `Analysis`, `SmartDoc`, `SqlDatabase`, and `McpServer`. | | `name` | string | Yes | Artifact display name. | | `props` | object | Yes | Type-specific configuration. The legacy alias `config` is also accepted. | | `source` | string | No | Artifact source. Defaults to `User`. | | `description` | string | No | Human-readable description. | | `parent_id` | string | No | Parent artifact ID for tree artifacts such as documents, folders, and links. Do not use it for MCP or database artifacts. | | `integration_id` | string | No | Integration ID for integration-backed artifacts. | | `external_url` | string | No | External URL for link-like or connector-backed artifacts. | | `raw_content` | string | No | Inline raw content for artifact types that accept text content. | | `keep_file_after_ingestion` | boolean | No | Whether uploaded file data should be retained after ingestion. Defaults to `true`. | | `interaction_id` | string | No | Interaction that produced this artifact, when applicable. | | `private_props` | object | No | Private connector configuration for MCP and SQL database artifacts. The legacy alias `private_config` is also accepted. | | `ws_auto_select` | boolean | No | Whether Workspace should auto-select an MCP or SQL database artifact as chat context. Defaults to `false`. | | `fileData` | file | No | Multipart-only file binary for upload-backed artifacts such as `Document` and `Skill`. | ### Document artifacts Document artifacts hold content, links reference existing artifacts, and folders organize artifacts inside a project. | Field | Type | Required | Description | | - | - | - | - | | `file_name` | string | Yes | Original file name. | | `content_type` | string | Yes | MIME type of `fileData`. | | `content_length` | integer | Yes | File size in bytes. Must match the uploaded file bytes. | | `metadata` | object | No | Provider-specific metadata for integration-backed documents. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -F 'type=Document' \ -F 'name=Q1 Support Summary' \ -F 'props={ "content_type":"text/plain", "file_name":"q1-support-summary.txt", "content_length":79 };type=application/json' \ -F 'fileData=@./q1-support-summary.txt;type=text/plain' ``` ```json theme={null} { "id": "artifact_doc_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "name": "Q1 Support Summary", "type": "Document", "source": "User", "state": "Published", "ingest_status": "Done", "has_content": true, "props": { "file_name": "q1-support-summary.txt", "content_type": "text/plain", "content_length": 79 }, "created_at": "2026-02-08T14:30:12Z", "updated_at": "2026-02-08T14:31:02Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `metadata` | object | No | Provider-specific metadata for integration-backed folders. Use `{}` for user-created folders without metadata. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "Folder", "source": "User", "name": "Q1 Support", "description": "Artifacts for Q1 support work.", "parent_id": null, "props": {} }' ``` ```json theme={null} { "id": "artifact_folder_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "name": "Q1 Support", "parent_id": null, "type": "Folder", "source": "User", "state": "Published", "child_count": 0, "ingest_status": "NotApplicable", "props": {}, "created_at": "2026-02-08T14:32:10Z", "updated_at": "2026-02-08T14:32:10Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `original_artifact_id` | string | Yes | Artifact to link into this project or folder. | | `source_artifact_id` | string | Response only | Canonical source artifact ID. The server sets this value. | | `original_artifact_type` | string | Response only | Type of the original artifact. The server sets this value. | | `original_project_id` | string \| null | Response only | Project that owns the original artifact, when available. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "Link", "source": "User", "name": "Q1 Support Summary (link)", "description": "Reference to the canonical document.", "parent_id": "artifact_folder_q1", "props": { "original_artifact_id": "{artifactID}" } }' ``` ```json theme={null} { "id": "artifact_link_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "name": "Q1 Support Summary (link)", "parent_id": "artifact_folder_q1", "type": "Link", "source": "User", "state": "Published", "ingest_status": "NotApplicable", "props": { "source_artifact_id": "artifact_doc_q1", "original_artifact_id": "artifact_doc_q1", "original_artifact_type": "Document", "original_project_id": "proj_7a5c3e1b9d2f4a6c" }, "created_at": "2026-02-08T14:33:22Z", "updated_at": "2026-02-08T14:33:22Z" } ``` ### AI Documents AI Documents run a Zylon workflow across one or more artifacts to produce a structured output. | Field | Type | Required | Description | | - | - | - | - | | `artifact_ids` | string\[] | Yes | Input artifacts to summarize. | | `style` | string | Yes | `Expert`, `Neutral`, or `Simple`. Deprecated values may still decode but should not be used. | | `detail` | string | Yes | `KeyPoints`, `ShortPieces`, or `LongPieces`. Deprecated values may still decode but should not be used. | | `instructions` | string\[] \| null | No | Extra instructions for the summary generation. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "Summary", "source": "User", "name": "Q1 Support Summary (auto)", "props": { "artifact_ids": ["{artifactID}"], "style": "Neutral", "detail": "KeyPoints", "instructions": ["Focus on billing and onboarding trends."] } }' ``` ```json theme={null} { "id": "artifact_summary_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "Summary", "state": "Processing", "ingest_status": "Processing", "props": { "artifact_ids": ["artifact_doc_q1"], "style": "Neutral", "detail": "KeyPoints", "instructions": ["Focus on billing and onboarding trends."] }, "created_at": "2026-02-08T15:10:00Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `artifact_ids` | string\[] | Yes | Input artifacts to use for the draft. | | `instructions` | string | Yes | Composition prompt or drafting instructions. | | `style` | string | Yes | `Expert`, `Neutral`, or `Simple`. | | `detail` | string | Yes | `KeyPoints`, `ShortPieces`, or `LongPieces`. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "Composition", "source": "User", "name": "Q1 Support Brief", "props": { "artifact_ids": ["{artifactID}"], "style": "Expert", "detail": "LongPieces", "instructions": "Draft a one-page summary for leadership." } }' ``` ```json theme={null} { "id": "artifact_comp_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "Composition", "state": "Processing", "ingest_status": "Processing", "props": { "artifact_ids": ["artifact_doc_q1"], "style": "Expert", "detail": "LongPieces", "instructions": "Draft a one-page summary for leadership." }, "created_at": "2026-02-08T15:12:40Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `questions` | string\[] | Yes | Questions to answer. | | `artifact_ids` | string\[] | Yes | Input artifacts to answer from. | | `instructions` | string\[] | Yes | Constraints or guidance for the answers. | | `detail` | string | Yes | `Concise`, `Moderate`, or `Comprehensive`. | | `style` | string | Yes | `Expert`, `Neutral`, or `Simple`. | | `results` | object\[] | No | Server-populated answer results. Defaults to `[]`. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "BulkQA", "source": "User", "name": "Billing FAQ", "props": { "artifact_ids": ["{artifactID}"], "style": "Simple", "detail": "Concise", "instructions": ["Answer using only the artifacts."], "questions": [ "What are the top billing issues?", "How quickly were priority bugs resolved?" ] } }' ``` ```json theme={null} { "id": "artifact_bulkqa_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "BulkQA", "state": "Processing", "ingest_status": "Processing", "props": { "artifact_ids": ["artifact_doc_q1"], "style": "Simple", "detail": "Concise", "instructions": ["Answer using only the artifacts."], "questions": [ "What are the top billing issues?", "How quickly were priority bugs resolved?" ] }, "created_at": "2026-02-08T15:14:10Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `artifact_ids` | string\[] | Yes | Input artifacts to read. | | `sections` | object\[] | Yes | Extraction targets. | | `sections[].id` | string | Yes | Stable section ID. | | `sections[].title` | string | Yes | Section title. | | `sections[].description` | string | Yes | What to extract for that section. | | `results` | object\[] | Response only | Extracted section results. | | `organization_context` | string \| null | Response only | Organization context used by the server. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "ReadAndExtract", "source": "User", "name": "Contract extraction", "props": { "artifact_ids": ["{artifactID}"], "sections": [ { "title": "Term", "description": "Contract term in months", "id": "term" }, { "title": "SLA", "description": "Support response time", "id": "sla" } ] } }' ``` ```json theme={null} { "id": "artifact_readextract_v3", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "ReadAndExtract", "state": "Processing", "ingest_status": "Processing", "props": { "artifact_ids": ["artifact_doc_q1"], "sections": [ { "title": "Term", "description": "Contract term in months", "id": "term" }, { "title": "SLA", "description": "Support response time", "id": "sla" } ] }, "created_at": "2026-02-08T15:15:55Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `artifact_ids` | string\[] | Yes | Input artifacts to analyze. | | `instruction` | object \| null | No | Custom analysis instruction. If omitted, the server uses its default analysis prompt. | | `instruction.id` | string | Yes when `instruction` is set | Stable instruction ID. | | `instruction.prompt` | string | Yes when `instruction` is set | Prompt used for analysis. | | `instruction.metadata` | object | No | Extra instruction metadata. Defaults to `{}`. | | `result` | object \| null | Response only | Combined analysis output. | | `organization_context` | string \| null | Response only | Organization context used by the server. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "Analysis", "source": "User", "name": "Support trend analysis", "props": { "artifact_ids": ["{artifactID}"], "instruction": { "id": "support_trends", "prompt": "Find the top support trends and risks.", "metadata": { "audience": "leadership" } } } }' ``` ```json theme={null} { "id": "artifact_analysis_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "Analysis", "state": "Processing", "ingest_status": "NotApplicable", "props": { "artifact_ids": ["artifact_doc_q1"], "instruction": { "id": "support_trends", "prompt": "Find the top support trends and risks.", "metadata": { "audience": "leadership" } }, "result": null }, "created_at": "2026-02-08T15:16:30Z" } ``` SmartDoc creation accepts `props`, but the server initializes SmartDoc artifacts with an empty object. Send `{}`. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "SmartDoc", "source": "User", "name": "Onboarding SmartDoc", "props": {} }' ``` ```json theme={null} { "id": "artifact_smartdoc_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "SmartDoc", "state": "Draft", "ingest_status": "NotApplicable", "props": {}, "created_at": "2026-02-08T15:17:20Z" } ``` ### Other artifacts Connector artifacts store tool integrations. `private_props` is only used for **MCP** and **SQL database** artifacts. | Field | Type | Required | Description | | - | - | - | - | | `schemas` | string\[] \| null | No | Database schemas to expose. | | `tables` | string\[] \| null | No | Database tables to expose. | | `ssl` | boolean \| null | No | Whether the database connection uses SSL. | | `enable_tables` | boolean \| null | No | Enable table discovery/use. | | `enable_views` | boolean \| null | No | Enable view discovery/use. | | `enable_procedures` | boolean \| null | No | Enable stored procedure discovery/use. | | `enable_functions` | boolean \| null | No | Enable function discovery/use. | | `private_props.connection_string` | string | Yes | Database connection string. Mask secrets in examples and logs. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "SqlDatabase", "source": "User", "name": "Sales database", "description": "Read-only reporting database.", "props": { "schemas": ["public", "analytics"], "tables": ["orders", "customers"], "ssl": true, "enable_tables": true, "enable_views": true, "enable_procedures": false, "enable_functions": false }, "private_props": { "connection_string": "postgresql://readonly:***@db.example.com:5432/sales" } }' ``` ```json theme={null} { "id": "artifact_db_sales", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "SqlDatabase", "state": "Published", "ingest_status": "NotApplicable", "props": { "schemas": ["public", "analytics"], "tables": ["orders", "customers"], "ssl": true, "enable_tables": true, "enable_views": true, "enable_procedures": false, "enable_functions": false }, "created_at": "2026-02-08T15:20:05Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `name` | string | Yes | MCP server name visible to tools. | | `tool_configuration` | object \| null | No | Tool allowlist configuration. | | `tool_configuration.enabled` | boolean | No | Whether tools are enabled. Defaults to `true`. | | `tool_configuration.allowed_tools` | string\[] \| null | No | Tool names clients may call through this MCP server. | | `private_props.url` | string | Yes | MCP server URL. | | `private_props.use_bearer_auth` | boolean | No | Whether to authenticate with bearer auth. Defaults to `false`. | | `private_props.authorization_token` | string \| null | No | Authorization token when the server expects a custom authorization token. Mask the value. | | `private_props.bearer_token` | string \| null | No | Bearer token when bearer auth is enabled. Mask the value. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "type": "McpServer", "source": "User", "name": "Internal tools", "props": { "name": "internal_mcp", "tool_configuration": { "enabled": true, "allowed_tools": ["crm_lookup", "ticket_search"] } }, "private_props": { "url": "https://mcp.internal.zylon", "authorization_token": "***" } }' ``` ```json theme={null} { "id": "artifact_mcp_internal", "project_id": "proj_7a5c3e1b9d2f4a6c", "type": "McpServer", "state": "Published", "ingest_status": "NotApplicable", "props": { "name": "internal_mcp", "tool_configuration": { "enabled": true, "allowed_tools": ["crm_lookup", "ticket_search"] } }, "created_at": "2026-02-08T15:22:30Z" } ``` To retrieve private details for these artifacts, call: `GET /api/v1/app/project/{projectId}/artifact/{artifactId}/private` Only the creator of the artifact can access the private details. ## Working with artifacts ### List artifacts | Query parameter | Type | Required | Description | | - | - | - | - | | `state` | string | No | Comma-separated artifact states. Defaults to `Published,Processing`. | | `source` | string | No | Comma-separated sources such as `User`, `SharePoint`, `Confluence`, `Claromentis`, or `FileSystem`. | | `ingest_status` | string | No | Comma-separated ingest statuses. Defaults to all statuses. | | `type` | string | No | Comma-separated artifact types. | | `parent_id` | string | No | Scope results to direct children of a parent artifact. | | `include_descendants` | boolean | No | Include the full subtree under `parent_id`; if no parent is set, include all descendants in the project. | | `filter_by_text` | string | No | Text search over artifact names and content metadata. | | `keep_ancestors` | boolean | No | Include ancestor artifacts for text matches. | | `resolve_links` | boolean | No | Include descendants of link artifacts. | | `sub_type` | string | No | Comma-separated subtype filter. | | `include` | string | No | Use `User` to include creator details. | | `page`, `page_size`, `after`, `before` | mixed | No | Pagination controls. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact?page=1&page_size=20&parent_id={artifactID}&include_descendants=false" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "data": [ { "id": "artifact_doc_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "name": "Q1 Support Summary", "type": "Document", "source": "User", "state": "Published", "ingest_status": "Done", "has_content": true, "parent_id": "artifact_folder_q1", "child_count": 0, "keep_file_after_ingestion": true, "ws_auto_select": false, "created_at": "2026-02-08T14:30:12Z", "updated_at": "2026-02-08T14:31:02Z" } ], "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` ### Get an artifact ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/{artifactID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "artifact_doc_q1", "project_id": "proj_7a5c3e1b9d2f4a6c", "name": "Q1 Support Summary", "type": "Document", "source": "User", "state": "Published", "ingest_status": "Done", "has_content": true, "parent_id": "artifact_folder_q1", "child_count": 0, "keep_file_after_ingestion": true, "ws_auto_select": false, "created_at": "2026-02-08T14:30:12Z", "updated_at": "2026-02-08T14:31:02Z" } ``` | Response field | Type | Description | | - | - | - | | `id` | string | Artifact ID. | | `parent_id` | string \| null | Parent artifact ID, when the artifact is nested. | | `child_count` | integer | Number of direct children. | | `project_id` | string | Project ID. | | `name` | string | Artifact name. | | `description` | string \| null | Artifact description. | | `type` | string | Artifact type. | | `source` | string | Artifact source. | | `state` | string | Current artifact state. | | `error` | string \| null | Ingest or processing error code. | | `ingest_status` | string | Ingest lifecycle status. | | `ingest_warnings` | string\[] \| null | Non-fatal ingest warnings. | | `ingest_progress` | number \| null | Ingest progress when available. | | `has_content` | boolean | Whether content is stored for the artifact. | | `raw_content` | string \| null | Raw content when explicitly included. | | `integration_id` | string \| null | Integration ID for integration-backed artifacts. | | `external_url` | string \| null | External URL when present. | | `props` | object | Type-specific public configuration. | | `file_uri` | string \| null | Temporary public file URL when available. | | `artifact_references` | object\[] \| null | References when `include_references=true`. | | `artifact_relationships` | object\[] \| null | Relationships when `include_relationships=true`. | | `keep_file_after_ingestion` | boolean | Whether uploaded file data is retained. | | `created_by` | object \| null | Creator details when `include=User`. | | `created_at` | timestamp | Creation timestamp. | | `updated_at` | timestamp | Last update timestamp. | | `ws_auto_select` | boolean | Whether Workspace auto-selects the artifact as context. Only meaningful for MCP and SQL database artifacts. | ### Update an artifact | Field | Type | Required | Description | | - | - | - | - | | `projectID` | path | Yes | Project identifier. | | `artifactID` | path | Yes | Artifact identifier. | | `name` | string | No | New artifact name. | | `parent_id` | string | No | Move a content/tree artifact under this parent artifact. Do not use it for MCP or database artifacts. | | `reset_parent_id` | boolean | No | Set to `true` to move a content/tree artifact back to the project root. Defaults to `false`. | | `external_url` | string | No | Replace the external URL. | | `props` | object | No | Replace or update type-specific public configuration. The legacy alias `config` is also accepted. | | `description` | string | No | Replace the description. | | `content` | string | No | Base64-encoded binary content. | | `plain_text_content` | string | No | Plain text content to store for the artifact. | | `private_props` | object | No | Private connector configuration for MCP and SQL database artifacts. The legacy alias `private_config` is also accepted. | | `ws_auto_select` | boolean | No | Whether Workspace should auto-select an MCP or SQL database artifact as chat context. Do not use it for document or agent-flow artifacts. | ```bash theme={null} curl -X PUT "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/{artifactID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Q1 Support Summary (final)", "description": "Finalized weekly summary notes.", "parent_id": "artifact_folder_q1", "reset_parent_id": false, "plain_text_content": "Ticket volume rose 12% week-over-week..." }' ``` ```json theme={null} { "id": "artifact_doc_q1", "name": "Q1 Support Summary (final)", "description": "Finalized weekly summary notes.", "parent_id": "artifact_folder_q1", "type": "Document", "source": "User", "ingest_status": "Done", "updated_at": "2026-02-08T14:45:21Z" } ``` Use `parent_id` to move an artifact into a folder. Use `reset_parent_id: true` to remove the current parent and move it back to the project root. ### Delete an artifact ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/{artifactID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "artifact_doc_q1", "state": "Deleted" } ``` ### Private artifact metadata ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/{artifactID}/private" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "connection_string": "postgresql://readonly:***@db.example.com:5432/sales" } ``` ### Download raw artifact content ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/{artifactID}/download" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```text theme={null} Ticket volume rose 12% week-over-week. Billing issues drove 38% of cases. ``` ### Get parsed content This endpoint is only available when the artifact has an initialized vector index. In practice, this usually means connector-backed documents or artifacts that have completed indexing. ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/{artifactID}/parsed-content" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```text theme={null} # Q1 Support Summary Billing issues drove 38% of support cases. ``` ### Sync an artifact This endpoint is primarily used for integration artifacts (SharePoint, Confluence, Claromentis, or FileSystem). ```bash theme={null} curl -N -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/{artifactID}/sync" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Accept: text/event-stream" ``` The request body is empty. The response is an SSE stream emitted by the integration sync process. ```text theme={null} event: sync_started data: {"current_artifact_count":12,"integration_item_count":40} event: sync_progress data: {"artifact_id":"artifact_doc_q1","op":"Updated","progress":0.42} event: sync_completed data: {} ``` ### Bulk update artifacts Use the bulk update endpoint to apply the same update body shape used by `PUT /artifact/{artifactID}` to multiple artifacts. | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `artifacts` | Yes | Array of artifact updates. | | Body | `artifacts[].artifactId` | Yes | Artifact identifier to update. | | Body | `artifacts[].update` | Yes | Update body using the same fields as `PUT /artifact/{artifactID}`. | ```bash theme={null} curl -X PUT "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/bulk" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "artifacts": [ { "artifactId": "artifact_doc_q1", "update": { "parent_id": "artifact_folder_q1", "reset_parent_id": false, "description": "Moved into Q1 folder." } } ] }' ``` ```json theme={null} [ { "id": "artifact_doc_q1", "parent_id": "artifact_folder_q1", "description": "Moved into Q1 folder.", "type": "Document", "state": "Published", "ingest_status": "Done", "updated_at": "2026-02-08T15:20:00Z" } ] ``` ### Bulk delete artifacts | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `artifact_ids` | Yes | Artifact identifiers to delete. | ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/app/project/{projectID}/artifact/bulk" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "artifact_ids": ["artifact_doc_q1", "artifact_link_q1"] }' ``` ```json theme={null} [ { "id": "artifact_doc_q1", "state": "Deleted" }, { "id": "artifact_link_q1", "state": "Deleted" } ] ``` ## Check linked artifacts before modifying Use this endpoint before changing an artifact when you need to check whether linked artifacts depend on it. | Type | Name | Required | Notes | | - | - | - | - | | Query | `created_by` | No | User ID that created the artifacts to check. | | Query | `project_id` | No | Project ID to check for linked artifacts. | | Query | `artifact_id` | No | Artifact ID to check for linked artifacts. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/resource/is-safe-to-modify?project_id={projectID}&artifact_id={artifactID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```json theme={null} { "has_linked_artifacts": false } ``` ## Errors and edge cases * **Artifact error codes**: the `error` field maps to ingest failures: | `error` value | Meaning | | - | - | | `InvalidExtension` | File extension is not supported. | | `MismatchedType` | File type does not match the declared artifact type. | | `Malformed` | File is corrupt or unreadable. | | `Encrypted` | File is password‑protected. | | `ParsingFailure` | Extractor failed to parse the file. | | `MaxNodes` | Document is too large/complex for parsing. | | `NoValidFile` | No valid file was found in the upload. | | `NoValidNodes` | No parseable content was extracted. | | `InternalError` | Ingest pipeline failed unexpectedly. | | `Unknown` | Unclassified ingest failure. | If `ingest_status` is `Error`, fix the source file (or convert it) and re‑sync. * **Warnings**: `ingest_warnings` can include values like `BigSize`, `UnprocessableContent`, or `NoContent` to indicate non‑fatal issues. * **401/403**: token missing or insufficient permissions. * **404**: artifact or project not found. * **409**: artifact already processing. * **413**: content exceeds the recommended upload size (250 MB). # Analytics Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/general/analytics Track usage totals, rankings, and time series metrics. Analytics endpoints summarize how your workspace is being used across projects and users. ## Basic request and response Start with totals to get a usage snapshot from `GET /api/v1/app/organization/analytics/totals`. ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/organization/analytics/totals" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "projects_total": 12, "threads_total": 184, "interactions_total": 1420, "agent_flows_total": 36, "uploaded_artifacts_total": 87 } ``` ## Active users ranking | Type | Name | Required | Notes | | - | - | - | - | | Query | `start_date` | No | Start of the reporting window as a Unix timestamp. | | Query | `end_date` | No | End of the reporting window as a Unix timestamp. | | Query | `limit` | No | Maximum number of ranked users to return. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/organization/analytics/ranking/active-users?start_date=1738291200&end_date=1738972800&limit=5" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} [ { "user": { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@auroralabs.com", "state": "Active", "roles": ["AppAdmin"], "created_at": "2026-02-08T14:12:45Z" }, "interactions_created": 46, "agent_flows_created": 4 } ] ``` ## Active projects ranking | Type | Name | Required | Notes | | - | - | - | - | | Query | `start_date` | No | Start of the reporting window as a Unix timestamp. | | Query | `end_date` | No | End of the reporting window as a Unix timestamp. | | Query | `limit` | No | Maximum number of ranked projects to return. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/organization/analytics/ranking/active-projects?start_date=1738291200&end_date=1738972800&limit=5" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} [ { "project": { "id": "proj_7a5c3e1b9d2f4a6c", "name": "Customer Insights", "goal": "Summarize weekly support trends.", "deadline": "2026-03-01T00:00:00Z", "visibility": "Private", "member_count": 4, "default_member_role": "Editor", "default_role_enabled": true, "project_context": "Support analytics for Q1.", "answer_context": "Use approved templates.", "is_pinned": true }, "interactions_created": 112, "agent_flows_created": 12 } ] ``` ## Time series | Type | Name | Required | Notes | | - | - | - | - | | Query | `start_date` | No | Start of the reporting window as a Unix timestamp. | | Query | `end_date` | No | End of the reporting window as a Unix timestamp. | | Query | `type` | Yes | Metric type to return, such as `interactions`. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/organization/analytics/timeseries?start_date=1738291200&end_date=1738972800&type=interactions" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} [ { "date": "2026-02-02", "value": 18 }, { "date": "2026-02-03", "value": 25 }, { "date": "2026-02-04", "value": 21 } ] ``` ## Errors and edge cases * **400**: invalid date range or type. * **403**: insufficient permissions. # Issues Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/general/issues Create and manage user-reported issues. Issues let users report problems with responses or content. Use these endpoints to list, create, update, and close issues. ## List issues List issues with `GET /api/v1/app/issue` before creating or updating. | Query parameter | Type | Required | Description | | - | - | - | - | | `include` | string | No | Comma-separated list of `User` and `Project` to include related objects. | | `type` | string | No | Comma-separated issue types: `NoAnswer`, `Inaccurate`, `NoContextUsed`, `Format`, `Other`. | | `states` | string | No | Comma-separated states: `NotReviewed`, `InReview`, `Closed`, `Deleted`. | | `start_date` / `end_date` | integer | No | Created-at filter as epoch milliseconds. | | `filter_by_text` | string | No | Text filter over issue content. | | `created_by` | string | No | Comma-separated user IDs. | | `projects` | string | No | Comma-separated project IDs. | | `page`, `page_size`, `after`, `before` | mixed | No | Pagination controls. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/issue?page=1&page_size=20&include=User,Project&states=NotReviewed,InReview" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```json theme={null} { "data": [ { "id": "issue_5c4b3a2d1e0f9a8b", "issue_number": 1842, "description": "Response missed the attached policy details.", "resource_type": "Thread", "type": "NoContextUsed", "state": "NotReviewed", "is_read": false, "data": { "thread_id": "thread_3f2a1c4d5b6e7f8a", "reported_interaction_id": "interaction_9b8a7c6d5e4f" }, "created_at": "2026-02-08T14:55:10Z", "updated_at": "2026-02-08T14:55:10Z", "created_by": { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@example.com", "state": "Active", "roles": ["AppAdmin"], "created_at": "2026-02-08T14:12:45Z" }, "project": { "id": "proj_7a5c3e1b9d2f4a6c", "name": "Customer Insights" } } ], "next_cursor": null, "previous_cursor": null, "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` ## Create an issue | Type | Name | Required | Notes | | - | - | - | - | | Body | `project_id` | Yes | Project where the reported resource lives. | | Body | `description` | No | User-provided issue description. | | Body | `resource_type` | Yes | Currently `Thread`. | | Body | `type` | Yes | One of `NoAnswer`, `Inaccurate`, `NoContextUsed`, `Format`, `Other`. | | Body | `config` | Yes | Resource-specific payload. For thread issues, provide `thread_id` and `reported_interaction_id`. | | Body | `anonymous` | Yes | Whether to hide the reporter from the issue payload. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/issue" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "project_id": "proj_7a5c3e1b9d2f4a6c", "description": "Response missed the attached policy details.", "resource_type": "Thread", "type": "NoContextUsed", "config": { "thread_id": "thread_3f2a1c4d5b6e7f8a", "reported_interaction_id": "interaction_9b8a7c6d5e4f" }, "anonymous": false }' ``` The create request uses `config`. Responses expose the stored issue payload as `data`. ```json theme={null} { "id": "issue_5c4b3a2d1e0f9a8b", "issue_number": 1842, "description": "Response missed the attached policy details.", "resource_type": "Thread", "type": "NoContextUsed", "state": "NotReviewed", "is_read": false, "data": { "thread_id": "thread_3f2a1c4d5b6e7f8a", "reported_interaction_id": "interaction_9b8a7c6d5e4f" }, "created_at": "2026-02-08T14:55:10Z", "updated_at": "2026-02-08T14:55:10Z" } ``` ## Get or update an issue ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/issue/{issueID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "issue_5c4b3a2d1e0f9a8b", "issue_number": 1842, "description": "Response missed the attached policy details.", "resource_type": "Thread", "type": "NoContextUsed", "state": "NotReviewed", "is_read": false, "data": { "thread_id": "thread_3f2a1c4d5b6e7f8a", "reported_interaction_id": "interaction_9b8a7c6d5e4f" }, "created_at": "2026-02-08T14:55:10Z", "updated_at": "2026-02-08T14:55:10Z" } ``` | Type | Name | Required | Notes | | - | - | - | - | | Path | `issueID` | Yes | Issue identifier. | | Body | `description` | No | Updated issue description. | | Body | `type` | No | Updated issue type. | | Body | `state` | No | Updated issue state. | | Body | `is_read` | No | Read flag. Defaults to `false` if omitted, so include the intended value when updating other fields. | ```bash theme={null} curl -X PUT "https://{BASE_URL}/api/v1/app/issue/{issueID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "description": "Reviewed by support.", "type": "NoContextUsed", "state": "InReview", "is_read": true }' ``` ```json theme={null} { "id": "issue_5c4b3a2d1e0f9a8b", "issue_number": 1842, "description": "Reviewed by support.", "resource_type": "Thread", "type": "NoContextUsed", "state": "InReview", "is_read": true, "data": { "thread_id": "thread_3f2a1c4d5b6e7f8a", "reported_interaction_id": "interaction_9b8a7c6d5e4f" }, "created_at": "2026-02-08T14:55:10Z", "updated_at": "2026-02-08T15:05:10Z" } ``` ## Delete an issue Delete soft-deletes the issue and returns the updated issue object. ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/app/issue/{issueID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "issue_5c4b3a2d1e0f9a8b", "issue_number": 1842, "resource_type": "Thread", "type": "NoContextUsed", "state": "Deleted", "is_read": true, "data": { "thread_id": "thread_3f2a1c4d5b6e7f8a", "reported_interaction_id": "interaction_9b8a7c6d5e4f" }, "created_at": "2026-02-08T14:55:10Z", "updated_at": "2026-02-08T15:10:00Z" } ``` ## Errors and edge cases * **404**: issue not found. * **400**: invalid issue state, issue type, or thread issue config. # Overview Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/general/overview Monitoring, reporting, and system endpoints for Workspace API. Use the General section to monitor usage, review issues, search across workspace content, and check system status. Usage totals, rankings, and time series metrics. Track user-reported issues and triage feedback. Query projects, threads, artifacts, and interactions. Health checks and system status. # Search Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/general/search Search across projects, threads, artifacts, artifact content, and interactions. Use the Search API to query workspace content with a single text query. Limit search scope with the `types` filter. Search requests require a token with workspace access and a PrivateGPT gateway linked to your organization collection. ## Basic request and response Search across resources with `GET /api/v1/app/search`. | Type | Name | Required | Notes | | - | - | - | - | | Query | `q` | Yes | Search text. Must be between 3 and 80 characters. | | Query | `types` | No | Comma-separated list of `Project`, `Artifact`, `ArtifactContent`, `Thread`, and `Interaction`. Defaults to all types. | | Query | `limit` | No | Maximum results. Defaults to `30` and must be greater than `1`. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/search?q=support%20summary&types=Artifact,ArtifactContent&limit=5" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```json theme={null} [ { "id": "artifact_2b4d6f8a1c3e5a7b", "type": "Artifact", "match": "Q1 Support Summary", "rank": 0.91, "metadata": { "name": "Q1 Support Summary", "type": "Document", "project_id": "proj_7a5c3e1b9d2f4a6c", "project_name": "Customer Insights" } }, { "id": "content_8f1a3d5c7b9e", "type": "ArtifactContent", "match": "Billing issues drove 38% of support cases.", "rank": 0.84, "metadata": { "name": "Q1 Support Summary", "type": "Document", "project_id": "proj_7a5c3e1b9d2f4a6c", "project_name": "Customer Insights" } } ] ``` ## Search only threads | Type | Name | Required | Notes | | - | - | - | - | | Query | `q` | Yes | Search text. Must be between 3 and 80 characters. | | Query | `types` | No | Use `Thread` to limit results to threads. | | Query | `limit` | No | Maximum results. Defaults to `30` and must be greater than `1`. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/search?q=weekly%20brief&types=Thread&limit=5" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```json theme={null} [ { "id": "thread_3f2a1c4d5b6e7f8a", "type": "Thread", "match": "Weekly Support Brief", "rank": 0.86, "metadata": { "name": "Weekly Support Brief", "project_id": "proj_7a5c3e1b9d2f4a6c", "project_name": "Customer Insights" } } ] ``` ## Metadata by result type | Result type | Metadata shape | | - | - | | `Project` | `entity`, containing the project object. | | `Artifact` | `name`, `type`, `project_id`, `project_name`. | | `ArtifactContent` | `name`, `type`, `project_id`, `project_name`. | | `Thread` | `name`, `project_id`, `project_name`. | | `Interaction` | `content`, `thread_id`, `project_id`, `project_name`, `thread_name`. | ## Errors and edge cases * **400**: missing `q`, blank query, query outside the 3-80 character range, invalid `types`, or `limit <= 1`. * **403**: insufficient permissions. # System Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/general/system Health checks for workspace availability. Use these endpoints to verify system status. ## Basic request and response Use the health check to verify availability with `GET /api/health`. ```bash theme={null} curl "https://{BASE_URL}/api/health" ``` ```json theme={null} { "status": "ok", "uptime": "3d 04:12:33", "commit": "9f1c2a3" } ``` ## Errors and edge cases * **503**: health check unavailable. # Claromentis Integration Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/integrations/claromentis Sync Claromentis content into your workspace. Claromentis integrations import knowledge base content. **Enable Claromentis at the instance level first**—see the operator guide: [Claromentis integration setup](/en/v1.57/operator-manual/knowledge-base/claromentis). ## Basic request and response Create a Claromentis integration with `POST /api/v1/app/integration/claromentis`. | Type | Name | Required | Notes | | - | - | - | - | | Body | `username` | Yes | Claromentis username. | | Body | `password` | Yes | Claromentis password. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/claromentis" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "username": "{username}", "password": "{password}" }' ``` ```json theme={null} { "id": "clar_3c2d1b4a5f6e7d8c", "user_id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "type": "Claromentis", "created_at": "2026-02-08T14:05:00Z", "updated_at": "2026-02-08T14:05:00Z" } ``` ## Update integration credentials | Type | Name | Required | Notes | | - | - | - | - | | Path | `integrationID` | Yes | Integration identifier. | | Body | `username` | Yes | Claromentis username. | | Body | `password` | Yes | Claromentis password. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/claromentis/{integrationID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "username": "{username}", "password": "{password}" }' ``` ```json theme={null} { "id": "clar_3c2d1b4a5f6e7d8c", "user_id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "type": "Claromentis", "created_at": "2026-02-08T14:05:00Z", "updated_at": "2026-02-08T15:10:00Z" } ``` ## Get integration config ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/integration/claromentis/{integrationID}/config" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "base_url": "https://claromentis.auroralabs.com", "site": "Knowledge Base" } ``` ## Start an ingest sync ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/claromentis/{integrationID}/ingest" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" ``` ```json theme={null} { "type": "sync_started", "current_artifact_count": 6, "integration_item_count": 24 } ``` ## Errors and edge cases * **403**: connector not enabled or missing permissions. * **404**: integration ID not found. # Confluence Integration Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/integrations/confluence Read and sync Confluence content into projects. Confluence integrations pull pages and spaces into your workspace so they can be used as artifacts. **You must enable Confluence at the instance level first**—see the operator guide: [Confluence integration setup](/en/v1.57/operator-manual/knowledge-base/confluence). If the integration needs OAuth, use the login endpoints in [OpenID & OAuth](/en/v1.57/developer-manual/build-with-zylon/workspace-api/authentication/openid). ## Basic request and response Fetch integration configuration with `GET /api/v1/app/integration/confluence/{integrationId}/config`. ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/integration/confluence/{integrationID}/config" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "space_key": "SUP", "base_url": "https://confluence.auroralabs.com" } ``` ## Start an ingest sync ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/confluence/{integrationID}/ingest" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "type": "sync_started", "current_artifact_count": 42, "integration_item_count": 120 } ``` ## ConfluenceLocal endpoints Use these endpoints when your deployment uses the `confluencelocal` provider with basic-auth credentials. ### Create a ConfluenceLocal integration ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/confluencelocallegacy" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "username": "{user}", "password": "{password}" }' ``` ### Update a ConfluenceLocal integration | Type | Name | Required | Notes | | - | - | - | - | | Path | `integrationID` | Yes | Integration identifier. | | Body | `username` | Yes | ConfluenceLocal username. | | Body | `password` | Yes | ConfluenceLocal password. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/confluencelocallegacy/{integrationID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "username": "{user}", "password": "{password}" }' ``` ### Get ConfluenceLocal config ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/integration/confluencelocallegacy/{integrationID}/config" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ### Start ConfluenceLocal ingest ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/confluencelocallegacy/{integrationID}/ingest" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" ``` ```json theme={null} { "id": "int_6d9a2b4c5e7f", "user_id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "type": "ConfluenceLocalLegacy", "provider_data": { "username": "confluence_service" }, "created_at": "2026-03-01T11:00:00Z", "updated_at": "2026-03-01T11:00:00Z" } ``` ## Common mistakes * Using the OAuth-style Confluence endpoints with a `confluencelocal` integration ID. * Forgetting to include JSON body fields (`username`, `password`) for create/update. * Calling ingest before the integration is configured. ## Errors and edge cases * **403**: integration not enabled or missing permissions. * **404**: integration ID not found. # Filesystem Integration Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/integrations/filesystem Sync files from a shared filesystem into your workspace. The filesystem integration connects a shared directory to your workspace. **Enable the filesystem connector first** in the operator guide: [Filesystem integration setup](/en/v1.57/operator-manual/knowledge-base/file-system). ## Basic request and response Create a filesystem integration with `POST /api/v1/app/integration/filesystem`. ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/filesystem" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "username": "{file_system_username}", "password": "{file_system_password}" }' ``` ```json theme={null} { "id": "fs_9f8e7d6c5b4a3c2d", "user_id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "type": "FileSystem", "created_at": "2026-02-08T14:10:00Z", "updated_at": "2026-02-08T14:10:00Z" } ``` ## Update integration credentials | Type | Name | Required | Notes | | - | - | - | - | | Path | `integrationID` | Yes | Integration identifier. | | Body | `username` | Yes | Filesystem username. | | Body | `password` | Yes | Filesystem password. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/filesystem/{integrationID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "username": "{file_system_username}", "password": "{file_system_password}" }' ``` ```json theme={null} { "id": "fs_9f8e7d6c5b4a3c2d", "user_id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "type": "FileSystem", "created_at": "2026-02-08T14:10:00Z", "updated_at": "2026-02-08T15:02:00Z" } ``` ## Get integration config ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/integration/filesystem/{integrationID}/config" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "path": "/mnt/shared/support" } ``` ## Validate credentials | Type | Name | Required | Notes | | - | - | - | - | | Query | `username` | Yes | Filesystem username to validate. | | Query | `password` | Yes | Filesystem password to validate. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/integration/filesystem/validate?username={file_system_username}&password={file_system_password}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} true ``` ## List files | Type | Name | Required | Notes | | - | - | - | - | | Query | `integrationId` | Yes | Filesystem integration identifier. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/integration/filesystem/files?integrationId={integrationID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} [ { "path": "/mnt/shared/support/weekly-brief.pdf", "name": "weekly-brief.pdf", "size": 287104, "updated_at": "2026-02-07T19:22:10Z" } ] ``` ## Start an ingest sync ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/filesystem/{integrationID}/ingest" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" ``` ```json theme={null} { "type": "sync_started", "current_artifact_count": 12, "integration_item_count": 48 } ``` ## Errors and edge cases * **403**: connector not enabled or missing permissions. * **400**: invalid credentials. * **404**: integration ID not found. # SharePoint Integration Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/integrations/sharepoint Sync SharePoint documents into your workspace. SharePoint integrations ingest libraries and documents into your workspace. **Enable SharePoint at the instance level first**—see the operator guide: [SharePoint integration setup](/en/v1.57/operator-manual/knowledge-base/sharepoint). If OAuth is required, use the login endpoints in [OpenID & OAuth](/en/v1.57/developer-manual/build-with-zylon/workspace-api/authentication/openid). ## Basic request and response Fetch integration configuration with `GET /api/v1/app/integration/sharepoint/{integrationId}/config`. ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/integration/sharepoint/{integrationID}/config" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "site_url": "https://auroralabs.sharepoint.com/sites/support", "library": "Shared Documents" } ``` ## Start an ingest sync ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/integration/sharepoint/{integrationID}/ingest" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" ``` ```json theme={null} { "type": "sync_started", "current_artifact_count": 18, "integration_item_count": 64 } ``` ## Errors and edge cases * **403**: integration not enabled or missing permissions. * **404**: integration ID not found. # Overview Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/overview API for automating and managing Zylon Workspace. The Workspace API lets you programmatically manage **everything in Zylon Workspace**—organizations, users, projects, chats, artifacts, integrations, and reporting. Use it to automate admin workflows or integrate Zylon into your internal systems. ## Base URL All Workspace endpoints live under: ``` https://{BASE_URL}/api/v1 ``` ## Organization header (`x-org`) Workspace endpoints under `/api/v1/app/*` require the `x-org` header so Zylon knows which workspace organization to target. You can set `x-org` to either: * the organization slug (recommended), for example `default` * the organization ID (UUID) Use this in requests: ```bash theme={null} -H "x-org: {org_slug}" ``` ## Core concepts | Concept | Meaning | | - | - | | **Account** | The identity record that authenticates into Zylon. One account can belong to multiple organizations. | | **User** | The org-specific representation of an account. An account can have **multiple users**, one per organization. | | **Artifact** | A persisted piece of knowledge that can be retrieved in chats and tools. | This model supports multi‑org setups where the same person can be a member of multiple workspaces with different roles. ## Pagination Pagination is a shared model across the Workspace API. List endpoints return a page envelope with cursors: ```json theme={null} { "data": [], "next_cursor": "cursor_next", "previous_cursor": "cursor_prev", "has_next_page": false, "has_previous_page": false, "total_count": 0 } ``` Use `page`, `page_size`, `after`, `before`, `first`, `last`, and `total_count` when they’re available on the endpoint. ## Workspace API sections Analytics, issues, search, and system status endpoints. SSO login flows and workspace login/auth callbacks. Create, update, and manage user access and org membership. Provision projects, manage membership, and control visibility. Create threads, run interactions, and stream responses. Manage artifacts and integrations like Confluence, SharePoint, Filesystem, and Claromentis. For manual log retrieval, use [Backoffice API: Logging](/en/v1.57/developer-manual/build-with-zylon/backoffice-api/logging). ## Errors and edge cases * **401/403**: token missing or insufficient permissions. * **404**: resource IDs are invalid or deleted. * **Redirect endpoints**: login/callback routes return `302` responses intended for browsers. # Projects Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/projects/project Create projects, update metadata, and run project-scoped chat. Projects are the workspace unit that holds threads, artifacts, and team context. Use these endpoints to create and configure projects, transfer ownership, and start project-scoped chats. ## Basic request and response Create a project with `POST /api/v1/app/project`. | Type | Name | Required | Notes | | - | - | - | - | | Body | `name` | Yes | Project name. | | Body | `goal` | No | Project goal or description. | | Body | `deadline` | No | Project deadline as a Unix timestamp. | | Body | `visibility` | No | `Public` or `Private`. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Customer Insights", "goal": "Summarize weekly support trends.", "deadline": 1709337600, "visibility": "Private" }' ``` ```json theme={null} { "id": "proj_7a5c3e1b9d2f4a6c", "name": "Customer Insights", "goal": "Summarize weekly support trends.", "deadline": "2026-03-01T00:00:00Z", "visibility": "Private", "member_count": 1, "default_member_role": "Editor", "default_role_enabled": true, "project_context": "Support analytics for Q1.", "answer_context": "Use approved templates.", "is_pinned": false } ``` ## Get a project ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "proj_7a5c3e1b9d2f4a6c", "name": "Customer Insights", "goal": "Summarize weekly support trends.", "visibility": "Private" } ``` ## Update a project | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `name` | No | Project name. | | Body | `goal` | No | Project goal or description. | | Body | `deadline` | No | Project deadline as an ISO timestamp. | | Body | `visibility` | No | `Public` or `Private`. | | Body | `project_context` | No | Project-level context. | | Body | `answer_context` | No | Default answer guidance. | | Body | `default_member_role` | No | `Viewer`, `Commenter`, `Editor`, `Admin`, or `Owner`. | | Body | `default_role_enabled` | No | Enables the default member role. | ```bash theme={null} curl -X PUT "https://{BASE_URL}/api/v1/app/project/{projectID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Customer Insights", "goal": "Summarize weekly support and churn signals.", "deadline": "2026-03-15T00:00:00Z", "visibility": "Private", "project_context": "Support analytics for Q1.", "answer_context": "Return answers in a weekly memo format.", "default_member_role": "Editor", "default_role_enabled": true }' ``` ```json theme={null} { "id": "proj_7a5c3e1b9d2f4a6c", "name": "Customer Insights", "goal": "Summarize weekly support and churn signals.", "deadline": "2026-03-15T00:00:00Z", "visibility": "Private", "member_count": 3, "default_member_role": "Editor", "default_role_enabled": true, "project_context": "Support analytics for Q1.", "answer_context": "Return answers in a weekly memo format.", "is_pinned": true } ``` | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | Any `UpdateProjectDTO` field | No | Partial update; send only fields to change. | ```bash theme={null} curl -X PATCH "https://{BASE_URL}/api/v1/app/project/{projectID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "project_context": "Support analytics for Q1 with strict PII handling." }' ``` ```text theme={null} HTTP/1.1 200 OK ``` ## Delete a project ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/app/project/{projectID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```text theme={null} HTTP/1.1 204 No Content ``` ## Leave a project ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/leave" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```text theme={null} HTTP/1.1 200 OK ``` ## Transfer project ownership | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `old_owner_id` | Yes | Current owner user ID. | | Body | `new_owner_id` | Yes | New owner user ID; must be a project member. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/transfer" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "old_owner_id": "{userID}", "new_owner_id": "{userID}" }' ``` ```text theme={null} HTTP/1.1 200 OK ``` ## Project user info ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/info/{userID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```text theme={null} HTTP/1.1 200 OK ``` | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `is_pinned` | No | Pins or unpins the project for the current user. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/info" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "is_pinned": true }' ``` ```text theme={null} HTTP/1.1 200 OK ``` ## Project-scoped chat | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `pgpt` | Yes | Chat request body. | | Body | `artifact_ids` | No | Limits context to selected artifact IDs. | | Body | `all_artifacts` | No | Includes all project artifacts when `true`. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/chat" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "all_artifacts": true, "pgpt": { "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Summarize the latest support trends in three bullets." } ] } ], "max_tokens": 80, "temperature": 0.2 } }' ``` ```json theme={null} { "id": "inter_5a7b9c1d3e5f7a9b", "state": "Completed" } ``` ## Errors and edge cases * **403**: not a project member. * **404**: project not found. * **409**: transfer target not eligible. # Project Members Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/projects/project-member Add, update, and remove members from a project. Use project member endpoints to control who can access a project and what role they have. Roles include `Viewer`, `Commenter`, `Editor`, `Admin`, and `Owner`. ## Basic request and response List current members with `GET /api/v1/app/project/{projectId}/member`. | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Query | `page` | No | Absolute page number to fetch, 1-based. | | Query | `page_size` | No | Number of items per page. Default is `20`. | | Query | `page_order` | No | `ASC` or `DESC`. Default is `ASC`. | | Query | `after` | No | Cursor or value to paginate after. | | Query | `before` | No | Cursor or value to paginate before. | | Query | `first` | No | Limit to the first N items after a cursor. | | Query | `last` | No | Limit to the last N items before a cursor. | | Query | `total_count` | No | Include total count in the response. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/member?page=1&page_size=50" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "data": [ { "id": "member_1a2b3c4d5e6f", "role": "Owner", "user": { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@auroralabs.com", "state": "Active", "roles": ["AppAdmin"], "created_at": "2026-02-08T14:12:45Z" }, "is_project_member": true } ], "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` ## Add members | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `members` | Yes | Array of members to add. | | Body | `members[].user_id` | Yes | User identifier. | | Body | `members[].role` | Yes | `Viewer`, `Commenter`, `Editor`, `Admin`, or `Owner`. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/project/{projectID}/member" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "members": [ { "user_id": "{userID}", "role": "Editor" } ] }' ``` ```json theme={null} [ { "id": "member_7f6e5d4c3b2a", "role": "Editor", "user": { "id": "user_9d1c3b5a7f2e4c6d", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Jordan Lee", "email": "jordan@auroralabs.com", "state": "Active", "roles": ["AppMember"], "created_at": "2026-02-07T09:20:12Z" }, "is_project_member": true } ] ``` ## Update member roles | Type | Name | Required | Notes | | - | - | - | - | | Path | `projectID` | Yes | Project identifier. | | Body | `members` | Yes | Array of members to update. | | Body | `members[].user_id` | Yes | User identifier. | | Body | `members[].role` | No | `Viewer`, `Commenter`, `Editor`, `Admin`, or `Owner`. | | Body | `members[].is_pinned` | No | Pins or unpins the project for that member. | ```bash theme={null} curl -X PUT "https://{BASE_URL}/api/v1/app/project/{projectID}/member" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "members": [ { "user_id": "{userID}", "role": "Admin", "is_pinned": true } ] }' ``` ```json theme={null} [ { "id": "member_7f6e5d4c3b2a", "role": "Admin", "user": { "id": "user_9d1c3b5a7f2e4c6d", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Jordan Lee", "email": "jordan@auroralabs.com", "state": "Active", "roles": ["AppMember"], "created_at": "2026-02-07T09:20:12Z" }, "is_project_member": true } ] ``` ## Get or remove a member ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/project/{projectID}/member/{userID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "member_7f6e5d4c3b2a", "role": "Admin", "user": { "id": "user_9d1c3b5a7f2e4c6d", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Jordan Lee", "email": "jordan@auroralabs.com", "state": "Active", "roles": ["AppMember"], "created_at": "2026-02-07T09:20:12Z" }, "is_project_member": true } ``` ```bash theme={null} curl -X DELETE "https://{BASE_URL}/api/v1/app/project/{projectID}/member/{userID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "member_7f6e5d4c3b2a", "role": "Admin", "user": { "id": "user_9d1c3b5a7f2e4c6d", "name": "Jordan Lee", "email": "jordan@auroralabs.com", "state": "Active", "roles": ["AppMember"], "created_at": "2026-02-07T09:20:12Z" }, "is_project_member": false } ``` ## Errors and edge cases * **403**: not allowed to manage members. * **404**: project or user not found. # Users Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/users/user Create and manage users, roles, and project access. Use the Users API to manage people in your workspace. You can create users linked to existing accounts, update profiles and roles, and inspect related projects or artifacts. ## Basic request and response Use `GET /api/v1/app/me` to verify your token and user context. ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/me" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@auroralabs.com", "job_position_name": "Product Ops Lead", "job_position_description": "Owns release coordination and analytics.", "state": "Active", "roles": ["AppAdmin"], "created_at": "2026-02-08T14:12:45Z" } ``` ## List users | Type | Name | Required | Notes | | - | - | - | - | | Query | `page` | No | Absolute page number to fetch, 1-based. | | Query | `page_size` | No | Number of items per page. | | Query | `page_order` | No | `ASC` or `DESC`. | | Query | `after` | No | Cursor or value to paginate after. | | Query | `before` | No | Cursor or value to paginate before. | | Query | `first` | No | Limit to the first N items after a cursor. | | Query | `last` | No | Limit to the last N items before a cursor. | | Query | `total_count` | No | Include total count in the response. | ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/user?page=1&page_size=20" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "data": [ { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@auroralabs.com", "state": "Active", "roles": ["AppAdmin"], "created_at": "2026-02-08T14:12:45Z" } ], "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` ## Create a user ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/user" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "account_id": "{accountID}", "role": "AppMember", "user_info": { "email": "sasha@auroralabs.com", "name": "Sasha Patel", "given_name": "Sasha", "family_name": "Patel" } }' ``` ```json theme={null} { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@auroralabs.com", "state": "Active", "roles": ["AppMember"], "created_at": "2026-02-08T14:12:45Z" } ``` ## Get or update a user ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/user/{userID}" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@auroralabs.com", "state": "Active", "roles": ["AppMember"], "created_at": "2026-02-08T14:12:45Z" } ``` | Type | Name | Required | Notes | | - | - | - | - | | Path | `userID` | Yes | User identifier. | | Body | `name` | No | User display name. | | Body | `role` | No | Workspace role to assign. | ```bash theme={null} curl -X PUT "https://{BASE_URL}/api/v1/app/user/{userID}" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Sasha Patel", "role": "AppAdmin" }' ``` ```json theme={null} { "id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "account_id": "acct_6c8a1f3b2d4e5f7a", "name": "Sasha Patel", "email": "sasha@auroralabs.com", "state": "Active", "roles": ["AppAdmin"], "created_at": "2026-02-08T14:12:45Z" } ``` ## Activate or deactivate a user ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/user/{userID}/deactivate" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "user_9d1c3b5a7f2e4c6d", "state": "Inactive" } ``` ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/user/{userID}/activate" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "user_9d1c3b5a7f2e4c6d", "state": "Active" } ``` ## List projects for a user ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/user/{userID}/project" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} { "data": [ { "id": "proj_7a5c3e1b9d2f4a6c", "name": "Customer Insights", "goal": "Summarize weekly support trends.", "deadline": "2026-03-01T00:00:00Z", "visibility": "Private", "member_count": 4, "default_member_role": "Editor", "default_role_enabled": true, "project_context": "Support analytics for Q1.", "answer_context": "Use approved templates.", "is_pinned": true } ], "has_next_page": false, "has_previous_page": false, "total_count": 1 } ``` ## Latest artifacts for a user ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/user/{userID}/latest-artifacts" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} [ { "id": "artifact_2b4d6f8a1c3e5a7b", "project_id": "proj_7a5c3e1b9d2f4a6c", "name": "Q1 Support Summary", "type": "Document", "source": "User", "state": "Published", "ingest_status": "Done", "has_content": true, "created_at": "2026-02-08T14:30:12Z" } ] ``` ## User integrations ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/user/integrations" \ -H "Authorization: Bearer {API_TOKEN}" -H "x-org: {org_slug}" ``` ```json theme={null} [ { "id": "conf_8a7b6c5d4e3f2a1b", "user_id": "user_4b7c2a1d9e5f3c8b", "org_id": "org_2f3a9d1c7b5e4a8f", "type": "Confluence", "created_at": "2026-02-05T09:10:00Z", "updated_at": "2026-02-08T10:02:11Z" } ] ``` ## Errors and edge cases * **409**: duplicate user email or account linkage. * **400**: invalid role. * **404**: user not found. # Organizations Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/workspace-api/users/user-organization Read and update the current Workspace organization. Organizations are the top-level container for users and projects. These endpoints operate on the organization selected by the `x-org` header. ## Basic request and response Get the current organization with `GET /api/v1/app/organization`. ```bash theme={null} curl "https://{BASE_URL}/api/v1/app/organization" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" ``` ```json theme={null} { "id": "org_2f3a9d1c7b5e4a8f", "name": "Aurora Labs", "slug": "aurora-labs", "state": "Active", "display_name": "Aurora Labs", "context": "Enterprise R&D and analytics.", "logo": "https://{BASE_URL}/files/org-logo.png", "auto_join_enabled": true, "default_role": "Viewer", "email_regex": ".*@auroralabs.com", "gateway_id": "gw_4b7c2a1d9e5f", "created_at": "2026-02-08T14:12:45Z", "member_count": null } ``` ## Update organization settings ```bash theme={null} curl -X POST "https://{BASE_URL}/api/v1/app/organization" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "x-org: {org_slug}" \ -H "Content-Type: application/json" \ -d '{ "name": "Aurora Labs", "context": "Private AI platform for product and support teams.", "clear_context": false, "email_regex": ".*@auroralabs.com" }' ``` | Field | Type | Required | Description | | - | - | - | - | | `name` | string | No | Organization display name. Maximum 60 characters. | | `context` | string | No | Organization context used by Workspace features. | | `clear_context` | boolean | No | Set to `true` to remove the existing context. Defaults to `false`. | | `logo_file_name` | string | No | Multipart logo file name. Required when uploading a logo file. | | `logo_content_type` | string | No | Multipart logo content type. Must be PNG or JPEG. | | `logo_content_length` | integer | No | Multipart logo size in bytes. Maximum 5 MB. | | `fileData` | file | No | Multipart-only logo binary. | ```json theme={null} { "id": "org_2f3a9d1c7b5e4a8f", "name": "Aurora Labs", "slug": "aurora-labs", "state": "Active", "display_name": "Aurora Labs", "context": "Private AI platform for product and support teams.", "logo": "https://{BASE_URL}/files/org-logo.png", "auto_join_enabled": true, "default_role": "Viewer", "email_regex": ".*@auroralabs.com", "gateway_id": "gw_4b7c2a1d9e5f", "created_at": "2026-02-08T14:12:45Z", "member_count": null } ``` ## Errors and edge cases * **401/403**: missing or invalid API token. * **400**: invalid regex, organization name over 60 characters, unsupported logo content type, or logo larger than 5 MB. # Embeddings Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/zylon-gpt-api/embeddings Generate embeddings for semantic search and similarity. Embeddings turn text into high‑dimensional vectors. Use them for semantic search, clustering, or similarity scoring across your own data. ## Prerequisites * An API token. See [Backoffice Developer Console](/en/v1.57/developer-manual/get-started/developer-console). * Your Zylon hostname (replace `{BASE_URL}` in the examples). ## Before you start * **Order matters**: `data[index]` aligns with your input order. * **Store the vectors** in your database or vector index to power search and similarity. * **Use consistent preprocessing** (same casing and formatting) for better similarity results. ## Create embeddings Generate embeddings with `POST /embeddings`. The `input` can be a single string or an array. | `input` shape | When to use | | - | - | | Single string | One text at a time. | | Array of strings | Batch inputs and keep output order. | ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/embeddings" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "input": "Summarize Q1 support trends in one vector." }' ``` ```json theme={null} { "object": "list", "model": "private-gpt", "data": [ { "index": 0, "object": "embedding", "embedding": [ 0.697265625, 0.5078125, 0.01129150390625, 0.244873046875, -0.285888671875, 0.058135986328125, 0.01922607421875, -0.11431884765625 ] } ] } ``` ```bash theme={null} curl -X POST "https://{BASE_URL}/api/gpt/v1/embeddings" \ -H "Authorization: Bearer {API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "input": [ "Billing issues drove 38% of cases.", "Priority bugs were resolved within 48 hours." ] }' ``` ```json theme={null} { "object": "list", "model": "private-gpt", "data": [ { "index": 0, "object": "embedding", "embedding": [ -0.435546875, -0.49169921875, -0.48876953125, 1.41015625, 0.11114501953125, -1.2626953125 ] }, { "index": 1, "object": "embedding", "embedding": [ -0.6748046875, 0.242431640625, -0.31396484375, 0.53955078125, -0.84716796875, -0.006961822509765625 ] } ] } ``` ## Errors and edge cases * **401/403**: token missing or invalid. * **413**: input too large. * **400**: invalid JSON or input type. # Handling stop reasons Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/zylon-gpt-api/handling-stop-reasons Know why a response stopped and how to handle ZylonGPT errors. When you call the Messages endpoint, each response includes a `stop_reason` that explains **why the model stopped**. Handling this field correctly is key to building reliable apps. For details about `stop_reason` in the response schema, see [Messages](/en/v1.57/developer-manual/build-with-zylon/working-with-messages). ## What is `stop_reason`? `stop_reason` is present on every **successful** response. It doesn’t mean there was an error—it tells you how the model completed its response. Example response (truncated): ```json theme={null} { "id": "msg_abf981cf3f1c449eacb7a85c064ca505", "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Here’s a concise update..." } ], "stop_reason": "end_turn", "stop_sequence": null } ``` ## Stop reason values When a request fails, the stop reason matches one of the error values below and the response is returned as an error envelope. | stop\_reason | Why it happens | What to do | | - | - | - | | `end_turn` | The model completed its response normally. Sometimes you’ll see an empty response after tool execution if you send extra user text with a `tool_result`. | Treat as complete. If empty, send only the `tool_result` block, or add a new user message like “Please continue.” | | `max_tokens` | The response hit your `max_tokens` limit. | Increase `max_tokens` or ask the model to continue. | | `stop_sequence` | The model generated one of your custom stop sequences. | Treat output as complete at the boundary or adjust/remove the sequence. | | `tool_use` | The model wants you to run a tool. | Execute the tool and return a `tool_result` block. | | `pause_turn` | The model intentionally paused. | Resume the conversation when ready. | | `refusal` | The model refused for safety or policy reasons. | Surface the refusal or re‑prompt with allowed content. | | `invalid_request_error` | The request inputs are invalid (e.g., artifacts not fully ingested, missing tool config, invalid IDs). | Fix inputs and retry. | | `permission_error` | The token lacks access to the referenced resource. | Check org/project membership and artifact visibility. | | `request_too_large` | Input size or token count exceeds model limits. | Reduce input, chunk content, or lower context size. | | `api_error` | An internal server error occurred. | Retry with exponential backoff. | | `overloaded_error` | The system is temporarily overloaded. | Retry with backoff and jitter. | # Overview Source: https://docs.zylon.ai/en/v1.57/developer-manual/build-with-zylon/zylon-gpt-api/overview The ZylonGPT API lets you generate responses, ingest knowledge, create embeddings, and call tools in one flow. ZylonGPT is the model-facing API. Most apps follow a simple loop: send messages, attach or reference artifacts, generate embeddings for search, and let the assistant call tools when it needs structured data or retrieval. Send conversation history and get structured assistant replies. Ingest text, files, or URLs into collections for reuse. Turn text into vectors for search and similarity. Enable semantic search, tabular analysis, web fetch, and custom tools. # Claude Code Source: https://docs.zylon.ai/en/v1.57/developer-manual/get-started/claude-code-setup Configure Claude Code CLI to work with Zylon's AI platform. **Claude Code** is Anthropic's CLI tool for interacting with Claude models. It allows you to use Claude's capabilities directly from your terminal for development and analysis tasks. For installation instructions, see the [official Claude Code documentation](https://claude.com/product/claude-code). This integration was verified with **Claude Code 2.1.166** on **macOS** using **Zylon 1.57.1**. If it's not working, please check other alternatives in the [Opencode setup guide](./opencode-setup). ## Tested versions | Zylon release | Claude Code version | Operating system | Result | | - | - | - | - | | 1.57.1 | 2.1.166 | macOS | Working | ## Setup Steps Before configuring Claude Code, you need a **Gateway Token** from Zylon. See [Token Management](./token-management) for detailed instructions on creating Gateway tokens. Add the following to your shell configuration file (`~/.zshrc` or `~/.bashrc`): ```bash theme={null} echo 'export ZYLON_BASE_URL="https://your-host/api/gpt"' >> ~/.zshrc echo 'export ZYLON_API_TOKEN="your-gateway-token"' >> ~/.zshrc echo 'export ZYLON_MODEL="default"' >> ~/.zshrc source ~/.zshrc ``` Replace `your-host` with your Zylon instance URL and `your-gateway-token` with your actual Gateway token. The model defaults to `default`. Never commit environment variables containing tokens to version control. Add them to your `.gitignore`. Confirm the variables are set correctly: ```bash theme={null} echo $ZYLON_BASE_URL echo $ZYLON_API_TOKEN echo $ZYLON_MODEL ``` Add the following to your shell configuration file (`~/.zshrc` or `~/.bashrc`): ```bash theme={null} echo 'export ANTHROPIC_BASE_URL="$ZYLON_BASE_URL"' >> ~/.zshrc echo 'export ANTHROPIC_AUTH_TOKEN="$ZYLON_API_TOKEN"' >> ~/.zshrc echo 'export ANTHROPIC_MODEL="$ZYLON_MODEL"' >> ~/.zshrc source ~/.zshrc ``` Test your configuration by running: ```bash theme={null} claude ``` If configured correctly, Claude Code will connect to your Zylon instance and be ready to assist. ## Limitations * Images are not supported ## Troubleshooting ### Connection Errors * Verify `ZYLON_BASE_URL` is correct and accessible * Ensure your Gateway token is valid and not expired * Check network connectivity to your Zylon instance ### Authentication Failures * Confirm the token is copied correctly without extra whitespace * Regenerate the token if it may have been compromised * Verify the token has appropriate permissions # Developer Console Source: https://docs.zylon.ai/en/v1.57/developer-manual/get-started/developer-console API token management for developers. ## Overview Developer Console is the Backoffice area used for Gateway token management. Tokens generated in Developer Console are the recommended option when you need one token that works across: * Workspace API * ZylonGPT API * Backoffice API It is available to: * Accounts with **Developer** role * Accounts with **Operator** role when they also belong to a gateway API tokens are created within gateways and are tied to both the gateway and the account that created them. If you only need Workspace API access, you can use the Workspace-only flow in [Workspace Token Management](/en/v1.57/developer-manual/get-started/token-management). For role-based access details, see [Roles and Permissions](/en/v1.57/operator-manual/backoffice/roles-and-permissions). ## Create API Token To create an API token: 1. Open **Developer Console**. 2. Select the target gateway. 3. Click **Create API Token**. 4. Enter a token name. 5. Generate the token. 6. Copy the token secret shown in the modal.