Skip to main content
简体中文 Use Gateway as the API base URL. Product management uses user identity; applications should generally invoke published capabilities through Endpoints.

Authentication and scope

POST /api/auth/login accepts {"username":"...","password":"..."} and returns token. Send it as Authorization: Bearer TOKEN. Use GET /api/auth/me to check identity and POST /api/auth/logout to sign out. Scope requests can carry X-AgentScope-Tenant and X-AgentScope-Namespace. Keep any tenant/namespace body or query fields consistent. The server determines authoritative scope in single-scope installations; use an authorized scope in multi-scope mode rather than assuming a shared default namespace.

Common resources

Paths are relative to Gateway. {id} means a returned resource ID, not a display name.

Chat request

Create a Chat with an existing Agent ID and authorized scope. Use the returned chat.id for turns:
A turn body is {"message":"Summarize this material"}. This product API differs from the runtime /api/sessions event protocol; do not mix their payloads.

Issue review and concurrent edits

Read GET /api/v1/issues/{id} and inspect the result and issue.version. Accept with {"expectedVersion":7}, or reject with {"expectedVersion":7,"reason":"Missing source evidence"}. Replace 7 with the reviewed version. Version fields differ: Chat patch uses version, Issue decisions and Workflow publication use expectedVersion, and Endpoint publication uses version. After 409, reread and review rather than automatically applying an old decision to a new version.

Endpoint invocation

See the Endpoint guide for jobs, conversations, credentials, states and SSE. Submission uses a logical-request Idempotency-Key. Follow returned statusUrl/eventsUrl instead of bypassing the Endpoint to manipulate internal tasks.

Errors

Record correlation/resource IDs, time, status code and a redacted error. See External Agents for SDK adapters and execution reference for states.