---
title: Platform API schemas
description: Every object Platform API v1 sends and accepts, field by field, including the run event stream (RunEvents) and the Error shape.
url: https://agentlab.cresclab.com/docs/en/api/schemas
language: en
updated: 2026-12-05
---

# Platform API schemas

Every object Platform API v1 sends and accepts, field by field, including the run event stream (RunEvents) and the Error shape.

> [!NOTE]
> Generated from the API contract (Agent Lab Platform API 1.0.0-alpha.1). Descriptions are the contract's own words.

## Recovery

What gets a refused request working again. Clients tolerate values added later.

| Type | Values |
| --- | --- |
| `string` | One of: `authorize`, `configure`, `retry`, `none`. |

## Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `object` | yes | — |
| `error.code` | `string` | yes | Stable, UPPER_SNAKE_CASE. New codes may be added under an existing `recovery`. |
| `error.message` | `string` | yes | For the developer's logs; not for display to a person, and never parsed. |
| `error.recovery` | [Recovery](https://agentlab.cresclab.com/docs/en/api/schemas.md#Recovery) | yes | — |
| `error.requestId` | `string` | yes | Quote it when asking for support. |
| `error.problems` | [Problem](https://agentlab.cresclab.com/docs/en/api/schemas.md#Problem)[] | no | With `RUN_CONFIGURATION_INVALID`: every problem found, each with its field. |

## Page

The page envelope every list answers, with its items beside it.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |

## AccountWorkspace

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `name` | `string` | yes | — |
| `slug` | `string` | yes | The workspace's short name, in its console address. |
| `state` | `string` | yes | `deletion_scheduled` only in the list filtered by it. One of: `active`, `deletion_scheduled`. |
| `role` | `string` | no | The person's role in the workspace, when known. Clients tolerate roles added later. |
| `organization` | `object` | no | The organization the workspace belongs to, once it is placed in one. |
| `organization.id` | `string` | yes | — |
| `organization.name` | `string` | yes | — |
| `deletionEffectiveAt` | `string (date-time)` | no | When a workspace scheduled for deletion is deleted; recoverable until then. |

## AccountWorkspaceList

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [AccountWorkspace](https://agentlab.cresclab.com/docs/en/api/schemas.md#AccountWorkspace)[] | yes | — |
| `creation` | `object` | no | Whether the person may create another workspace; absent from the `deletion_scheduled` list. |
| `creation.status` | `string` | yes | One of: `available`, `limit_reached`. |
| `creation.remaining` | `integer` or `null` | no | With `available`, how many more; `null` when there is no limit. |
| `creation.limit` | `integer` | no | With `limit_reached`, the limit. |

## AccountWorkspaceCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | yes | — |
| `slug` | `string` | yes | — |

## WorkspaceAdmission

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | yes | One of: `reachable`, `realm_not_admitted`, `no_membership`. |
| `signInRealms` | `object`[] | no | With `realm_not_admitted`, the entrances the workspace admits. |
| `signInRealms[].id` | `string` | yes | — |
| `signInRealms[].kind` | `string` | yes | — |
| `signInRealms[].loginMethods` | `string`[] | yes | — |

## Installation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `workspaceId` | `string` | yes | — |
| `clientId` | `string` | yes | The OAuth client id of the installed application. |
| `applicationName` | `string` | yes | — |
| `installedAt` | `string (date-time)` | yes | — |
| `grantedScopes` | `string`[] | yes | What an administrator approved. |
| `pendingScopes` | `string`[] | yes | What the application declares beyond them, awaiting an administrator's approval. |
| `tokenScopes` | `string`[] | yes | What this token carries, and so what this call and the next ones with it may use. |

## WorkspaceMember

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | `string` | yes | — |
| `role` | `string` | yes | The member's role in the workspace. Clients tolerate roles added later. |
| `capabilities` | `string`[] | yes | What the role lets the member do in this workspace. Clients ignore names they do not know. |

## WorkspaceSettings

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `defaultModel` | `string` | yes | The workspace's default model id; empty when it uses the platform's. |
| `systemPrompt` | `string` | yes | The instructions the workspace adds to every answer. |
| `requireEvalBeforePublish` | `boolean` | yes | — |
| `monthlyTokenBudget` | `integer` | yes | Tokens per calendar month; 0 keeps the platform's default. |
| `rollingWindowTokenBudget` | `integer` | yes | Tokens per rolling window; 0 keeps the platform's default. |
| `disableAutoToolExecution` | `boolean` | yes | Every tool call waits for a person's approval. |
| `approvalChannelId` | `string` | yes | Where approval requests are delivered; empty keeps them in the console. |
| `locale` | `string` | yes | The language of platform-written messages. |
| `auditRetentionDays` | `integer` or `null` | yes | Null keeps every audit record. |
| `gatewayActivityRetentionDays` | `integer` or `null` | yes | Null keeps every AI Gateway activity record. |
| `sandboxPosture` | `string` | yes | — |
| `sandboxAvailable` | `boolean` | yes | Whether this platform offers code execution to the workspace at all. |
| `taskFocused` | `boolean` | yes | — |
| `generalAssistantEnabled` | `boolean` | yes | — |
| `timeZone` | `string` | yes | IANA time zone. |

## WorkspaceSettingsPatch

The settings to change; each field left out keeps its value.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `defaultModel` | `string` | no | A model id or capability profile the plan includes; empty uses the platform's default. |
| `systemPrompt` | `string` | no | — |
| `requireEvalBeforePublish` | `boolean` | no | — |
| `monthlyTokenBudget` | `integer` | no | — |
| `rollingWindowTokenBudget` | `integer` | no | — |
| `disableAutoToolExecution` | `boolean` | no | — |
| `approvalChannelId` | `string` | no | Trimmed, then at most 60 characters; empty keeps approvals in the console. |
| `locale` | `string` | no | One of: `en`, `zh-TW`, `zh-CN`, `ja`, `th`. |
| `auditRetentionDays` | `integer` or `null` | no | Null keeps every audit record. |
| `gatewayActivityRetentionDays` | `integer` or `null` | no | Null keeps every AI Gateway activity record; a number deletes older records. |
| `taskFocused` | `boolean` | no | — |
| `generalAssistantEnabled` | `boolean` | no | — |
| `timeZone` | `string` | no | An IANA time zone; empty uses the platform's. |

## InstructionVersion

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `seq` | `integer` | yes | The version's number in the workspace, from 1. |
| `systemPrompt` | `string` | yes | — |
| `changedByAccountId` | `string` or `null` | yes | The member who set it; null for a version the platform wrote. |
| `createdAt` | `string (date-time)` | yes | — |

## InstructionVersionPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [InstructionVersion](https://agentlab.cresclab.com/docs/en/api/schemas.md#InstructionVersion)[] | yes | — |

## WorkspaceModule

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `module` | `string` | yes | The product (`deployment`, `studio`, `aiRouting`, `channelSdk`, `apiGateway`, or one added later). |
| `enabled` | `boolean` | yes | — |
| `plan` | `string` | yes | The product's plan (such as `free`). |

## WorkspaceModuleList

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | [WorkspaceModule](https://agentlab.cresclab.com/docs/en/api/schemas.md#WorkspaceModule)[] | yes | — |

## Team

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `name` | `string` | yes | — |
| `memberCount` | `integer` | yes | — |
| `createdAt` | `string (date-time)` | yes | — |
| `viewerRole` | `string` or `null` | yes | The acting member's role in the team (`manager` or `member`); null when not on it. |

## TeamPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [Team](https://agentlab.cresclab.com/docs/en/api/schemas.md#Team)[] | yes | — |
| `truncated` | `boolean` | yes | The workspace has more teams than the platform lists. |

## Member

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | `string` | yes | — |
| `email` | `string` or `null` | yes | — |
| `role` | `string` | yes | — |
| `status` | `string` | yes | — |
| `createdAt` | `string (date-time)` | yes | When the membership began. |

## MemberPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [Member](https://agentlab.cresclab.com/docs/en/api/schemas.md#Member)[] | yes | — |
| `truncated` | `boolean` | yes | The workspace has more members than the platform lists. |

## Model

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `provider` | `string` | yes | — |
| `id` | `string` | yes | — |
| `displayName` | `string` | yes | — |
| `isDefault` | `boolean` | yes | The platform's default model. |
| `entitled` | `boolean` | yes | The workspace's plan includes it; a run naming one it does not is refused. |

## ResolvedModel

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `entitled` | `boolean` | yes | — |

## ModelCatalog

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | [Model](https://agentlab.cresclab.com/docs/en/api/schemas.md#Model)[] | yes | — |
| `capabilityProfiles` | `object`[] | yes | Model choices by capability rather than by name, such as `agentlab/balanced`. |
| `capabilityProfiles[].id` | `string` | yes | — |
| `capabilityProfiles[].tier` | `string` | yes | — |
| `platformDefault` | [ResolvedModel](https://agentlab.cresclab.com/docs/en/api/schemas.md#ResolvedModel) | yes | — |
| `workspaceDefault` | [ResolvedModel](https://agentlab.cresclab.com/docs/en/api/schemas.md#ResolvedModel) | yes | — |

## KnowledgeAudience

Who may retrieve it: `organization`, every member; `team`, the named teams and the
workspace's owners and administrators.

| Type | Values |
| --- | --- |
| `string` | One of: `organization`, `team`. |

## KnowledgeDocument

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `title` | `string` | yes | — |
| `sourceType` | `string` | yes | `markdown`, `text` or `pdf`. |
| `byteSize` | `integer` | yes | — |
| `status` | `string` | yes | `queued`, `indexing`, `waiting_for_confirmation`, `waiting_for_allowance`, `ready` or `failed`. Only a `ready` document contributes to answers. Clients tolerate values added later. |
| `description` | `string` | yes | The summary indexing wrote; empty until `ready`. |
| `sectionCount` | `integer` | yes | — |
| `error` | `string` or `null` | yes | Why indexing failed, for the developer's logs. |
| `failureCode` | `string` or `null` | yes | A stable reason for some failures, such as `spend_cap_reached`. |
| `estimatedCostMicros` | `integer` | yes | Indexing's estimated cost, in millionths of a US dollar. |
| `spendCapMicros` | `integer` | yes | — |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/en/api/schemas.md#KnowledgeAudience) | yes | — |
| `personal` | `boolean` | yes | The acting member's own document, which no one else sees. |
| `createdAt` | `string (date-time)` | yes | — |

## KnowledgeDocumentPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [KnowledgeDocument](https://agentlab.cresclab.com/docs/en/api/schemas.md#KnowledgeDocument)[] | yes | — |

## KnowledgeDocumentUpload

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `title` | `string` | yes | — |
| `sourceType` | `string` | yes | One of: `markdown`, `text`, `pdf`. |
| `content` | `string` | yes | The text, or for `pdf` the file base64-encoded. |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/en/api/schemas.md#KnowledgeAudience) | no | — |
| `audienceTeamIds` | `string (uuid)`[] | no | With `audience: team`, the teams it admits, by id. |

## KnowledgeQAEntry

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `question` | `string` | yes | — |
| `answer` | `string` | yes | — |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/en/api/schemas.md#KnowledgeAudience) | yes | — |
| `createdAt` | `string (date-time)` | yes | — |
| `updatedAt` | `string (date-time)` | yes | — |

## KnowledgeQAPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [KnowledgeQAEntry](https://agentlab.cresclab.com/docs/en/api/schemas.md#KnowledgeQAEntry)[] | yes | — |

## KnowledgeQACreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `question` | `string` | yes | — |
| `answer` | `string` | yes | — |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/en/api/schemas.md#KnowledgeAudience) | no | — |
| `audienceTeamIds` | `string (uuid)`[] | no | With `audience: team`, the teams it admits, by id. |

## KnowledgeQAUpdate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `question` | `string` | yes | — |
| `answer` | `string` | yes | — |

## Channel

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `provider` | `string` | yes | `slack`, `line` or `teams`. Clients tolerate values added later. |
| `teamName` | `string` | yes | The provider workspace or official account's name. |
| `teamRef` | `string` | yes | The provider's own id for it. |
| `status` | `string` | yes | `connected` or `revoked`. Clients tolerate values added later. |
| `scopeCoverage` | `string` | yes | Whether the provider granted everything the platform asks for. |
| `ambientReadiness` | `string` | yes | Whether the platform can answer in it without being mentioned. |
| `createdAt` | `string (date-time)` | yes | — |

## ChannelPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [Channel](https://agentlab.cresclab.com/docs/en/api/schemas.md#Channel)[] | yes | — |
| `truncated` | `boolean` | yes | The workspace has more channels than the platform lists. |

## LineConnect

A LINE official account's Messaging API credentials. Never answered.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `channelSecret` | `string` | yes | — |
| `accessToken` | `string` | yes | — |

## LinePushBudget

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ceiling` | `integer` | yes | Pushes the workspace's LINE summaries may send each calendar month; 0 sends none. |

## ConnectLinkCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `redirectUri` | `string` | yes | Where the browser returns, one of the application's registered redirect URIs. |

## ConnectLink

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | `string` | yes | Open it in the acting member's browser, once. |
| `expiresAt` | `string (date-time)` | yes | After this the link connects nothing; ask for another. |

## EngagementPolicy

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `channelRef` | `string` | yes | The provider's own id of the room. |
| `mode` | `string` | yes | `addressed_only` or `ambient`. Clients tolerate values added later. |
| `standingOrders` | `string` | no | What the assistant follows in this room; empty for none. |

## EngagementPolicyPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [EngagementPolicy](https://agentlab.cresclab.com/docs/en/api/schemas.md#EngagementPolicy)[] | yes | — |
| `truncated` | `boolean` | yes | The channel has more policies than the platform lists. |

## ChannelIdentity

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `providerUserId` | `string` | yes | The provider's own id of the user. |
| `accountId` | `string` | yes | The member it is bound to. |
| `evidence` | `string` | yes | What was verified when it was bound. Clients tolerate values added later. |
| `createdAt` | `string (date-time)` | yes | — |

## ChannelIdentityPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [ChannelIdentity](https://agentlab.cresclab.com/docs/en/api/schemas.md#ChannelIdentity)[] | yes | — |
| `scope` | `string` | yes | `own`, the acting member's binding only, or `workspace`, everyone's. |
| `truncated` | `boolean` | yes | The workspace has more bindings than the platform lists. |

## LineQuota

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `known` | `boolean` | yes | LINE answered. |
| `limited` | `boolean` | yes | The official account's plan caps pushes per month. |
| `limit` | `integer` | yes | — |
| `used` | `integer` | yes | — |

## Conversation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `workspaceId` | `string` | yes | — |
| `category` | `string` | yes | `conversation`, one a person started; `background`, one automation started; `evaluation`, an evaluation run's. Clients tolerate values added later. |
| `channel` | `boolean` | yes | Held in a channel (Slack, LINE, Teams) rather than in Agent Lab. |
| `agentRef` | `string` or `null` | yes | What it was held with, opaque, for grouping; not a resource of this API. |
| `title` | `string` | yes | The name a reader sees; the member's own name when they gave one. |
| `customTitle` | `string` | yes | The member's own name for it; empty when they gave none. |
| `archived` | `boolean` | yes | — |
| `pinned` | `boolean` | yes | — |
| `unseen` | `boolean` | yes | It holds a reply the acting member has not opened; only ever true for the member who started it. |
| `updatedAt` | `string (date-time)` | yes | — |

## ConversationPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [Conversation](https://agentlab.cresclab.com/docs/en/api/schemas.md#Conversation)[] | yes | — |

## ConversationMessage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `role` | `string` | yes | `user` or `assistant`. Clients tolerate values added later. |
| `status` | `string` | yes | `pending` while a reply is being written, `completed` or `failed`. Clients tolerate values added later. |
| `content` | `string` | yes | — |
| `refusal` | `string` or `null` | yes | What stopped this reply, as a stable code, such as `budget`. Clients tolerate values added later. |
| `stopped` | `boolean` | yes | The member stopped this reply; its content is what had been written. |
| `attachments` | [ConversationAttachment](https://agentlab.cresclab.com/docs/en/api/schemas.md#ConversationAttachment)[] | yes | The files the member attached to this message; empty on a read by anyone but the member who started the conversation. |
| `createdAt` | `string (date-time)` | yes | — |

## ConversationDetail

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](https://agentlab.cresclab.com/docs/en/api/schemas.md#Conversation) | yes | — |
| `messages` | [ConversationMessage](https://agentlab.cresclab.com/docs/en/api/schemas.md#ConversationMessage)[] | yes | — |

## ConversationStateChange

Only what is sent changes. `pinned` and `archived` are never both true.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `title` | `string` | no | The member's own name for it; empty clears it back to the generated one. |
| `pinned` | `boolean` | no | — |
| `archived` | `boolean` | no | Archiving also unpins it. |
| `seen` | `boolean` | no | The member opened it. Nothing marks a conversation unread. One of: `true`. |

## ConversationAttachment

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `name` | `string` | yes | — |
| `sourceType` | `string` | yes | `markdown`, `text` or `pdf`. Clients tolerate values added later. |
| `byteSize` | `integer` | yes | — |
| `archived` | `boolean` | yes | Archived after the member who attached it left the workspace. |

## ConversationAttachmentContent

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `name` | `string` | yes | — |
| `sourceType` | `string` | yes | `markdown`, `text` or `pdf`. Clients tolerate values added later. |
| `byteSize` | `integer` | yes | — |
| `archived` | `boolean` | yes | Archived after the member who attached it left the workspace. |
| `content` | `string` | yes | The file as it was attached, base64-encoded. |

## ConversationAttachmentInventory

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | [ConversationAttachment](https://agentlab.cresclab.com/docs/en/api/schemas.md#ConversationAttachment)[] | yes | — |
| `uploaderActive` | `boolean` | yes | The member who started the conversation is still a member; until they leave, their files cannot be archived. |

## ConversationSearch

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | `object`[] | yes | — |
| `items[].conversation` | [Conversation](https://agentlab.cresclab.com/docs/en/api/schemas.md#Conversation) | yes | — |
| `items[].matches` | `integer` | yes | How many of its messages matched; not what orders the list. |
| `items[].snippet` | `string` | yes | The first matching message, clipped. |
| `searched` | `integer` | yes | How many conversations were searched. |

## ConversationSource

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | `string` | yes | `schedule` or `trigger`. Clients tolerate values added later. |
| `id` | `string` | yes | — |
| `name` | `string` | no | Its name; absent once it has been deleted. |

## BackgroundConversation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](https://agentlab.cresclab.com/docs/en/api/schemas.md#Conversation) | yes | — |
| `outcome` | `string` or `null` | yes | How its run ended: `succeeded`, `failed`, `refused` or `running`; null when nobody recorded it. Clients tolerate values added later. |
| `source` | [ConversationSource](https://agentlab.cresclab.com/docs/en/api/schemas.md#ConversationSource) or `null` | yes | What started it; null when it names nothing. |
| `lastActivity` | `string (date-time)` | yes | — |

## BackgroundConversationPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [BackgroundConversation](https://agentlab.cresclab.com/docs/en/api/schemas.md#BackgroundConversation)[] | yes | — |

## BackgroundConversationSummary

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `groups` | `object`[] | yes | — |
| `groups[].source` | [ConversationSource](https://agentlab.cresclab.com/docs/en/api/schemas.md#ConversationSource) | yes | — |
| `groups[].total` | `integer` | yes | — |
| `groups[].succeeded` | `integer` | yes | — |
| `groups[].failed` | `integer` | yes | — |
| `groups[].refused` | `integer` | yes | — |
| `groups[].running` | `integer` | yes | — |
| `groups[].unknown` | `integer` | yes | Runs whose outcome nobody recorded. |
| `groups[].lastFailureAt` | `string (date-time)` or `null (date-time)` | yes | The newest failed or refused run in the window. |
| `unattributedCount` | `integer` | yes | — |
| `window` | `integer` | yes | How many of the newest background conversations were counted. |

## BackgroundConversationUnseen

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `count` | `integer` | yes | — |
| `window` | `integer` | yes | How many of the member's newest background conversations were counted. |

## PendingAuthorizationList

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | `object`[] | yes | — |
| `items[].toolId` | `string` | yes | — |
| `items[].name` | `string` | yes | — |
| `items[].description` | `string` | yes | — |

## McpCatalogEntry

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `scope` | `string` | yes | `platform` (the platform's own) or `workspace` (the workspace registered it). Clients tolerate values added later. |
| `name` | `string` | yes | — |
| `url` | `string` | yes | The connector's MCP server. |
| `authType` | `string` | yes | How a connection authenticates: `none`, `static_bearer`, `client_credentials` or `oauth` (in the browser, through `POST …/mcp/connections`). Clients tolerate values added later. |
| `description` | `string` | yes | — |
| `status` | `string` | yes | `enabled`, `disabled` or `deprecated`. Clients tolerate values added later. |
| `health` | `string` | yes | `unknown`, `healthy` or `unhealthy`. Clients tolerate values added later. |
| `lastError` | `string` or `null` | yes | Why the last health check failed; null when it did not, or for a member who may not manage connections. |
| `toolsOmitted` | `integer` | yes | Tools the server exposed beyond what the platform keeps. |

## McpCatalog

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | [McpCatalogEntry](https://agentlab.cresclab.com/docs/en/api/schemas.md#McpCatalogEntry)[] | yes | — |
| `truncated` | `boolean` | yes | The workspace has more connectors than the platform lists. |

## McpConnection

One identity connected to a connector. Its credential is never answered.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `catalogEntryId` | `string` | yes | — |
| `scope` | `string` | yes | `workspace` (shared by everyone) or `member` (one member's own). Clients tolerate values added later. |
| `label` | `string` or `null` | yes | Names one of several shared identities of a connector. |
| `authType` | `string` | yes | As the connector's `authType`. |
| `status` | `string` | yes | `connected`, `needs_reauth` (connect again with `POST …/mcp/connections`) or `revoked`. Clients tolerate values added later. |
| `ownedByMe` | `boolean` | yes | It is the acting member's own. |
| `delegationMode` | `string` | yes | Whose permission applies at the connector, in the platform's delegation taxonomy. Clients tolerate values added later. |
| `appliesMemberPermission` | `boolean` | yes | Calls act with the member's own permission at the connector. |
| `credentialExpires` | `boolean` | yes | The credential is short-lived and renewed. |
| `outputPolicy` | `string` | yes | Who may read what its calls answer: `inherit`, `workspace` or `personal`. Clients tolerate values added later. |

## McpConnectionPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [McpConnection](https://agentlab.cresclab.com/docs/en/api/schemas.md#McpConnection)[] | yes | — |

## McpConnectionCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `catalogEntryId` | `string` | yes | The connector, one the workspace registered. |
| `scope` | `string` | yes | Shared by everyone, or the acting member's own. One of: `workspace`, `member`. |
| `label` | `string` | no | Names one of several shared identities; only with `workspace`. |
| `redirectUri` | `string` | yes | Where the browser returns, one of the application's registered redirect URIs. |

## McpTool

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | yes | — |
| `description` | `string` | yes | — |
| `serverDeclaredReadOnly` | `boolean` or `null` | yes | The server's own claim, null when it makes none; it never lowers the approval bar. |
| `workspaceReadOnly` | `boolean` or `null` | yes | The workspace's own declaration, null when it made none; this, never the server's claim, decides whether a call waits for approval. |

## McpToolList

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | [McpTool](https://agentlab.cresclab.com/docs/en/api/schemas.md#McpTool)[] | yes | — |

## ToolCredential

The identity a tool presents. The credential itself is never answered.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `toolId` | `string` | yes | — |
| `scope` | `string` | yes | `workspace` (shared by everyone) or `member` (one member's own). Clients tolerate values added later. |
| `ownedByMe` | `boolean` | yes | It is the acting member's own. |
| `delegationMode` | `string` | yes | Whose permission applies downstream, in the platform's delegation taxonomy. Clients tolerate values added later. |
| `appliesMemberPermission` | `boolean` | yes | — |
| `credentialExpires` | `boolean` | yes | — |
| `status` | `string` | yes | `connected` or `revoked`. Clients tolerate values added later. |

## ToolCredentialList

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | [ToolCredential](https://agentlab.cresclab.com/docs/en/api/schemas.md#ToolCredential)[] | yes | — |
| `truncated` | `boolean` | yes | The workspace has more tool credentials than the platform lists. |

## ToolCredentialCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `toolId` | `string` | yes | — |
| `token` | `string` | yes | The credential the tool presents. Never answered. |

## OAuthError

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes | — |
| `error_description` | `string` | no | — |

## LegacyErrorString

The body these operations answered before this document; kept within v1.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes | — |

## LegacyErrorCode

The body this operation answered before this document; kept within v1.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `object` | yes | — |
| `error.code` | `string` | yes | — |

## TokenRequest

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `grant_type` | `string` | yes | One of: `authorization_code`, `refresh_token`, `client_credentials`. |
| `code` | `string` | no | — |
| `code_verifier` | `string` | no | — |
| `client_id` | `string` | no | — |
| `client_secret` | `string` | no | `client_secret_post`; a workspace application's secret. |
| `redirect_uri` | `string` | no | — |
| `resource` | `string` | no | — |
| `refresh_token` | `string` | no | — |
| `installation_id` | `string` | no | `client_credentials`: the installation, by id. |
| `workspace_id` | `string` | no | `client_credentials`: the installation, by the workspace it is in. |
| `scope` | `string` | no | `client_credentials`: `install` or absent. |

## TokenResponse

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `access_token` | `string` | yes | — |
| `token_type` | `string` | yes | One of: `Bearer`. |
| `expires_in` | `integer` | yes | Seconds. |
| `refresh_token` | `string` | no | — |
| `scope` | `string` | yes | Space-separated. |
| `id_token` | `string` | no | Present when `openid` was granted to an operators' own application. |

## InstallationTokenResponse

An installation token (`client_credentials`).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `access_token` | `string` | yes | — |
| `token_type` | `string` | yes | One of: `Bearer`. |
| `expires_in` | `integer` | yes | Seconds. |
| `scope` | `string` | yes | — |
| `installation_id` | `string` | yes | — |
| `workspace_id` | `string` | yes | — |

## InstallResult

An install request's code answers where the application was installed, and no token.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `installation_id` | `string` | yes | — |
| `workspace_id` | `string` | yes | — |
| `scope` | `string` | yes | — |

## Introspection

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `active` | `boolean` | yes | — |
| `sub` | `string` | no | The account id. |
| `client_id` | `string` | no | — |
| `scope` | `string` | no | Space-separated. |
| `exp` | `integer` | no | Unix seconds. |
| `aud` | `string` | no | — |
| `iss` | `string` | no | — |
| `token_type` | `string` | no | One of: `Bearer`. |
| `workspace_id` | `string` | no | An installation token names its workspace. |

## UserInfo

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sub` | `string` | yes | — |
| `workspace_id` | `string` | yes | — |
| `workspace_slug` | `string` | no | — |
| `workspace_name` | `string` | no | — |
| `email` | `string` | no | — |
| `email_verified` | `boolean` | no | — |
| `name` | `string` | no | — |

## OpenIDConfiguration

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `issuer` | `string` | yes | — |
| `authorization_endpoint` | `string` | yes | — |
| `token_endpoint` | `string` | yes | — |
| `userinfo_endpoint` | `string` | yes | — |
| `revocation_endpoint` | `string` | no | — |
| `introspection_endpoint` | `string` | no | — |
| `jwks_uri` | `string` | yes | — |
| `response_types_supported` | `string`[] | yes | — |
| `grant_types_supported` | `string`[] | no | — |
| `subject_types_supported` | `string`[] | yes | — |
| `id_token_signing_alg_values_supported` | `string`[] | yes | — |
| `code_challenge_methods_supported` | `string`[] | no | — |
| `token_endpoint_auth_methods_supported` | `string`[] | no | — |
| `introspection_endpoint_auth_methods_supported` | `string`[] | no | — |
| `scopes_supported` | `string`[] | no | — |
| `claims_supported` | `string`[] | no | — |

## AuthorizationServerMetadata

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `issuer` | `string` | yes | — |
| `authorization_endpoint` | `string` | yes | — |
| `token_endpoint` | `string` | yes | — |
| `revocation_endpoint` | `string` | no | — |
| `registration_endpoint` | `string` | no | — |
| `response_types_supported` | `string`[] | yes | — |
| `grant_types_supported` | `string`[] | no | — |
| `code_challenge_methods_supported` | `string`[] | no | — |
| `token_endpoint_auth_methods_supported` | `string`[] | no | — |
| `scopes_supported` | `string`[] | no | — |
| `client_id_metadata_document_supported` | `boolean` | no | — |

## SdkEventVerificationKey

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version` | `string` | yes | `agentlab-sdk-event-v1-ed25519`. |
| `keyId` | `string` | yes | — |
| `algorithm` | `string` | yes | One of: `Ed25519`. |
| `publicKey` | `string` | yes | base64url, no padding. |

## SdkReply

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version` | `string` | yes | One of: `sdk-event/v1`. |
| `correlationId` | `string (uuid)` | yes | The delivered event's `correlationId`. |
| `content` | `string` | yes | The answer's text; not blank. |

## Problem

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `field` | `string` | yes | The request's JSON path to the value, such as `agent.skills[0].name`. |
| `reason` | `string` | yes | For the developer; not for display to a person, and never parsed. |

## RunCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `conversationId` | `string (uuid)` | no | A run conversation of this member and installation to continue; omitted starts a new one. |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/en/api/schemas.md#AgentConfig) | yes | — |
| `input` | [RunInputMessage](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunInputMessage)[] | yes | The member's message. |
| `background` | `boolean` | no | An automation with no reader waiting; not streamed. Default: `false`. |
| `replyTo` | `object` | no | — |
| `replyTo.eventId` | `string (uuid)` | yes | The `eventId` of an `sdk-event/v1` event delivered to this installation's application, accepted and not yet answered, that no other run answers (a run that failed, was cancelled or could not deliver no longer does). |
| `metadata` | [RunMetadata](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunMetadata) | no | — |

## EvaluationRunCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/en/api/schemas.md#AgentConfig) | yes | — |
| `cases` | [EvaluationCase](https://agentlab.cresclab.com/docs/en/api/schemas.md#EvaluationCase)[] | yes | The cases to ask, each with an `id` no other case of the run has. |

## EvaluationCase

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The application's own id for the case, echoed back with its result; no surrounding spaces. |
| `title` | `string` | no | A name for the case; omitted, the start of its question. |
| `input` | [RunInputMessage](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunInputMessage)[] | yes | The member's message the case asks; at most 1000 characters in all. |
| `expectations` | [EvaluationExpectations](https://agentlab.cresclab.com/docs/en/api/schemas.md#EvaluationExpectations) | yes | — |
| `weight` | `integer` | no | What the case counts for beside the others. Default: `1`. |

## EvaluationExpectations

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `rubric` | `string` | yes | What a good answer does, which the platform's judge reads; no surrounding spaces. |
| `requiredTools` | `string`[] | no | Tools the answer must have used successfully, by name. Each name at most 120 bytes in UTF-8, listed once, no surrounding spaces. |
| `forbiddenTools` | `string`[] | no | Tools the answer must not reach for at all, by name; none also required. Each name at most 120 bytes in UTF-8, listed once, no surrounding spaces. |
| `groundingRequired` | `boolean` | no | The answer must rest on the configuration's knowledge. Default: `false`. |
| `mustContain` | `string`[] | no | Phrases every one of which the answer's text must contain, checked without the judge: a missing phrase fails the case whatever the judge thinks. Compared after Unicode case folding, NFC and collapsing every run of whitespace to one space, as a substring (not a word). Each phrase listed once in that form, no surrounding spaces. |
| `mustNotContain` | `string`[] | no | Phrases none of which the answer's text may contain, compared as `mustContain` is; a phrase found fails the case whatever the judge thinks. None may sit inside a `mustContain` phrase. Each phrase listed once in that form, no surrounding spaces. |

## EvaluationRun

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `status` | `string` | yes | `running`, `completed` (every case answered and judged) or `failed` (`reason` says why). Clients tolerate values added later. One of: `running`, `completed`, `failed`. |
| `reason` | `string` or `null` | yes | Why the run failed; null otherwise. |
| `passed` | `integer` | yes | Cases judged so far that passed. |
| `failed` | `integer` | yes | Cases judged so far that did not pass, an `error` verdict included. |
| `cases` | [EvaluationCaseResult](https://agentlab.cresclab.com/docs/en/api/schemas.md#EvaluationCaseResult)[] | yes | — |
| `createdAt` | `string (date-time)` | yes | When the run started; on the `202`, when the start was answered, which may differ by a moment. |
| `completedAt` | `string (date-time)` or `null (date-time)` | yes | — |

## EvaluationCaseResult

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The case's `id` as the application sent it. |
| `result` | `null` or [EvaluationVerdict](https://agentlab.cresclab.com/docs/en/api/schemas.md#EvaluationVerdict) | yes | The answer and the judge's verdict; null until the case is answered and judged. |

## EvaluationVerdict

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `verdict` | `string` | yes | `pass`, `fail`, or `error` (the case could not be answered or judged). Clients tolerate values added later. One of: `pass`, `fail`, `error`. |
| `output` | `string` | yes | The answer's text. |
| `rationale` | `string` | yes | The judge's reasoning, or why the case could not be answered. |
| `refusal` | `string` or `null` | yes | Which limit refused the answer, when the verdict is `error` for that reason. |
| `model` | `string` | yes | The model that answered; empty when none did. |
| `durationMs` | `integer` | yes | How long the answer took; 0 when not recorded. |
| `toolCalls` | `object`[] | yes | The tools the answer reached for, in order, and how each call ended. |
| `toolCalls[].name` | `string` | yes | — |
| `toolCalls[].status` | `string` | yes | How the call ended (`succeeded`, `failed`, `rejected` for a call declined because it waited for a person, `refused`). Clients tolerate values added later. |
| `weight` | `integer` | yes | What the case counted for; 0 when not recorded. |
| `phraseFailures` | `object`[] | yes | Every `mustContain` phrase the answer's text lacks and every `mustNotContain` phrase it has, as the application sent it, whatever else decided the verdict; empty when the verdict is `error` or every phrase held. |
| `phraseFailures[].expectation` | `string` | yes | `mustContain` or `mustNotContain`: the list the phrase came from. One of: `mustContain`, `mustNotContain`. |
| `phraseFailures[].phrase` | `string` | yes | — |

## DeploymentCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entryKind` | `string` | yes | `slack`, `slack_channel` or `line`; values may be added later. |
| `entryRef` | `string` | yes | The entry point in the channel's own terms, as `createDeployment` describes. |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/en/api/schemas.md#AgentConfig) | no | — |

## DeployedAgentReplace

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/en/api/schemas.md#AgentConfig) | yes | — |
| `expectedRevision` | `integer` | yes | The revision this replaces, as the deployment answered it; 0 for the first. |

## DeployedAgent

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agentRef` | `string` or `null` | yes | The deployed configuration's `ref`, null when it named none. |
| `revision` | `integer` | yes | Counts the configurations deployed to this entry; the next replacement names it. |
| `deployedAt` | `string (date-time)` | yes | — |

## Deployment

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `entryKind` | `string` | yes | — |
| `entryRef` | `string` | yes | — |
| `status` | `string` | yes | `active` or `disabled`; clients tolerate values added later. |
| `responder` | `string` | yes | `application`, a registered application answers the entry; `agent`, an assistant the console deployed. Clients tolerate values added later. |
| `applicationId` | `string` or `null` | yes | The registered application that answers the entry, null for an assistant. |
| `thisApplication` | `boolean` | yes | The calling installation's application answers the entry. |
| `agent` | [DeployedAgent](https://agentlab.cresclab.com/docs/en/api/schemas.md#DeployedAgent) or `null` | yes | The entry's deployed configuration, which the platform answers its events with; null when its events are delivered to the application, or the entry is not an application's. A first `PUT …/agent` names `expectedRevision: 0`. |
| `createdAt` | `string (date-time)` | yes | — |

## DeploymentPage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nextCursor` | `string` or `null` | no | Absent or null on the last page. |
| `items` | [Deployment](https://agentlab.cresclab.com/docs/en/api/schemas.md#Deployment)[] | yes | — |

## RunMetadata

The application's own values, kept with the run and answered back; never interpreted.

| Type | Values |
| --- | --- |
| `object` | — |

## AgentConfig

The agent, passed with every run. The platform keeps it with the run and stores no agent.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ref` | `string` | no | The application's own id for the agent and its version, opaque to the platform; answered back as `agentRef`. |
| `name` | `string` | yes | — |
| `instructions` | `string` | yes | — |
| `model` | `string` | yes | `"auto"` for the workspace's default, or a model the workspace may use (`GET …/models`). |
| `skills` | [InlineSkill](https://agentlab.cresclab.com/docs/en/api/schemas.md#InlineSkill)[] | no | Standing instructions sent with the agent's, in order; together at most 6000 characters with their headings. |
| `tools` | [RunTool](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunTool)[] | no | The tools the agent may call, and nothing else: no platform tools, no member's own connections beyond those named. Each runs under the platform's tool authority, bound to this configuration: a call approved under it never runs under another. |
| `knowledge` | [RunKnowledge](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunKnowledge) | no | — |

## RunTool

`type: "mcp"`: the tools of an MCP connection, by `connectionId` — the member's own, or an
organization-shared one when the member's role may manage connections — narrowed by
`allowedTools` (left out: every tool its server offers); `approval` is `"always"`, a person
approves every call. `type: "http"`: an HTTPS action the configuration defines, presenting
no credential: `name`, `description`, `inputSchema` (a JSON Schema object), `url`, `method`;
`approval: "never"` lets a `GET` run unattended when the workspace allows it. A field of
the other type is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string` | yes | One of: `mcp`, `http`. |
| `connectionId` | `string` | no | — |
| `allowedTools` | `string`[] | no | — |
| `approval` | `string` | yes | One of: `always`, `never`. |
| `name` | `string` | no | — |
| `description` | `string` | no | — |
| `inputSchema` | `object` | no | — |
| `url` | `string` | no | — |
| `method` | `string` | no | One of: `GET`, `POST`. |

## RunKnowledge

What the agent answers from. `scope: "listed"` (the default) retrieves from the documents
and Q&A entries listed; `"workspace"` from everything in the workspace the member may read.
The member's team audience filters either.

`contextProvider: "self"` asks the calling application instead, on every turn: the
platform sends a signed `context-provider/v1` request to the context endpoint the
application's registration publishes, and writes what it answers into the turn as it writes
its own knowledge. It is the answer's only knowledge, so it is refused beside `documentIds`,
`qaIds` or `scope: "workspace"`; and it is refused before the run starts when the
installation is not granted `context:provide` or the registration publishes no context
endpoint. A turn whose request fails (timeout, error, invalid answer, the installation
revoked since) is answered without knowledge, and nothing is recorded as its grounding.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `documentIds` | `string`[] | no | — |
| `qaIds` | `string`[] | no | Every listed entry the member may read is sent with each answer. |
| `scope` | `string` | no | One of: `listed`, `workspace`. |
| `contextProvider` | `string` | no | One of: `self`. |

## InlineSkill

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | yes | — |
| `instructions` | `string` | yes | — |

## RunInputMessage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `role` | `string` | yes | One of: `user`. |
| `content` | [RunTextPart](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunTextPart)[] | yes | Text parts, joined with a blank line; at most 4000 characters in all. |

## RunTextPart

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string` | yes | One of: `text`. |
| `text` | `string` | yes | — |

## Run

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `conversationId` | `string` | yes | — |
| `status` | `string` | yes | `queued`, `running`, `requires_action` (a tool call waits for approval), `completed`, `failed` (`cancelled` says whether it was stopped), or `refused` (a limit refused the answer; `refusal` says which). Clients tolerate values added later. One of: `queued`, `running`, `requires_action`, `completed`, `failed`, `refused`. |
| `agentRef` | `string` or `null` | yes | The configuration's `ref`; null when it had none. |
| `output` | [RunOutputMessage](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunOutputMessage)[] or `null` | yes | The answer, when `completed`. |
| `refusal` | `string` or `null` | yes | Which limit refused the answer, when `refused`. |
| `metadata` | [RunMetadata](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunMetadata) | no | — |
| `background` | `boolean` | no | — |
| `cancelled` | `boolean` | no | The run was stopped (`POST …/runs/{runId}/cancel`) before it finished; its status is `failed`. |
| `replyTo` | `object` or `null` | no | The event the run answers, when it was started with `replyTo`. |
| `replyTo.eventId` | `string` | yes | — |
| `replyTo.delivery` | `string` | yes | `pending` until the run settles; `delivered`; or `not_delivered`, the run did not complete or the event could no longer be answered (the application may still answer it with `POST /v1/sdk/replies`). Clients tolerate values added later. One of: `pending`, `delivered`, `not_delivered`. |
| `requiredAction` | `null` or [RunRequiredAction](https://agentlab.cresclab.com/docs/en/api/schemas.md#RunRequiredAction) | no | What the run waits on, when `requires_action`; else null. |
| `createdAt` | `string (date-time)` | yes | — |

## RunEvents

Server-sent events, each `event: <name>` and one `data:` line of JSON:

- `run`: the whole `Run`; first, whenever its status changes, and last when it settles.
- `output_text.delta`: `{"delta": string}`, text the answer gained while `running`. The
  settled `run` event carries the whole answer.
- `error`: an `Error`; the run could not be read, and the stream ends.

Lines starting with `:` keep the connection open. The stream ends when the run settles, or
after ten minutes; read or stream the run again with `GET …/runs/{runId}`. A streamed `POST`
under `Idempotency-Key` keeps the events written before the stream ended, and a retry
replays exactly those; read the run with `GET` for where it stands.

| Type | Values |
| --- | --- |
| `string` | — |

## RunRequiredAction

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `toolApprovals` | [ToolApproval](https://agentlab.cresclab.com/docs/en/api/schemas.md#ToolApproval)[] | yes | — |

## ToolApproval

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `name` | `string` | yes | The tool, as the agent called it (an MCP tool's name is prefixed `mcp__`). |
| `arguments` | `object` | yes | What the agent passed. |
| `readOnly` | `boolean` or `null` | yes | The risk the workspace declared for this tool: true read-only, false writing, null undeclared (approved as destructive). |
| `reason` | `string` or `null` | yes | Why the call waits for a person beyond the configuration asking, when there is one. |
| `createdAt` | `string (date-time)` | yes | — |

## ToolApprovalDecision

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `decision` | `string` | yes | One of: `approve`, `reject`. |

## RunOutputMessage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `role` | `string` | yes | One of: `assistant`. |
| `content` | `object`[] | yes | — |
| `content[].type` | `string` | yes | One of: `text`. |
| `content[].text` | `string` | yes | — |

## UsageReport

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sinceDays` | `integer` | yes | The window the report covers, in days. |
| `items` | [AgentRefUsage](https://agentlab.cresclab.com/docs/en/api/schemas.md#AgentRefUsage)[] | yes | — |
| `truncated` | `boolean` | yes | There are more groups than the report lists. |

## AgentRefUsage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agentRef` | `string` or `null` | yes | The configuration's `ref`; null for configurations passed without one. |
| `kind` | `string` | yes | `run` or `evaluation`. Clients tolerate values added later. |
| `turns` | `integer` | yes | Replies answered. |
| `modelCalls` | `integer` | yes | Model calls made for those replies; a reply that calls tools makes several. |
| `inputTokens` | `integer` | yes | Input tokens charged at the full rate (not read from or written to a cache). |
| `outputTokens` | `integer` | yes | — |
| `cachedReadTokens` | `integer` | yes | — |
| `cacheWriteTokens` | `integer` | yes | — |
| `cost` | `null` or [UsageCost](https://agentlab.cresclab.com/docs/en/api/schemas.md#UsageCost) | yes | What it cost at the workspace's prices; null for a member who may not read cost. |

## UsageCost

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `amountUsd` | `number` | yes | — |
| `pricingComplete` | `boolean` | yes | Every model was priced at the workspace's prices. When false, the models in `unpricedModels` are counted at the platform's list price where it has one. |
| `unpricedModels` | `string`[] | yes | — |

## MemoryFact

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `kind` | `string` | yes | `standing` or `episodic`. Clients tolerate values added later. |
| `body` | `string` | yes | One sentence, at most 1000 characters. |
| `sourceLabel` | `string` | yes | Where it was learned, as the console names it. |
| `sourceTrusted` | `boolean` | yes | — |
| `explicit` | `boolean` | yes | Someone stated it deliberately, rather than an assistant inferring it. |
| `organizationWide` | `boolean` | yes | — |
| `capturedAt` | `string (date-time)` | yes | — |

## MemoryRevision

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `op` | `string` | yes | What the line records, such as `edit` or `delete`. Clients tolerate values added later. |
| `body` | `string` | yes | — |
| `authorAccountId` | `string` or `null` | yes | The member who made the change; null when an assistant made it. |
| `at` | `string (date-time)` | yes | — |

## MemoryNotebook

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `standing` | [MemoryFact](https://agentlab.cresclab.com/docs/en/api/schemas.md#MemoryFact)[] | yes | — |
| `episodic` | [MemoryFact](https://agentlab.cresclab.com/docs/en/api/schemas.md#MemoryFact)[] | yes | — |
| `history` | [MemoryRevision](https://agentlab.cresclab.com/docs/en/api/schemas.md#MemoryRevision)[] | yes | The 50 newest history lines, newest first. |
| `historyTruncated` | `boolean` | yes | — |

## MemoryFactEdit

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expectedBody` | `string` | yes | The fact's sentence as last read. |
| `body` | `string` | yes | — |

## TranscriptionCreate

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `audio` | `string` | yes | A mono 16 kHz 16-bit PCM WAV of at most two minutes, base64-encoded. |

## Transcription

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | `string` | yes | — |

## OutreachSend

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetUserRef` | `string` | no | A person, by their Slack user id. Exactly one of this and `targetChannelRef`. |
| `targetChannelRef` | `string` | no | A channel, by its Slack id. Exactly one of this and `targetUserRef`. |
| `body` | `string` | yes | The message, at most 4000 characters. |
| `reason` | `string` | yes | Why it is sent, at most 300 characters; kept with the message. |

## OutreachMessage

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | — |
| `channelId` | `string` | yes | The channel it was sent through. |
| `targetRef` | `string` | yes | The Slack conversation it was posted to (a direct message's, for a person). |
| `body` | `string` | yes | — |
| `reason` | `string` | yes | — |
| `status` | `string` | yes | `pending`, `sent`, `abandoned` or `unknown`. Clients tolerate values added later. |
| `attempts` | `integer` | yes | — |
| `lastError` | `string` | yes | Why the latest attempt failed; empty when none did. |
| `createdAt` | `string (date-time)` | yes | — |

## OutreachList

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | [OutreachMessage](https://agentlab.cresclab.com/docs/en/api/schemas.md#OutreachMessage)[] | yes | — |
| `truncated` | `boolean` | yes | The member has older sends in the workspace than the 50 that were read. |

## Gateway

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | `boolean` | yes | — |
| `operatorDisabled` | `boolean` | yes | Agent Lab turned the Gateway off for this workspace. |
| `plan` | `null` or [GatewayPlan](https://agentlab.cresclab.com/docs/en/api/schemas.md#GatewayPlan) | yes | Null while the Gateway is off, and for a member who may not read usage. |

## GatewayPlan

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | `string` | yes | The plan's name. Clients tolerate values added later. |
| `source` | `string` | yes | Where the plan comes from. Clients tolerate values added later. |
| `includedRequests` | `integer` or `null` | yes | The requests the plan includes this month; null when it does not limit them. |
| `usedRequests` | `integer` or `null` | yes | The requests made this month; null when they are not counted. |
| `periodStart` | `string (date-time)` | yes | — |
| `periodEnd` | `string (date-time)` | yes | — |
| `asOf` | `string (date-time)` | yes | — |
| `spendCapUsd` | `number` or `null` | yes | The plan's model-spend ceiling; null without one. |
| `spentUsd` | `number` or `null` | yes | All Gateway spend the workspace made; null when some of it has no price. |
| `credit` | `null` or [GatewayCredit](https://agentlab.cresclab.com/docs/en/api/schemas.md#GatewayCredit) | yes | The prepaid credit; null before the first credit. |

## GatewayCredit

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creditedUsd` | `number` | yes | Every top-up, contract credit and redeemed code. |
| `spentUsd` | `number` or `null` | yes | What was drawn from it; null when some spend has no price. |
| `balanceUsd` | `number` or `null` | yes | What is left; null when the spend is not known. |
