API reference
Generated from the OpenAPI contract at build time. The base URL ishttps://api.agentmailbox.app. Every request uses a bearer token; see Authentication.
identity
/v1/meReturn the principal behind this credential.
Resolves the bearer token to its workspace, subject, scopes, and expiry. Use it to confirm which workspace and permissions a key carries before acting.
| Field | Type | Description |
|---|---|---|
workspace_idrequired | string | Workspace this credential is bound to. |
subject_idrequired | string | User, agent, or service the credential acts for. |
subject_typerequired | "user" | "agent" | "service" | Kind of subject behind the credential. |
token_kindrequired | "api_key" | "oauth" | "run_token" | "session" | Credential class used for this request. |
scopesrequired | array of string | Effective capabilities, already narrowed by role and key. |
expires_atrequired | string (date-time) | Expiry of the underlying credential, or the epoch for non-expiring keys. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/principal.json",
"title": "Principal",
"description": "The credential's identity and effective permissions, as resolved from the bearer token.",
"type": "object",
"additionalProperties": false,
"required": [
"workspace_id",
"subject_id",
"subject_type",
"token_kind",
"scopes",
"expires_at"
],
"properties": {
"workspace_id": {
"type": "string",
"pattern": "^wsp_[0-9A-Za-z]{20,}$",
"description": "Workspace this credential is bound to.",
"examples": [
"wsp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"subject_id": {
"type": "string",
"description": "User, agent, or service the credential acts for.",
"examples": [
"usr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"subject_type": {
"type": "string",
"enum": [
"user",
"agent",
"service"
],
"description": "Kind of subject behind the credential.",
"examples": [
"agent"
]
},
"token_kind": {
"type": "string",
"enum": [
"api_key",
"oauth",
"run_token",
"session"
],
"description": "Credential class used for this request.",
"examples": [
"api_key"
]
},
"scopes": {
"type": "array",
"description": "Effective capabilities, already narrowed by role and key.",
"items": {
"type": "string",
"pattern": "^[a-z_]+:(read|write|send|reply|create|control|admin)$",
"description": "A single effective capability granted to this principal.",
"examples": [
"inbox:read"
]
},
"examples": [
[
"inbox:read",
"message:send"
]
]
},
"expires_at": {
"type": "string",
"format": "date-time",
"description": "Expiry of the underlying credential, or the epoch for non-expiring keys.",
"examples": [
"2026-11-12T10:05:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}meta
/v1/metaReturn contract version and schema hash.
Public metadata for drift detection: the deployed contract version, a SHA-256 of the generated OpenAPI document, and any deprecations.
| Field | Type | Description |
|---|---|---|
contract_versionrequired | string | Semantic version of the published contract. |
schema_hashrequired | string | SHA-256 of the generated OpenAPI document. |
generated_atrequired | string (date-time) | When the running build was generated. |
deprecationsrequired | array of object | Operations scheduled for removal, with their replacement. |
deprecations[].operationrequired | string | Deprecated operation ID. |
deprecations[].replacementrequired | string | Operation ID to use instead. |
deprecations[].sunset_atrequired | string (date-time) | When the operation stops working. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/meta.json",
"title": "Contract metadata",
"description": "Identifies the deployed contract so clients can detect drift.",
"type": "object",
"additionalProperties": false,
"required": [
"contract_version",
"schema_hash",
"generated_at",
"deprecations"
],
"properties": {
"contract_version": {
"type": "string",
"description": "Semantic version of the published contract.",
"examples": [
"1.0.0"
]
},
"schema_hash": {
"type": "string",
"pattern": "^[0-9a-f]{64}$",
"description": "SHA-256 of the generated OpenAPI document.",
"examples": [
"f8c37b6176629629c849082173f373688435bc82d21937942957e84b4874557d"
]
},
"generated_at": {
"type": "string",
"format": "date-time",
"description": "When the running build was generated.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"deprecations": {
"type": "array",
"description": "Operations scheduled for removal, with their replacement.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"operation",
"replacement",
"sunset_at"
],
"properties": {
"operation": {
"type": "string",
"description": "Deprecated operation ID.",
"examples": [
"inbox.create_legacy"
]
},
"replacement": {
"type": "string",
"description": "Operation ID to use instead.",
"examples": [
"inbox.create"
]
},
"sunset_at": {
"type": "string",
"format": "date-time",
"description": "When the operation stops working.",
"examples": [
"2027-01-01T00:00:00Z"
]
}
}
}
}
}
}
}
}
}
}
}workspace
/v1/workspaceReturn the caller's workspace.
Reads plan, limits, and retention defaults for the workspace the token is bound to.
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable workspace identifier. |
namerequired | string | Workspace display name. |
planrequired | "sandbox" | "build" | "team" | "appsumo_solo" | "appsumo_studio" | "appsumo_agency" | Current subscription plan. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/workspace.json",
"title": "Workspace",
"description": "A tenant containing team members, domains, inboxes, and credentials.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"plan",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^wsp_[0-9A-Za-z]{20,}$",
"description": "Stable workspace identifier.",
"examples": [
"wsp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "Workspace display name.",
"examples": [
"Acme Agents"
]
},
"plan": {
"type": "string",
"enum": [
"sandbox",
"build",
"team",
"appsumo_solo",
"appsumo_studio",
"appsumo_agency"
],
"description": "Current subscription plan.",
"examples": [
"sandbox"
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/workspaceUpdate workspace settings.
Changes the workspace display name. Requires an admin-scoped credential; a workspace-scoped key cannot rename its tenant.
| Field | Type | Description |
|---|---|---|
name | string | Workspace display name. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable workspace identifier. |
namerequired | string | Workspace display name. |
planrequired | "sandbox" | "build" | "team" | "appsumo_solo" | "appsumo_studio" | "appsumo_agency" | Current subscription plan. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/workspace-update-request.json",
"title": "Update workspace request",
"description": "Changes workspace settings. Omitted fields are left unchanged.",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "Workspace display name.",
"examples": [
"Acme Agents"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/workspace.json",
"title": "Workspace",
"description": "A tenant containing team members, domains, inboxes, and credentials.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"plan",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^wsp_[0-9A-Za-z]{20,}$",
"description": "Stable workspace identifier.",
"examples": [
"wsp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "Workspace display name.",
"examples": [
"Acme Agents"
]
},
"plan": {
"type": "string",
"enum": [
"sandbox",
"build",
"team",
"appsumo_solo",
"appsumo_studio",
"appsumo_agency"
],
"description": "Current subscription plan.",
"examples": [
"sandbox"
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}domains
/v1/domainsList domains.
Cursor-paginated domains, ordered by name. Filters are applied server-side and are always scoped to the token's workspace.
| Name | In | Type | Description |
|---|---|---|---|
status | query | string | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Domains in this page, ordered by name ascending. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null when exhausted. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "status",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"pending",
"verified",
"failed"
],
"description": "Only return domains in this state."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/domain-list-response.json",
"title": "Domain list",
"description": "A cursor-paginated page of domains.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Domains in this page, ordered by name ascending.",
"items": {
"$ref": "https://schemas.agentmailbox.app/domain.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor for the next page, or null when exhausted.",
"examples": [
"cur_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/domainsRegister a domain.
Registers a domain and returns the DNS records required to verify it. Receiving is opt-in and requires exclusive MX verification before the shared edge will accept mail.
| Field | Type | Description |
|---|---|---|
name | string | Registrable domain to register, without a trailing dot. |
receiving_enabled | boolean = false | Ask the shared MX edge to accept inbound mail for this domain. |
subdomain | string | Create a managed <subdomain>.agentmailbox.app address space instead of registering a domain. Receive-only unless the subdomain is separately verified. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable domain identifier. |
namerequired | string | Lowercase registrable domain name. |
statusrequired | "pending" | "verified" | "failed" | DNS verification state. |
sending_enabledrequired | boolean | Whether outbound mail may use this domain. |
receiving_enabledrequired | boolean | Whether the shared MX edge accepts mail for this domain. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/domain-create-request.json",
"title": "Register domain request",
"description": "Registers a domain for sending and, optionally, receiving.",
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"name": {
"type": "string",
"pattern": "^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
"description": "Registrable domain to register, without a trailing dot.",
"examples": [
"acme.com"
]
},
"receiving_enabled": {
"type": "boolean",
"default": false,
"description": "Ask the shared MX edge to accept inbound mail for this domain.",
"examples": [
false
]
},
"subdomain": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9-]{0,30}$",
"description": "Create a managed <subdomain>.agentmailbox.app address space instead of registering a domain. Receive-only unless the subdomain is separately verified.",
"examples": [
"acme"
]
}
},
"anyOf": [
{
"required": [
"name"
]
},
{
"required": [
"subdomain"
]
}
]
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/domain.json",
"title": "Domain",
"description": "A customer domain that AgentMailbox can send from and receive mail for.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"status",
"sending_enabled",
"receiving_enabled",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Stable domain identifier.",
"examples": [
"dom_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"pattern": "^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
"description": "Lowercase registrable domain name.",
"examples": [
"acme.com"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"verified",
"failed"
],
"description": "DNS verification state.",
"examples": [
"verified"
]
},
"sending_enabled": {
"type": "boolean",
"description": "Whether outbound mail may use this domain.",
"examples": [
true
]
},
"receiving_enabled": {
"type": "boolean",
"description": "Whether the shared MX edge accepts mail for this domain.",
"examples": [
false
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/domains/{id}Get one domain.
Returns verification state, sending and receiving flags. A domain in another workspace returns 404, never 403.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable domain identifier. |
namerequired | string | Lowercase registrable domain name. |
statusrequired | "pending" | "verified" | "failed" | DNS verification state. |
sending_enabledrequired | boolean | Whether outbound mail may use this domain. |
receiving_enabledrequired | boolean | Whether the shared MX edge accepts mail for this domain. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Domain identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/domain.json",
"title": "Domain",
"description": "A customer domain that AgentMailbox can send from and receive mail for.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"status",
"sending_enabled",
"receiving_enabled",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Stable domain identifier.",
"examples": [
"dom_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"pattern": "^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
"description": "Lowercase registrable domain name.",
"examples": [
"acme.com"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"verified",
"failed"
],
"description": "DNS verification state.",
"examples": [
"verified"
]
},
"sending_enabled": {
"type": "boolean",
"description": "Whether outbound mail may use this domain.",
"examples": [
true
]
},
"receiving_enabled": {
"type": "boolean",
"description": "Whether the shared MX edge accepts mail for this domain.",
"examples": [
false
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/domains/{id}/verifyRe-check domain DNS.
Runs a fresh DNS check for the registered domain and returns the resulting status. Idempotent by nature; safe to call after changing records.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable domain identifier. |
namerequired | string | Lowercase registrable domain name. |
statusrequired | "pending" | "verified" | "failed" | DNS verification state. |
sending_enabledrequired | boolean | Whether outbound mail may use this domain. |
receiving_enabledrequired | boolean | Whether the shared MX edge accepts mail for this domain. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Domain identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/domain.json",
"title": "Domain",
"description": "A customer domain that AgentMailbox can send from and receive mail for.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"status",
"sending_enabled",
"receiving_enabled",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Stable domain identifier.",
"examples": [
"dom_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"pattern": "^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,}$",
"description": "Lowercase registrable domain name.",
"examples": [
"acme.com"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"verified",
"failed"
],
"description": "DNS verification state.",
"examples": [
"verified"
]
},
"sending_enabled": {
"type": "boolean",
"description": "Whether outbound mail may use this domain.",
"examples": [
true
]
},
"receiving_enabled": {
"type": "boolean",
"description": "Whether the shared MX edge accepts mail for this domain.",
"examples": [
false
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/domains/{id}/dns-recordsList required DNS records.
Returns the DKIM, SPF, and MX records this domain needs, sourced from SES where available.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Records to publish. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Domain identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "DNS records",
"description": "Every record required for this domain.",
"type": "object",
"additionalProperties": false,
"required": [
"data"
],
"properties": {
"data": {
"type": "array",
"description": "Records to publish.",
"items": {
"$ref": "https://schemas.agentmailbox.app/dns-record.json"
}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/dns-record-list.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/domains/{id}/zone-fileDownload a zone file.
Returns the required records as a BIND-style zone fragment with a text/plain body.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Domain identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}inboxes
/v1/inboxesList inboxes.
Cursor-paginated inboxes ordered by address, optionally filtered by domain and status.
| Name | In | Type | Description |
|---|---|---|---|
domain_id | query | string | |
status | query | string | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Inboxes in this page, ordered by address ascending. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null when exhausted. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "domain_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Only inboxes on this domain."
}
},
{
"name": "status",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"pending",
"active",
"suspended",
"deleted"
],
"description": "Only inboxes in this state."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox-list-response.json",
"title": "Inbox list",
"description": "A cursor-paginated page of inboxes.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Inboxes in this page, ordered by address ascending.",
"items": {
"$ref": "https://schemas.agentmailbox.app/inbox.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor for the next page, or null when exhausted.",
"examples": [
"cur_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxesCreate an inbox on a verified domain.
Creates an agent address. Zero retention is opt-in and receive-only: nothing is persisted and replies are rejected.
| Field | Type | Description |
|---|---|---|
addressrequired | string (email) | A full address on a verified domain. |
display_name | string | null | Name recipients see on outbound mail. |
retention_mode | "standard" | "zero" = "standard" | Whether inbound mail is stored or delivered once. |
retention_days | 7 | 30 | 90 | 365 = 30 | Retention period when mode is standard. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable inbox identifier. |
addressrequired | string (email) | Full address on a verified domain. |
display_name | string | null | Name recipients see on outbound mail. |
statusrequired | "pending" | "active" | "suspended" | "deleted" | Inbox lifecycle state. |
domain_idrequired | string | Verified domain that owns the address. |
retention_moderequired | "standard" | "zero" | Whether inbound mail is stored or delivered once. |
retention_daysrequired | 7 | 30 | 90 | 365 | Retention period when mode is standard. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox-create-request.json",
"title": "Create inbox request",
"description": "Creates an agent address on a verified domain.",
"type": "object",
"additionalProperties": false,
"required": [
"address"
],
"properties": {
"address": {
"type": "string",
"format": "email",
"maxLength": 320,
"description": "A full address on a verified domain.",
"examples": [
"support@acme.com"
]
},
"display_name": {
"type": [
"string",
"null"
],
"maxLength": 120,
"description": "Name recipients see on outbound mail.",
"examples": [
"Acme Support"
]
},
"retention_mode": {
"type": "string",
"enum": [
"standard",
"zero"
],
"default": "standard",
"description": "Whether inbound mail is stored or delivered once.",
"examples": [
"standard"
]
},
"retention_days": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"default": 30,
"description": "Retention period when mode is standard.",
"examples": [
30
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox.json",
"title": "Inbox",
"description": "An agent address on a verified domain.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"address",
"status",
"domain_id",
"retention_mode",
"retention_days",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Stable inbox identifier.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"address": {
"type": "string",
"format": "email",
"description": "Full address on a verified domain.",
"examples": [
"support@acme.com"
],
"x-pii": true
},
"display_name": {
"type": [
"string",
"null"
],
"maxLength": 120,
"description": "Name recipients see on outbound mail.",
"examples": [
"Acme Support"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"active",
"suspended",
"deleted"
],
"description": "Inbox lifecycle state.",
"examples": [
"active"
]
},
"domain_id": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Verified domain that owns the address.",
"examples": [
"dom_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"retention_mode": {
"type": "string",
"enum": [
"standard",
"zero"
],
"description": "Whether inbound mail is stored or delivered once.",
"examples": [
"standard"
]
},
"retention_days": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"description": "Retention period when mode is standard.",
"examples": [
30
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}Get one inbox.
Returns inbox settings and retention policy. Cross-workspace or out-of-grant inboxes return 404.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable inbox identifier. |
addressrequired | string (email) | Full address on a verified domain. |
display_name | string | null | Name recipients see on outbound mail. |
statusrequired | "pending" | "active" | "suspended" | "deleted" | Inbox lifecycle state. |
domain_idrequired | string | Verified domain that owns the address. |
retention_moderequired | "standard" | "zero" | Whether inbound mail is stored or delivered once. |
retention_daysrequired | 7 | 30 | 90 | 365 | Retention period when mode is standard. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox.json",
"title": "Inbox",
"description": "An agent address on a verified domain.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"address",
"status",
"domain_id",
"retention_mode",
"retention_days",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Stable inbox identifier.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"address": {
"type": "string",
"format": "email",
"description": "Full address on a verified domain.",
"examples": [
"support@acme.com"
],
"x-pii": true
},
"display_name": {
"type": [
"string",
"null"
],
"maxLength": 120,
"description": "Name recipients see on outbound mail.",
"examples": [
"Acme Support"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"active",
"suspended",
"deleted"
],
"description": "Inbox lifecycle state.",
"examples": [
"active"
]
},
"domain_id": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Verified domain that owns the address.",
"examples": [
"dom_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"retention_mode": {
"type": "string",
"enum": [
"standard",
"zero"
],
"description": "Whether inbound mail is stored or delivered once.",
"examples": [
"standard"
]
},
"retention_days": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"description": "Retention period when mode is standard.",
"examples": [
30
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}Update inbox settings.
Changes display name or retention policy. Omitted fields are left unchanged.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
display_name | string | null | Name recipients see on outbound mail, or null to clear it. |
retention_mode | "standard" | "zero" | Whether inbound mail is stored or delivered once. |
retention_days | 7 | 30 | 90 | 365 | Retention period when mode is standard. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable inbox identifier. |
addressrequired | string (email) | Full address on a verified domain. |
display_name | string | null | Name recipients see on outbound mail. |
statusrequired | "pending" | "active" | "suspended" | "deleted" | Inbox lifecycle state. |
domain_idrequired | string | Verified domain that owns the address. |
retention_moderequired | "standard" | "zero" | Whether inbound mail is stored or delivered once. |
retention_daysrequired | 7 | 30 | 90 | 365 | Retention period when mode is standard. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox-update-request.json",
"title": "Update inbox request",
"description": "Changes mutable inbox settings. Omitted fields are left unchanged.",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"display_name": {
"type": [
"string",
"null"
],
"maxLength": 120,
"description": "Name recipients see on outbound mail, or null to clear it.",
"examples": [
"Acme Support"
]
},
"retention_mode": {
"type": "string",
"enum": [
"standard",
"zero"
],
"description": "Whether inbound mail is stored or delivered once.",
"examples": [
"standard"
]
},
"retention_days": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"description": "Retention period when mode is standard.",
"examples": [
30
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox.json",
"title": "Inbox",
"description": "An agent address on a verified domain.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"address",
"status",
"domain_id",
"retention_mode",
"retention_days",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Stable inbox identifier.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"address": {
"type": "string",
"format": "email",
"description": "Full address on a verified domain.",
"examples": [
"support@acme.com"
],
"x-pii": true
},
"display_name": {
"type": [
"string",
"null"
],
"maxLength": 120,
"description": "Name recipients see on outbound mail.",
"examples": [
"Acme Support"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"active",
"suspended",
"deleted"
],
"description": "Inbox lifecycle state.",
"examples": [
"active"
]
},
"domain_id": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Verified domain that owns the address.",
"examples": [
"dom_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"retention_mode": {
"type": "string",
"enum": [
"standard",
"zero"
],
"description": "Whether inbound mail is stored or delivered once.",
"examples": [
"standard"
]
},
"retention_days": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"description": "Retention period when mode is standard.",
"examples": [
30
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}Delete an inbox.
Soft-deletes the inbox and stops delivery. Retention policy still governs when stored messages are purged.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}/retentionSet inbox retention.
Chooses standard storage for 7/30/90/365 days, or zero retention which stores nothing and rejects replies.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
moderequired | "standard" | "zero" | Retention mode. |
days | 7 | 30 | 90 | 365 | Retention period in days for standard mode. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable inbox identifier. |
addressrequired | string (email) | Full address on a verified domain. |
display_name | string | null | Name recipients see on outbound mail. |
statusrequired | "pending" | "active" | "suspended" | "deleted" | Inbox lifecycle state. |
domain_idrequired | string | Verified domain that owns the address. |
retention_moderequired | "standard" | "zero" | Whether inbound mail is stored or delivered once. |
retention_daysrequired | 7 | 30 | 90 | 365 | Retention period when mode is standard. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/retention-request.json",
"title": "Retention request",
"description": "Sets the retention policy for one inbox. Zero retention stores nothing and rejects replies.",
"type": "object",
"additionalProperties": false,
"required": [
"mode"
],
"properties": {
"mode": {
"type": "string",
"enum": [
"standard",
"zero"
],
"description": "Retention mode.",
"examples": [
"standard"
]
},
"days": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"description": "Retention period in days for standard mode.",
"examples": [
30
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox.json",
"title": "Inbox",
"description": "An agent address on a verified domain.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"address",
"status",
"domain_id",
"retention_mode",
"retention_days",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Stable inbox identifier.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"address": {
"type": "string",
"format": "email",
"description": "Full address on a verified domain.",
"examples": [
"support@acme.com"
],
"x-pii": true
},
"display_name": {
"type": [
"string",
"null"
],
"maxLength": 120,
"description": "Name recipients see on outbound mail.",
"examples": [
"Acme Support"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"active",
"suspended",
"deleted"
],
"description": "Inbox lifecycle state.",
"examples": [
"active"
]
},
"domain_id": {
"type": "string",
"pattern": "^dom_[0-9A-Za-z]{20,}$",
"description": "Verified domain that owns the address.",
"examples": [
"dom_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"retention_mode": {
"type": "string",
"enum": [
"standard",
"zero"
],
"description": "Whether inbound mail is stored or delivered once.",
"examples": [
"standard"
]
},
"retention_days": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"description": "Retention period when mode is standard.",
"examples": [
30
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}/forwardingGet inbox forwarding.
Returns the forwarding destination, if one is configured.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
enabledrequired | boolean | Whether forwarding is active. |
torequired | string | null (email) | Verified destination, or null. |
verifiedrequired | boolean | Whether the destination was confirmed. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Forwarding",
"description": "Where copies of inbound mail for an inbox are sent.",
"type": "object",
"additionalProperties": false,
"required": [
"enabled",
"to",
"verified",
"created_at",
"updated_at"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether forwarding is active.",
"examples": [
true
]
},
"to": {
"type": [
"string",
"null"
],
"format": "email",
"description": "Verified destination, or null.",
"examples": [
"owner@acme.com"
]
},
"verified": {
"type": "boolean",
"description": "Whether the destination was confirmed.",
"examples": [
true
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/forwarding.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}/forwardingSet inbox forwarding.
Sends a copy of every stored inbound message to one destination address.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
torequired | string (email) | Destination address for copies. |
| Field | Type | Description |
|---|---|---|
enabledrequired | boolean | Whether forwarding is active. |
torequired | string | null (email) | Verified destination, or null. |
verifiedrequired | boolean | Whether the destination was confirmed. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Set forwarding request",
"description": "Sets the forwarding destination for an inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"to"
],
"properties": {
"to": {
"type": "string",
"format": "email",
"maxLength": 320,
"description": "Destination address for copies.",
"examples": [
"owner@acme.com"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/forwarding-request.json"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Forwarding",
"description": "Where copies of inbound mail for an inbox are sent.",
"type": "object",
"additionalProperties": false,
"required": [
"enabled",
"to",
"verified",
"created_at",
"updated_at"
],
"properties": {
"enabled": {
"type": "boolean",
"description": "Whether forwarding is active.",
"examples": [
true
]
},
"to": {
"type": [
"string",
"null"
],
"format": "email",
"description": "Verified destination, or null.",
"examples": [
"owner@acme.com"
]
},
"verified": {
"type": "boolean",
"description": "Whether the destination was confirmed.",
"examples": [
true
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/forwarding.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}/forwardingDisable inbox forwarding.
Stops sending copies for this inbox.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}threads
/v1/threadsList threads.
Threads ordered by most recent message, optionally filtered by inbox, folder, or a search query. Search uses FTS5 and is ACL-filtered.
| Name | In | Type | Description |
|---|---|---|---|
inbox_id | query | string | |
folder | query | string | |
q | query | string | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Threads in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null when exhausted. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "inbox_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Only threads in this inbox."
}
},
{
"name": "folder",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"inbox",
"archive",
"trash",
"spam"
],
"description": "Only threads in this folder."
}
},
{
"name": "q",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 256,
"description": "Full-text search over subject and participants."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/thread-list-response.json",
"title": "Thread list",
"description": "A cursor-paginated page of threads, newest activity first.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Threads in this page.",
"items": {
"$ref": "https://schemas.agentmailbox.app/thread.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor for the next page, or null when exhausted.",
"examples": [
"cur_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/threads/{id}Get one thread with a page of its messages.
Returns thread state, counts, and one page of messages, oldest first, with the stored text and HTML for each. Without a cursor the page is the newest messages; `before` reads earlier messages and `after` reads later ones. Cross-workspace or out-of-grant threads return 404.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
limit | query | integer | |
before | query | string | |
after | query | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable thread identifier. |
inbox_idrequired | string | Inbox that owns this conversation. |
subjectrequired | string | Normalized subject without reply prefixes. |
participantsrequired | array of string | Every address that has sent or received in this thread. |
message_countrequired | integer | Number of messages in the thread. |
unread_countrequired | integer | Messages not yet read. |
folderrequired | "inbox" | "archive" | "trash" | "spam" | Current folder for the thread. |
is_readrequired | boolean | Whether the thread has no unread messages. |
last_message_atrequired | string (date-time) | Timestamp of the newest message, used for ordering. |
messages | array of object | One page of messages, oldest first, each with its stored text and HTML. Present on a single-thread read and omitted from lists. |
messages_page | object | Cursors for the pages on either side of `messages`. Present on a single-thread read and omitted from lists. |
messages_page.before_cursorrequired | string | null | Pass as `before` for the page of older messages. Null when this page starts at the first message. |
messages_page.after_cursorrequired | string | null | Pass as `after` for the page of newer messages. Null when this page ends at the last message. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread identifier."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Messages per page."
}
},
{
"name": "before",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Page cursor from messages_page.before_cursor. Returns the messages older than it."
}
},
{
"name": "after",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Page cursor from messages_page.after_cursor. Returns the messages newer than it."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/thread.json",
"title": "Thread",
"description": "A conversation: messages grouped by subject and participants inside one inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"subject",
"participants",
"message_count",
"unread_count",
"folder",
"is_read",
"last_message_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Stable thread identifier.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that owns this conversation.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Normalized subject without reply prefixes.",
"examples": [
"Invoice 42"
]
},
"participants": {
"type": "array",
"description": "Every address that has sent or received in this thread.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com",
"dana@example.com"
]
]
},
"message_count": {
"type": "integer",
"minimum": 1,
"description": "Number of messages in the thread.",
"examples": [
3
]
},
"unread_count": {
"type": "integer",
"minimum": 0,
"description": "Messages not yet read.",
"examples": [
1
]
},
"folder": {
"type": "string",
"enum": [
"inbox",
"archive",
"trash",
"spam"
],
"description": "Current folder for the thread.",
"examples": [
"inbox"
]
},
"is_read": {
"type": "boolean",
"description": "Whether the thread has no unread messages.",
"examples": [
false
]
},
"last_message_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp of the newest message, used for ordering.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"messages": {
"type": "array",
"description": "One page of messages, oldest first, each with its stored text and HTML. Present on a single-thread read and omitted from lists.",
"items": {
"$ref": "https://schemas.agentmailbox.app/message.json"
}
},
"messages_page": {
"type": "object",
"description": "Cursors for the pages on either side of `messages`. Present on a single-thread read and omitted from lists.",
"required": [
"before_cursor",
"after_cursor"
],
"properties": {
"before_cursor": {
"type": [
"string",
"null"
],
"description": "Pass as `before` for the page of older messages. Null when this page starts at the first message.",
"examples": [
"djE6MjAyNi0xMS0xMlQwOTo0MTowMFp8bXNnXzAxSjhaM0s0UTlWN00yTjZQMVI1VDhXMFg"
]
},
"after_cursor": {
"type": [
"string",
"null"
],
"description": "Pass as `after` for the page of newer messages. Null when this page ends at the last message.",
"examples": [
null
]
}
}
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/threads/{id}Update thread state.
Marks a thread read or moves it between folders. Omitted fields are unchanged.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
is_read | boolean | Mark the whole thread read or unread. |
folder | "inbox" | "archive" | "trash" | "spam" | Move the thread to another folder. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable thread identifier. |
inbox_idrequired | string | Inbox that owns this conversation. |
subjectrequired | string | Normalized subject without reply prefixes. |
participantsrequired | array of string | Every address that has sent or received in this thread. |
message_countrequired | integer | Number of messages in the thread. |
unread_countrequired | integer | Messages not yet read. |
folderrequired | "inbox" | "archive" | "trash" | "spam" | Current folder for the thread. |
is_readrequired | boolean | Whether the thread has no unread messages. |
last_message_atrequired | string (date-time) | Timestamp of the newest message, used for ordering. |
messages | array of object | One page of messages, oldest first, each with its stored text and HTML. Present on a single-thread read and omitted from lists. |
messages_page | object | Cursors for the pages on either side of `messages`. Present on a single-thread read and omitted from lists. |
messages_page.before_cursorrequired | string | null | Pass as `before` for the page of older messages. Null when this page starts at the first message. |
messages_page.after_cursorrequired | string | null | Pass as `after` for the page of newer messages. Null when this page ends at the last message. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/thread-update-request.json",
"title": "Update thread request",
"description": "Changes mutable thread state. Omitted fields are left unchanged.",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"is_read": {
"type": "boolean",
"description": "Mark the whole thread read or unread.",
"examples": [
true
]
},
"folder": {
"type": "string",
"enum": [
"inbox",
"archive",
"trash",
"spam"
],
"description": "Move the thread to another folder.",
"examples": [
"archive"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/thread.json",
"title": "Thread",
"description": "A conversation: messages grouped by subject and participants inside one inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"subject",
"participants",
"message_count",
"unread_count",
"folder",
"is_read",
"last_message_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Stable thread identifier.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that owns this conversation.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Normalized subject without reply prefixes.",
"examples": [
"Invoice 42"
]
},
"participants": {
"type": "array",
"description": "Every address that has sent or received in this thread.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com",
"dana@example.com"
]
]
},
"message_count": {
"type": "integer",
"minimum": 1,
"description": "Number of messages in the thread.",
"examples": [
3
]
},
"unread_count": {
"type": "integer",
"minimum": 0,
"description": "Messages not yet read.",
"examples": [
1
]
},
"folder": {
"type": "string",
"enum": [
"inbox",
"archive",
"trash",
"spam"
],
"description": "Current folder for the thread.",
"examples": [
"inbox"
]
},
"is_read": {
"type": "boolean",
"description": "Whether the thread has no unread messages.",
"examples": [
false
]
},
"last_message_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp of the newest message, used for ordering.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"messages": {
"type": "array",
"description": "One page of messages, oldest first, each with its stored text and HTML. Present on a single-thread read and omitted from lists.",
"items": {
"$ref": "https://schemas.agentmailbox.app/message.json"
}
},
"messages_page": {
"type": "object",
"description": "Cursors for the pages on either side of `messages`. Present on a single-thread read and omitted from lists.",
"required": [
"before_cursor",
"after_cursor"
],
"properties": {
"before_cursor": {
"type": [
"string",
"null"
],
"description": "Pass as `before` for the page of older messages. Null when this page starts at the first message.",
"examples": [
"djE6MjAyNi0xMS0xMlQwOTo0MTowMFp8bXNnXzAxSjhaM0s0UTlWN00yTjZQMVI1VDhXMFg"
]
},
"after_cursor": {
"type": [
"string",
"null"
],
"description": "Pass as `after` for the page of newer messages. Null when this page ends at the last message.",
"examples": [
null
]
}
}
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}messages
/v1/messagesList messages.
Messages ordered oldest first, filtered by inbox, thread, or direction. Bodies are never inlined in list responses.
| Name | In | Type | Description |
|---|---|---|---|
inbox_id | query | string | |
thread_id | query | string | |
direction | query | string | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Messages in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null when exhausted. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "inbox_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Only messages in this inbox."
}
},
{
"name": "thread_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Only messages in this thread."
}
},
{
"name": "direction",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Only inbound or outbound messages."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message-list-response.json",
"title": "Message list",
"description": "A cursor-paginated page of messages, oldest first within a thread.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Messages in this page.",
"items": {
"$ref": "https://schemas.agentmailbox.app/message.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor for the next page, or null when exhausted.",
"examples": [
"cur_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/messages/{id}Get one message.
Returns metadata and the stored text and HTML body. Raw RFC 822 bytes and attachments use their own endpoints.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable message identifier. |
thread_idrequired | string | Thread this message belongs to. |
inbox_idrequired | string | Inbox that sent or received this message. |
directionrequired | "inbound" | "outbound" | Whether the message arrived at or left the inbox. |
statusrequired | "received" | "queued" | "sent" | "delivered" | "bounced" | "complained" | "failed" | Delivery state for outbound, receipt state for inbound. |
fromrequired | string (email) | Envelope sender address. |
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject as received or sent. |
snippetrequired | string | Short plain-text preview used by list views. |
text | string | null | Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists. |
html | string | null | Stored HTML body. Present on single-message reads when the body was stored; omitted from lists. |
size_bytesrequired | integer | Raw RFC 822 size in bytes. |
created_atrequired | string (date-time) | Receipt or send time in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message.json",
"title": "Message",
"description": "One email in a thread. Bodies are immutable; only labels and read state change.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"thread_id",
"inbox_id",
"direction",
"status",
"from",
"to",
"subject",
"snippet",
"size_bytes",
"created_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Stable message identifier.",
"examples": [
"msg_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread this message belongs to.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that sent or received this message.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Whether the message arrived at or left the inbox.",
"examples": [
"inbound"
]
},
"status": {
"type": "string",
"enum": [
"received",
"queued",
"sent",
"delivered",
"bounced",
"complained",
"failed"
],
"description": "Delivery state for outbound, receipt state for inbound.",
"examples": [
"received"
]
},
"from": {
"type": "string",
"format": "email",
"description": "Envelope sender address.",
"examples": [
"dana@example.com"
],
"x-pii": true
},
"to": {
"type": "array",
"description": "Primary recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com"
]
]
},
"cc": {
"type": "array",
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[]
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Subject as received or sent.",
"examples": [
"Invoice 42"
]
},
"snippet": {
"type": "string",
"maxLength": 500,
"description": "Short plain-text preview used by list views.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"text": {
"type": [
"string",
"null"
],
"description": "Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"html": {
"type": [
"string",
"null"
],
"description": "Stored HTML body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"<p>Please pay the attached invoice by Friday.</p>"
]
},
"size_bytes": {
"type": "integer",
"minimum": 0,
"description": "Raw RFC 822 size in bytes.",
"examples": [
3272
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Receipt or send time in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}/messagesSend a message from an inbox.
Sends a new message. The inbox supplies the From address, so a caller can never spoof another identity. Delivery is asynchronous; the message starts in queued status.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject line. |
textrequired | string | Plain-text body. Always required so every message is readable. |
html | string | null | Optional HTML body for clients that render it. |
attachment_ids | array of string | Stored attachment identifiers to include. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable message identifier. |
thread_idrequired | string | Thread this message belongs to. |
inbox_idrequired | string | Inbox that sent or received this message. |
directionrequired | "inbound" | "outbound" | Whether the message arrived at or left the inbox. |
statusrequired | "received" | "queued" | "sent" | "delivered" | "bounced" | "complained" | "failed" | Delivery state for outbound, receipt state for inbound. |
fromrequired | string (email) | Envelope sender address. |
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject as received or sent. |
snippetrequired | string | Short plain-text preview used by list views. |
text | string | null | Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists. |
html | string | null | Stored HTML body. Present on single-message reads when the body was stored; omitted from lists. |
size_bytesrequired | integer | Raw RFC 822 size in bytes. |
created_atrequired | string (date-time) | Receipt or send time in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message-send-request.json",
"title": "Send message request",
"description": "Sends a new message from an inbox. The inbox supplies the From address; recipients never choose it.",
"type": "object",
"additionalProperties": false,
"required": [
"to",
"subject",
"text"
],
"properties": {
"to": {
"type": "array",
"minItems": 1,
"maxItems": 50,
"description": "Primary recipients.",
"items": {
"type": "string",
"format": "email",
"maxLength": 320
},
"examples": [
[
"dana@example.com"
]
]
},
"cc": {
"type": "array",
"maxItems": 50,
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email",
"maxLength": 320
},
"examples": [
[]
]
},
"subject": {
"type": "string",
"minLength": 1,
"maxLength": 998,
"description": "Subject line.",
"examples": [
"Re: Invoice 42"
]
},
"text": {
"type": "string",
"maxLength": 1000000,
"description": "Plain-text body. Always required so every message is readable.",
"examples": [
"Payment is on its way."
]
},
"html": {
"type": [
"string",
"null"
],
"maxLength": 1000000,
"description": "Optional HTML body for clients that render it.",
"examples": [
"<p>Payment is on its way.</p>"
]
},
"attachment_ids": {
"type": "array",
"maxItems": 10,
"description": "Stored attachment identifiers to include.",
"items": {
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$"
},
"examples": [
[
"att_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message.json",
"title": "Message",
"description": "One email in a thread. Bodies are immutable; only labels and read state change.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"thread_id",
"inbox_id",
"direction",
"status",
"from",
"to",
"subject",
"snippet",
"size_bytes",
"created_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Stable message identifier.",
"examples": [
"msg_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread this message belongs to.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that sent or received this message.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Whether the message arrived at or left the inbox.",
"examples": [
"inbound"
]
},
"status": {
"type": "string",
"enum": [
"received",
"queued",
"sent",
"delivered",
"bounced",
"complained",
"failed"
],
"description": "Delivery state for outbound, receipt state for inbound.",
"examples": [
"received"
]
},
"from": {
"type": "string",
"format": "email",
"description": "Envelope sender address.",
"examples": [
"dana@example.com"
],
"x-pii": true
},
"to": {
"type": "array",
"description": "Primary recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com"
]
]
},
"cc": {
"type": "array",
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[]
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Subject as received or sent.",
"examples": [
"Invoice 42"
]
},
"snippet": {
"type": "string",
"maxLength": 500,
"description": "Short plain-text preview used by list views.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"text": {
"type": [
"string",
"null"
],
"description": "Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"html": {
"type": [
"string",
"null"
],
"description": "Stored HTML body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"<p>Please pay the attached invoice by Friday.</p>"
]
},
"size_bytes": {
"type": "integer",
"minimum": 0,
"description": "Raw RFC 822 size in bytes.",
"examples": [
3272
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Receipt or send time in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/messages/{id}/replyReply in a thread.
Replies to the original sender inside the same thread and inbox, setting In-Reply-To. Recipients come from the thread, never from the request body.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
textrequired | string | Plain-text body. |
html | string | null | Optional HTML body. |
attachment_ids | array of string | Stored attachment identifiers to include. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable message identifier. |
thread_idrequired | string | Thread this message belongs to. |
inbox_idrequired | string | Inbox that sent or received this message. |
directionrequired | "inbound" | "outbound" | Whether the message arrived at or left the inbox. |
statusrequired | "received" | "queued" | "sent" | "delivered" | "bounced" | "complained" | "failed" | Delivery state for outbound, receipt state for inbound. |
fromrequired | string (email) | Envelope sender address. |
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject as received or sent. |
snippetrequired | string | Short plain-text preview used by list views. |
text | string | null | Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists. |
html | string | null | Stored HTML body. Present on single-message reads when the body was stored; omitted from lists. |
size_bytesrequired | integer | Raw RFC 822 size in bytes. |
created_atrequired | string (date-time) | Receipt or send time in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message-reply-request.json",
"title": "Reply request",
"description": "Replies in the same thread and inbox as the original message. Recipients come from the thread, not the body.",
"type": "object",
"additionalProperties": false,
"required": [
"text"
],
"properties": {
"text": {
"type": "string",
"maxLength": 1000000,
"description": "Plain-text body.",
"examples": [
"Thanks, received."
]
},
"html": {
"type": [
"string",
"null"
],
"maxLength": 1000000,
"description": "Optional HTML body.",
"examples": [
"<p>Thanks, received.</p>"
]
},
"attachment_ids": {
"type": "array",
"maxItems": 10,
"description": "Stored attachment identifiers to include.",
"items": {
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$"
},
"examples": [
[
"att_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message.json",
"title": "Message",
"description": "One email in a thread. Bodies are immutable; only labels and read state change.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"thread_id",
"inbox_id",
"direction",
"status",
"from",
"to",
"subject",
"snippet",
"size_bytes",
"created_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Stable message identifier.",
"examples": [
"msg_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread this message belongs to.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that sent or received this message.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Whether the message arrived at or left the inbox.",
"examples": [
"inbound"
]
},
"status": {
"type": "string",
"enum": [
"received",
"queued",
"sent",
"delivered",
"bounced",
"complained",
"failed"
],
"description": "Delivery state for outbound, receipt state for inbound.",
"examples": [
"received"
]
},
"from": {
"type": "string",
"format": "email",
"description": "Envelope sender address.",
"examples": [
"dana@example.com"
],
"x-pii": true
},
"to": {
"type": "array",
"description": "Primary recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com"
]
]
},
"cc": {
"type": "array",
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[]
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Subject as received or sent.",
"examples": [
"Invoice 42"
]
},
"snippet": {
"type": "string",
"maxLength": 500,
"description": "Short plain-text preview used by list views.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"text": {
"type": [
"string",
"null"
],
"description": "Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"html": {
"type": [
"string",
"null"
],
"description": "Stored HTML body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"<p>Please pay the attached invoice by Friday.</p>"
]
},
"size_bytes": {
"type": "integer",
"minimum": 0,
"description": "Raw RFC 822 size in bytes.",
"examples": [
3272
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Receipt or send time in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/messages/{id}/reply-allReply to everyone.
Replies to the sender and every other participant in the thread, excluding the inbox itself. Recipients always come from the thread.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
textrequired | string | Plain-text body. |
html | string | null | Optional HTML body. |
attachment_ids | array of string | Stored attachment identifiers to include. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable message identifier. |
thread_idrequired | string | Thread this message belongs to. |
inbox_idrequired | string | Inbox that sent or received this message. |
directionrequired | "inbound" | "outbound" | Whether the message arrived at or left the inbox. |
statusrequired | "received" | "queued" | "sent" | "delivered" | "bounced" | "complained" | "failed" | Delivery state for outbound, receipt state for inbound. |
fromrequired | string (email) | Envelope sender address. |
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject as received or sent. |
snippetrequired | string | Short plain-text preview used by list views. |
text | string | null | Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists. |
html | string | null | Stored HTML body. Present on single-message reads when the body was stored; omitted from lists. |
size_bytesrequired | integer | Raw RFC 822 size in bytes. |
created_atrequired | string (date-time) | Receipt or send time in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message-reply-request.json",
"title": "Reply request",
"description": "Replies in the same thread and inbox as the original message. Recipients come from the thread, not the body.",
"type": "object",
"additionalProperties": false,
"required": [
"text"
],
"properties": {
"text": {
"type": "string",
"maxLength": 1000000,
"description": "Plain-text body.",
"examples": [
"Thanks, received."
]
},
"html": {
"type": [
"string",
"null"
],
"maxLength": 1000000,
"description": "Optional HTML body.",
"examples": [
"<p>Thanks, received.</p>"
]
},
"attachment_ids": {
"type": "array",
"maxItems": 10,
"description": "Stored attachment identifiers to include.",
"items": {
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$"
},
"examples": [
[
"att_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message.json",
"title": "Message",
"description": "One email in a thread. Bodies are immutable; only labels and read state change.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"thread_id",
"inbox_id",
"direction",
"status",
"from",
"to",
"subject",
"snippet",
"size_bytes",
"created_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Stable message identifier.",
"examples": [
"msg_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread this message belongs to.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that sent or received this message.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Whether the message arrived at or left the inbox.",
"examples": [
"inbound"
]
},
"status": {
"type": "string",
"enum": [
"received",
"queued",
"sent",
"delivered",
"bounced",
"complained",
"failed"
],
"description": "Delivery state for outbound, receipt state for inbound.",
"examples": [
"received"
]
},
"from": {
"type": "string",
"format": "email",
"description": "Envelope sender address.",
"examples": [
"dana@example.com"
],
"x-pii": true
},
"to": {
"type": "array",
"description": "Primary recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com"
]
]
},
"cc": {
"type": "array",
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[]
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Subject as received or sent.",
"examples": [
"Invoice 42"
]
},
"snippet": {
"type": "string",
"maxLength": 500,
"description": "Short plain-text preview used by list views.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"text": {
"type": [
"string",
"null"
],
"description": "Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"html": {
"type": [
"string",
"null"
],
"description": "Stored HTML body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"<p>Please pay the attached invoice by Friday.</p>"
]
},
"size_bytes": {
"type": "integer",
"minimum": 0,
"description": "Raw RFC 822 size in bytes.",
"examples": [
3272
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Receipt or send time in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/messages/{id}/forwardForward a message.
Sends a copy to new recipients in a new thread. Unlike reply, the recipients come from the request.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
torequired | array of string | Recipients of the forward. |
cc | array of string | Copied recipients. |
textrequired | string | Plain-text body. |
html | string | null | Optional HTML body. |
attachment_ids | array of string | Stored attachments to include. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable message identifier. |
thread_idrequired | string | Thread this message belongs to. |
inbox_idrequired | string | Inbox that sent or received this message. |
directionrequired | "inbound" | "outbound" | Whether the message arrived at or left the inbox. |
statusrequired | "received" | "queued" | "sent" | "delivered" | "bounced" | "complained" | "failed" | Delivery state for outbound, receipt state for inbound. |
fromrequired | string (email) | Envelope sender address. |
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject as received or sent. |
snippetrequired | string | Short plain-text preview used by list views. |
text | string | null | Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists. |
html | string | null | Stored HTML body. Present on single-message reads when the body was stored; omitted from lists. |
size_bytesrequired | integer | Raw RFC 822 size in bytes. |
created_atrequired | string (date-time) | Receipt or send time in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Forward request",
"description": "Forwards a message to new recipients in a new thread. Recipients come from the request, unlike reply.",
"type": "object",
"additionalProperties": false,
"required": [
"to",
"text"
],
"properties": {
"to": {
"type": "array",
"minItems": 1,
"maxItems": 50,
"description": "Recipients of the forward.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"team@example.com"
]
]
},
"cc": {
"type": "array",
"maxItems": 50,
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[]
]
},
"text": {
"type": "string",
"maxLength": 1000000,
"description": "Plain-text body.",
"examples": [
"Forwarding this for visibility."
]
},
"html": {
"type": [
"string",
"null"
],
"maxLength": 1000000,
"description": "Optional HTML body.",
"examples": [
null
]
},
"attachment_ids": {
"type": "array",
"maxItems": 10,
"description": "Stored attachments to include.",
"items": {
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$"
},
"examples": [
[]
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message-forward-request.json"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message.json",
"title": "Message",
"description": "One email in a thread. Bodies are immutable; only labels and read state change.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"thread_id",
"inbox_id",
"direction",
"status",
"from",
"to",
"subject",
"snippet",
"size_bytes",
"created_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Stable message identifier.",
"examples": [
"msg_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread this message belongs to.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that sent or received this message.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Whether the message arrived at or left the inbox.",
"examples": [
"inbound"
]
},
"status": {
"type": "string",
"enum": [
"received",
"queued",
"sent",
"delivered",
"bounced",
"complained",
"failed"
],
"description": "Delivery state for outbound, receipt state for inbound.",
"examples": [
"received"
]
},
"from": {
"type": "string",
"format": "email",
"description": "Envelope sender address.",
"examples": [
"dana@example.com"
],
"x-pii": true
},
"to": {
"type": "array",
"description": "Primary recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com"
]
]
},
"cc": {
"type": "array",
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[]
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Subject as received or sent.",
"examples": [
"Invoice 42"
]
},
"snippet": {
"type": "string",
"maxLength": 500,
"description": "Short plain-text preview used by list views.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"text": {
"type": [
"string",
"null"
],
"description": "Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"html": {
"type": [
"string",
"null"
],
"description": "Stored HTML body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"<p>Please pay the attached invoice by Friday.</p>"
]
},
"size_bytes": {
"type": "integer",
"minimum": 0,
"description": "Raw RFC 822 size in bytes.",
"examples": [
3272
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Receipt or send time in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/messages/{id}/rawDownload the raw message.
Returns the original RFC 822 bytes from private storage.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}drafts
/v1/draftsList drafts.
Drafts ordered by last update, optionally filtered by inbox.
| Name | In | Type | Description |
|---|---|---|---|
inbox_id | query | string | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Drafts in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "inbox_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Only drafts in this inbox."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Draft list",
"description": "A cursor-paginated page of drafts, newest first.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"description": "Drafts in this page.",
"type": "array",
"items": {
"$ref": "https://schemas.agentmailbox.app/draft.json"
}
},
"next_cursor": {
"description": "Opaque cursor for the next page, or null.",
"type": [
"string",
"null"
],
"examples": [
null
]
},
"has_more": {
"description": "Whether another page exists.",
"type": "boolean",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/draft-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/draftsCreate a draft.
Stores an unsent message. Sending it later produces a normal outbound message with the same threading rules.
| Field | Type | Description |
|---|---|---|
inbox_idrequired | string | Stable inbox identifier. |
thread_id | string | null | Reply in this thread, or omit for a new message. |
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject line. |
textrequired | string | Plain-text body. |
html | string | null | Optional HTML body. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable draft identifier. |
inbox_idrequired | string | Stable inbox identifier. |
thread_idrequired | string | null | Thread this draft replies to, or null for a new message. |
torequired | array of string | Primary recipients. |
ccrequired | array of string | Copied recipients. |
subjectrequired | string | Subject line. |
textrequired | string | Plain-text body. |
htmlrequired | string | null | Optional HTML body. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Create draft request",
"description": "Creates an unsent message in an inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"inbox_id",
"to",
"subject",
"text"
],
"properties": {
"inbox_id": {
"description": "Stable inbox identifier.",
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"description": "Reply in this thread, or omit for a new message.",
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"examples": [
null
]
},
"to": {
"description": "Primary recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"cc": {
"description": "Copied recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"subject": {
"description": "Subject line.",
"type": "string",
"minLength": 1,
"maxLength": 998,
"examples": [
"Invoice 42"
]
},
"text": {
"description": "Plain-text body.",
"type": "string",
"maxLength": 1000000,
"examples": [
"Payment is on its way."
]
},
"html": {
"description": "Optional HTML body.",
"type": [
"string",
"null"
],
"maxLength": 1000000,
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/draft-create-request.json"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Draft",
"description": "An unsent message. Sending it creates a Message in the same inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"to",
"cc",
"subject",
"text",
"html",
"created_at",
"updated_at"
],
"properties": {
"id": {
"description": "Stable draft identifier.",
"type": "string",
"pattern": "^drf_[0-9A-Za-z]{20,}$",
"examples": [
"drf_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"description": "Stable inbox identifier.",
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"description": "Thread this draft replies to, or null for a new message.",
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"examples": [
null
]
},
"to": {
"description": "Primary recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"cc": {
"description": "Copied recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"subject": {
"description": "Subject line.",
"type": "string",
"maxLength": 998,
"examples": [
"Invoice 42"
]
},
"text": {
"description": "Plain-text body.",
"type": "string",
"maxLength": 1000000,
"examples": [
"Payment is on its way."
]
},
"html": {
"description": "Optional HTML body.",
"type": [
"string",
"null"
],
"maxLength": 1000000,
"examples": [
null
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/draft.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/drafts/{id}Get one draft.
Returns the draft body and its target thread, if any.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable draft identifier. |
inbox_idrequired | string | Stable inbox identifier. |
thread_idrequired | string | null | Thread this draft replies to, or null for a new message. |
torequired | array of string | Primary recipients. |
ccrequired | array of string | Copied recipients. |
subjectrequired | string | Subject line. |
textrequired | string | Plain-text body. |
htmlrequired | string | null | Optional HTML body. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^drf_[0-9A-Za-z]{20,}$",
"description": "Draft identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Draft",
"description": "An unsent message. Sending it creates a Message in the same inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"to",
"cc",
"subject",
"text",
"html",
"created_at",
"updated_at"
],
"properties": {
"id": {
"description": "Stable draft identifier.",
"type": "string",
"pattern": "^drf_[0-9A-Za-z]{20,}$",
"examples": [
"drf_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"description": "Stable inbox identifier.",
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"description": "Thread this draft replies to, or null for a new message.",
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"examples": [
null
]
},
"to": {
"description": "Primary recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"cc": {
"description": "Copied recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"subject": {
"description": "Subject line.",
"type": "string",
"maxLength": 998,
"examples": [
"Invoice 42"
]
},
"text": {
"description": "Plain-text body.",
"type": "string",
"maxLength": 1000000,
"examples": [
"Payment is on its way."
]
},
"html": {
"description": "Optional HTML body.",
"type": [
"string",
"null"
],
"maxLength": 1000000,
"examples": [
null
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/draft.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/drafts/{id}Update a draft.
Changes recipients, subject, or body. Omitted fields are unchanged.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
to | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subject | string | Subject line. |
text | string | Plain-text body. |
html | string | null | Optional HTML body. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable draft identifier. |
inbox_idrequired | string | Stable inbox identifier. |
thread_idrequired | string | null | Thread this draft replies to, or null for a new message. |
torequired | array of string | Primary recipients. |
ccrequired | array of string | Copied recipients. |
subjectrequired | string | Subject line. |
textrequired | string | Plain-text body. |
htmlrequired | string | null | Optional HTML body. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^drf_[0-9A-Za-z]{20,}$",
"description": "Draft identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Update draft request",
"description": "Changes draft fields. Omitted fields are unchanged.",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"to": {
"description": "Primary recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"cc": {
"description": "Copied recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"subject": {
"description": "Subject line.",
"type": "string",
"minLength": 1,
"maxLength": 998,
"examples": [
"Invoice 42"
]
},
"text": {
"description": "Plain-text body.",
"type": "string",
"maxLength": 1000000,
"examples": [
"Payment is on its way."
]
},
"html": {
"description": "Optional HTML body.",
"type": [
"string",
"null"
],
"maxLength": 1000000,
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/draft-update-request.json"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Draft",
"description": "An unsent message. Sending it creates a Message in the same inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"to",
"cc",
"subject",
"text",
"html",
"created_at",
"updated_at"
],
"properties": {
"id": {
"description": "Stable draft identifier.",
"type": "string",
"pattern": "^drf_[0-9A-Za-z]{20,}$",
"examples": [
"drf_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"description": "Stable inbox identifier.",
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"description": "Thread this draft replies to, or null for a new message.",
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"examples": [
null
]
},
"to": {
"description": "Primary recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"cc": {
"description": "Copied recipients.",
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"dana@example.com"
]
]
},
"subject": {
"description": "Subject line.",
"type": "string",
"maxLength": 998,
"examples": [
"Invoice 42"
]
},
"text": {
"description": "Plain-text body.",
"type": "string",
"maxLength": 1000000,
"examples": [
"Payment is on its way."
]
},
"html": {
"description": "Optional HTML body.",
"type": [
"string",
"null"
],
"maxLength": 1000000,
"examples": [
null
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/draft.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/drafts/{id}Delete a draft.
Discards the draft without sending it.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^drf_[0-9A-Za-z]{20,}$",
"description": "Draft identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/drafts/{id}/sendSend a draft.
Sends the stored draft and returns the created message. A failed provider send leaves the message queued.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable message identifier. |
thread_idrequired | string | Thread this message belongs to. |
inbox_idrequired | string | Inbox that sent or received this message. |
directionrequired | "inbound" | "outbound" | Whether the message arrived at or left the inbox. |
statusrequired | "received" | "queued" | "sent" | "delivered" | "bounced" | "complained" | "failed" | Delivery state for outbound, receipt state for inbound. |
fromrequired | string (email) | Envelope sender address. |
torequired | array of string | Primary recipients. |
cc | array of string | Copied recipients. |
subjectrequired | string | Subject as received or sent. |
snippetrequired | string | Short plain-text preview used by list views. |
text | string | null | Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists. |
html | string | null | Stored HTML body. Present on single-message reads when the body was stored; omitted from lists. |
size_bytesrequired | integer | Raw RFC 822 size in bytes. |
created_atrequired | string (date-time) | Receipt or send time in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^drf_[0-9A-Za-z]{20,}$",
"description": "Draft identifier."
}
}
],
"requestBody": null,
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/message.json",
"title": "Message",
"description": "One email in a thread. Bodies are immutable; only labels and read state change.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"thread_id",
"inbox_id",
"direction",
"status",
"from",
"to",
"subject",
"snippet",
"size_bytes",
"created_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Stable message identifier.",
"examples": [
"msg_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread this message belongs to.",
"examples": [
"thr_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that sent or received this message.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"direction": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Whether the message arrived at or left the inbox.",
"examples": [
"inbound"
]
},
"status": {
"type": "string",
"enum": [
"received",
"queued",
"sent",
"delivered",
"bounced",
"complained",
"failed"
],
"description": "Delivery state for outbound, receipt state for inbound.",
"examples": [
"received"
]
},
"from": {
"type": "string",
"format": "email",
"description": "Envelope sender address.",
"examples": [
"dana@example.com"
],
"x-pii": true
},
"to": {
"type": "array",
"description": "Primary recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[
"support@acme.com"
]
]
},
"cc": {
"type": "array",
"description": "Copied recipients.",
"items": {
"type": "string",
"format": "email"
},
"examples": [
[]
]
},
"subject": {
"type": "string",
"maxLength": 998,
"description": "Subject as received or sent.",
"examples": [
"Invoice 42"
]
},
"snippet": {
"type": "string",
"maxLength": 500,
"description": "Short plain-text preview used by list views.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"text": {
"type": [
"string",
"null"
],
"description": "Stored plain-text body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"Please pay the attached invoice by Friday."
]
},
"html": {
"type": [
"string",
"null"
],
"description": "Stored HTML body. Present on single-message reads when the body was stored; omitted from lists.",
"examples": [
"<p>Please pay the attached invoice by Friday.</p>"
]
},
"size_bytes": {
"type": "integer",
"minimum": 0,
"description": "Raw RFC 822 size in bytes.",
"examples": [
3272
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Receipt or send time in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}labels
/v1/labelsList labels.
Workspace labels ordered by name.
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Labels in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Label list",
"description": "A cursor-paginated page of labels, ordered by name.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"description": "Labels in this page.",
"type": "array",
"items": {
"$ref": "https://schemas.agentmailbox.app/label.json"
}
},
"next_cursor": {
"description": "Opaque cursor for the next page, or null.",
"type": [
"string",
"null"
],
"examples": [
null
]
},
"has_more": {
"description": "Whether another page exists.",
"type": "boolean",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/label-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/labelsCreate a label.
Creates a workspace label used to group threads.
| Field | Type | Description |
|---|---|---|
namerequired | string | Label name, unique per workspace. |
color | string | null | Hex color. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable label identifier. |
namerequired | string | Label name, unique per workspace. |
colorrequired | string | null | Hex color or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Create label request",
"description": "Creates a workspace label.",
"type": "object",
"additionalProperties": false,
"required": [
"name"
],
"properties": {
"name": {
"description": "Label name, unique per workspace.",
"type": "string",
"minLength": 1,
"maxLength": 64,
"examples": [
"billing"
]
},
"color": {
"description": "Hex color.",
"type": [
"string",
"null"
],
"pattern": "^#[0-9a-fA-F]{6}$",
"examples": [
"#2563eb"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/label-create-request.json"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Label",
"description": "A workspace label that can be attached to threads.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"color",
"created_at",
"updated_at"
],
"properties": {
"id": {
"description": "Stable label identifier.",
"type": "string",
"pattern": "^lbl_[0-9A-Za-z]{20,}$",
"examples": [
"lbl_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"description": "Label name, unique per workspace.",
"type": "string",
"minLength": 1,
"maxLength": 64,
"examples": [
"billing"
]
},
"color": {
"description": "Hex color or null.",
"type": [
"string",
"null"
],
"pattern": "^#[0-9a-fA-F]{6}$",
"examples": [
"#2563eb"
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/label.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/labels/{id}Update a label.
Renames or recolors a label.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
name | string | Label name, unique per workspace. |
color | string | null | Hex color. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable label identifier. |
namerequired | string | Label name, unique per workspace. |
colorrequired | string | null | Hex color or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^lbl_[0-9A-Za-z]{20,}$",
"description": "Label identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Update label request",
"description": "Renames or recolors a label.",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"name": {
"description": "Label name, unique per workspace.",
"type": "string",
"minLength": 1,
"maxLength": 64,
"examples": [
"billing"
]
},
"color": {
"description": "Hex color.",
"type": [
"string",
"null"
],
"pattern": "^#[0-9a-fA-F]{6}$",
"examples": [
"#2563eb"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/label-update-request.json"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Label",
"description": "A workspace label that can be attached to threads.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"color",
"created_at",
"updated_at"
],
"properties": {
"id": {
"description": "Stable label identifier.",
"type": "string",
"pattern": "^lbl_[0-9A-Za-z]{20,}$",
"examples": [
"lbl_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"description": "Label name, unique per workspace.",
"type": "string",
"minLength": 1,
"maxLength": 64,
"examples": [
"billing"
]
},
"color": {
"description": "Hex color or null.",
"type": [
"string",
"null"
],
"pattern": "^#[0-9a-fA-F]{6}$",
"examples": [
"#2563eb"
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/label.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/labels/{id}Delete a label.
Removes the label and detaches it from every thread.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^lbl_[0-9A-Za-z]{20,}$",
"description": "Label identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/threads/{id}/labelsList thread labels.
Labels currently attached to a thread.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Labels in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Label list",
"description": "A cursor-paginated page of labels, ordered by name.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"description": "Labels in this page.",
"type": "array",
"items": {
"$ref": "https://schemas.agentmailbox.app/label.json"
}
},
"next_cursor": {
"description": "Opaque cursor for the next page, or null.",
"type": [
"string",
"null"
],
"examples": [
null
]
},
"has_more": {
"description": "Whether another page exists.",
"type": "boolean",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/label-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/threads/{id}/labelsAdd a label to a thread.
Attaches one label; adding an existing label is a no-op.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
label_idrequired | string | Label to attach. |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Labels in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"label_id"
],
"properties": {
"label_id": {
"type": "string",
"pattern": "^lbl_[0-9A-Za-z]{20,}$",
"description": "Label to attach.",
"examples": [
"lbl_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Label list",
"description": "A cursor-paginated page of labels, ordered by name.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"description": "Labels in this page.",
"type": "array",
"items": {
"$ref": "https://schemas.agentmailbox.app/label.json"
}
},
"next_cursor": {
"description": "Opaque cursor for the next page, or null.",
"type": [
"string",
"null"
],
"examples": [
null
]
},
"has_more": {
"description": "Whether another page exists.",
"type": "boolean",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/label-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/threads/{id}/labels/{label_id}Remove a label from a thread.
Detaches one label from a thread.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
label_idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread identifier."
}
},
{
"name": "label_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^lbl_[0-9A-Za-z]{20,}$",
"description": "Label identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}attachments
/v1/attachmentsUpload an attachment.
Stores a file privately and returns a time-limited URL. Accepts JSON with a remote URL or base64 content, or raw bytes with content-type application/octet-stream.
| Name | In | Type | Description |
|---|---|---|---|
filename | query | string | |
content_type | query | string | |
retention_days | query | integer |
| Field | Type | Description |
|---|---|---|
filenamerequired | string | Filename to store. |
url | string (uri) | Public HTTPS URL to fetch once. |
content | string | Base64 content. |
content_type | string | Media type override. |
retention_days | 7 | 30 | 90 | 365 = 7 | Retention tier in days. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable attachment identifier. |
filenamerequired | string | Original filename. |
content_typerequired | string | IANA media type. |
size_bytesrequired | integer | Size in bytes. |
urlrequired | string | null (uri) | Time-limited download URL, or null when storage is unavailable. |
expires_atrequired | string (date-time) | Timestamp in UTC. |
created_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "filename",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 255,
"description": "Filename for a raw application/octet-stream upload.",
"examples": [
"invoice.pdf"
]
}
},
{
"name": "content_type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 128,
"description": "Media type for a raw application/octet-stream upload.",
"examples": [
"application/pdf"
]
}
},
{
"name": "retention_days",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"enum": [
7,
30,
90,
365
],
"description": "Retention tier for a raw application/octet-stream upload.",
"examples": [
7
]
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Create attachment request",
"description": "Uploads a file by remote URL or by base64 content. Raw bytes are accepted with content-type application/octet-stream.",
"type": "object",
"additionalProperties": false,
"required": [
"filename"
],
"anyOf": [
{
"required": [
"url"
]
},
{
"required": [
"content"
]
}
],
"properties": {
"filename": {
"description": "Filename to store.",
"type": "string",
"minLength": 1,
"maxLength": 255,
"examples": [
"invoice.pdf"
]
},
"url": {
"description": "Public HTTPS URL to fetch once.",
"type": "string",
"format": "uri",
"maxLength": 2048,
"examples": [
"https://example.com/invoice.pdf"
]
},
"content": {
"description": "Base64 content.",
"type": "string",
"maxLength": 34952534,
"examples": [
"JVBERi0xLjQK"
]
},
"content_type": {
"description": "Media type override.",
"type": "string",
"maxLength": 128,
"examples": [
"application/pdf"
]
},
"retention_days": {
"description": "Retention tier in days.",
"type": "integer",
"enum": [
7,
30,
90,
365
],
"default": 7,
"examples": [
7
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/attachment-create-request.json"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Attachment",
"description": "A file stored privately for later send or download.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"filename",
"content_type",
"size_bytes",
"url",
"expires_at",
"created_at"
],
"properties": {
"id": {
"description": "Stable attachment identifier.",
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$",
"examples": [
"att_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"filename": {
"description": "Original filename.",
"type": "string",
"minLength": 1,
"maxLength": 255,
"examples": [
"invoice.pdf"
]
},
"content_type": {
"description": "IANA media type.",
"type": "string",
"maxLength": 128,
"examples": [
"application/pdf"
]
},
"size_bytes": {
"description": "Size in bytes.",
"type": "integer",
"minimum": 0,
"maximum": 26214400,
"examples": [
12034
]
},
"url": {
"description": "Time-limited download URL, or null when storage is unavailable.",
"type": [
"string",
"null"
],
"format": "uri",
"examples": [
"https://api.agentmailbox.app/v1/attachments/att_x/download?exp=1&sig=abc"
]
},
"expires_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/attachment.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/attachments/{id}Get attachment metadata.
Returns filename, size, and a signed download URL.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable attachment identifier. |
filenamerequired | string | Original filename. |
content_typerequired | string | IANA media type. |
size_bytesrequired | integer | Size in bytes. |
urlrequired | string | null (uri) | Time-limited download URL, or null when storage is unavailable. |
expires_atrequired | string (date-time) | Timestamp in UTC. |
created_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$",
"description": "Attachment identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Attachment",
"description": "A file stored privately for later send or download.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"filename",
"content_type",
"size_bytes",
"url",
"expires_at",
"created_at"
],
"properties": {
"id": {
"description": "Stable attachment identifier.",
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$",
"examples": [
"att_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"filename": {
"description": "Original filename.",
"type": "string",
"minLength": 1,
"maxLength": 255,
"examples": [
"invoice.pdf"
]
},
"content_type": {
"description": "IANA media type.",
"type": "string",
"maxLength": 128,
"examples": [
"application/pdf"
]
},
"size_bytes": {
"description": "Size in bytes.",
"type": "integer",
"minimum": 0,
"maximum": 26214400,
"examples": [
12034
]
},
"url": {
"description": "Time-limited download URL, or null when storage is unavailable.",
"type": [
"string",
"null"
],
"format": "uri",
"examples": [
"https://api.agentmailbox.app/v1/attachments/att_x/download?exp=1&sig=abc"
]
},
"expires_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/attachment.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/attachments/{id}Delete an attachment.
Removes the stored object before its retention expires.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^att_[0-9A-Za-z]{20,}$",
"description": "Attachment identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}webhooks
/v1/webhooksList webhooks.
Returns endpoints and their subscriptions. Signing secrets are never returned.
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Webhooks in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null when exhausted. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/webhook-list-response.json",
"title": "Webhook list",
"description": "A cursor-paginated page of webhooks.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Webhooks in this page.",
"items": {
"$ref": "https://schemas.agentmailbox.app/webhook.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor for the next page, or null when exhausted.",
"examples": [
"cur_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/webhooksCreate a webhook.
Registers an HTTPS endpoint and returns it with a signing secret shown exactly once.
| Field | Type | Description |
|---|---|---|
urlrequired | string (uri) | HTTPS endpoint that receives deliveries. HTTP and private addresses are rejected. |
eventsrequired | array of "message.received" | "message.sent" | "message.delivered" | "message.bounced" | "thread.created" | "thread.updated" | "domain.verified" | "inbox.created" | "webhook.test" | Event types to subscribe to. |
description | string | null | Operator note for this endpoint. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable webhook identifier. |
urlrequired | string (uri) | HTTPS endpoint that receives deliveries. |
eventsrequired | array of "message.received" | "message.sent" | "message.delivered" | "message.bounced" | "thread.created" | "thread.updated" | "domain.verified" | "inbox.created" | "webhook.test" | Event types this endpoint subscribes to. |
statusrequired | "active" | "disabled" | Whether deliveries are attempted. |
description | string | null | Operator note for this endpoint. |
created_atrequired | string (date-time) | Creation timestamp in UTC. |
updated_atrequired | string (date-time) | Last update timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/webhook-create-request.json",
"title": "Create webhook request",
"description": "Registers an HTTPS endpoint for signed event deliveries.",
"type": "object",
"additionalProperties": false,
"required": [
"url",
"events"
],
"properties": {
"url": {
"type": "string",
"format": "uri",
"pattern": "^https://",
"maxLength": 2048,
"description": "HTTPS endpoint that receives deliveries. HTTP and private addresses are rejected.",
"examples": [
"https://acme.com/hooks/agentmailbox"
]
},
"events": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"description": "Event types to subscribe to.",
"items": {
"type": "string",
"enum": [
"message.received",
"message.sent",
"message.delivered",
"message.bounced",
"thread.created",
"thread.updated",
"domain.verified",
"inbox.created",
"webhook.test"
]
},
"examples": [
[
"message.received"
]
]
},
"description": {
"type": [
"string",
"null"
],
"maxLength": 200,
"description": "Operator note for this endpoint.",
"examples": [
"Primary agent hook"
]
}
}
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/webhook.json",
"title": "Webhook",
"description": "An HTTPS endpoint that receives signed event deliveries for this workspace.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"url",
"events",
"status",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"description": "Stable webhook identifier.",
"examples": [
"whk_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"url": {
"type": "string",
"format": "uri",
"pattern": "^https://",
"maxLength": 2048,
"description": "HTTPS endpoint that receives deliveries.",
"examples": [
"https://acme.com/hooks/agentmailbox"
]
},
"events": {
"type": "array",
"minItems": 1,
"description": "Event types this endpoint subscribes to.",
"items": {
"type": "string",
"enum": [
"message.received",
"message.sent",
"message.delivered",
"message.bounced",
"thread.created",
"thread.updated",
"domain.verified",
"inbox.created",
"webhook.test"
]
},
"examples": [
[
"message.received",
"message.bounced"
]
]
},
"status": {
"type": "string",
"enum": [
"active",
"disabled"
],
"description": "Whether deliveries are attempted.",
"examples": [
"active"
]
},
"description": {
"type": [
"string",
"null"
],
"maxLength": 200,
"description": "Operator note for this endpoint.",
"examples": [
"Primary agent hook"
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Creation timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/webhooks/{id}Delete a webhook.
Stops deliveries and removes the endpoint.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"description": "Webhook identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/webhooks/{id}/deliveriesList webhook deliveries.
Attempt history for one endpoint, newest first.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Deliveries in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"description": "Webhook identifier."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Delivery list",
"description": "A cursor-paginated page of deliveries, newest first.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"description": "Deliveries in this page.",
"type": "array",
"items": {
"$ref": "https://schemas.agentmailbox.app/delivery.json"
}
},
"next_cursor": {
"description": "Opaque cursor for the next page, or null.",
"type": [
"string",
"null"
],
"examples": [
null
]
},
"has_more": {
"description": "Whether another page exists.",
"type": "boolean",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/delivery-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/deliveries/{id}/replayReplay a delivery.
Re-sends the original event to the same endpoint and returns the new delivery state.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable delivery identifier. |
webhook_idrequired | string | Stable webhook identifier. |
event_idrequired | string | Stable event identifier. |
statusrequired | "pending" | "delivered" | "failed" | Delivery state. |
attemptsrequired | integer | Attempts made so far. |
response_coderequired | integer | null | Last HTTP status returned by the endpoint. |
next_attempt_atrequired | string | null (date-time) | When the next retry is due, or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^dlv_[0-9A-Za-z]{20,}$",
"description": "Delivery identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Webhook delivery",
"description": "One attempt series for a webhook event.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"webhook_id",
"event_id",
"status",
"attempts",
"response_code",
"next_attempt_at",
"created_at"
],
"properties": {
"id": {
"description": "Stable delivery identifier.",
"type": "string",
"pattern": "^dlv_[0-9A-Za-z]{20,}$",
"examples": [
"dlv_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"webhook_id": {
"description": "Stable webhook identifier.",
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"examples": [
"whk_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"event_id": {
"description": "Stable event identifier.",
"type": "string",
"pattern": "^evt_[0-9A-Za-z]{20,}$",
"examples": [
"evt_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"status": {
"description": "Delivery state.",
"type": "string",
"enum": [
"pending",
"delivered",
"failed"
],
"examples": [
"delivered"
]
},
"attempts": {
"description": "Attempts made so far.",
"type": "integer",
"minimum": 0,
"examples": [
1
]
},
"response_code": {
"description": "Last HTTP status returned by the endpoint.",
"type": [
"integer",
"null"
],
"minimum": 100,
"maximum": 599,
"examples": [
200
]
},
"next_attempt_at": {
"description": "When the next retry is due, or null.",
"type": [
"string",
"null"
],
"format": "date-time",
"examples": [
null
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/delivery.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/webhooks/{id}/rotate-secretRotate a webhook secret.
Issues a new signing secret and returns it once. The previous secret stops working immediately.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Webhook identifier. |
secretrequired | string | New signing secret. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"description": "Webhook identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Webhook secret",
"description": "A newly rotated signing secret. It is shown exactly once.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"secret"
],
"properties": {
"id": {
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"description": "Webhook identifier.",
"examples": [
"whk_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"secret": {
"type": "string",
"description": "New signing secret.",
"examples": [
"whsec_9f2b0c1d"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/webhook-secret.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/webhooks/{id}/testSend a test delivery.
Creates a webhook.test event and a delivery for this endpoint, then attempts it immediately.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable delivery identifier. |
webhook_idrequired | string | Stable webhook identifier. |
event_idrequired | string | Stable event identifier. |
statusrequired | "pending" | "delivered" | "failed" | Delivery state. |
attemptsrequired | integer | Attempts made so far. |
response_coderequired | integer | null | Last HTTP status returned by the endpoint. |
next_attempt_atrequired | string | null (date-time) | When the next retry is due, or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"description": "Webhook identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Webhook delivery",
"description": "One attempt series for a webhook event.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"webhook_id",
"event_id",
"status",
"attempts",
"response_code",
"next_attempt_at",
"created_at"
],
"properties": {
"id": {
"description": "Stable delivery identifier.",
"type": "string",
"pattern": "^dlv_[0-9A-Za-z]{20,}$",
"examples": [
"dlv_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"webhook_id": {
"description": "Stable webhook identifier.",
"type": "string",
"pattern": "^whk_[0-9A-Za-z]{20,}$",
"examples": [
"whk_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"event_id": {
"description": "Stable event identifier.",
"type": "string",
"pattern": "^evt_[0-9A-Za-z]{20,}$",
"examples": [
"evt_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"status": {
"description": "Delivery state.",
"type": "string",
"enum": [
"pending",
"delivered",
"failed"
],
"examples": [
"delivered"
]
},
"attempts": {
"description": "Attempts made so far.",
"type": "integer",
"minimum": 0,
"examples": [
1
]
},
"response_code": {
"description": "Last HTTP status returned by the endpoint.",
"type": [
"integer",
"null"
],
"minimum": 100,
"maximum": 599,
"examples": [
200
]
},
"next_attempt_at": {
"description": "When the next retry is due, or null.",
"type": [
"string",
"null"
],
"format": "date-time",
"examples": [
null
]
},
"created_at": {
"description": "Timestamp in UTC.",
"type": "string",
"format": "date-time",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/delivery.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}events
/v1/eventsList events.
Events in sequence order, usable as a pull cursor when webhooks are not delivering.
| Name | In | Type | Description |
|---|---|---|---|
after | query | integer | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Events in this page. |
next_cursorrequired | string | null | Opaque cursor for the next page, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "after",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"description": "Return events with a greater sequence.",
"examples": [
41
]
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Event list",
"description": "A cursor-paginated page of events, oldest first.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"description": "Events in this page.",
"type": "array",
"items": {
"$ref": "https://schemas.agentmailbox.app/event.json"
}
},
"next_cursor": {
"description": "Opaque cursor for the next page, or null.",
"type": [
"string",
"null"
],
"examples": [
null
]
},
"has_more": {
"description": "Whether another page exists.",
"type": "boolean",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/event-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}lists
/v1/lists/{direction}/{type}List allow/block entries.
Returns every entry on one directional list. Inbound entries reject matching senders; outbound entries refuse matching recipients.
| Name | In | Type | Description |
|---|---|---|---|
directionrequired | path | string | |
typerequired | path | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Entries on the list. |
next_cursorrequired | string | null | Always null; lists are not paginated. |
has_morerequired | boolean | Always false. |
moderequired | "block" | "allow" | block rejects listed values; allow accepts only listed values. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "direction",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Which list: inbound blocks senders, outbound blocks recipients."
}
},
{
"name": "type",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"address",
"domain"
],
"description": "Whether entries are full addresses or domains."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "List entries",
"description": "All entries on one list.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more",
"mode"
],
"properties": {
"data": {
"type": "array",
"description": "Entries on the list.",
"items": {
"$ref": "https://schemas.agentmailbox.app/list-entry.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Always null; lists are not paginated.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Always false.",
"examples": [
false
]
},
"mode": {
"type": "string",
"enum": [
"block",
"allow"
],
"description": "block rejects listed values; allow accepts only listed values.",
"examples": [
"block"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/lists/{direction}/{type}Add a list entry.
Adds an address or domain to an allow/block list. Repeating an entry is a no-op.
| Name | In | Type | Description |
|---|---|---|---|
directionrequired | path | string | |
typerequired | path | string |
| Field | Type | Description |
|---|---|---|
valuerequired | string | Address or domain to add. |
| Field | Type | Description |
|---|---|---|
valuerequired | string | Address or domain this entry matches. |
created_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "direction",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Which list: inbound blocks senders, outbound blocks recipients."
}
},
{
"name": "type",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"address",
"domain"
],
"description": "Whether entries are full addresses or domains."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Add list entry request",
"description": "Adds one address or domain to a list.",
"type": "object",
"additionalProperties": false,
"required": [
"value"
],
"properties": {
"value": {
"type": "string",
"minLength": 3,
"maxLength": 320,
"description": "Address or domain to add.",
"examples": [
"dana@example.com"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/list-add-request.json"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "List entry",
"description": "One address or domain on an allow or block list.",
"type": "object",
"additionalProperties": false,
"required": [
"value",
"created_at"
],
"properties": {
"value": {
"type": "string",
"maxLength": 320,
"description": "Address or domain this entry matches.",
"examples": [
"dana@example.com"
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/list-entry.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/lists/{direction}/{type}/{value}Remove a list entry.
Removes one address or domain from a list.
| Name | In | Type | Description |
|---|---|---|---|
directionrequired | path | string | |
typerequired | path | string | |
valuerequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "direction",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Which list: inbound blocks senders, outbound blocks recipients."
}
},
{
"name": "type",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"address",
"domain"
],
"description": "Whether entries are full addresses or domains."
}
},
{
"name": "value",
"in": "path",
"required": true,
"schema": {
"type": "string",
"maxLength": 320,
"description": "Entry value to remove.",
"examples": [
"dana@example.com"
]
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/lists/{direction}/{type}/modeSet list mode.
Switches a list between block (reject listed values) and allow (accept only listed values). An allow list with no entries blocks everything.
| Name | In | Type | Description |
|---|---|---|---|
directionrequired | path | string | |
typerequired | path | string |
| Field | Type | Description |
|---|---|---|
moderequired | "block" | "allow" | List mode. |
| Field | Type | Description |
|---|---|---|
moderequired | "block" | "allow" | List mode. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "direction",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"inbound",
"outbound"
],
"description": "Which list."
}
},
{
"name": "type",
"in": "path",
"required": true,
"schema": {
"type": "string",
"enum": [
"address",
"domain"
],
"description": "Address or domain entries."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/list-mode.json",
"title": "List mode",
"description": "Whether the list blocks listed values or allows only them.",
"type": "object",
"additionalProperties": false,
"required": [
"mode"
],
"properties": {
"mode": {
"type": "string",
"enum": [
"block",
"allow"
],
"description": "List mode.",
"examples": [
"allow"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/list-mode.json",
"title": "List mode",
"description": "Whether the list blocks listed values or allows only them.",
"type": "object",
"additionalProperties": false,
"required": [
"mode"
],
"properties": {
"mode": {
"type": "string",
"enum": [
"block",
"allow"
],
"description": "List mode.",
"examples": [
"allow"
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}audit
/v1/auditList audit events.
Append-only allow and deny decisions, newest first. Admin scope only.
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Events in this page. |
next_cursorrequired | string | null | Opaque cursor, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"description": "Page size.",
"default": 50
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Audit list",
"description": "A cursor-paginated page of audit events, newest first.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Events in this page.",
"items": {
"$ref": "https://schemas.agentmailbox.app/audit-event.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor, or null.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/audit-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}automation
/v1/inboxes/{id}/automationGet inbox automation.
Returns the command template that runs for every stored inbound message, or null when disabled.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
commandrequired | string | null | Shell command template. Supports {{message_id}}, {{thread_id}}, {{subject}}, {{from}}, and {{text}}. |
replyrequired | boolean | Reserved: reply with the run output when it succeeds. Not implemented yet. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox-automation.json",
"title": "Inbox automation",
"description": "The command that runs for every stored inbound message on an inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"command",
"reply"
],
"properties": {
"command": {
"type": [
"string",
"null"
],
"maxLength": 4000,
"description": "Shell command template. Supports {{message_id}}, {{thread_id}}, {{subject}}, {{from}}, and {{text}}.",
"examples": [
"printf '%s' \"{{subject}}\" > artifacts/subject.txt"
]
},
"reply": {
"type": "boolean",
"description": "Reserved: reply with the run output when it succeeds. Not implemented yet.",
"examples": [
false
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/inboxes/{id}/automationSet inbox automation.
Sets the shell command that runs for every stored inbound message, with the message substituted into the template. Pass null to disable.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
commandrequired | string | null | Command template, or null to disable. |
reply | boolean | Reserved for auto-reply. |
| Field | Type | Description |
|---|---|---|
commandrequired | string | null | Shell command template. Supports {{message_id}}, {{thread_id}}, {{subject}}, {{from}}, and {{text}}. |
replyrequired | boolean | Reserved: reply with the run output when it succeeds. Not implemented yet. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox-automation-request.json",
"title": "Set inbox automation",
"description": "Sets or clears the command that runs for inbound mail.",
"type": "object",
"additionalProperties": false,
"required": [
"command"
],
"properties": {
"command": {
"type": [
"string",
"null"
],
"maxLength": 4000,
"description": "Command template, or null to disable.",
"examples": [
"mkdir -p artifacts && printf '{{subject}}' > artifacts/subject.txt"
]
},
"reply": {
"type": "boolean",
"description": "Reserved for auto-reply.",
"examples": [
false
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/inbox-automation.json",
"title": "Inbox automation",
"description": "The command that runs for every stored inbound message on an inbox.",
"type": "object",
"additionalProperties": false,
"required": [
"command",
"reply"
],
"properties": {
"command": {
"type": [
"string",
"null"
],
"maxLength": 4000,
"description": "Shell command template. Supports {{message_id}}, {{thread_id}}, {{subject}}, {{from}}, and {{text}}.",
"examples": [
"printf '%s' \"{{subject}}\" > artifacts/subject.txt"
]
},
"reply": {
"type": "boolean",
"description": "Reserved: reply with the run output when it succeeds. Not implemented yet.",
"examples": [
false
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}channels
/v1/channelsList channels.
Channels configured for this workspace, with their connection state. Credentials are never returned.
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Channels. |
next_cursorrequired | string | null | Always null. |
has_morerequired | boolean | Always false. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Channel list",
"description": "Configured channels for the workspace.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Channels.",
"items": {
"$ref": "https://schemas.agentmailbox.app/channel.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Always null.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Always false.",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/channel-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/channelsConnect a channel.
Starts a connection into an inbox. Gmail returns an OAuth URL; Telegram returns a deep link that binds a chat.
| Field | Type | Description |
|---|---|---|
providerrequired | "email" | "telegram" | "gmail" | Provider to connect. Gmail is retired for self-serve connections. |
inbox_idrequired | string | Inbox that receives the messages. |
address | string (email) | Email only: the address that will send commands and receive replies. Required when provider is email. |
| Field | Type | Description |
|---|---|---|
channelrequired | object | The channel that was created, still pending until the provider confirms. |
auth_urlrequired | string | null (uri) | Retired Gmail OAuth URL. Always null for email and Telegram. |
connect_urlrequired | string | null (uri) | Deep link that binds a chat for Telegram, null otherwise. |
verify_sentrequired | boolean | null | Email only: whether the confirmation link was handed to the mail provider. Null for other providers. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Connect channel request",
"description": "Starts a connection for one provider into one inbox. Email sends a confirmation link to the address; Telegram returns a deep link.",
"type": "object",
"additionalProperties": false,
"required": [
"provider",
"inbox_id"
],
"properties": {
"provider": {
"type": "string",
"enum": [
"email",
"telegram",
"gmail"
],
"description": "Provider to connect. Gmail is retired for self-serve connections.",
"examples": [
"email"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that receives the messages.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"address": {
"type": "string",
"format": "email",
"maxLength": 320,
"description": "Email only: the address that will send commands and receive replies. Required when provider is email.",
"examples": [
"dana@example.com"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/channel-connect-request.json",
"allOf": [
{
"if": {
"properties": {
"provider": {
"const": "email"
}
},
"required": [
"provider"
]
},
"then": {
"required": [
"address"
]
}
}
]
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Connect channel response",
"description": "The pending channel plus what the operator must do next: an emailed confirmation, a Telegram deep link, or nothing for a retired provider.",
"type": "object",
"additionalProperties": false,
"required": [
"channel",
"auth_url",
"connect_url",
"verify_sent"
],
"properties": {
"channel": {
"description": "The channel that was created, still pending until the provider confirms.",
"allOf": [
{
"$ref": "https://schemas.agentmailbox.app/channel.json"
}
]
},
"auth_url": {
"type": [
"string",
"null"
],
"format": "uri",
"description": "Retired Gmail OAuth URL. Always null for email and Telegram.",
"examples": [
null
]
},
"connect_url": {
"type": [
"string",
"null"
],
"format": "uri",
"description": "Deep link that binds a chat for Telegram, null otherwise.",
"examples": [
"https://t.me/AgentMailBoxBot?start=abc"
]
},
"verify_sent": {
"type": [
"boolean",
"null"
],
"description": "Email only: whether the confirmation link was handed to the mail provider. Null for other providers.",
"examples": [
true,
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/channel-connect-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/channels/{id}Get a channel.
Returns one channel's state and external identity.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable channel identifier. |
inbox_idrequired | string | Inbox that receives the messages. |
providerrequired | "email" | "telegram" | "gmail" | External platform. |
statusrequired | "pending" | "connected" | "needs_reauth" | "revoked" | Connection state. |
external_accountrequired | string | null | External identity, such as a mailbox address or chat id. |
last_event_atrequired | string | null (date-time) | Last inbound activity, or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
command_tokenrequired | string | null | Email only: the code a sender includes before the address is trusted. Null for other providers. |
verified_atrequired | string | null (date-time) | When the endpoint was confirmed. Null while pending. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^chn_[0-9A-Za-z]{20,}$",
"description": "Channel identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Channel",
"description": "A messaging endpoint on the external side of the conversation. We can send to it and authenticate what arrives from it; we never read the account.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"provider",
"status",
"external_account",
"last_event_at",
"created_at",
"updated_at",
"command_token",
"verified_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^chn_[0-9A-Za-z]{20,}$",
"description": "Stable channel identifier.",
"examples": [
"chn_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox that receives the messages.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"provider": {
"type": "string",
"enum": [
"email",
"telegram",
"gmail"
],
"description": "External platform.",
"examples": [
"email"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"connected",
"needs_reauth",
"revoked"
],
"description": "Connection state.",
"examples": [
"connected"
]
},
"external_account": {
"type": [
"string",
"null"
],
"description": "External identity, such as a mailbox address or chat id.",
"examples": [
"dana@example.com"
]
},
"last_event_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Last inbound activity, or null.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"command_token": {
"type": [
"string",
"null"
],
"description": "Email only: the code a sender includes before the address is trusted. Null for other providers.",
"examples": [
"AMB-7K2Q9X",
null
]
},
"verified_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "When the endpoint was confirmed. Null while pending.",
"examples": [
"2026-11-18T09:41:00Z",
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/channel.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/channels/{id}Disconnect a channel.
Revokes the stored credential and stops delivery. Messages already stored follow inbox retention.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^chn_[0-9A-Za-z]{20,}$",
"description": "Channel identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/channels/{id}/testSend a test message.
Sends one message through the channel to the external account, proving the credential works.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
sentrequired | boolean | Whether the provider accepted the message. |
detailrequired | string | null | Provider response or failure reason. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^chn_[0-9A-Za-z]{20,}$",
"description": "Channel identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Channel test response",
"description": "Result of sending a test message through a channel.",
"type": "object",
"additionalProperties": false,
"required": [
"sent",
"detail"
],
"properties": {
"sent": {
"type": "boolean",
"description": "Whether the provider accepted the message.",
"examples": [
true
]
},
"detail": {
"type": [
"string",
"null"
],
"description": "Provider response or failure reason.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/channel-test-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}usage
/v1/usageGet usage.
Metered send, receive, and storage totals for the current period.
| Field | Type | Description |
|---|---|---|
period_startrequired | string (date-time) | Timestamp in UTC. |
period_endrequired | string (date-time) | Timestamp in UTC. |
messages_sentrequired | integer | Outbound messages in the period. |
messages_receivedrequired | integer | Inbound messages in the period. |
storage_bytesrequired | integer | Raw bytes currently stored. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Usage",
"description": "Metered usage for the current period.",
"type": "object",
"additionalProperties": false,
"required": [
"period_start",
"period_end",
"messages_sent",
"messages_received",
"storage_bytes"
],
"properties": {
"period_start": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"period_end": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"messages_sent": {
"type": "integer",
"minimum": 0,
"description": "Outbound messages in the period.",
"examples": [
42
]
},
"messages_received": {
"type": "integer",
"minimum": 0,
"description": "Inbound messages in the period.",
"examples": [
128
]
},
"storage_bytes": {
"type": "integer",
"minimum": 0,
"description": "Raw bytes currently stored.",
"examples": [
1048576
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/usage.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}artifacts
/v1/artifacts/{id}Get an artifact.
Returns metadata and a signed download URL that expires with the run.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Artifact identifier. |
run_idrequired | string | Run that produced it. |
filenamerequired | string | File name inside the run workspace. |
content_typerequired | string | Media type. |
size_bytesrequired | integer | Size in bytes. |
urlrequired | string | null (uri) | Signed download URL. |
expires_atrequired | string (date-time) | Timestamp in UTC. |
created_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^art_[0-9A-Za-z]{20,}$",
"description": "Artifact identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Artifact",
"description": "A file produced by a run.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"run_id",
"filename",
"content_type",
"size_bytes",
"url",
"expires_at",
"created_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^art_[0-9A-Za-z]{20,}$",
"description": "Artifact identifier.",
"examples": [
"art_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"run_id": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run that produced it.",
"examples": [
"run_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"filename": {
"type": "string",
"maxLength": 255,
"description": "File name inside the run workspace.",
"examples": [
"receipt.txt"
]
},
"content_type": {
"type": "string",
"maxLength": 128,
"description": "Media type.",
"examples": [
"text/plain"
]
},
"size_bytes": {
"type": "integer",
"minimum": 0,
"description": "Size in bytes.",
"examples": [
42
]
},
"url": {
"type": [
"string",
"null"
],
"format": "uri",
"description": "Signed download URL.",
"examples": [
"https://api.agentmailbox.app/v1/artifacts/art_x/download?exp=1&sig=abc"
]
},
"expires_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/artifact.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}billing
/v1/billingGet the billing state.
The plan in force, the lifetime AppSumo codes behind it, and the next tier one more code would grant.
| Field | Type | Description |
|---|---|---|
planrequired | "sandbox" | "build" | "team" | "appsumo_solo" | "appsumo_studio" | "appsumo_agency" | Effective plan, after taking the larger of the workspace plan and the lifetime tier. |
namerequired | string | Display name of the effective plan. |
lifetimerequired | boolean | True when at least one AppSumo code has been redeemed on this workspace. |
codesrequired | integer | AppSumo codes this workspace has redeemed. |
max_codesrequired | integer | Codes that still change the tier. A further code is accepted but adds no capacity. |
code_pricerequired | integer | One-time price of one code, in US cents. |
limitrequired | object | Allowances the effective plan enforces. |
limit.monthlyrequired | integer | Accepted inbound messages plus outbound recipients per UTC calendar month. |
limit.dailyrequired | integer | The same unit, per UTC day. |
limit.per_secondrequired | integer | Sustained write requests per second. |
nextrequired | one of | The tier one more code would grant, or null at the top tier or before the first code. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/billing-status.json",
"title": "Billing status",
"description": "The plan in force, the lifetime AppSumo codes behind it, and the next tier one more code would grant.",
"type": "object",
"additionalProperties": false,
"required": [
"plan",
"name",
"lifetime",
"codes",
"max_codes",
"code_price",
"limit",
"next"
],
"properties": {
"plan": {
"type": "string",
"enum": [
"sandbox",
"build",
"team",
"appsumo_solo",
"appsumo_studio",
"appsumo_agency"
],
"description": "Effective plan, after taking the larger of the workspace plan and the lifetime tier.",
"examples": [
"appsumo_studio"
]
},
"name": {
"type": "string",
"description": "Display name of the effective plan.",
"examples": [
"Studio"
]
},
"lifetime": {
"type": "boolean",
"description": "True when at least one AppSumo code has been redeemed on this workspace.",
"examples": [
true
]
},
"codes": {
"type": "integer",
"minimum": 0,
"description": "AppSumo codes this workspace has redeemed.",
"examples": [
2
]
},
"max_codes": {
"type": "integer",
"minimum": 1,
"description": "Codes that still change the tier. A further code is accepted but adds no capacity.",
"examples": [
3
]
},
"code_price": {
"type": "integer",
"minimum": 0,
"description": "One-time price of one code, in US cents.",
"examples": [
4900
]
},
"limit": {
"description": "Allowances the effective plan enforces.",
"type": "object",
"additionalProperties": false,
"required": [
"monthly",
"daily",
"per_second"
],
"properties": {
"monthly": {
"type": "integer",
"minimum": 0,
"description": "Accepted inbound messages plus outbound recipients per UTC calendar month.",
"examples": [
75000
]
},
"daily": {
"type": "integer",
"minimum": 0,
"description": "The same unit, per UTC day.",
"examples": [
5000
]
},
"per_second": {
"type": "integer",
"minimum": 1,
"description": "Sustained write requests per second.",
"examples": [
15
]
}
}
},
"next": {
"description": "The tier one more code would grant, or null at the top tier or before the first code.",
"oneOf": [
{
"type": "null"
},
{
"type": "object",
"additionalProperties": false,
"required": [
"codes",
"plan",
"name",
"limit"
],
"properties": {
"codes": {
"type": "integer",
"minimum": 1,
"description": "Total codes that grants this tier.",
"examples": [
3
]
},
"plan": {
"type": "string",
"enum": [
"appsumo_solo",
"appsumo_studio",
"appsumo_agency"
],
"description": "Plan id the next tier grants.",
"examples": [
"appsumo_agency"
]
},
"name": {
"type": "string",
"description": "Display name of the next tier.",
"examples": [
"Agency"
]
},
"limit": {
"description": "Allowances the next tier enforces.",
"type": "object",
"additionalProperties": false,
"required": [
"monthly",
"daily",
"per_second"
],
"properties": {
"monthly": {
"type": "integer",
"minimum": 0,
"description": "Accepted inbound messages plus outbound recipients per UTC calendar month.",
"examples": [
200000
]
},
"daily": {
"type": "integer",
"minimum": 0,
"description": "The same unit, per UTC day.",
"examples": [
10000
]
},
"per_second": {
"type": "integer",
"minimum": 1,
"description": "Sustained write requests per second.",
"examples": [
25
]
}
}
}
}
}
]
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/billing/appsumo/redeemRedeem an AppSumo code.
Applies a lifetime AppSumo code from the dashboard session. One code grants Solo, two Studio, three Agency; a fourth is accepted but adds no capacity. An API key cannot redeem.
| Field | Type | Description |
|---|---|---|
coderequired | string | The code from the AppSumo receipt. Case-insensitive. |
| Field | Type | Description |
|---|---|---|
planrequired | "appsumo_solo" | "appsumo_studio" | "appsumo_agency" | Effective lifetime plan. |
codesrequired | integer | Codes this workspace has redeemed, after this call. |
already_redeemedrequired | boolean | True when this workspace had already redeemed this code; the call is a no-op. |
workspacerequired | object | The workspace after the grant, with its new plan. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/appsumo-redeem-request.json",
"title": "Redeem an AppSumo code",
"description": "Applies a purchased AppSumo code to this workspace. Codes are stackable: the granted plan is how many codes the workspace has redeemed.",
"type": "object",
"additionalProperties": false,
"required": [
"code"
],
"properties": {
"code": {
"type": "string",
"minLength": 6,
"maxLength": 64,
"pattern": "^[A-Za-z0-9-]+$",
"description": "The code from the AppSumo receipt. Case-insensitive.",
"examples": [
"AMB-7K2Q9X"
]
}
}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/appsumo-redeem-response.json",
"title": "AppSumo redemption",
"description": "The plan now in force, how many codes the workspace has redeemed, and the workspace itself.",
"type": "object",
"additionalProperties": false,
"required": [
"plan",
"codes",
"already_redeemed",
"workspace"
],
"properties": {
"plan": {
"type": "string",
"enum": [
"appsumo_solo",
"appsumo_studio",
"appsumo_agency"
],
"description": "Effective lifetime plan.",
"examples": [
"appsumo_solo"
]
},
"codes": {
"type": "integer",
"minimum": 1,
"description": "Codes this workspace has redeemed, after this call.",
"examples": [
1
]
},
"already_redeemed": {
"type": "boolean",
"description": "True when this workspace had already redeemed this code; the call is a no-op.",
"examples": [
false
]
},
"workspace": {
"$ref": "https://schemas.agentmailbox.app/workspace.json",
"description": "The workspace after the grant, with its new plan."
}
}
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}keys
/v1/api-keysList API keys.
Returns key metadata only: prefix, last four characters, scopes, and revocation state.
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Keys in this page. |
next_cursorrequired | string | null | Always null. |
has_morerequired | boolean | Always false. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "API key list",
"description": "A page of API keys.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Keys in this page.",
"items": {
"$ref": "https://schemas.agentmailbox.app/api-key.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Always null.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Always false.",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/api-key-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/api-keysCreate an API key.
Issues a key with an explicit scope set, never wider than the creator's own. The secret is returned once.
| Field | Type | Description |
|---|---|---|
namerequired | string | Operator label. |
scopesrequired | array of string | Scopes to grant. It can never exceed the creator's own scopes. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable key identifier. |
namerequired | string | Operator label. |
prefixrequired | string | Non-secret prefix for identification. |
last4required | string | Last four characters of the secret. |
scopesrequired | array of string | Effective scopes for this key. |
created_atrequired | string (date-time) | Timestamp in UTC. |
revoked_atrequired | string | null (date-time) | Revocation time, or null while active. |
secretrequired | string | The full secret. Store it now; it cannot be read again. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Create API key request",
"description": "Creates a key with an explicit scope set.",
"type": "object",
"additionalProperties": false,
"required": [
"name",
"scopes"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "Operator label.",
"examples": [
"production server"
]
},
"scopes": {
"type": "array",
"minItems": 1,
"maxItems": 40,
"description": "Scopes to grant. It can never exceed the creator's own scopes.",
"items": {
"type": "string",
"pattern": "^[a-z_]+:(read|write|send|reply|create|control|admin)$"
},
"examples": [
[
"inbox:read",
"message:send",
"message:reply"
]
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/api-key-create-request.json"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "API key with secret",
"description": "A created or rotated key. The secret is shown exactly once.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"prefix",
"last4",
"scopes",
"created_at",
"revoked_at",
"secret"
],
"properties": {
"id": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Stable key identifier.",
"examples": [
"key_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"maxLength": 80,
"description": "Operator label.",
"examples": [
"production server"
]
},
"prefix": {
"type": "string",
"description": "Non-secret prefix for identification.",
"examples": [
"amb_live_ab12"
]
},
"last4": {
"type": "string",
"description": "Last four characters of the secret.",
"examples": [
"9f2b"
]
},
"scopes": {
"type": "array",
"description": "Effective scopes for this key.",
"items": {
"type": "string"
},
"examples": [
[
"inbox:read",
"message:send"
]
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"revoked_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Revocation time, or null while active.",
"examples": [
null
]
},
"secret": {
"type": "string",
"description": "The full secret. Store it now; it cannot be read again.",
"examples": [
"amb_live_ab1234567890"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/api-key-with-secret.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/api-keys/{id}Get an API key.
Returns metadata for one key. The secret is never included.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable key identifier. |
namerequired | string | Operator label. |
prefixrequired | string | Non-secret prefix for identification. |
last4required | string | Last four characters of the secret. |
scopesrequired | array of string | Effective scopes for this key. |
created_atrequired | string (date-time) | Timestamp in UTC. |
revoked_atrequired | string | null (date-time) | Revocation time, or null while active. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Key identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "API key",
"description": "A credential bound to one workspace. The secret itself is never returned after creation.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"prefix",
"last4",
"scopes",
"created_at",
"revoked_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Stable key identifier.",
"examples": [
"key_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"maxLength": 80,
"description": "Operator label.",
"examples": [
"production server"
]
},
"prefix": {
"type": "string",
"description": "Non-secret prefix for identification.",
"examples": [
"amb_live_ab12"
]
},
"last4": {
"type": "string",
"description": "Last four characters of the secret.",
"examples": [
"9f2b"
]
},
"scopes": {
"type": "array",
"description": "Effective scopes for this key.",
"items": {
"type": "string"
},
"examples": [
[
"inbox:read",
"message:send"
]
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"revoked_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Revocation time, or null while active.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/api-key.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/api-keys/{id}Update an API key.
Renames a key or narrows its scopes.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
name | string | Operator label. |
scopes | array of string | New scope set. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable key identifier. |
namerequired | string | Operator label. |
prefixrequired | string | Non-secret prefix for identification. |
last4required | string | Last four characters of the secret. |
scopesrequired | array of string | Effective scopes for this key. |
created_atrequired | string (date-time) | Timestamp in UTC. |
revoked_atrequired | string | null (date-time) | Revocation time, or null while active. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Key identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Update API key request",
"description": "Renames a key or narrows its scopes.",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "Operator label.",
"examples": [
"production server"
]
},
"scopes": {
"type": "array",
"minItems": 1,
"maxItems": 40,
"description": "New scope set.",
"items": {
"type": "string"
},
"examples": [
[
"inbox:read"
]
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/api-key-update-request.json"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "API key",
"description": "A credential bound to one workspace. The secret itself is never returned after creation.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"prefix",
"last4",
"scopes",
"created_at",
"revoked_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Stable key identifier.",
"examples": [
"key_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"maxLength": 80,
"description": "Operator label.",
"examples": [
"production server"
]
},
"prefix": {
"type": "string",
"description": "Non-secret prefix for identification.",
"examples": [
"amb_live_ab12"
]
},
"last4": {
"type": "string",
"description": "Last four characters of the secret.",
"examples": [
"9f2b"
]
},
"scopes": {
"type": "array",
"description": "Effective scopes for this key.",
"items": {
"type": "string"
},
"examples": [
[
"inbox:read",
"message:send"
]
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"revoked_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Revocation time, or null while active.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/api-key.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/api-keys/{id}Revoke an API key.
Revocation is immediate; in-flight requests with the key start failing.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Key identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/api-keys/{id}/rotateRotate an API key.
Issues a new secret for the same key id and returns it once. The old secret stops working immediately.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable key identifier. |
namerequired | string | Operator label. |
prefixrequired | string | Non-secret prefix for identification. |
last4required | string | Last four characters of the secret. |
scopesrequired | array of string | Effective scopes for this key. |
created_atrequired | string (date-time) | Timestamp in UTC. |
revoked_atrequired | string | null (date-time) | Revocation time, or null while active. |
secretrequired | string | The full secret. Store it now; it cannot be read again. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Key identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "API key with secret",
"description": "A created or rotated key. The secret is shown exactly once.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"prefix",
"last4",
"scopes",
"created_at",
"revoked_at",
"secret"
],
"properties": {
"id": {
"type": "string",
"pattern": "^key_[0-9A-Za-z]{20,}$",
"description": "Stable key identifier.",
"examples": [
"key_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"maxLength": 80,
"description": "Operator label.",
"examples": [
"production server"
]
},
"prefix": {
"type": "string",
"description": "Non-secret prefix for identification.",
"examples": [
"amb_live_ab12"
]
},
"last4": {
"type": "string",
"description": "Last four characters of the secret.",
"examples": [
"9f2b"
]
},
"scopes": {
"type": "array",
"description": "Effective scopes for this key.",
"items": {
"type": "string"
},
"examples": [
[
"inbox:read",
"message:send"
]
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"revoked_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Revocation time, or null while active.",
"examples": [
null
]
},
"secret": {
"type": "string",
"description": "The full secret. Store it now; it cannot be read again.",
"examples": [
"amb_live_ab1234567890"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/api-key-with-secret.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}mcp
/v1/mcp-serversList MCP servers.
Servers connected to this workspace, with the tools each listed at its last introspection.
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Servers. |
next_cursorrequired | string | null | Always null. |
has_morerequired | boolean | Always false. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "MCP server list",
"description": "Connected servers for the workspace.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Servers.",
"items": {
"$ref": "https://schemas.agentmailbox.app/mcp-server.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Always null.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Always false.",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/mcp-server-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/mcp-serversConnect an MCP server.
Registers a server and introspects it once. A reachable server returns connected with its tools; an unreachable one is stored with status error and the reason.
| Field | Type | Description |
|---|---|---|
namerequired | string | Label for the server. |
urlrequired | string (uri) | HTTPS endpoint of the server. |
transport | "http" | "sse" = "http" | Wire protocol. |
auth_header | string | null | Bearer token sent to the server, stored encrypted. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable server identifier. |
namerequired | string | Label chosen by the workspace. |
urlrequired | string (uri) | Endpoint the workspace connected. |
transportrequired | "http" | "sse" | Wire protocol used for introspection. |
statusrequired | "pending" | "connected" | "error" | Result of the last introspection. |
toolsrequired | array of object | Tools listed at the last introspection. |
allowed_toolsrequired | array of string | Tool names a run may call. Empty means none. |
server_inforequired | object | null | Name and version the server reported, or null. |
last_errorrequired | string | null | Why the last introspection failed, or null. |
last_introspected_atrequired | string | null (date-time) | Last successful or attempted introspection, or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Connect MCP server request",
"description": "Registers a server and introspects it once.",
"type": "object",
"additionalProperties": false,
"required": [
"name",
"url"
],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "Label for the server.",
"examples": [
"Linear"
]
},
"url": {
"type": "string",
"format": "uri",
"maxLength": 2048,
"description": "HTTPS endpoint of the server.",
"examples": [
"https://mcp.example.com/mcp"
]
},
"transport": {
"type": "string",
"enum": [
"http",
"sse"
],
"default": "http",
"description": "Wire protocol.",
"examples": [
"http"
]
},
"auth_header": {
"type": [
"string",
"null"
],
"maxLength": 2048,
"description": "Bearer token sent to the server, stored encrypted.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/mcp-server-create-request.json"
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "MCP server",
"description": "A connected MCP server and the tools it offered at the last introspection.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"url",
"transport",
"status",
"tools",
"allowed_tools",
"server_info",
"last_error",
"last_introspected_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "Stable server identifier.",
"examples": [
"mcp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"description": "Label chosen by the workspace.",
"examples": [
"Linear"
]
},
"url": {
"type": "string",
"format": "uri",
"description": "Endpoint the workspace connected.",
"examples": [
"https://mcp.example.com/mcp"
]
},
"transport": {
"type": "string",
"enum": [
"http",
"sse"
],
"description": "Wire protocol used for introspection.",
"examples": [
"http"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"connected",
"error"
],
"description": "Result of the last introspection.",
"examples": [
"connected"
]
},
"tools": {
"type": "array",
"description": "Tools listed at the last introspection.",
"items": {
"$ref": "https://schemas.agentmailbox.app/mcp-server-tool.json"
}
},
"allowed_tools": {
"type": "array",
"description": "Tool names a run may call. Empty means none.",
"items": {
"type": "string",
"description": "Tool name.",
"examples": [
"search_issues"
]
}
},
"server_info": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"description": "Name and version the server reported, or null.",
"properties": {
"name": {
"type": "string",
"description": "Server name.",
"examples": [
"linear-mcp"
]
},
"version": {
"type": "string",
"description": "Server version.",
"examples": [
"1.2.0"
]
}
},
"examples": [
{
"name": "linear-mcp",
"version": "1.2.0"
},
null
]
},
"last_error": {
"type": [
"string",
"null"
],
"description": "Why the last introspection failed, or null.",
"examples": [
null
]
},
"last_introspected_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Last successful or attempted introspection, or null.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/mcp-server.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/mcp-servers/{id}Get an MCP server.
One server with its tools and allowlist.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable server identifier. |
namerequired | string | Label chosen by the workspace. |
urlrequired | string (uri) | Endpoint the workspace connected. |
transportrequired | "http" | "sse" | Wire protocol used for introspection. |
statusrequired | "pending" | "connected" | "error" | Result of the last introspection. |
toolsrequired | array of object | Tools listed at the last introspection. |
allowed_toolsrequired | array of string | Tool names a run may call. Empty means none. |
server_inforequired | object | null | Name and version the server reported, or null. |
last_errorrequired | string | null | Why the last introspection failed, or null. |
last_introspected_atrequired | string | null (date-time) | Last successful or attempted introspection, or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "MCP server identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "MCP server",
"description": "A connected MCP server and the tools it offered at the last introspection.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"url",
"transport",
"status",
"tools",
"allowed_tools",
"server_info",
"last_error",
"last_introspected_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "Stable server identifier.",
"examples": [
"mcp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"description": "Label chosen by the workspace.",
"examples": [
"Linear"
]
},
"url": {
"type": "string",
"format": "uri",
"description": "Endpoint the workspace connected.",
"examples": [
"https://mcp.example.com/mcp"
]
},
"transport": {
"type": "string",
"enum": [
"http",
"sse"
],
"description": "Wire protocol used for introspection.",
"examples": [
"http"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"connected",
"error"
],
"description": "Result of the last introspection.",
"examples": [
"connected"
]
},
"tools": {
"type": "array",
"description": "Tools listed at the last introspection.",
"items": {
"$ref": "https://schemas.agentmailbox.app/mcp-server-tool.json"
}
},
"allowed_tools": {
"type": "array",
"description": "Tool names a run may call. Empty means none.",
"items": {
"type": "string",
"description": "Tool name.",
"examples": [
"search_issues"
]
}
},
"server_info": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"description": "Name and version the server reported, or null.",
"properties": {
"name": {
"type": "string",
"description": "Server name.",
"examples": [
"linear-mcp"
]
},
"version": {
"type": "string",
"description": "Server version.",
"examples": [
"1.2.0"
]
}
},
"examples": [
{
"name": "linear-mcp",
"version": "1.2.0"
},
null
]
},
"last_error": {
"type": [
"string",
"null"
],
"description": "Why the last introspection failed, or null.",
"examples": [
null
]
},
"last_introspected_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Last successful or attempted introspection, or null.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/mcp-server.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/mcp-servers/{id}Update an MCP server.
Rename it, change which tools a run may call, or replace its credential. Allowlisted names must come from the last introspection.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
name | string | New label. |
allowed_tools | array of string | Tool names a run may call. Must come from the last introspection. |
auth_header | string | null | Replacement bearer token, or null to remove it. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable server identifier. |
namerequired | string | Label chosen by the workspace. |
urlrequired | string (uri) | Endpoint the workspace connected. |
transportrequired | "http" | "sse" | Wire protocol used for introspection. |
statusrequired | "pending" | "connected" | "error" | Result of the last introspection. |
toolsrequired | array of object | Tools listed at the last introspection. |
allowed_toolsrequired | array of string | Tool names a run may call. Empty means none. |
server_inforequired | object | null | Name and version the server reported, or null. |
last_errorrequired | string | null | Why the last introspection failed, or null. |
last_introspected_atrequired | string | null (date-time) | Last successful or attempted introspection, or null. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "MCP server identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Update MCP server request",
"description": "Renames a server, changes its allowlist, or replaces its credential.",
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "New label.",
"examples": [
"Linear (prod)"
]
},
"allowed_tools": {
"type": "array",
"description": "Tool names a run may call. Must come from the last introspection.",
"items": {
"type": "string",
"description": "Tool name.",
"examples": [
"search_issues"
]
}
},
"auth_header": {
"type": [
"string",
"null"
],
"maxLength": 2048,
"description": "Replacement bearer token, or null to remove it.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/mcp-server-update-request.json"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "MCP server",
"description": "A connected MCP server and the tools it offered at the last introspection.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"name",
"url",
"transport",
"status",
"tools",
"allowed_tools",
"server_info",
"last_error",
"last_introspected_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "Stable server identifier.",
"examples": [
"mcp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"name": {
"type": "string",
"description": "Label chosen by the workspace.",
"examples": [
"Linear"
]
},
"url": {
"type": "string",
"format": "uri",
"description": "Endpoint the workspace connected.",
"examples": [
"https://mcp.example.com/mcp"
]
},
"transport": {
"type": "string",
"enum": [
"http",
"sse"
],
"description": "Wire protocol used for introspection.",
"examples": [
"http"
]
},
"status": {
"type": "string",
"enum": [
"pending",
"connected",
"error"
],
"description": "Result of the last introspection.",
"examples": [
"connected"
]
},
"tools": {
"type": "array",
"description": "Tools listed at the last introspection.",
"items": {
"$ref": "https://schemas.agentmailbox.app/mcp-server-tool.json"
}
},
"allowed_tools": {
"type": "array",
"description": "Tool names a run may call. Empty means none.",
"items": {
"type": "string",
"description": "Tool name.",
"examples": [
"search_issues"
]
}
},
"server_info": {
"type": [
"object",
"null"
],
"additionalProperties": false,
"description": "Name and version the server reported, or null.",
"properties": {
"name": {
"type": "string",
"description": "Server name.",
"examples": [
"linear-mcp"
]
},
"version": {
"type": "string",
"description": "Server version.",
"examples": [
"1.2.0"
]
}
},
"examples": [
{
"name": "linear-mcp",
"version": "1.2.0"
},
null
]
},
"last_error": {
"type": [
"string",
"null"
],
"description": "Why the last introspection failed, or null.",
"examples": [
null
]
},
"last_introspected_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Last successful or attempted introspection, or null.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/mcp-server.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/mcp-servers/{id}Disconnect an MCP server.
Removes the server, its credential, and its allowlist.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "MCP server identifier."
}
}
],
"requestBody": null,
"responses": {
"204": {
"description": "No content"
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/mcp-servers/{id}/introspectIntrospect an MCP server.
Calls initialize and tools/list again and stores the result, so a rotated credential or a changed tool list is picked up.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
serverrequired | object | The server with its current snapshot. |
statusrequired | "connected" | "error" | Outcome of the intro-spection. |
detailrequired | string | null | Failure reason, or null. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "MCP server identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Introspect response",
"description": "The server after a fresh introspection, and what happened.",
"type": "object",
"additionalProperties": false,
"required": [
"server",
"status",
"detail"
],
"properties": {
"server": {
"description": "The server with its current snapshot.",
"allOf": [
{
"$ref": "https://schemas.agentmailbox.app/mcp-server.json"
}
]
},
"status": {
"type": "string",
"enum": [
"connected",
"error"
],
"description": "Outcome of the intro-spection.",
"examples": [
"connected"
]
},
"detail": {
"type": [
"string",
"null"
],
"description": "Failure reason, or null.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/mcp-server-introspect-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}runs
/v1/runsStart a run.
Queues work for an inbox. With require_approval the run waits for an approve call and returns a one-time approval token. Execution is asynchronous; poll the run or its events.
| Field | Type | Description |
|---|---|---|
inbox_idrequired | string | Inbox the run acts for. |
thread_id | string | null | Attach the run to a thread. |
instructionrequired | string | What to do. |
command | string | Shell command executed in the sandbox. Omit to queue the run for a planning executor. |
runtime | "container" | "fly" | "computer" | Execution runtime. |
require_approval | boolean | Hold the run until it is approved. |
budget_seconds | integer | Wall-clock budget. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable run identifier. |
inbox_idrequired | string | Inbox the run acts for. |
thread_idrequired | string | null | Thread the run belongs to, when started from mail. |
instructionrequired | string | What the run was asked to do. |
runtimerequired | "container" | "fly" | "computer" | Where it executes. |
statusrequired | "pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled" | Lifecycle state. |
exit_coderequired | integer | null | Process exit code once finished. |
budget_secondsrequired | integer | Wall-clock budget. |
started_atrequired | string | null (date-time) | Execution start. |
finished_atrequired | string | null (date-time) | Execution end. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
approval_token | string | null | One-time approval token, returned only when the run is created with require_approval. |
approval_message_id | string | null | Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists. |
run_token | string | null | Short-lived token bound to this run, its inbox, and its thread. Returned only on create. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Create run request",
"description": "Starts a run. With approvals enabled it waits for an approve call before executing.",
"type": "object",
"additionalProperties": false,
"required": [
"inbox_id",
"instruction"
],
"properties": {
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox the run acts for.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Attach the run to a thread.",
"examples": [
null
]
},
"instruction": {
"type": "string",
"minLength": 1,
"maxLength": 8000,
"description": "What to do.",
"examples": [
"Write a receipt to artifacts/receipt.txt"
]
},
"command": {
"type": "string",
"maxLength": 4000,
"description": "Shell command executed in the sandbox. Omit to queue the run for a planning executor.",
"examples": [
"mkdir -p artifacts && printf done > artifacts/receipt.txt"
]
},
"runtime": {
"type": "string",
"enum": [
"container",
"fly",
"computer"
],
"description": "Execution runtime.",
"examples": [
"container"
]
},
"require_approval": {
"type": "boolean",
"description": "Hold the run until it is approved.",
"examples": [
false
]
},
"budget_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 3600,
"description": "Wall-clock budget.",
"examples": [
120
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run-create-request.json"
}
}
}
},
"responses": {
"202": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run",
"description": "A unit of work attached to an inbox: queued, executed, and finished.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"instruction",
"runtime",
"status",
"exit_code",
"budget_seconds",
"started_at",
"finished_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Stable run identifier.",
"examples": [
"run_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox the run acts for.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread the run belongs to, when started from mail.",
"examples": [
null
]
},
"instruction": {
"type": "string",
"maxLength": 8000,
"description": "What the run was asked to do.",
"examples": [
"Summarise the invoice and write a receipt."
]
},
"runtime": {
"type": "string",
"enum": [
"container",
"fly",
"computer"
],
"description": "Where it executes.",
"examples": [
"container"
]
},
"status": {
"type": "string",
"enum": [
"pending_approval",
"queued",
"running",
"succeeded",
"failed",
"cancelled"
],
"description": "Lifecycle state.",
"examples": [
"succeeded"
]
},
"exit_code": {
"type": [
"integer",
"null"
],
"description": "Process exit code once finished.",
"examples": [
0
]
},
"budget_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 3600,
"description": "Wall-clock budget.",
"examples": [
300
]
},
"started_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution start.",
"examples": [
null
]
},
"finished_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution end.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"approval_token": {
"type": [
"string",
"null"
],
"description": "One-time approval token, returned only when the run is created with require_approval.",
"examples": [
null
]
},
"approval_message_id": {
"type": [
"string",
"null"
],
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists.",
"examples": [
null
]
},
"run_token": {
"type": [
"string",
"null"
],
"description": "Short-lived token bound to this run, its inbox, and its thread. Returned only on create.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runsList runs.
Runs ordered newest first, optionally filtered by inbox, thread, or status. Cursor-paged: pass next_cursor from the previous page.
| Name | In | Type | Description |
|---|---|---|---|
inbox_id | query | string | |
thread_id | query | string | |
status | query | string | |
limit | query | integer | |
cursor | query | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Runs in this page. |
next_cursorrequired | string | null | Opaque cursor, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "inbox_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Only runs for this inbox."
}
},
{
"name": "thread_id",
"in": "query",
"required": false,
"schema": {
"type": "string",
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Only runs attached to this thread."
}
},
{
"name": "status",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": [
"pending_approval",
"queued",
"running",
"succeeded",
"failed",
"cancelled"
],
"description": "Only runs in this state."
}
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 200,
"default": 50,
"description": "Page size."
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"schema": {
"type": "string",
"maxLength": 200,
"description": "Opaque cursor from the previous page."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run list",
"description": "A page of runs, newest first.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Runs in this page.",
"items": {
"$ref": "https://schemas.agentmailbox.app/run.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor, or null.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runs/{id}Get one run.
Status, timings, exit code, and captured output.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable run identifier. |
inbox_idrequired | string | Inbox the run acts for. |
thread_idrequired | string | null | Thread the run belongs to, when started from mail. |
instructionrequired | string | What the run was asked to do. |
runtimerequired | "container" | "fly" | "computer" | Where it executes. |
statusrequired | "pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled" | Lifecycle state. |
exit_coderequired | integer | null | Process exit code once finished. |
budget_secondsrequired | integer | Wall-clock budget. |
started_atrequired | string | null (date-time) | Execution start. |
finished_atrequired | string | null (date-time) | Execution end. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
approval_token | string | null | One-time approval token, returned only when the run is created with require_approval. |
approval_message_id | string | null | Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists. |
run_token | string | null | Short-lived token bound to this run, its inbox, and its thread. Returned only on create. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run",
"description": "A unit of work attached to an inbox: queued, executed, and finished.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"instruction",
"runtime",
"status",
"exit_code",
"budget_seconds",
"started_at",
"finished_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Stable run identifier.",
"examples": [
"run_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox the run acts for.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread the run belongs to, when started from mail.",
"examples": [
null
]
},
"instruction": {
"type": "string",
"maxLength": 8000,
"description": "What the run was asked to do.",
"examples": [
"Summarise the invoice and write a receipt."
]
},
"runtime": {
"type": "string",
"enum": [
"container",
"fly",
"computer"
],
"description": "Where it executes.",
"examples": [
"container"
]
},
"status": {
"type": "string",
"enum": [
"pending_approval",
"queued",
"running",
"succeeded",
"failed",
"cancelled"
],
"description": "Lifecycle state.",
"examples": [
"succeeded"
]
},
"exit_code": {
"type": [
"integer",
"null"
],
"description": "Process exit code once finished.",
"examples": [
0
]
},
"budget_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 3600,
"description": "Wall-clock budget.",
"examples": [
300
]
},
"started_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution start.",
"examples": [
null
]
},
"finished_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution end.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"approval_token": {
"type": [
"string",
"null"
],
"description": "One-time approval token, returned only when the run is created with require_approval.",
"examples": [
null
]
},
"approval_message_id": {
"type": [
"string",
"null"
],
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists.",
"examples": [
null
]
},
"run_token": {
"type": [
"string",
"null"
],
"description": "Short-lived token bound to this run, its inbox, and its thread. Returned only on create.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runs/{id}/eventsList run events.
The append-only log for one run: started, output, artifacts, approval, finish.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Events in this page. |
next_cursorrequired | string | null | Opaque cursor, or null. |
has_morerequired | boolean | Whether another page exists. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run event list",
"description": "Run events in sequence order.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Events in this page.",
"items": {
"$ref": "https://schemas.agentmailbox.app/run-event.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Opaque cursor, or null.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Whether another page exists.",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run-event-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runs/{id}/artifactsList run artifacts.
Files the run produced, with signed download URLs.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
datarequired | array of object | Artifacts. |
next_cursorrequired | string | null | Always null. |
has_morerequired | boolean | Always false. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Artifact list",
"description": "Artifacts produced by one run.",
"type": "object",
"additionalProperties": false,
"required": [
"data",
"next_cursor",
"has_more"
],
"properties": {
"data": {
"type": "array",
"description": "Artifacts.",
"items": {
"$ref": "https://schemas.agentmailbox.app/artifact.json"
}
},
"next_cursor": {
"type": [
"string",
"null"
],
"description": "Always null.",
"examples": [
null
]
},
"has_more": {
"type": "boolean",
"description": "Always false.",
"examples": [
false
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/artifact-list-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runs/{id}/cancelCancel a run.
Stops a queued or running run. A finished run cannot be cancelled.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable run identifier. |
inbox_idrequired | string | Inbox the run acts for. |
thread_idrequired | string | null | Thread the run belongs to, when started from mail. |
instructionrequired | string | What the run was asked to do. |
runtimerequired | "container" | "fly" | "computer" | Where it executes. |
statusrequired | "pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled" | Lifecycle state. |
exit_coderequired | integer | null | Process exit code once finished. |
budget_secondsrequired | integer | Wall-clock budget. |
started_atrequired | string | null (date-time) | Execution start. |
finished_atrequired | string | null (date-time) | Execution end. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
approval_token | string | null | One-time approval token, returned only when the run is created with require_approval. |
approval_message_id | string | null | Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists. |
run_token | string | null | Short-lived token bound to this run, its inbox, and its thread. Returned only on create. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run",
"description": "A unit of work attached to an inbox: queued, executed, and finished.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"instruction",
"runtime",
"status",
"exit_code",
"budget_seconds",
"started_at",
"finished_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Stable run identifier.",
"examples": [
"run_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox the run acts for.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread the run belongs to, when started from mail.",
"examples": [
null
]
},
"instruction": {
"type": "string",
"maxLength": 8000,
"description": "What the run was asked to do.",
"examples": [
"Summarise the invoice and write a receipt."
]
},
"runtime": {
"type": "string",
"enum": [
"container",
"fly",
"computer"
],
"description": "Where it executes.",
"examples": [
"container"
]
},
"status": {
"type": "string",
"enum": [
"pending_approval",
"queued",
"running",
"succeeded",
"failed",
"cancelled"
],
"description": "Lifecycle state.",
"examples": [
"succeeded"
]
},
"exit_code": {
"type": [
"integer",
"null"
],
"description": "Process exit code once finished.",
"examples": [
0
]
},
"budget_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 3600,
"description": "Wall-clock budget.",
"examples": [
300
]
},
"started_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution start.",
"examples": [
null
]
},
"finished_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution end.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"approval_token": {
"type": [
"string",
"null"
],
"description": "One-time approval token, returned only when the run is created with require_approval.",
"examples": [
null
]
},
"approval_message_id": {
"type": [
"string",
"null"
],
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists.",
"examples": [
null
]
},
"run_token": {
"type": [
"string",
"null"
],
"description": "Short-lived token bound to this run, its inbox, and its thread. Returned only on create.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runs/{id}/approveApprove a run.
Consumes the one-time approval token and queues the run for execution. A token cannot be reused.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
tokenrequired | string | One-time approval token returned when the run was created. |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable run identifier. |
inbox_idrequired | string | Inbox the run acts for. |
thread_idrequired | string | null | Thread the run belongs to, when started from mail. |
instructionrequired | string | What the run was asked to do. |
runtimerequired | "container" | "fly" | "computer" | Where it executes. |
statusrequired | "pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled" | Lifecycle state. |
exit_coderequired | integer | null | Process exit code once finished. |
budget_secondsrequired | integer | Wall-clock budget. |
started_atrequired | string | null (date-time) | Execution start. |
finished_atrequired | string | null (date-time) | Execution end. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
approval_token | string | null | One-time approval token, returned only when the run is created with require_approval. |
approval_message_id | string | null | Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists. |
run_token | string | null | Short-lived token bound to this run, its inbox, and its thread. Returned only on create. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Approval request",
"description": "Approves a run that is waiting for a human decision.",
"type": "object",
"additionalProperties": false,
"required": [
"token"
],
"properties": {
"token": {
"type": "string",
"minLength": 16,
"maxLength": 200,
"description": "One-time approval token returned when the run was created.",
"examples": [
"apr_9f2b0c1d3e4a5b6c"
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/approval-request.json"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run",
"description": "A unit of work attached to an inbox: queued, executed, and finished.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"instruction",
"runtime",
"status",
"exit_code",
"budget_seconds",
"started_at",
"finished_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Stable run identifier.",
"examples": [
"run_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox the run acts for.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread the run belongs to, when started from mail.",
"examples": [
null
]
},
"instruction": {
"type": "string",
"maxLength": 8000,
"description": "What the run was asked to do.",
"examples": [
"Summarise the invoice and write a receipt."
]
},
"runtime": {
"type": "string",
"enum": [
"container",
"fly",
"computer"
],
"description": "Where it executes.",
"examples": [
"container"
]
},
"status": {
"type": "string",
"enum": [
"pending_approval",
"queued",
"running",
"succeeded",
"failed",
"cancelled"
],
"description": "Lifecycle state.",
"examples": [
"succeeded"
]
},
"exit_code": {
"type": [
"integer",
"null"
],
"description": "Process exit code once finished.",
"examples": [
0
]
},
"budget_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 3600,
"description": "Wall-clock budget.",
"examples": [
300
]
},
"started_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution start.",
"examples": [
null
]
},
"finished_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution end.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"approval_token": {
"type": [
"string",
"null"
],
"description": "One-time approval token, returned only when the run is created with require_approval.",
"examples": [
null
]
},
"approval_message_id": {
"type": [
"string",
"null"
],
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists.",
"examples": [
null
]
},
"run_token": {
"type": [
"string",
"null"
],
"description": "Short-lived token bound to this run, its inbox, and its thread. Returned only on create.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runs/{id}/rejectReject a run.
Denies a pending run and marks it failed.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
idrequired | string | Stable run identifier. |
inbox_idrequired | string | Inbox the run acts for. |
thread_idrequired | string | null | Thread the run belongs to, when started from mail. |
instructionrequired | string | What the run was asked to do. |
runtimerequired | "container" | "fly" | "computer" | Where it executes. |
statusrequired | "pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled" | Lifecycle state. |
exit_coderequired | integer | null | Process exit code once finished. |
budget_secondsrequired | integer | Wall-clock budget. |
started_atrequired | string | null (date-time) | Execution start. |
finished_atrequired | string | null (date-time) | Execution end. |
created_atrequired | string (date-time) | Timestamp in UTC. |
updated_atrequired | string (date-time) | Timestamp in UTC. |
approval_token | string | null | One-time approval token, returned only when the run is created with require_approval. |
approval_message_id | string | null | Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists. |
run_token | string | null | Short-lived token bound to this run, its inbox, and its thread. Returned only on create. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run identifier."
}
}
],
"requestBody": null,
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run",
"description": "A unit of work attached to an inbox: queued, executed, and finished.",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"inbox_id",
"thread_id",
"instruction",
"runtime",
"status",
"exit_code",
"budget_seconds",
"started_at",
"finished_at",
"created_at",
"updated_at"
],
"properties": {
"id": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Stable run identifier.",
"examples": [
"run_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"inbox_id": {
"type": "string",
"pattern": "^inx_[0-9A-Za-z]{20,}$",
"description": "Inbox the run acts for.",
"examples": [
"inx_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"thread_id": {
"type": [
"string",
"null"
],
"pattern": "^thr_[0-9A-Za-z]{20,}$",
"description": "Thread the run belongs to, when started from mail.",
"examples": [
null
]
},
"instruction": {
"type": "string",
"maxLength": 8000,
"description": "What the run was asked to do.",
"examples": [
"Summarise the invoice and write a receipt."
]
},
"runtime": {
"type": "string",
"enum": [
"container",
"fly",
"computer"
],
"description": "Where it executes.",
"examples": [
"container"
]
},
"status": {
"type": "string",
"enum": [
"pending_approval",
"queued",
"running",
"succeeded",
"failed",
"cancelled"
],
"description": "Lifecycle state.",
"examples": [
"succeeded"
]
},
"exit_code": {
"type": [
"integer",
"null"
],
"description": "Process exit code once finished.",
"examples": [
0
]
},
"budget_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 3600,
"description": "Wall-clock budget.",
"examples": [
300
]
},
"started_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution start.",
"examples": [
null
]
},
"finished_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "Execution end.",
"examples": [
null
]
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"updated_at": {
"type": "string",
"format": "date-time",
"description": "Timestamp in UTC.",
"examples": [
"2026-11-12T09:41:00Z"
]
},
"approval_token": {
"type": [
"string",
"null"
],
"description": "One-time approval token, returned only when the run is created with require_approval.",
"examples": [
null
]
},
"approval_message_id": {
"type": [
"string",
"null"
],
"pattern": "^msg_[0-9A-Za-z]{20,}$",
"description": "Message that carried the approval request. Null when the run is not waiting for approval or no owner address exists.",
"examples": [
null
]
},
"run_token": {
"type": [
"string",
"null"
],
"description": "Short-lived token bound to this run, its inbox, and its thread. Returned only on create.",
"examples": [
null
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}/v1/runs/{id}/tools/callCall a tool for a run.
Invokes one tool on a connected MCP server through the gateway. Only a run token reaches it, the run must be running, and the tool must be on the server's allowlist; every allow and denial is audited.
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
| Field | Type | Description |
|---|---|---|
server_idrequired | string | Connected MCP server. |
toolrequired | string | Tool name as the server listed it at the last introspection. |
arguments | object | null | Arguments passed to the tool as JSON, or null for none. |
| Field | Type | Description |
|---|---|---|
server_idrequired | string | Server that answered the call. |
toolrequired | string | Tool that was called. |
resultrequired | object | null | The tool's JSON-RPC result, or null when the call failed. |
is_errorrequired | boolean | Whether the tool reported an error of its own. |
errorrequired | string | null | Why the call failed, or null. |
duration_msrequired | integer | Round trip in milliseconds. |
| Field | Type | Description |
|---|---|---|
errorrequired | object | The error body: a stable code, a human message, and a correlation ID. |
error.typerequired | string | Broad error class. |
error.coderequired | string | Stable machine-readable error code. |
error.messagerequired | string | Human-readable error message generated from the error catalog. |
error.param | string | null | The parameter associated with the failure, when applicable. |
error.request_idrequired | string | Correlation ID for logs and support. |
error.details | array of object | Validation or policy details. |
JSON schema
{
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^run_[0-9A-Za-z]{20,}$",
"description": "Run identifier."
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Call a run tool",
"description": "Invokes one tool on a connected MCP server for a running run. The call is refused unless the tool is on the server's allowlist.",
"type": "object",
"additionalProperties": false,
"required": [
"server_id",
"tool"
],
"properties": {
"server_id": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "Connected MCP server.",
"examples": [
"mcp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"tool": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"pattern": "^[A-Za-z0-9_.-]+$",
"description": "Tool name as the server listed it at the last introspection.",
"examples": [
"search_issues"
]
},
"arguments": {
"type": [
"object",
"null"
],
"additionalProperties": true,
"description": "Arguments passed to the tool as JSON, or null for none.",
"examples": [
{
"query": "open invoices"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run-tool-call-request.json"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"title": "Run tool call",
"description": "The outcome of one gateway-checked tool call: what the tool returned, or an error the caller can act on.",
"type": "object",
"additionalProperties": false,
"required": [
"server_id",
"tool",
"result",
"is_error",
"error",
"duration_ms"
],
"properties": {
"server_id": {
"type": "string",
"pattern": "^mcp_[0-9A-Za-z]{20,}$",
"description": "Server that answered the call.",
"examples": [
"mcp_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"tool": {
"type": "string",
"description": "Tool that was called.",
"examples": [
"search_issues"
]
},
"result": {
"type": [
"object",
"null"
],
"additionalProperties": true,
"description": "The tool's JSON-RPC result, or null when the call failed.",
"examples": [
{
"issues": []
}
]
},
"is_error": {
"type": "boolean",
"description": "Whether the tool reported an error of its own.",
"examples": [
false
]
},
"error": {
"type": [
"string",
"null"
],
"description": "Why the call failed, or null.",
"examples": [
null
]
},
"duration_ms": {
"type": "integer",
"minimum": 0,
"description": "Round trip in milliseconds.",
"examples": [
42
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/run-tool-call-response.json"
}
}
}
},
"default": {
"description": "Error envelope from contracts/errors.json",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.agentmailbox.app/error.json",
"title": "Error",
"description": "The stable error envelope returned by every JSON API failure.",
"type": "object",
"additionalProperties": false,
"required": [
"error"
],
"properties": {
"error": {
"type": "object",
"description": "The error body: a stable code, a human message, and a correlation ID.",
"additionalProperties": false,
"required": [
"type",
"code",
"message",
"request_id"
],
"properties": {
"type": {
"type": "string",
"description": "Broad error class.",
"examples": [
"invalid_request"
]
},
"code": {
"type": "string",
"description": "Stable machine-readable error code.",
"examples": [
"validation_failed"
]
},
"message": {
"type": "string",
"description": "Human-readable error message generated from the error catalog.",
"examples": [
"The request did not match the schema."
]
},
"param": {
"type": [
"string",
"null"
],
"description": "The parameter associated with the failure, when applicable.",
"examples": [
"address"
]
},
"request_id": {
"type": "string",
"description": "Correlation ID for logs and support.",
"examples": [
"req_01J8Z3K4Q9V7M2N6P1R5T8W0X"
]
},
"details": {
"type": "array",
"description": "Validation or policy details.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"path",
"rule"
],
"properties": {
"path": {
"type": "string",
"description": "JSON Pointer or parameter path.",
"examples": [
"/address"
]
},
"rule": {
"type": "string",
"description": "The schema or policy rule that failed.",
"examples": [
"format"
]
},
"message": {
"type": "string",
"description": "Optional human-readable detail.",
"examples": [
"must match format \"email\""
]
}
}
}
}
}
}
}
}
}
}
}
}
}