---
title: Schema ของ Platform API
description: ทุกออบเจกต์ที่ Platform API v1 รับและส่ง ทีละฟิลด์ รวมถึง event stream ของการรัน (RunEvents) และรูปแบบ Error
url: https://agentlab.cresclab.com/docs/th/api/schemas
language: th
updated: 2026-12-05
---

# Schema ของ Platform API

ทุกออบเจกต์ที่ Platform API v1 รับและส่ง ทีละฟิลด์ รวมถึง event stream ของการรัน (RunEvents) และรูปแบบ Error

> [!NOTE]
> สร้างจาก API contract (Agent Lab Platform API 1.0.0-alpha.1) คำอธิบายเป็นภาษาอังกฤษตามต้นฉบับใน contract

## Recovery

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

| ชนิด | ค่า |
| --- | --- |
| `string` | ค่าที่เป็นไปได้: `authorize`, `configure`, `retry`, `none`. |

## Error

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `error` | `object` | ใช่ | — |
| `error.code` | `string` | ใช่ | Stable, UPPER_SNAKE_CASE. New codes may be added under an existing `recovery`. |
| `error.message` | `string` | ใช่ | For the developer's logs; not for display to a person, and never parsed. |
| `error.recovery` | [Recovery](https://agentlab.cresclab.com/docs/th/api/schemas.md#Recovery) | ใช่ | — |
| `error.requestId` | `string` | ใช่ | Quote it when asking for support. |
| `error.problems` | [Problem](https://agentlab.cresclab.com/docs/th/api/schemas.md#Problem)[] | ไม่ | With `RUN_CONFIGURATION_INVALID`: every problem found, each with its field. |

## Page

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |

## AccountWorkspace

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `name` | `string` | ใช่ | — |
| `slug` | `string` | ใช่ | The workspace's short name, in its console address. |
| `state` | `string` | ใช่ | `deletion_scheduled` only in the list filtered by it. ค่าที่เป็นไปได้: `active`, `deletion_scheduled`. |
| `role` | `string` | ไม่ | The person's role in the workspace, when known. Clients tolerate roles added later. |
| `organization` | `object` | ไม่ | The organization the workspace belongs to, once it is placed in one. |
| `organization.id` | `string` | ใช่ | — |
| `organization.name` | `string` | ใช่ | — |
| `deletionEffectiveAt` | `string (date-time)` | ไม่ | When a workspace scheduled for deletion is deleted; recoverable until then. |

## AccountWorkspaceList

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [AccountWorkspace](https://agentlab.cresclab.com/docs/th/api/schemas.md#AccountWorkspace)[] | ใช่ | — |
| `creation` | `object` | ไม่ | Whether the person may create another workspace; absent from the `deletion_scheduled` list. |
| `creation.status` | `string` | ใช่ | ค่าที่เป็นไปได้: `available`, `limit_reached`. |
| `creation.remaining` | `integer` หรือ `null` | ไม่ | With `available`, how many more; `null` when there is no limit. |
| `creation.limit` | `integer` | ไม่ | With `limit_reached`, the limit. |

## AccountWorkspaceCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `name` | `string` | ใช่ | — |
| `slug` | `string` | ใช่ | — |

## WorkspaceAdmission

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `status` | `string` | ใช่ | ค่าที่เป็นไปได้: `reachable`, `realm_not_admitted`, `no_membership`. |
| `signInRealms` | `object`[] | ไม่ | With `realm_not_admitted`, the entrances the workspace admits. |
| `signInRealms[].id` | `string` | ใช่ | — |
| `signInRealms[].kind` | `string` | ใช่ | — |
| `signInRealms[].loginMethods` | `string`[] | ใช่ | — |

## Installation

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `workspaceId` | `string` | ใช่ | — |
| `clientId` | `string` | ใช่ | The OAuth client id of the installed application. |
| `applicationName` | `string` | ใช่ | — |
| `installedAt` | `string (date-time)` | ใช่ | — |
| `grantedScopes` | `string`[] | ใช่ | What an administrator approved. |
| `pendingScopes` | `string`[] | ใช่ | What the application declares beyond them, awaiting an administrator's approval. |
| `tokenScopes` | `string`[] | ใช่ | What this token carries, and so what this call and the next ones with it may use. |

## WorkspaceMember

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `accountId` | `string` | ใช่ | — |
| `role` | `string` | ใช่ | The member's role in the workspace. Clients tolerate roles added later. |
| `capabilities` | `string`[] | ใช่ | What the role lets the member do in this workspace. Clients ignore names they do not know. |

## WorkspaceSettings

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `defaultModel` | `string` | ใช่ | The workspace's default model id; empty when it uses the platform's. |
| `systemPrompt` | `string` | ใช่ | The instructions the workspace adds to every answer. |
| `requireEvalBeforePublish` | `boolean` | ใช่ | — |
| `monthlyTokenBudget` | `integer` | ใช่ | Tokens per calendar month; 0 keeps the platform's default. |
| `rollingWindowTokenBudget` | `integer` | ใช่ | Tokens per rolling window; 0 keeps the platform's default. |
| `disableAutoToolExecution` | `boolean` | ใช่ | Every tool call waits for a person's approval. |
| `approvalChannelId` | `string` | ใช่ | Where approval requests are delivered; empty keeps them in the console. |
| `locale` | `string` | ใช่ | The language of platform-written messages. |
| `auditRetentionDays` | `integer` หรือ `null` | ใช่ | Null keeps every audit record. |
| `gatewayActivityRetentionDays` | `integer` หรือ `null` | ใช่ | Null keeps every AI Gateway activity record. |
| `sandboxPosture` | `string` | ใช่ | — |
| `sandboxAvailable` | `boolean` | ใช่ | Whether this platform offers code execution to the workspace at all. |
| `taskFocused` | `boolean` | ใช่ | — |
| `generalAssistantEnabled` | `boolean` | ใช่ | — |
| `timeZone` | `string` | ใช่ | IANA time zone. |

## WorkspaceSettingsPatch

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `defaultModel` | `string` | ไม่ | A model id or capability profile the plan includes; empty uses the platform's default. |
| `systemPrompt` | `string` | ไม่ | — |
| `requireEvalBeforePublish` | `boolean` | ไม่ | — |
| `monthlyTokenBudget` | `integer` | ไม่ | — |
| `rollingWindowTokenBudget` | `integer` | ไม่ | — |
| `disableAutoToolExecution` | `boolean` | ไม่ | — |
| `approvalChannelId` | `string` | ไม่ | Trimmed, then at most 60 characters; empty keeps approvals in the console. |
| `locale` | `string` | ไม่ | ค่าที่เป็นไปได้: `en`, `zh-TW`, `zh-CN`, `ja`, `th`. |
| `auditRetentionDays` | `integer` หรือ `null` | ไม่ | Null keeps every audit record. |
| `gatewayActivityRetentionDays` | `integer` หรือ `null` | ไม่ | Null keeps every AI Gateway activity record; a number deletes older records. |
| `taskFocused` | `boolean` | ไม่ | — |
| `generalAssistantEnabled` | `boolean` | ไม่ | — |
| `timeZone` | `string` | ไม่ | An IANA time zone; empty uses the platform's. |

## InstructionVersion

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `seq` | `integer` | ใช่ | The version's number in the workspace, from 1. |
| `systemPrompt` | `string` | ใช่ | — |
| `changedByAccountId` | `string` หรือ `null` | ใช่ | The member who set it; null for a version the platform wrote. |
| `createdAt` | `string (date-time)` | ใช่ | — |

## InstructionVersionPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [InstructionVersion](https://agentlab.cresclab.com/docs/th/api/schemas.md#InstructionVersion)[] | ใช่ | — |

## WorkspaceModule

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `module` | `string` | ใช่ | The product (`deployment`, `studio`, `aiRouting`, `channelSdk`, `apiGateway`, or one added later). |
| `enabled` | `boolean` | ใช่ | — |
| `plan` | `string` | ใช่ | The product's plan (such as `free`). |

## WorkspaceModuleList

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | [WorkspaceModule](https://agentlab.cresclab.com/docs/th/api/schemas.md#WorkspaceModule)[] | ใช่ | — |

## Team

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `name` | `string` | ใช่ | — |
| `memberCount` | `integer` | ใช่ | — |
| `createdAt` | `string (date-time)` | ใช่ | — |
| `viewerRole` | `string` หรือ `null` | ใช่ | The acting member's role in the team (`manager` or `member`); null when not on it. |

## TeamPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [Team](https://agentlab.cresclab.com/docs/th/api/schemas.md#Team)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | The workspace has more teams than the platform lists. |

## Member

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `accountId` | `string` | ใช่ | — |
| `email` | `string` หรือ `null` | ใช่ | — |
| `role` | `string` | ใช่ | — |
| `status` | `string` | ใช่ | — |
| `createdAt` | `string (date-time)` | ใช่ | When the membership began. |

## MemberPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [Member](https://agentlab.cresclab.com/docs/th/api/schemas.md#Member)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | The workspace has more members than the platform lists. |

## Model

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `provider` | `string` | ใช่ | — |
| `id` | `string` | ใช่ | — |
| `displayName` | `string` | ใช่ | — |
| `isDefault` | `boolean` | ใช่ | The platform's default model. |
| `entitled` | `boolean` | ใช่ | The workspace's plan includes it; a run naming one it does not is refused. |

## ResolvedModel

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `entitled` | `boolean` | ใช่ | — |

## ModelCatalog

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | [Model](https://agentlab.cresclab.com/docs/th/api/schemas.md#Model)[] | ใช่ | — |
| `capabilityProfiles` | `object`[] | ใช่ | Model choices by capability rather than by name, such as `agentlab/balanced`. |
| `capabilityProfiles[].id` | `string` | ใช่ | — |
| `capabilityProfiles[].tier` | `string` | ใช่ | — |
| `platformDefault` | [ResolvedModel](https://agentlab.cresclab.com/docs/th/api/schemas.md#ResolvedModel) | ใช่ | — |
| `workspaceDefault` | [ResolvedModel](https://agentlab.cresclab.com/docs/th/api/schemas.md#ResolvedModel) | ใช่ | — |

## KnowledgeAudience

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

| ชนิด | ค่า |
| --- | --- |
| `string` | ค่าที่เป็นไปได้: `organization`, `team`. |

## KnowledgeDocument

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `title` | `string` | ใช่ | — |
| `sourceType` | `string` | ใช่ | `markdown`, `text` or `pdf`. |
| `byteSize` | `integer` | ใช่ | — |
| `status` | `string` | ใช่ | `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` | ใช่ | The summary indexing wrote; empty until `ready`. |
| `sectionCount` | `integer` | ใช่ | — |
| `error` | `string` หรือ `null` | ใช่ | Why indexing failed, for the developer's logs. |
| `failureCode` | `string` หรือ `null` | ใช่ | A stable reason for some failures, such as `spend_cap_reached`. |
| `estimatedCostMicros` | `integer` | ใช่ | Indexing's estimated cost, in millionths of a US dollar. |
| `spendCapMicros` | `integer` | ใช่ | — |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/th/api/schemas.md#KnowledgeAudience) | ใช่ | — |
| `personal` | `boolean` | ใช่ | The acting member's own document, which no one else sees. |
| `createdAt` | `string (date-time)` | ใช่ | — |

## KnowledgeDocumentPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [KnowledgeDocument](https://agentlab.cresclab.com/docs/th/api/schemas.md#KnowledgeDocument)[] | ใช่ | — |

## KnowledgeDocumentUpload

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `title` | `string` | ใช่ | — |
| `sourceType` | `string` | ใช่ | ค่าที่เป็นไปได้: `markdown`, `text`, `pdf`. |
| `content` | `string` | ใช่ | The text, or for `pdf` the file base64-encoded. |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/th/api/schemas.md#KnowledgeAudience) | ไม่ | — |
| `audienceTeamIds` | `string (uuid)`[] | ไม่ | With `audience: team`, the teams it admits, by id. |

## KnowledgeQAEntry

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `question` | `string` | ใช่ | — |
| `answer` | `string` | ใช่ | — |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/th/api/schemas.md#KnowledgeAudience) | ใช่ | — |
| `createdAt` | `string (date-time)` | ใช่ | — |
| `updatedAt` | `string (date-time)` | ใช่ | — |

## KnowledgeQAPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [KnowledgeQAEntry](https://agentlab.cresclab.com/docs/th/api/schemas.md#KnowledgeQAEntry)[] | ใช่ | — |

## KnowledgeQACreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `question` | `string` | ใช่ | — |
| `answer` | `string` | ใช่ | — |
| `audience` | [KnowledgeAudience](https://agentlab.cresclab.com/docs/th/api/schemas.md#KnowledgeAudience) | ไม่ | — |
| `audienceTeamIds` | `string (uuid)`[] | ไม่ | With `audience: team`, the teams it admits, by id. |

## KnowledgeQAUpdate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `question` | `string` | ใช่ | — |
| `answer` | `string` | ใช่ | — |

## Channel

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `provider` | `string` | ใช่ | `slack`, `line` or `teams`. Clients tolerate values added later. |
| `teamName` | `string` | ใช่ | The provider workspace or official account's name. |
| `teamRef` | `string` | ใช่ | The provider's own id for it. |
| `status` | `string` | ใช่ | `connected` or `revoked`. Clients tolerate values added later. |
| `scopeCoverage` | `string` | ใช่ | Whether the provider granted everything the platform asks for. |
| `ambientReadiness` | `string` | ใช่ | Whether the platform can answer in it without being mentioned. |
| `createdAt` | `string (date-time)` | ใช่ | — |

## ChannelPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [Channel](https://agentlab.cresclab.com/docs/th/api/schemas.md#Channel)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | The workspace has more channels than the platform lists. |

## LineConnect

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `channelSecret` | `string` | ใช่ | — |
| `accessToken` | `string` | ใช่ | — |

## LinePushBudget

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `ceiling` | `integer` | ใช่ | Pushes the workspace's LINE summaries may send each calendar month; 0 sends none. |

## ConnectLinkCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `redirectUri` | `string` | ใช่ | Where the browser returns, one of the application's registered redirect URIs. |

## ConnectLink

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `url` | `string` | ใช่ | Open it in the acting member's browser, once. |
| `expiresAt` | `string (date-time)` | ใช่ | After this the link connects nothing; ask for another. |

## EngagementPolicy

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `channelRef` | `string` | ใช่ | The provider's own id of the room. |
| `mode` | `string` | ใช่ | `addressed_only` or `ambient`. Clients tolerate values added later. |
| `standingOrders` | `string` | ไม่ | What the assistant follows in this room; empty for none. |

## EngagementPolicyPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [EngagementPolicy](https://agentlab.cresclab.com/docs/th/api/schemas.md#EngagementPolicy)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | The channel has more policies than the platform lists. |

## ChannelIdentity

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `providerUserId` | `string` | ใช่ | The provider's own id of the user. |
| `accountId` | `string` | ใช่ | The member it is bound to. |
| `evidence` | `string` | ใช่ | What was verified when it was bound. Clients tolerate values added later. |
| `createdAt` | `string (date-time)` | ใช่ | — |

## ChannelIdentityPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [ChannelIdentity](https://agentlab.cresclab.com/docs/th/api/schemas.md#ChannelIdentity)[] | ใช่ | — |
| `scope` | `string` | ใช่ | `own`, the acting member's binding only, or `workspace`, everyone's. |
| `truncated` | `boolean` | ใช่ | The workspace has more bindings than the platform lists. |

## LineQuota

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `known` | `boolean` | ใช่ | LINE answered. |
| `limited` | `boolean` | ใช่ | The official account's plan caps pushes per month. |
| `limit` | `integer` | ใช่ | — |
| `used` | `integer` | ใช่ | — |

## Conversation

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `workspaceId` | `string` | ใช่ | — |
| `category` | `string` | ใช่ | `conversation`, one a person started; `background`, one automation started; `evaluation`, an evaluation run's. Clients tolerate values added later. |
| `channel` | `boolean` | ใช่ | Held in a channel (Slack, LINE, Teams) rather than in Agent Lab. |
| `agentRef` | `string` หรือ `null` | ใช่ | What it was held with, opaque, for grouping; not a resource of this API. |
| `title` | `string` | ใช่ | The name a reader sees; the member's own name when they gave one. |
| `customTitle` | `string` | ใช่ | The member's own name for it; empty when they gave none. |
| `archived` | `boolean` | ใช่ | — |
| `pinned` | `boolean` | ใช่ | — |
| `unseen` | `boolean` | ใช่ | It holds a reply the acting member has not opened; only ever true for the member who started it. |
| `updatedAt` | `string (date-time)` | ใช่ | — |

## ConversationPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [Conversation](https://agentlab.cresclab.com/docs/th/api/schemas.md#Conversation)[] | ใช่ | — |

## ConversationMessage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `role` | `string` | ใช่ | `user` or `assistant`. Clients tolerate values added later. |
| `status` | `string` | ใช่ | `pending` while a reply is being written, `completed` or `failed`. Clients tolerate values added later. |
| `content` | `string` | ใช่ | — |
| `refusal` | `string` หรือ `null` | ใช่ | What stopped this reply, as a stable code, such as `budget`. Clients tolerate values added later. |
| `stopped` | `boolean` | ใช่ | The member stopped this reply; its content is what had been written. |
| `attachments` | [ConversationAttachment](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationAttachment)[] | ใช่ | 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)` | ใช่ | — |

## ConversationDetail

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `conversation` | [Conversation](https://agentlab.cresclab.com/docs/th/api/schemas.md#Conversation) | ใช่ | — |
| `messages` | [ConversationMessage](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationMessage)[] | ใช่ | — |

## ConversationStateChange

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `title` | `string` | ไม่ | The member's own name for it; empty clears it back to the generated one. |
| `pinned` | `boolean` | ไม่ | — |
| `archived` | `boolean` | ไม่ | Archiving also unpins it. |
| `seen` | `boolean` | ไม่ | The member opened it. Nothing marks a conversation unread. ค่าที่เป็นไปได้: `true`. |

## ConversationAttachment

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `name` | `string` | ใช่ | — |
| `sourceType` | `string` | ใช่ | `markdown`, `text` or `pdf`. Clients tolerate values added later. |
| `byteSize` | `integer` | ใช่ | — |
| `archived` | `boolean` | ใช่ | Archived after the member who attached it left the workspace. |

## ConversationAttachmentContent

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `name` | `string` | ใช่ | — |
| `sourceType` | `string` | ใช่ | `markdown`, `text` or `pdf`. Clients tolerate values added later. |
| `byteSize` | `integer` | ใช่ | — |
| `archived` | `boolean` | ใช่ | Archived after the member who attached it left the workspace. |
| `content` | `string` | ใช่ | The file as it was attached, base64-encoded. |

## ConversationAttachmentInventory

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | [ConversationAttachment](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationAttachment)[] | ใช่ | — |
| `uploaderActive` | `boolean` | ใช่ | The member who started the conversation is still a member; until they leave, their files cannot be archived. |

## ConversationSearch

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | `object`[] | ใช่ | — |
| `items[].conversation` | [Conversation](https://agentlab.cresclab.com/docs/th/api/schemas.md#Conversation) | ใช่ | — |
| `items[].matches` | `integer` | ใช่ | How many of its messages matched; not what orders the list. |
| `items[].snippet` | `string` | ใช่ | The first matching message, clipped. |
| `searched` | `integer` | ใช่ | How many conversations were searched. |

## ConversationSource

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `kind` | `string` | ใช่ | `schedule` or `trigger`. Clients tolerate values added later. |
| `id` | `string` | ใช่ | — |
| `name` | `string` | ไม่ | Its name; absent once it has been deleted. |

## BackgroundConversation

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `conversation` | [Conversation](https://agentlab.cresclab.com/docs/th/api/schemas.md#Conversation) | ใช่ | — |
| `outcome` | `string` หรือ `null` | ใช่ | 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/th/api/schemas.md#ConversationSource) หรือ `null` | ใช่ | What started it; null when it names nothing. |
| `lastActivity` | `string (date-time)` | ใช่ | — |

## BackgroundConversationPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [BackgroundConversation](https://agentlab.cresclab.com/docs/th/api/schemas.md#BackgroundConversation)[] | ใช่ | — |

## BackgroundConversationSummary

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `groups` | `object`[] | ใช่ | — |
| `groups[].source` | [ConversationSource](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationSource) | ใช่ | — |
| `groups[].total` | `integer` | ใช่ | — |
| `groups[].succeeded` | `integer` | ใช่ | — |
| `groups[].failed` | `integer` | ใช่ | — |
| `groups[].refused` | `integer` | ใช่ | — |
| `groups[].running` | `integer` | ใช่ | — |
| `groups[].unknown` | `integer` | ใช่ | Runs whose outcome nobody recorded. |
| `groups[].lastFailureAt` | `string (date-time)` หรือ `null (date-time)` | ใช่ | The newest failed or refused run in the window. |
| `unattributedCount` | `integer` | ใช่ | — |
| `window` | `integer` | ใช่ | How many of the newest background conversations were counted. |

## BackgroundConversationUnseen

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `count` | `integer` | ใช่ | — |
| `window` | `integer` | ใช่ | How many of the member's newest background conversations were counted. |

## PendingAuthorizationList

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | `object`[] | ใช่ | — |
| `items[].toolId` | `string` | ใช่ | — |
| `items[].name` | `string` | ใช่ | — |
| `items[].description` | `string` | ใช่ | — |

## McpCatalogEntry

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `scope` | `string` | ใช่ | `platform` (the platform's own) or `workspace` (the workspace registered it). Clients tolerate values added later. |
| `name` | `string` | ใช่ | — |
| `url` | `string` | ใช่ | The connector's MCP server. |
| `authType` | `string` | ใช่ | 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` | ใช่ | — |
| `status` | `string` | ใช่ | `enabled`, `disabled` or `deprecated`. Clients tolerate values added later. |
| `health` | `string` | ใช่ | `unknown`, `healthy` or `unhealthy`. Clients tolerate values added later. |
| `lastError` | `string` หรือ `null` | ใช่ | Why the last health check failed; null when it did not, or for a member who may not manage connections. |
| `toolsOmitted` | `integer` | ใช่ | Tools the server exposed beyond what the platform keeps. |

## McpCatalog

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | [McpCatalogEntry](https://agentlab.cresclab.com/docs/th/api/schemas.md#McpCatalogEntry)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | The workspace has more connectors than the platform lists. |

## McpConnection

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `catalogEntryId` | `string` | ใช่ | — |
| `scope` | `string` | ใช่ | `workspace` (shared by everyone) or `member` (one member's own). Clients tolerate values added later. |
| `label` | `string` หรือ `null` | ใช่ | Names one of several shared identities of a connector. |
| `authType` | `string` | ใช่ | As the connector's `authType`. |
| `status` | `string` | ใช่ | `connected`, `needs_reauth` (connect again with `POST …/mcp/connections`) or `revoked`. Clients tolerate values added later. |
| `ownedByMe` | `boolean` | ใช่ | It is the acting member's own. |
| `delegationMode` | `string` | ใช่ | Whose permission applies at the connector, in the platform's delegation taxonomy. Clients tolerate values added later. |
| `appliesMemberPermission` | `boolean` | ใช่ | Calls act with the member's own permission at the connector. |
| `credentialExpires` | `boolean` | ใช่ | The credential is short-lived and renewed. |
| `outputPolicy` | `string` | ใช่ | Who may read what its calls answer: `inherit`, `workspace` or `personal`. Clients tolerate values added later. |

## McpConnectionPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [McpConnection](https://agentlab.cresclab.com/docs/th/api/schemas.md#McpConnection)[] | ใช่ | — |

## McpConnectionCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `catalogEntryId` | `string` | ใช่ | The connector, one the workspace registered. |
| `scope` | `string` | ใช่ | Shared by everyone, or the acting member's own. ค่าที่เป็นไปได้: `workspace`, `member`. |
| `label` | `string` | ไม่ | Names one of several shared identities; only with `workspace`. |
| `redirectUri` | `string` | ใช่ | Where the browser returns, one of the application's registered redirect URIs. |

## McpTool

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `name` | `string` | ใช่ | — |
| `description` | `string` | ใช่ | — |
| `serverDeclaredReadOnly` | `boolean` หรือ `null` | ใช่ | The server's own claim, null when it makes none; it never lowers the approval bar. |
| `workspaceReadOnly` | `boolean` หรือ `null` | ใช่ | The workspace's own declaration, null when it made none; this, never the server's claim, decides whether a call waits for approval. |

## McpToolList

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | [McpTool](https://agentlab.cresclab.com/docs/th/api/schemas.md#McpTool)[] | ใช่ | — |

## ToolCredential

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `toolId` | `string` | ใช่ | — |
| `scope` | `string` | ใช่ | `workspace` (shared by everyone) or `member` (one member's own). Clients tolerate values added later. |
| `ownedByMe` | `boolean` | ใช่ | It is the acting member's own. |
| `delegationMode` | `string` | ใช่ | Whose permission applies downstream, in the platform's delegation taxonomy. Clients tolerate values added later. |
| `appliesMemberPermission` | `boolean` | ใช่ | — |
| `credentialExpires` | `boolean` | ใช่ | — |
| `status` | `string` | ใช่ | `connected` or `revoked`. Clients tolerate values added later. |

## ToolCredentialList

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | [ToolCredential](https://agentlab.cresclab.com/docs/th/api/schemas.md#ToolCredential)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | The workspace has more tool credentials than the platform lists. |

## ToolCredentialCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `toolId` | `string` | ใช่ | — |
| `token` | `string` | ใช่ | The credential the tool presents. Never answered. |

## OAuthError

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `error` | `string` | ใช่ | — |
| `error_description` | `string` | ไม่ | — |

## LegacyErrorString

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `error` | `string` | ใช่ | — |

## LegacyErrorCode

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `error` | `object` | ใช่ | — |
| `error.code` | `string` | ใช่ | — |

## TokenRequest

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `grant_type` | `string` | ใช่ | ค่าที่เป็นไปได้: `authorization_code`, `refresh_token`, `client_credentials`. |
| `code` | `string` | ไม่ | — |
| `code_verifier` | `string` | ไม่ | — |
| `client_id` | `string` | ไม่ | — |
| `client_secret` | `string` | ไม่ | `client_secret_post`; a workspace application's secret. |
| `redirect_uri` | `string` | ไม่ | — |
| `resource` | `string` | ไม่ | — |
| `refresh_token` | `string` | ไม่ | — |
| `installation_id` | `string` | ไม่ | `client_credentials`: the installation, by id. |
| `workspace_id` | `string` | ไม่ | `client_credentials`: the installation, by the workspace it is in. |
| `scope` | `string` | ไม่ | `client_credentials`: `install` or absent. |

## TokenResponse

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `access_token` | `string` | ใช่ | — |
| `token_type` | `string` | ใช่ | ค่าที่เป็นไปได้: `Bearer`. |
| `expires_in` | `integer` | ใช่ | Seconds. |
| `refresh_token` | `string` | ไม่ | — |
| `scope` | `string` | ใช่ | Space-separated. |
| `id_token` | `string` | ไม่ | Present when `openid` was granted to an operators' own application. |

## InstallationTokenResponse

An installation token (`client_credentials`).

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `access_token` | `string` | ใช่ | — |
| `token_type` | `string` | ใช่ | ค่าที่เป็นไปได้: `Bearer`. |
| `expires_in` | `integer` | ใช่ | Seconds. |
| `scope` | `string` | ใช่ | — |
| `installation_id` | `string` | ใช่ | — |
| `workspace_id` | `string` | ใช่ | — |

## InstallResult

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `installation_id` | `string` | ใช่ | — |
| `workspace_id` | `string` | ใช่ | — |
| `scope` | `string` | ใช่ | — |

## Introspection

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `active` | `boolean` | ใช่ | — |
| `sub` | `string` | ไม่ | The account id. |
| `client_id` | `string` | ไม่ | — |
| `scope` | `string` | ไม่ | Space-separated. |
| `exp` | `integer` | ไม่ | Unix seconds. |
| `aud` | `string` | ไม่ | — |
| `iss` | `string` | ไม่ | — |
| `token_type` | `string` | ไม่ | ค่าที่เป็นไปได้: `Bearer`. |
| `workspace_id` | `string` | ไม่ | An installation token names its workspace. |

## UserInfo

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `sub` | `string` | ใช่ | — |
| `workspace_id` | `string` | ใช่ | — |
| `workspace_slug` | `string` | ไม่ | — |
| `workspace_name` | `string` | ไม่ | — |
| `email` | `string` | ไม่ | — |
| `email_verified` | `boolean` | ไม่ | — |
| `name` | `string` | ไม่ | — |

## OpenIDConfiguration

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `issuer` | `string` | ใช่ | — |
| `authorization_endpoint` | `string` | ใช่ | — |
| `token_endpoint` | `string` | ใช่ | — |
| `userinfo_endpoint` | `string` | ใช่ | — |
| `revocation_endpoint` | `string` | ไม่ | — |
| `introspection_endpoint` | `string` | ไม่ | — |
| `jwks_uri` | `string` | ใช่ | — |
| `response_types_supported` | `string`[] | ใช่ | — |
| `grant_types_supported` | `string`[] | ไม่ | — |
| `subject_types_supported` | `string`[] | ใช่ | — |
| `id_token_signing_alg_values_supported` | `string`[] | ใช่ | — |
| `code_challenge_methods_supported` | `string`[] | ไม่ | — |
| `token_endpoint_auth_methods_supported` | `string`[] | ไม่ | — |
| `introspection_endpoint_auth_methods_supported` | `string`[] | ไม่ | — |
| `scopes_supported` | `string`[] | ไม่ | — |
| `claims_supported` | `string`[] | ไม่ | — |

## AuthorizationServerMetadata

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `issuer` | `string` | ใช่ | — |
| `authorization_endpoint` | `string` | ใช่ | — |
| `token_endpoint` | `string` | ใช่ | — |
| `revocation_endpoint` | `string` | ไม่ | — |
| `registration_endpoint` | `string` | ไม่ | — |
| `response_types_supported` | `string`[] | ใช่ | — |
| `grant_types_supported` | `string`[] | ไม่ | — |
| `code_challenge_methods_supported` | `string`[] | ไม่ | — |
| `token_endpoint_auth_methods_supported` | `string`[] | ไม่ | — |
| `scopes_supported` | `string`[] | ไม่ | — |
| `client_id_metadata_document_supported` | `boolean` | ไม่ | — |

## SdkEventVerificationKey

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `version` | `string` | ใช่ | `agentlab-sdk-event-v1-ed25519`. |
| `keyId` | `string` | ใช่ | — |
| `algorithm` | `string` | ใช่ | ค่าที่เป็นไปได้: `Ed25519`. |
| `publicKey` | `string` | ใช่ | base64url, no padding. |

## SdkReply

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `version` | `string` | ใช่ | ค่าที่เป็นไปได้: `sdk-event/v1`. |
| `correlationId` | `string (uuid)` | ใช่ | The delivered event's `correlationId`. |
| `content` | `string` | ใช่ | The answer's text; not blank. |

## Problem

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `field` | `string` | ใช่ | The request's JSON path to the value, such as `agent.skills[0].name`. |
| `reason` | `string` | ใช่ | For the developer; not for display to a person, and never parsed. |

## RunCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `conversationId` | `string (uuid)` | ไม่ | A run conversation of this member and installation to continue; omitted starts a new one. |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/th/api/schemas.md#AgentConfig) | ใช่ | — |
| `input` | [RunInputMessage](https://agentlab.cresclab.com/docs/th/api/schemas.md#RunInputMessage)[] | ใช่ | The member's message. |
| `background` | `boolean` | ไม่ | An automation with no reader waiting; not streamed. ค่าเริ่มต้น: `false`. |
| `replyTo` | `object` | ไม่ | — |
| `replyTo.eventId` | `string (uuid)` | ใช่ | 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/th/api/schemas.md#RunMetadata) | ไม่ | — |

## EvaluationRunCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/th/api/schemas.md#AgentConfig) | ใช่ | — |
| `cases` | [EvaluationCase](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationCase)[] | ใช่ | The cases to ask, each with an `id` no other case of the run has. |

## EvaluationCase

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | The application's own id for the case, echoed back with its result; no surrounding spaces. |
| `title` | `string` | ไม่ | A name for the case; omitted, the start of its question. |
| `input` | [RunInputMessage](https://agentlab.cresclab.com/docs/th/api/schemas.md#RunInputMessage)[] | ใช่ | The member's message the case asks; at most 1000 characters in all. |
| `expectations` | [EvaluationExpectations](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationExpectations) | ใช่ | — |
| `weight` | `integer` | ไม่ | What the case counts for beside the others. ค่าเริ่มต้น: `1`. |

## EvaluationExpectations

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `rubric` | `string` | ใช่ | What a good answer does, which the platform's judge reads; no surrounding spaces. |
| `requiredTools` | `string`[] | ไม่ | 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`[] | ไม่ | 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` | ไม่ | The answer must rest on the configuration's knowledge. ค่าเริ่มต้น: `false`. |
| `mustContain` | `string`[] | ไม่ | 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`[] | ไม่ | 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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `status` | `string` | ใช่ | `running`, `completed` (every case answered and judged) or `failed` (`reason` says why). Clients tolerate values added later. ค่าที่เป็นไปได้: `running`, `completed`, `failed`. |
| `reason` | `string` หรือ `null` | ใช่ | Why the run failed; null otherwise. |
| `passed` | `integer` | ใช่ | Cases judged so far that passed. |
| `failed` | `integer` | ใช่ | Cases judged so far that did not pass, an `error` verdict included. |
| `cases` | [EvaluationCaseResult](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationCaseResult)[] | ใช่ | — |
| `createdAt` | `string (date-time)` | ใช่ | When the run started; on the `202`, when the start was answered, which may differ by a moment. |
| `completedAt` | `string (date-time)` หรือ `null (date-time)` | ใช่ | — |

## EvaluationCaseResult

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | The case's `id` as the application sent it. |
| `result` | `null` หรือ [EvaluationVerdict](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationVerdict) | ใช่ | The answer and the judge's verdict; null until the case is answered and judged. |

## EvaluationVerdict

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `verdict` | `string` | ใช่ | `pass`, `fail`, or `error` (the case could not be answered or judged). Clients tolerate values added later. ค่าที่เป็นไปได้: `pass`, `fail`, `error`. |
| `output` | `string` | ใช่ | The answer's text. |
| `rationale` | `string` | ใช่ | The judge's reasoning, or why the case could not be answered. |
| `refusal` | `string` หรือ `null` | ใช่ | Which limit refused the answer, when the verdict is `error` for that reason. |
| `model` | `string` | ใช่ | The model that answered; empty when none did. |
| `durationMs` | `integer` | ใช่ | How long the answer took; 0 when not recorded. |
| `toolCalls` | `object`[] | ใช่ | The tools the answer reached for, in order, and how each call ended. |
| `toolCalls[].name` | `string` | ใช่ | — |
| `toolCalls[].status` | `string` | ใช่ | 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` | ใช่ | What the case counted for; 0 when not recorded. |
| `phraseFailures` | `object`[] | ใช่ | 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` | ใช่ | `mustContain` or `mustNotContain`: the list the phrase came from. ค่าที่เป็นไปได้: `mustContain`, `mustNotContain`. |
| `phraseFailures[].phrase` | `string` | ใช่ | — |

## DeploymentCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `entryKind` | `string` | ใช่ | `slack`, `slack_channel` or `line`; values may be added later. |
| `entryRef` | `string` | ใช่ | The entry point in the channel's own terms, as `createDeployment` describes. |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/th/api/schemas.md#AgentConfig) | ไม่ | — |

## DeployedAgentReplace

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/th/api/schemas.md#AgentConfig) | ใช่ | — |
| `expectedRevision` | `integer` | ใช่ | The revision this replaces, as the deployment answered it; 0 for the first. |

## DeployedAgent

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `agentRef` | `string` หรือ `null` | ใช่ | The deployed configuration's `ref`, null when it named none. |
| `revision` | `integer` | ใช่ | Counts the configurations deployed to this entry; the next replacement names it. |
| `deployedAt` | `string (date-time)` | ใช่ | — |

## Deployment

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `entryKind` | `string` | ใช่ | — |
| `entryRef` | `string` | ใช่ | — |
| `status` | `string` | ใช่ | `active` or `disabled`; clients tolerate values added later. |
| `responder` | `string` | ใช่ | `application`, a registered application answers the entry; `agent`, an assistant the console deployed. Clients tolerate values added later. |
| `applicationId` | `string` หรือ `null` | ใช่ | The registered application that answers the entry, null for an assistant. |
| `thisApplication` | `boolean` | ใช่ | The calling installation's application answers the entry. |
| `agent` | [DeployedAgent](https://agentlab.cresclab.com/docs/th/api/schemas.md#DeployedAgent) หรือ `null` | ใช่ | 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)` | ใช่ | — |

## DeploymentPage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `nextCursor` | `string` หรือ `null` | ไม่ | Absent or null on the last page. |
| `items` | [Deployment](https://agentlab.cresclab.com/docs/th/api/schemas.md#Deployment)[] | ใช่ | — |

## RunMetadata

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

| ชนิด | ค่า |
| --- | --- |
| `object` | — |

## AgentConfig

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

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `ref` | `string` | ไม่ | The application's own id for the agent and its version, opaque to the platform; answered back as `agentRef`. |
| `name` | `string` | ใช่ | — |
| `instructions` | `string` | ใช่ | — |
| `model` | `string` | ใช่ | `"auto"` for the workspace's default, or a model the workspace may use (`GET …/models`). |
| `skills` | [InlineSkill](https://agentlab.cresclab.com/docs/th/api/schemas.md#InlineSkill)[] | ไม่ | Standing instructions sent with the agent's, in order; together at most 6000 characters with their headings. |
| `tools` | [RunTool](https://agentlab.cresclab.com/docs/th/api/schemas.md#RunTool)[] | ไม่ | 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/th/api/schemas.md#RunKnowledge) | ไม่ | — |

## 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.

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `type` | `string` | ใช่ | ค่าที่เป็นไปได้: `mcp`, `http`. |
| `connectionId` | `string` | ไม่ | — |
| `allowedTools` | `string`[] | ไม่ | — |
| `approval` | `string` | ใช่ | ค่าที่เป็นไปได้: `always`, `never`. |
| `name` | `string` | ไม่ | — |
| `description` | `string` | ไม่ | — |
| `inputSchema` | `object` | ไม่ | — |
| `url` | `string` | ไม่ | — |
| `method` | `string` | ไม่ | ค่าที่เป็นไปได้: `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.

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `documentIds` | `string`[] | ไม่ | — |
| `qaIds` | `string`[] | ไม่ | Every listed entry the member may read is sent with each answer. |
| `scope` | `string` | ไม่ | ค่าที่เป็นไปได้: `listed`, `workspace`. |
| `contextProvider` | `string` | ไม่ | ค่าที่เป็นไปได้: `self`. |

## InlineSkill

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `name` | `string` | ใช่ | — |
| `instructions` | `string` | ใช่ | — |

## RunInputMessage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `role` | `string` | ใช่ | ค่าที่เป็นไปได้: `user`. |
| `content` | [RunTextPart](https://agentlab.cresclab.com/docs/th/api/schemas.md#RunTextPart)[] | ใช่ | Text parts, joined with a blank line; at most 4000 characters in all. |

## RunTextPart

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `type` | `string` | ใช่ | ค่าที่เป็นไปได้: `text`. |
| `text` | `string` | ใช่ | — |

## Run

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `conversationId` | `string` | ใช่ | — |
| `status` | `string` | ใช่ | `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. ค่าที่เป็นไปได้: `queued`, `running`, `requires_action`, `completed`, `failed`, `refused`. |
| `agentRef` | `string` หรือ `null` | ใช่ | The configuration's `ref`; null when it had none. |
| `output` | [RunOutputMessage](https://agentlab.cresclab.com/docs/th/api/schemas.md#RunOutputMessage)[] หรือ `null` | ใช่ | The answer, when `completed`. |
| `refusal` | `string` หรือ `null` | ใช่ | Which limit refused the answer, when `refused`. |
| `metadata` | [RunMetadata](https://agentlab.cresclab.com/docs/th/api/schemas.md#RunMetadata) | ไม่ | — |
| `background` | `boolean` | ไม่ | — |
| `cancelled` | `boolean` | ไม่ | The run was stopped (`POST …/runs/{runId}/cancel`) before it finished; its status is `failed`. |
| `replyTo` | `object` หรือ `null` | ไม่ | The event the run answers, when it was started with `replyTo`. |
| `replyTo.eventId` | `string` | ใช่ | — |
| `replyTo.delivery` | `string` | ใช่ | `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. ค่าที่เป็นไปได้: `pending`, `delivered`, `not_delivered`. |
| `requiredAction` | `null` หรือ [RunRequiredAction](https://agentlab.cresclab.com/docs/th/api/schemas.md#RunRequiredAction) | ไม่ | What the run waits on, when `requires_action`; else null. |
| `createdAt` | `string (date-time)` | ใช่ | — |

## 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.

| ชนิด | ค่า |
| --- | --- |
| `string` | — |

## RunRequiredAction

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `toolApprovals` | [ToolApproval](https://agentlab.cresclab.com/docs/th/api/schemas.md#ToolApproval)[] | ใช่ | — |

## ToolApproval

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `name` | `string` | ใช่ | The tool, as the agent called it (an MCP tool's name is prefixed `mcp__`). |
| `arguments` | `object` | ใช่ | What the agent passed. |
| `readOnly` | `boolean` หรือ `null` | ใช่ | The risk the workspace declared for this tool: true read-only, false writing, null undeclared (approved as destructive). |
| `reason` | `string` หรือ `null` | ใช่ | Why the call waits for a person beyond the configuration asking, when there is one. |
| `createdAt` | `string (date-time)` | ใช่ | — |

## ToolApprovalDecision

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `decision` | `string` | ใช่ | ค่าที่เป็นไปได้: `approve`, `reject`. |

## RunOutputMessage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `role` | `string` | ใช่ | ค่าที่เป็นไปได้: `assistant`. |
| `content` | `object`[] | ใช่ | — |
| `content[].type` | `string` | ใช่ | ค่าที่เป็นไปได้: `text`. |
| `content[].text` | `string` | ใช่ | — |

## UsageReport

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `sinceDays` | `integer` | ใช่ | The window the report covers, in days. |
| `items` | [AgentRefUsage](https://agentlab.cresclab.com/docs/th/api/schemas.md#AgentRefUsage)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | There are more groups than the report lists. |

## AgentRefUsage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `agentRef` | `string` หรือ `null` | ใช่ | The configuration's `ref`; null for configurations passed without one. |
| `kind` | `string` | ใช่ | `run` or `evaluation`. Clients tolerate values added later. |
| `turns` | `integer` | ใช่ | Replies answered. |
| `modelCalls` | `integer` | ใช่ | Model calls made for those replies; a reply that calls tools makes several. |
| `inputTokens` | `integer` | ใช่ | Input tokens charged at the full rate (not read from or written to a cache). |
| `outputTokens` | `integer` | ใช่ | — |
| `cachedReadTokens` | `integer` | ใช่ | — |
| `cacheWriteTokens` | `integer` | ใช่ | — |
| `cost` | `null` หรือ [UsageCost](https://agentlab.cresclab.com/docs/th/api/schemas.md#UsageCost) | ใช่ | What it cost at the workspace's prices; null for a member who may not read cost. |

## UsageCost

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `amountUsd` | `number` | ใช่ | — |
| `pricingComplete` | `boolean` | ใช่ | 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`[] | ใช่ | — |

## MemoryFact

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `kind` | `string` | ใช่ | `standing` or `episodic`. Clients tolerate values added later. |
| `body` | `string` | ใช่ | One sentence, at most 1000 characters. |
| `sourceLabel` | `string` | ใช่ | Where it was learned, as the console names it. |
| `sourceTrusted` | `boolean` | ใช่ | — |
| `explicit` | `boolean` | ใช่ | Someone stated it deliberately, rather than an assistant inferring it. |
| `organizationWide` | `boolean` | ใช่ | — |
| `capturedAt` | `string (date-time)` | ใช่ | — |

## MemoryRevision

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `op` | `string` | ใช่ | What the line records, such as `edit` or `delete`. Clients tolerate values added later. |
| `body` | `string` | ใช่ | — |
| `authorAccountId` | `string` หรือ `null` | ใช่ | The member who made the change; null when an assistant made it. |
| `at` | `string (date-time)` | ใช่ | — |

## MemoryNotebook

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `standing` | [MemoryFact](https://agentlab.cresclab.com/docs/th/api/schemas.md#MemoryFact)[] | ใช่ | — |
| `episodic` | [MemoryFact](https://agentlab.cresclab.com/docs/th/api/schemas.md#MemoryFact)[] | ใช่ | — |
| `history` | [MemoryRevision](https://agentlab.cresclab.com/docs/th/api/schemas.md#MemoryRevision)[] | ใช่ | The 50 newest history lines, newest first. |
| `historyTruncated` | `boolean` | ใช่ | — |

## MemoryFactEdit

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `expectedBody` | `string` | ใช่ | The fact's sentence as last read. |
| `body` | `string` | ใช่ | — |

## TranscriptionCreate

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `audio` | `string` | ใช่ | A mono 16 kHz 16-bit PCM WAV of at most two minutes, base64-encoded. |

## Transcription

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `text` | `string` | ใช่ | — |

## OutreachSend

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `targetUserRef` | `string` | ไม่ | A person, by their Slack user id. Exactly one of this and `targetChannelRef`. |
| `targetChannelRef` | `string` | ไม่ | A channel, by its Slack id. Exactly one of this and `targetUserRef`. |
| `body` | `string` | ใช่ | The message, at most 4000 characters. |
| `reason` | `string` | ใช่ | Why it is sent, at most 300 characters; kept with the message. |

## OutreachMessage

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `id` | `string` | ใช่ | — |
| `channelId` | `string` | ใช่ | The channel it was sent through. |
| `targetRef` | `string` | ใช่ | The Slack conversation it was posted to (a direct message's, for a person). |
| `body` | `string` | ใช่ | — |
| `reason` | `string` | ใช่ | — |
| `status` | `string` | ใช่ | `pending`, `sent`, `abandoned` or `unknown`. Clients tolerate values added later. |
| `attempts` | `integer` | ใช่ | — |
| `lastError` | `string` | ใช่ | Why the latest attempt failed; empty when none did. |
| `createdAt` | `string (date-time)` | ใช่ | — |

## OutreachList

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `items` | [OutreachMessage](https://agentlab.cresclab.com/docs/th/api/schemas.md#OutreachMessage)[] | ใช่ | — |
| `truncated` | `boolean` | ใช่ | The member has older sends in the workspace than the 50 that were read. |

## Gateway

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `enabled` | `boolean` | ใช่ | — |
| `operatorDisabled` | `boolean` | ใช่ | Agent Lab turned the Gateway off for this workspace. |
| `plan` | `null` หรือ [GatewayPlan](https://agentlab.cresclab.com/docs/th/api/schemas.md#GatewayPlan) | ใช่ | Null while the Gateway is off, and for a member who may not read usage. |

## GatewayPlan

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `plan` | `string` | ใช่ | The plan's name. Clients tolerate values added later. |
| `source` | `string` | ใช่ | Where the plan comes from. Clients tolerate values added later. |
| `includedRequests` | `integer` หรือ `null` | ใช่ | The requests the plan includes this month; null when it does not limit them. |
| `usedRequests` | `integer` หรือ `null` | ใช่ | The requests made this month; null when they are not counted. |
| `periodStart` | `string (date-time)` | ใช่ | — |
| `periodEnd` | `string (date-time)` | ใช่ | — |
| `asOf` | `string (date-time)` | ใช่ | — |
| `spendCapUsd` | `number` หรือ `null` | ใช่ | The plan's model-spend ceiling; null without one. |
| `spentUsd` | `number` หรือ `null` | ใช่ | All Gateway spend the workspace made; null when some of it has no price. |
| `credit` | `null` หรือ [GatewayCredit](https://agentlab.cresclab.com/docs/th/api/schemas.md#GatewayCredit) | ใช่ | The prepaid credit; null before the first credit. |

## GatewayCredit

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `creditedUsd` | `number` | ใช่ | Every top-up, contract credit and redeemed code. |
| `spentUsd` | `number` หรือ `null` | ใช่ | What was drawn from it; null when some spend has no price. |
| `balanceUsd` | `number` หรือ `null` | ใช่ | What is left; null when the spend is not known. |
