Skip to main content
Upcoming release — Zylon 1.58These docs are published ahead of release so you can prepare your API integrations. The release image is not yet available. For installations running 1.57, use the 1.57 documentation.
Chats in the Workspace API are organized around threads and interactions: 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.
In 1.58, created_by.id identifies an account, not a workspace membership. Both IDs are UUIDs. Update stored comparisons and lookups; see account ID migration.

Basic request and response

Create a thread interaction with POST /api/v1/app/thread/{threadID}/interaction. Send exactly one new user message; the server adds thread history. The response is 200 SSE with an initial interaction event and message events ending in done.
The stream below is abbreviated. Read the initial interaction event for the persisted interaction ID, then process message events until done.

Interaction response fields

Null fields may be omitted. Nested message fields follow Messages; account fields follow Workspace Members.

Selecting artifacts

Use artifacts on interaction and wrapped chat requests. It contains optional document, connector, skill, and agent_flow arrays. Each array contains selections by organization or project scope.
Do not combine all_artifacts: true with a nonempty artifacts_ids array. Each category may contain at most one entry per scope. A project selection uses the thread project or the wrapped chat project_id; without project context, all_artifacts for that scope selects nothing. Top-level artifact_ids and all_artifacts are not the current selection model.
Eligible organization artifacts are included by default for each category without an explicit organization entry. To exclude that default for a category, send an explicit organization entry with all_artifacts: false and artifacts_ids: []. Available files produced by previous turns in the same thread also remain usable.

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: start_timestamp, stop_timestamp, and _meta are optional on all blocks.
Example interaction request with image + text and runtime flags:
  • 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:
List threads in a project:

Thread response fields

Create, detail, update and delete return this thread model with 200. Project lists wrap it in the shared pagination envelope. Nullable fields may be omitted; thread responses have no created_at field. Account details follow the Workspace member account model. Reading GET /app/thread/{threadID}/interaction advances the current account checkpoint through completed assistant responses in the returned page, or at least the thread creation time when none are returned. Reading thread details alone does not mark the conversation read. Read state is per account. Create a thread and first interaction in one request:
This operation returns 200 SSE with the new interaction and thread IDs in the initial interaction event, followed by message events and done. name and visibility belong to the separate thread-create body and do not replace thread_name, thread_visibility, or pgpt here.

Get a thread

Returns the thread response model above. include relations are available on the project list, not this detail endpoint.

Update or delete a thread

PUT returns the updated thread; DELETE soft-deletes it and returns the thread with state: "Deleted". Both return 200 JSON.
Delete a thread:

List or fetch interactions

List interactions for a thread:
Fetch a specific interaction:

Delete or stream an interaction

Cancel a running interaction:
Delete an interaction:
Stream interaction output:
The stream below is abbreviated. Read the initial interaction event for the persisted interaction ID, then process message events until done.

Thread files

Thread file endpoints use the thread as the session scope. Upload and raw PUT store bytes; conversion exports or imports MDX artifact content. Send x-org and an API token on every request. Upload, PUT and export from an artifact require permission to update the thread.

Upload a file

Returns 200 with file metadata. Missing multipart file returns 400.

Put raw file bytes

Returns 200 with file metadata. Parent directories are created and an existing key is overwritten.

Download a thread file

Returns 200 with raw file bytes, inferred MIME type and Content-Disposition; it does not return a presigned URL. Organization settings can deny the download with 403: outputs require generated-resource downloads, uploads require uploaded-resource downloads, and unrecognized paths require both settings.

Convert a thread file to an artifact

Returns 200 with the created or updated artifact model. The content must be valid artifact MDX; its projection metadata determines the artifact type and properties. Missing both selectors, non-MDX paths or invalid MDX fail. Normal artifact creation/update permissions apply.

Convert an artifact to a thread file

Returns 200 with file metadata for the MDX export. Requires artifact read permission and passes the same content-download checks as downloading the artifact; disabled downloads return 403.

File metadata response

Upload, PUT and export-from-artifact share this response. Nullable fields may be omitted.

One-shot chat

The current endpoint returns 200 with Content-Type: text/event-stream, including when pgpt.stream is false. It creates no persisted thread or interaction. Send the wrapped body to select a project or artifacts. A legacy flat Messages request is still accepted for an organization-only chat.
Consume the message events until done; there is no persisted interaction event for this operation. Disconnecting cancels the active request. See Messages for nested request and response fields.

Validate a chat request

Returns 200 with valid: true, or 400 with valid: false and the validation result. Invalid bodies or failures before a result is available return a standard API error. Nullable result fields may be omitted. This checks the Messages body; wrapped project context, artifact selections and Workspace permissions are checked when executing the chat.

Available tools

Only Zylon-defined tools are accepted in pgpt.tools; custom client tools are not supported by these Workspace chat routes. Use the tool declarations and examples. Workspace knowledge tools also include get_knowledge_base_files (list_files_v1), get_artifact_structure (get_file_structure_v1), get_artifact_content (get_content_v1), analyze_artifact (analyze_artifact_v1), summarize_artifact (summarize_artifact_v1), and create_document (process_content_v1).

Errors and edge cases

  • 400: invalid message schema, invalid artifact selectors, or a request without exactly one user message (use /chat/validate).
  • 403: insufficient project access or downloads disabled by organization policy.
  • Handle SSE error events and terminal done after the HTTP stream begins.
  • 404: thread or interaction not found.
  • 409: interaction already completed when canceling.