Endpoint specification and error codes for the System Integration API of the Marketplace edition.
note
The Marketplace edition provides Chat, Conversation Management, File Management, Artifact Retrieval, Search and Projects. The Library, Agent, Skills, Playbooks, Review Request, Connector, Persona, User, Master Data, User Management, Logs and Shared Memory APIs are available in the SaaS edition only. The project APIs are limited to the four below (creating and editing projects, retrieving records and metrics, and so on are available in the SaaS edition only). See the User API Reference (SaaS) and the System Integration API Reference (SaaS) for those.
Cursor value for the next page. Pass the cursor from the previous response as is.
order
string
Sort order: "asc" or "desc" (default). Any other value returns 400 Bad Request. Supported on some endpoints only.
Responses include a hasMore field. While it is true, pass the cursor value in the next request to retrieve the following page.
Cursor-based pagination is available on the list endpoints of Conversations, Messages, Files and Projects. Treat cursor as opaque: do not interpret it, just pass the previous value back.
The APIs on this page handle requests as follows. See each endpoint's description and error responses for endpoint-specific handling.
Query parameters and body fields that are not in the specification are ignored. However, a field that the service accepts but this page does not document may still return 400 Bad Request if its type or value is invalid.
An invalid value for a documented query parameter returns 400 Bad Request.
A malformed JSON body returns 400 Bad Request (invalid_body).
Sending a body with a Content-Type other than application/json to an endpoint that accepts a JSON body returns 415 Unsupported Media Type (unsupported_media_type). File uploads return 415 for a body other than multipart/form-data. However, if reading the body fails first with 400 (malformed JSON) or 413 (over the size limit), that error is returned instead.
A body field of the wrong type returns 400 Bad Request.
Array of message objects. At least one user-role message is required. Even if multiple user messages are included, only the last one is processed. Conversation history is managed on the server side, so you do not need to send past exchanges in the messages array. To continue an existing conversation, specify the previous conversation ID in the conversationId parameter.
stream
boolean
必須
Specify true. Currently, only streaming mode is supported.
conversationId
string
—
Specify a conversation ID to continue an existing conversation. If omitted, a new conversation is created.
Use "user". "assistant" / "system" are accepted but only "user" is effectively used as the starting point of the agent turn in the current implementation
content
string | array
必須
The message content. A string, or an array of content parts (text / input_file). The text to be processed must be 1 MB or less in UTF-8.
2. data: {"choices":[{"delta":{"content":"..."}}]} × N
3. data: {"choices":[{"finishReason":"stop"}]}
4. data: [DONE]
Responses are delivered via SSE (Server-Sent Events) streaming. Each chunk is in OpenAI-compatible ChatCompletionChunk format. For details on the connection lifecycle, response objects, agent extension fields, and error handling, see the Streaming Guide.
Errors before the SSE stream starts are returned in JSON format. Errors during the stream are delivered as SSE chunks.
Status
Description
400
Invalid request parameters (missing or malformed model / messages / stream / conversationId / role / content, or more than 20 input_file parts in a single request). A malformed JSON body (code: "invalid_body"). Or the specified conversationId is archived (code: "conversation_archived")
415
The body Content-Type is not application/json (code: "unsupported_media_type")
404
The specified input_file fileId is not found
409
The specified conversation is currently being processed
GET/v1/chat/completions/:conversationId
Reconnect to the SSE stream of a conversation in progress. Use this when the agent is processing a long-running task or to recover after a network disconnection.
Reconnects to the SSE stream. The response format is the same as POST /v1/chat/completions. The response headers include X-Conversation-Id and X-Message-Id. For detailed reconnection procedures, see the Streaming Guide.
Invalid conversationId, messageId is not a string, the body is malformed JSON or not a JSON object (code: "invalid_body"), or the conversation is archived (code: "conversation_archived")
415
The body Content-Type is not application/json (code: "unsupported_media_type")
Conversations retrieved with mode=archive only support read operations (list / message history) and restoration. The following operations return a 400 error (code: "conversation_archived").
Operation
Behavior on archived conversations
GET /v1/conversations?mode=archive
✅ Allowed
GET /v1/conversations/:id/messages
✅ Allowed (messages[].archived: true is added)
PATCH /v1/conversations/:id
❌ 400 Archived conversations cannot be modified
DELETE /v1/conversations/:id
❌ 400 Archived conversations cannot be deleted via this endpoint
POST /v1/chat/completions (continuing an existing conversation)
❌ 400 Cannot send messages to an archived conversation
POST /v1/chat/completions/:id/cancel
❌ 400 Cannot cancel an archived conversation
POST /v1/conversations/:id/restore
✅ Restore to active
GET/v1/conversations
List conversations. Supports cursor-based pagination.
Cursor for fetching the next page (cursor value from the previous response)
order
string
"desc"
"asc" or "desc"
title
string
—
Filter by title
mode
string
"active"
"active" (regular conversations) or "archive" (archived conversations). Switching mode queries a different data store, so cursor cannot be carried over
Whether archived. Always true when retrieved via mode=archive. When mode=active returns this field as true, it is only because the conversation remained in archive state but was returned by the active list — usually omitted
hasMore
boolean
Whether the next page exists
cursor
string
Cursor for fetching the next page. Included only when hasMore is true
Invalid limit parameter (outside the range of 1-100), mode is not "active" / "archive", order is not "asc" / "desc", or title is not a string (for example, specified more than once)
GET/v1/conversations/:conversationId/messages
Retrieve the message history of a specified conversation. Cursor-based pagination is supported.
Array of artifacts generated by the agent. Included only when present
messages[].deliverables[].filename
string
Artifact file name
messages[].deliverables[].filepath
string
Artifact file path
messages[].deliverables[].source
string
"agent" (agent-generated) or "user" (user-uploaded)
messages[].deliverables[].isPrimary
boolean
Whether it is a primary artifact
messages[].deliverables[].createdAt
string
Creation date and time (ISO 8601 format)
messages[].deliverables[].mimeType
string?
MIME type (e.g., "application/pdf", "text/markdown"). Omitted when it cannot be determined
messages[].deliverables[].size
number?
File size (bytes). Omitted when 0 or below
messages[].files
array?
Array of user-uploaded files. Included only when present for messages with sender: "User"
messages[].files[].fileId
string
Unique identifier of the file (UUID)
messages[].files[].mimeType
string
MIME type (e.g., "image/png", "application/pdf")
messages[].files[].width
number?
Image width in pixels. Only for image files
messages[].files[].height
number?
Image height in pixels. Only for image files
messages[].archived
boolean?
true only for messages retrieved via archive. Added when viewing the message history of a conversation retrieved with GET /v1/conversations?mode=archive
hasMore
boolean
Whether a next page exists
cursor
string
Cursor for the next page. Included only when hasMore is true
Task execution result text. Omitted when not present
metadata
object?
Auxiliary information that varies by actionType (sub_event_type, url, filepath, etc.). See the Streaming Guide for details
files
array?
Files related to the task (filename / size / filepath / mimeType?. mimeType is omitted when it cannot be determined). The array itself is omitted when there are no related files
timestamp
number
Timestamp of task execution (Unix milliseconds)
createdAt
string
Creation date and time (ISO 8601)
updatedAt
string
Last updated date and time (ISO 8601)
Safely ignore unknown fields
Future implementations may add new fields to actionType / metadata. Client implementations should safely ignore any fields not listed in this table. For detailed metadata structure, refer to the Streaming Guide — Task data model.
If limit is omitted, 50 items are returned. To fetch everything, keep following the cursor until hasMore becomes false.
Using the cursor
The cursor represents a position in the result set. Do not change order while you are following the same cursor — changing the conditions changes the target set and causes duplicated or skipped items.
Items may also be duplicated or skipped across pages if messages are added or removed while you are paging.
title is missing, empty, or exceeds 200 characters, the body is malformed JSON (code: "invalid_body"), or the conversation is archived (code: "conversation_archived")
415
The body Content-Type is not application/json (code: "unsupported_media_type")
Invalid conversationId, or the conversation is archived (code: "conversation_archived"; use POST /v1/conversations/:id/restore to restore it)
404
Conversation not found
409
Conversation cannot be deleted because it is currently being processed
POST/v1/conversations/:conversationId/restore
Restore an archived conversation back to active. After restoration, the conversation can be edited, continued, and deleted just like a regular conversation.
If limit is omitted, 50 items are returned. To fetch everything, keep following the cursor until hasMore becomes false.
Using the cursor
The cursor represents a position in the result set. Do not change order while you are following the same cursor — changing the conditions changes the target set and causes duplicated or skipped items.
Items may also be duplicated or skipped across pages if files are added or removed while you are paging.
Array of artifacts generated by the agent (included only when present)
messages[].deliverables[].filename
string
Artifact file name
messages[].deliverables[].filepath
string
Artifact file path
messages[].deliverables[].source
string
"agent" (agent-generated) or "user" (user-uploaded)
messages[].deliverables[].isPrimary
boolean
Whether it is a primary artifact
messages[].deliverables[].createdAt
string
Creation date and time (ISO 8601 format)
messages[].deliverables[].mimeType
string?
MIME type (e.g., "application/pdf", "text/markdown"). Omitted when it cannot be determined
messages[].deliverables[].size
number?
File size (bytes). Omitted when 0 or below
messages[].files
array?
Array of user-uploaded files. Included only when present for messages with sender: "User". The field structure matches the history API (fileId / mimeType / width? / height?). See GET /v1/conversations/:id/messages for details
hasMore
boolean
Always false (pagination not supported). It is false even when more than 50 messages match, so there is no guarantee that every match is included
A project is the unit in which multiple agents are placed to carry out work. From an external system you can list projects, start a run, and check run status.
There are two project types, and each is triggered differently.
Type
Description
How runs are triggered
workflow
Advances through steps in order. A run starts from the first enabled step.
POST /v1/projects/{projectId}/runs
cycle
Keeps multiple agents running on their own schedules. An external event can add one extra ad-hoc run.
POST /v1/projects/{projectId}/triggers/{triggerId}/fire
What you can operate on
You can call the project API only with a service account token. Calling it with a token obtained by signing in as a user returns 404 Not Found for every endpoint. You can operate on every project in this environment.
Retrieves the list of projects you can access. Supports cursor-based pagination. cycle projects also appear in the list, but they are not valid targets for starting a run (POST /v1/projects/{projectId}/runs).
Resending with the same key returns the same run even after the project has been paused, after the concurrent-run limit has been reached, or after that run has finished.
If a timeout leaves the outcome unknown, simply resend with the same key. Nothing is run twice.
Fires a webhook trigger configured on a cycle project and runs the target agent once, as an extra ad-hoc run. Calling it for a workflow project returns 404 Not Found.
The scheduled runs stay exactly as configured. A fired run is added separately from the schedule. Each fire is accepted separately and is never merged into an earlier fire. Fires to the same step of the same agent placement are processed one at a time, in the order they were accepted.
A unique ID issued by the sender. Resending the same ID is treated as a duplicate. 1-160 characters using alphanumerics and _ . : @ + - only
payload
any
—
Arbitrary JSON passed to the agent. It is serialized to a JSON string and added to the request sent to the agent; anything beyond 8,000 characters after serialization is omitted
"accepted" (newly accepted) or "duplicate" (already accepted for the same eventId)
jobId
string
ID of the receiving job. It is fixed per combination of agent placement and step: fires to the same combination return the same value (it does not change per fire). It cannot be used to get run status (GET /v1/projects/{projectId}/runs/{runId})
This 202 Accepted means only that the request was recorded as accepted. The run happens afterwards, and its outcome is not part of this response. Do not treat 202 as business success.
Idempotency is decided by the combination of project, trigger, and eventId. Resending the same content returns 202 with result: "duplicate". Sending the same eventId with a different payload returns 409 Conflict (event_conflict).
The request body is malformed JSON or is not a JSON object
415
unsupported_media_type
A request body is sent with a Content-Type other than application/json
404
trigger_not_found
The project or trigger does not exist, is not accessible, the trigger is not a webhook trigger, or a workflow project was specified
409
trigger_disabled
The trigger is disabled
409
project_not_active
The project is not in a runnable state
409
placement_unavailable
The target agent placement does not exist, or is not in a state that can run
409
event_conflict
The same eventId was sent with a different payload
413
body_too_large
The request body exceeds 16 KiB
429
queue_full
The number of fires waiting to run on the same step of the same agent placement has reached the limit (20)
GET/v1/projects/{projectId}/runs/{runId}
Retrieves the status of a run. Besides runs started through the API (POST /v1/projects/{projectId}/runs), runs started from the UI or on a schedule can also be retrieved. cycle projects do not create runs, so they are out of scope for this endpoint.
Run state. One of "running" (running), "waiting_gate" (awaiting review), "closed_done" (completed), "closed_rejected" (ended by rejection), "closed_failed" (ended by failure) or "cancelled" (cancelled). Any value other than "running" and "waiting_gate" means the run has ended
originType
string | null
How the run started. One of "manual" (started from the UI), "api" (started through the API) or "cron" (scheduled)
originRef
string | null
A reference value that depends on how the run started. For a run started through the API, the Idempotency-Key used to start it
currentStepId
string | null
ID (UUID) of the step in progress. While the run proceeds in separate lanes, the ID of the step before the branch. null for a completed run. For a run that ended for another reason, the ID of the step at that time may remain
startedByRef
string | null
Who or what started the run. See the "Who started the run" table below
actorLabel
string | null
Display name of a starter that is not a user (the service account name). null if unknown, and null otherwise
startedAt
string | null
Start time (ISO 8601). null before it starts
endedAt
string | null
End time (ISO 8601). null before it ends
summary
string | null
For a completed run, the output of the last completed step that recorded an output (first 2,000 characters). null if there is no such step and for a run that has not completed
runtimeKind
string | null
Kind of runtime. "marketplace" (a run of registered agents) or "autonomous". May be null for older runs
cancelRequestedAt
string | null
Time (ISO 8601) when cancellation was requested. null if not requested
configRevision
number | null
Revision of the case configuration. Used by runs of registered agents; null for other runs
steps
array
Records of the step runs, in the order they were recorded
steps[].runStepId
string
ID of the step run (starts with "rs:")
steps[].stepId
string | null
Step ID (UUID)
steps[].placementId
string | null
ID (UUID) of the placement that handled the step. null for rows that do not run an agent (such as review steps)
steps[].executionId
string | null
ID of the agent execution. Set once the agent starts running
steps[].conversationId
string | null
ID of the conversation of the agent execution. null for runs of registered agents
steps[].status
string
One of "pending" (waiting to run), "running" (running), "waiting_gate" (awaiting review), "done" (done), "failed" (failed) or "skipped" (skipped)
steps[].attempt
number | null
Retry count within the same visit (starting at 1)
steps[].lane
string | null
ID of the lane the step belongs to. "main" for steps that are not in a separate lane
steps[].scheduledAt
string | null
When the step has a scheduled time, the time (ISO 8601) this row waits for. null once it starts
steps[].startedAt
string | null
Start time (ISO 8601)
steps[].endedAt
string | null
End time (ISO 8601)
steps[].outputSummary
string | null
Summary of the step output
steps[].outcome
string | null
Result of the agent execution. One of "completed", "incomplete", "failed", "timeout", "stopped", "denied" or "skipped". null for rows without a result
steps[].reasonCode
string | null
Reason code for the result
steps[].held
boolean
Whether the step is held because the project is paused and is waiting to resume
steps[].visit
number | null
Which visit to this step this is (increases with send-backs). null for rows without this record
steps[].reworkReason
string | null
Reason for the send-back
steps[].gateFor
string | null
For a review row, the step run (runStepId) it was raised for
steps[].routedFrom
string | null
When steps were skipped by choosing a destination, the step run (runStepId) that chose it
steps[].late
string | null
Why a result that arrived late was not used to advance the run
steps[].gate
object | null
Summary of a review step. null for rows that are not review steps
steps[].gate.decision
string | null
One of "proceed", "send_back" or "reject". null if not decided yet
steps[].gate.waitSource
string | null
What the review waits for. "human" (a person's decision) or "external" (an external condition)
plannedPlacements
array
Order of steps and placements planned to run, based on the configuration when the run started
plannedPlacements[].stepId
string | null
Step ID (UUID)
plannedPlacements[].placementId
string | null
Placement ID (UUID). null for review steps and steps without an agent
lanes
array
Status of each lane after the branch. An empty array before the branch and for runs that do not use lanes
lanes[].laneId
string
Lane ID
lanes[].name
string | null
Lane name
lanes[].position
number | null
Lane order (starting at 1)
lanes[].state
string
One of "running" (running), "waiting_gate" (awaiting review), "arrived" (waiting to join) or "closed" (ended)
lanes[].currentStepId
string | null
ID (UUID) of the step in progress in that lane. null for a lane waiting to join. For a lane that has ended, the ID of its last step may remain
The same 404 Not Found is returned whether the project does not exist or is not accessible, and the response does not reveal which of the two applies. The code is fixed per endpoint: project_not_found for starting a run, trigger_not_found for firing a trigger, and run_not_found for run status.
When the type is out of scope
Calling trigger fire on a workflow project, or run status on a cycle project, returns 404. Starting a run on a cycle project is the one exception: it returns 409 unsupported_project_type.
Request body
When you send a body to start a run or fire a trigger, make it a JSON object. Anything other than Content-Type: application/json returns 415, malformed JSON or a body that is not a JSON object returns 400 (invalid_body), and a body larger than 16 KiB returns 413.
Unknown fields / queries
Fields and query parameters that are not in the specification are ignored. An invalid value for a documented query parameter, or a cursor that cannot be read, returns 400 Bad Request.
Timeouts
504 Gateway Timeout does not mean "it did not run". Resend a run start with the same Idempotency-Key, and a trigger fire with the same eventId and the same body.
HTTP status codes that may be returned by all endpoints.
Status
Description
400 Bad Request
Invalid request parameters
401 Unauthorized
Token is invalid or missing
403 Forbidden
No access permission to the resource
404 Not Found
Resource does not exist
409 Conflict
Operation conflict, such as the resource currently being processed
413 Payload Too Large
Request body exceeds the size limit
415 Unsupported Media Type
The request body format (Content-Type) is not supported
429 Too Many Requests
Rate limit or concurrent-run limit exceeded. error.type is rate_limit_error, and error.code depends on the endpoint (for example monthly_quota_exceeded for the monthly limit and too_many_active_runs for concurrent project runs). Please wait and retry.
500 Internal Server Error
Internal server error
502 Bad Gateway
Communication error with upstream services (authentication / chat backends, etc.)
The parameter that caused the error. Included only for validation errors
error.suggested_action
string
Recommended action to take. Included only for some errors
JSON
{ "error":{ "type":"invalid_request_error", "message":"Invalid parameter: limit", "code":"invalid_parameter", "param":"limit", "suggested_action":"limit must be between 1 and 100" } }