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.

OpenAPI 3.1.090 operationsContract 1.0.0

identity

GET/v1/me

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

Bearer token
Responses
200 Success
FieldTypeDescription
workspace_idrequiredstringWorkspace this credential is bound to.
subject_idrequiredstringUser, 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.
scopesrequiredarray of stringEffective capabilities, already narrowed by role and key.
expires_atrequiredstring (date-time)Expiry of the underlying credential, or the epoch for non-expiring keys.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/meta

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

Responses
200 Success
FieldTypeDescription
contract_versionrequiredstringSemantic version of the published contract.
schema_hashrequiredstringSHA-256 of the generated OpenAPI document.
generated_atrequiredstring (date-time)When the running build was generated.
deprecationsrequiredarray of objectOperations scheduled for removal, with their replacement.
deprecations[].operationrequiredstringDeprecated operation ID.
deprecations[].replacementrequiredstringOperation ID to use instead.
deprecations[].sunset_atrequiredstring (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

GET/v1/workspace

Return the caller's workspace.

Reads plan, limits, and retention defaults for the workspace the token is bound to.

Bearer token
Responses
200 Success
FieldTypeDescription
idrequiredstringStable workspace identifier.
namerequiredstringWorkspace display name.
planrequired"sandbox" | "build" | "team" | "appsumo_solo" | "appsumo_studio" | "appsumo_agency"Current subscription plan.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PATCH/v1/workspace

Update workspace settings.

Changes the workspace display name. Requires an admin-scoped credential; a workspace-scoped key cannot rename its tenant.

Bearer token
Request body
FieldTypeDescription
namestringWorkspace display name.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable workspace identifier.
namerequiredstringWorkspace display name.
planrequired"sandbox" | "build" | "team" | "appsumo_solo" | "appsumo_studio" | "appsumo_agency"Current subscription plan.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/domains

List domains.

Cursor-paginated domains, ordered by name. Filters are applied server-side and are always scoped to the token's workspace.

Bearer token
Parameters
NameInTypeDescription
statusquerystring
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectDomains in this page, ordered by name ascending.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null when exhausted.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/domains

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

Bearer token
Request body
FieldTypeDescription
namestringRegistrable domain to register, without a trailing dot.
receiving_enabledboolean = falseAsk the shared MX edge to accept inbound mail for this domain.
subdomainstringCreate a managed <subdomain>.agentmailbox.app address space instead of registering a domain. Receive-only unless the subdomain is separately verified.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable domain identifier.
namerequiredstringLowercase registrable domain name.
statusrequired"pending" | "verified" | "failed"DNS verification state.
sending_enabledrequiredbooleanWhether outbound mail may use this domain.
receiving_enabledrequiredbooleanWhether the shared MX edge accepts mail for this domain.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/domains/{id}

Get one domain.

Returns verification state, sending and receiving flags. A domain in another workspace returns 404, never 403.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable domain identifier.
namerequiredstringLowercase registrable domain name.
statusrequired"pending" | "verified" | "failed"DNS verification state.
sending_enabledrequiredbooleanWhether outbound mail may use this domain.
receiving_enabledrequiredbooleanWhether the shared MX edge accepts mail for this domain.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/domains/{id}/verify

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

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable domain identifier.
namerequiredstringLowercase registrable domain name.
statusrequired"pending" | "verified" | "failed"DNS verification state.
sending_enabledrequiredbooleanWhether outbound mail may use this domain.
receiving_enabledrequiredbooleanWhether the shared MX edge accepts mail for this domain.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/domains/{id}/dns-records

List required DNS records.

Returns the DKIM, SPF, and MX records this domain needs, sourced from SES where available.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectRecords to publish.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/domains/{id}/zone-file

Download a zone file.

Returns the required records as a BIND-style zone fragment with a text/plain body.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/inboxes

List inboxes.

Cursor-paginated inboxes ordered by address, optionally filtered by domain and status.

Bearer token
Parameters
NameInTypeDescription
domain_idquerystring
statusquerystring
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectInboxes in this page, ordered by address ascending.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null when exhausted.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/inboxes

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

Bearer token
Request body
FieldTypeDescription
addressrequiredstring (email)A full address on a verified domain.
display_namestring | nullName recipients see on outbound mail.
retention_mode"standard" | "zero" = "standard"Whether inbound mail is stored or delivered once.
retention_days7 | 30 | 90 | 365 = 30Retention period when mode is standard.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable inbox identifier.
addressrequiredstring (email)Full address on a verified domain.
display_namestring | nullName recipients see on outbound mail.
statusrequired"pending" | "active" | "suspended" | "deleted"Inbox lifecycle state.
domain_idrequiredstringVerified domain that owns the address.
retention_moderequired"standard" | "zero"Whether inbound mail is stored or delivered once.
retention_daysrequired7 | 30 | 90 | 365Retention period when mode is standard.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/inboxes/{id}

Get one inbox.

Returns inbox settings and retention policy. Cross-workspace or out-of-grant inboxes return 404.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable inbox identifier.
addressrequiredstring (email)Full address on a verified domain.
display_namestring | nullName recipients see on outbound mail.
statusrequired"pending" | "active" | "suspended" | "deleted"Inbox lifecycle state.
domain_idrequiredstringVerified domain that owns the address.
retention_moderequired"standard" | "zero"Whether inbound mail is stored or delivered once.
retention_daysrequired7 | 30 | 90 | 365Retention period when mode is standard.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PATCH/v1/inboxes/{id}

Update inbox settings.

Changes display name or retention policy. Omitted fields are left unchanged.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
display_namestring | nullName recipients see on outbound mail, or null to clear it.
retention_mode"standard" | "zero"Whether inbound mail is stored or delivered once.
retention_days7 | 30 | 90 | 365Retention period when mode is standard.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable inbox identifier.
addressrequiredstring (email)Full address on a verified domain.
display_namestring | nullName recipients see on outbound mail.
statusrequired"pending" | "active" | "suspended" | "deleted"Inbox lifecycle state.
domain_idrequiredstringVerified domain that owns the address.
retention_moderequired"standard" | "zero"Whether inbound mail is stored or delivered once.
retention_daysrequired7 | 30 | 90 | 365Retention period when mode is standard.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/inboxes/{id}

Delete an inbox.

Soft-deletes the inbox and stops delivery. Retention policy still governs when stored messages are purged.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PUT/v1/inboxes/{id}/retention

Set inbox retention.

Chooses standard storage for 7/30/90/365 days, or zero retention which stores nothing and rejects replies.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
moderequired"standard" | "zero"Retention mode.
days7 | 30 | 90 | 365Retention period in days for standard mode.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable inbox identifier.
addressrequiredstring (email)Full address on a verified domain.
display_namestring | nullName recipients see on outbound mail.
statusrequired"pending" | "active" | "suspended" | "deleted"Inbox lifecycle state.
domain_idrequiredstringVerified domain that owns the address.
retention_moderequired"standard" | "zero"Whether inbound mail is stored or delivered once.
retention_daysrequired7 | 30 | 90 | 365Retention period when mode is standard.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/inboxes/{id}/forwarding

Get inbox forwarding.

Returns the forwarding destination, if one is configured.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
enabledrequiredbooleanWhether forwarding is active.
torequiredstring | null (email)Verified destination, or null.
verifiedrequiredbooleanWhether the destination was confirmed.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PUT/v1/inboxes/{id}/forwarding

Set inbox forwarding.

Sends a copy of every stored inbound message to one destination address.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
torequiredstring (email)Destination address for copies.
Responses
200 Success
FieldTypeDescription
enabledrequiredbooleanWhether forwarding is active.
torequiredstring | null (email)Verified destination, or null.
verifiedrequiredbooleanWhether the destination was confirmed.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/inboxes/{id}/forwarding

Disable inbox forwarding.

Stops sending copies for this inbox.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/threads

List threads.

Threads ordered by most recent message, optionally filtered by inbox, folder, or a search query. Search uses FTS5 and is ACL-filtered.

Bearer token
Parameters
NameInTypeDescription
inbox_idquerystring
folderquerystring
qquerystring
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectThreads in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null when exhausted.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/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.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
limitqueryinteger
beforequerystring
afterquerystring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable thread identifier.
inbox_idrequiredstringInbox that owns this conversation.
subjectrequiredstringNormalized subject without reply prefixes.
participantsrequiredarray of stringEvery address that has sent or received in this thread.
message_countrequiredintegerNumber of messages in the thread.
unread_countrequiredintegerMessages not yet read.
folderrequired"inbox" | "archive" | "trash" | "spam"Current folder for the thread.
is_readrequiredbooleanWhether the thread has no unread messages.
last_message_atrequiredstring (date-time)Timestamp of the newest message, used for ordering.
messagesarray of objectOne page of messages, oldest first, each with its stored text and HTML. Present on a single-thread read and omitted from lists.
messages_pageobjectCursors for the pages on either side of `messages`. Present on a single-thread read and omitted from lists.
messages_page.before_cursorrequiredstring | nullPass as `before` for the page of older messages. Null when this page starts at the first message.
messages_page.after_cursorrequiredstring | nullPass as `after` for the page of newer messages. Null when this page ends at the last message.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PATCH/v1/threads/{id}

Update thread state.

Marks a thread read or moves it between folders. Omitted fields are unchanged.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
is_readbooleanMark the whole thread read or unread.
folder"inbox" | "archive" | "trash" | "spam"Move the thread to another folder.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable thread identifier.
inbox_idrequiredstringInbox that owns this conversation.
subjectrequiredstringNormalized subject without reply prefixes.
participantsrequiredarray of stringEvery address that has sent or received in this thread.
message_countrequiredintegerNumber of messages in the thread.
unread_countrequiredintegerMessages not yet read.
folderrequired"inbox" | "archive" | "trash" | "spam"Current folder for the thread.
is_readrequiredbooleanWhether the thread has no unread messages.
last_message_atrequiredstring (date-time)Timestamp of the newest message, used for ordering.
messagesarray of objectOne page of messages, oldest first, each with its stored text and HTML. Present on a single-thread read and omitted from lists.
messages_pageobjectCursors for the pages on either side of `messages`. Present on a single-thread read and omitted from lists.
messages_page.before_cursorrequiredstring | nullPass as `before` for the page of older messages. Null when this page starts at the first message.
messages_page.after_cursorrequiredstring | nullPass as `after` for the page of newer messages. Null when this page ends at the last message.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/messages

List messages.

Messages ordered oldest first, filtered by inbox, thread, or direction. Bodies are never inlined in list responses.

Bearer token
Parameters
NameInTypeDescription
inbox_idquerystring
thread_idquerystring
directionquerystring
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectMessages in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null when exhausted.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/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.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable message identifier.
thread_idrequiredstringThread this message belongs to.
inbox_idrequiredstringInbox 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.
fromrequiredstring (email)Envelope sender address.
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject as received or sent.
snippetrequiredstringShort plain-text preview used by list views.
textstring | nullStored plain-text body. Present on single-message reads when the body was stored; omitted from lists.
htmlstring | nullStored HTML body. Present on single-message reads when the body was stored; omitted from lists.
size_bytesrequiredintegerRaw RFC 822 size in bytes.
created_atrequiredstring (date-time)Receipt or send time in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/inboxes/{id}/messages

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

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject line.
textrequiredstringPlain-text body. Always required so every message is readable.
htmlstring | nullOptional HTML body for clients that render it.
attachment_idsarray of stringStored attachment identifiers to include.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable message identifier.
thread_idrequiredstringThread this message belongs to.
inbox_idrequiredstringInbox 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.
fromrequiredstring (email)Envelope sender address.
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject as received or sent.
snippetrequiredstringShort plain-text preview used by list views.
textstring | nullStored plain-text body. Present on single-message reads when the body was stored; omitted from lists.
htmlstring | nullStored HTML body. Present on single-message reads when the body was stored; omitted from lists.
size_bytesrequiredintegerRaw RFC 822 size in bytes.
created_atrequiredstring (date-time)Receipt or send time in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/messages/{id}/reply

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

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
textrequiredstringPlain-text body.
htmlstring | nullOptional HTML body.
attachment_idsarray of stringStored attachment identifiers to include.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable message identifier.
thread_idrequiredstringThread this message belongs to.
inbox_idrequiredstringInbox 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.
fromrequiredstring (email)Envelope sender address.
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject as received or sent.
snippetrequiredstringShort plain-text preview used by list views.
textstring | nullStored plain-text body. Present on single-message reads when the body was stored; omitted from lists.
htmlstring | nullStored HTML body. Present on single-message reads when the body was stored; omitted from lists.
size_bytesrequiredintegerRaw RFC 822 size in bytes.
created_atrequiredstring (date-time)Receipt or send time in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/messages/{id}/reply-all

Reply to everyone.

Replies to the sender and every other participant in the thread, excluding the inbox itself. Recipients always come from the thread.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
textrequiredstringPlain-text body.
htmlstring | nullOptional HTML body.
attachment_idsarray of stringStored attachment identifiers to include.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable message identifier.
thread_idrequiredstringThread this message belongs to.
inbox_idrequiredstringInbox 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.
fromrequiredstring (email)Envelope sender address.
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject as received or sent.
snippetrequiredstringShort plain-text preview used by list views.
textstring | nullStored plain-text body. Present on single-message reads when the body was stored; omitted from lists.
htmlstring | nullStored HTML body. Present on single-message reads when the body was stored; omitted from lists.
size_bytesrequiredintegerRaw RFC 822 size in bytes.
created_atrequiredstring (date-time)Receipt or send time in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/messages/{id}/forward

Forward a message.

Sends a copy to new recipients in a new thread. Unlike reply, the recipients come from the request.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
torequiredarray of stringRecipients of the forward.
ccarray of stringCopied recipients.
textrequiredstringPlain-text body.
htmlstring | nullOptional HTML body.
attachment_idsarray of stringStored attachments to include.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable message identifier.
thread_idrequiredstringThread this message belongs to.
inbox_idrequiredstringInbox 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.
fromrequiredstring (email)Envelope sender address.
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject as received or sent.
snippetrequiredstringShort plain-text preview used by list views.
textstring | nullStored plain-text body. Present on single-message reads when the body was stored; omitted from lists.
htmlstring | nullStored HTML body. Present on single-message reads when the body was stored; omitted from lists.
size_bytesrequiredintegerRaw RFC 822 size in bytes.
created_atrequiredstring (date-time)Receipt or send time in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/messages/{id}/raw

Download the raw message.

Returns the original RFC 822 bytes from private storage.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/drafts

List drafts.

Drafts ordered by last update, optionally filtered by inbox.

Bearer token
Parameters
NameInTypeDescription
inbox_idquerystring
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectDrafts in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/drafts

Create a draft.

Stores an unsent message. Sending it later produces a normal outbound message with the same threading rules.

Bearer token
Request body
FieldTypeDescription
inbox_idrequiredstringStable inbox identifier.
thread_idstring | nullReply in this thread, or omit for a new message.
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject line.
textrequiredstringPlain-text body.
htmlstring | nullOptional HTML body.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable draft identifier.
inbox_idrequiredstringStable inbox identifier.
thread_idrequiredstring | nullThread this draft replies to, or null for a new message.
torequiredarray of stringPrimary recipients.
ccrequiredarray of stringCopied recipients.
subjectrequiredstringSubject line.
textrequiredstringPlain-text body.
htmlrequiredstring | nullOptional HTML body.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/drafts/{id}

Get one draft.

Returns the draft body and its target thread, if any.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable draft identifier.
inbox_idrequiredstringStable inbox identifier.
thread_idrequiredstring | nullThread this draft replies to, or null for a new message.
torequiredarray of stringPrimary recipients.
ccrequiredarray of stringCopied recipients.
subjectrequiredstringSubject line.
textrequiredstringPlain-text body.
htmlrequiredstring | nullOptional HTML body.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PATCH/v1/drafts/{id}

Update a draft.

Changes recipients, subject, or body. Omitted fields are unchanged.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
toarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectstringSubject line.
textstringPlain-text body.
htmlstring | nullOptional HTML body.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable draft identifier.
inbox_idrequiredstringStable inbox identifier.
thread_idrequiredstring | nullThread this draft replies to, or null for a new message.
torequiredarray of stringPrimary recipients.
ccrequiredarray of stringCopied recipients.
subjectrequiredstringSubject line.
textrequiredstringPlain-text body.
htmlrequiredstring | nullOptional HTML body.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/drafts/{id}

Delete a draft.

Discards the draft without sending it.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/drafts/{id}/send

Send a draft.

Sends the stored draft and returns the created message. A failed provider send leaves the message queued.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
201 Success
FieldTypeDescription
idrequiredstringStable message identifier.
thread_idrequiredstringThread this message belongs to.
inbox_idrequiredstringInbox 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.
fromrequiredstring (email)Envelope sender address.
torequiredarray of stringPrimary recipients.
ccarray of stringCopied recipients.
subjectrequiredstringSubject as received or sent.
snippetrequiredstringShort plain-text preview used by list views.
textstring | nullStored plain-text body. Present on single-message reads when the body was stored; omitted from lists.
htmlstring | nullStored HTML body. Present on single-message reads when the body was stored; omitted from lists.
size_bytesrequiredintegerRaw RFC 822 size in bytes.
created_atrequiredstring (date-time)Receipt or send time in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/labels

List labels.

Workspace labels ordered by name.

Bearer token
Parameters
NameInTypeDescription
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectLabels in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/labels

Create a label.

Creates a workspace label used to group threads.

Bearer token
Request body
FieldTypeDescription
namerequiredstringLabel name, unique per workspace.
colorstring | nullHex color.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable label identifier.
namerequiredstringLabel name, unique per workspace.
colorrequiredstring | nullHex color or null.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PATCH/v1/labels/{id}

Update a label.

Renames or recolors a label.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
namestringLabel name, unique per workspace.
colorstring | nullHex color.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable label identifier.
namerequiredstringLabel name, unique per workspace.
colorrequiredstring | nullHex color or null.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/labels/{id}

Delete a label.

Removes the label and detaches it from every thread.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/threads/{id}/labels

List thread labels.

Labels currently attached to a thread.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectLabels in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/threads/{id}/labels

Add a label to a thread.

Attaches one label; adding an existing label is a no-op.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
label_idrequiredstringLabel to attach.
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectLabels in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/threads/{id}/labels/{label_id}

Remove a label from a thread.

Detaches one label from a thread.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
label_idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

POST/v1/attachments

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

Bearer token
Parameters
NameInTypeDescription
filenamequerystring
content_typequerystring
retention_daysqueryinteger
Request body
FieldTypeDescription
filenamerequiredstringFilename to store.
urlstring (uri)Public HTTPS URL to fetch once.
contentstringBase64 content.
content_typestringMedia type override.
retention_days7 | 30 | 90 | 365 = 7Retention tier in days.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable attachment identifier.
filenamerequiredstringOriginal filename.
content_typerequiredstringIANA media type.
size_bytesrequiredintegerSize in bytes.
urlrequiredstring | null (uri)Time-limited download URL, or null when storage is unavailable.
expires_atrequiredstring (date-time)Timestamp in UTC.
created_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/attachments/{id}

Get attachment metadata.

Returns filename, size, and a signed download URL.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable attachment identifier.
filenamerequiredstringOriginal filename.
content_typerequiredstringIANA media type.
size_bytesrequiredintegerSize in bytes.
urlrequiredstring | null (uri)Time-limited download URL, or null when storage is unavailable.
expires_atrequiredstring (date-time)Timestamp in UTC.
created_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/attachments/{id}

Delete an attachment.

Removes the stored object before its retention expires.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/webhooks

List webhooks.

Returns endpoints and their subscriptions. Signing secrets are never returned.

Bearer token
Parameters
NameInTypeDescription
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectWebhooks in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null when exhausted.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/webhooks

Create a webhook.

Registers an HTTPS endpoint and returns it with a signing secret shown exactly once.

Bearer token
Request body
FieldTypeDescription
urlrequiredstring (uri)HTTPS endpoint that receives deliveries. HTTP and private addresses are rejected.
eventsrequiredarray of "message.received" | "message.sent" | "message.delivered" | "message.bounced" | "thread.created" | "thread.updated" | "domain.verified" | "inbox.created" | "webhook.test"Event types to subscribe to.
descriptionstring | nullOperator note for this endpoint.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable webhook identifier.
urlrequiredstring (uri)HTTPS endpoint that receives deliveries.
eventsrequiredarray 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.
descriptionstring | nullOperator note for this endpoint.
created_atrequiredstring (date-time)Creation timestamp in UTC.
updated_atrequiredstring (date-time)Last update timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/webhooks/{id}

Delete a webhook.

Stops deliveries and removes the endpoint.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/webhooks/{id}/deliveries

List webhook deliveries.

Attempt history for one endpoint, newest first.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectDeliveries in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/deliveries/{id}/replay

Replay a delivery.

Re-sends the original event to the same endpoint and returns the new delivery state.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable delivery identifier.
webhook_idrequiredstringStable webhook identifier.
event_idrequiredstringStable event identifier.
statusrequired"pending" | "delivered" | "failed"Delivery state.
attemptsrequiredintegerAttempts made so far.
response_coderequiredinteger | nullLast HTTP status returned by the endpoint.
next_attempt_atrequiredstring | null (date-time)When the next retry is due, or null.
created_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/webhooks/{id}/rotate-secret

Rotate a webhook secret.

Issues a new signing secret and returns it once. The previous secret stops working immediately.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringWebhook identifier.
secretrequiredstringNew signing secret.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/webhooks/{id}/test

Send a test delivery.

Creates a webhook.test event and a delivery for this endpoint, then attempts it immediately.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable delivery identifier.
webhook_idrequiredstringStable webhook identifier.
event_idrequiredstringStable event identifier.
statusrequired"pending" | "delivered" | "failed"Delivery state.
attemptsrequiredintegerAttempts made so far.
response_coderequiredinteger | nullLast HTTP status returned by the endpoint.
next_attempt_atrequiredstring | null (date-time)When the next retry is due, or null.
created_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/events

List events.

Events in sequence order, usable as a pull cursor when webhooks are not delivering.

Bearer token
Parameters
NameInTypeDescription
afterqueryinteger
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectEvents in this page.
next_cursorrequiredstring | nullOpaque cursor for the next page, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/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.

Bearer token
Parameters
NameInTypeDescription
directionrequiredpathstring
typerequiredpathstring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectEntries on the list.
next_cursorrequiredstring | nullAlways null; lists are not paginated.
has_morerequiredbooleanAlways false.
moderequired"block" | "allow"block rejects listed values; allow accepts only listed values.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/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.

Bearer token
Parameters
NameInTypeDescription
directionrequiredpathstring
typerequiredpathstring
Request body
FieldTypeDescription
valuerequiredstringAddress or domain to add.
Responses
201 Success
FieldTypeDescription
valuerequiredstringAddress or domain this entry matches.
created_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/lists/{direction}/{type}/{value}

Remove a list entry.

Removes one address or domain from a list.

Bearer token
Parameters
NameInTypeDescription
directionrequiredpathstring
typerequiredpathstring
valuerequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PUT/v1/lists/{direction}/{type}/mode

Set list mode.

Switches a list between block (reject listed values) and allow (accept only listed values). An allow list with no entries blocks everything.

Bearer token
Parameters
NameInTypeDescription
directionrequiredpathstring
typerequiredpathstring
Request body
FieldTypeDescription
moderequired"block" | "allow"List mode.
Responses
200 Success
FieldTypeDescription
moderequired"block" | "allow"List mode.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/audit

List audit events.

Append-only allow and deny decisions, newest first. Admin scope only.

Bearer token
Parameters
NameInTypeDescription
limitqueryinteger
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectEvents in this page.
next_cursorrequiredstring | nullOpaque cursor, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/inboxes/{id}/automation

Get inbox automation.

Returns the command template that runs for every stored inbound message, or null when disabled.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
commandrequiredstring | nullShell command template. Supports {{message_id}}, {{thread_id}}, {{subject}}, {{from}}, and {{text}}.
replyrequiredbooleanReserved: reply with the run output when it succeeds. Not implemented yet.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PUT/v1/inboxes/{id}/automation

Set inbox automation.

Sets the shell command that runs for every stored inbound message, with the message substituted into the template. Pass null to disable.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
commandrequiredstring | nullCommand template, or null to disable.
replybooleanReserved for auto-reply.
Responses
200 Success
FieldTypeDescription
commandrequiredstring | nullShell command template. Supports {{message_id}}, {{thread_id}}, {{subject}}, {{from}}, and {{text}}.
replyrequiredbooleanReserved: reply with the run output when it succeeds. Not implemented yet.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/channels

List channels.

Channels configured for this workspace, with their connection state. Credentials are never returned.

Bearer token
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectChannels.
next_cursorrequiredstring | nullAlways null.
has_morerequiredbooleanAlways false.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/channels

Connect a channel.

Starts a connection into an inbox. Gmail returns an OAuth URL; Telegram returns a deep link that binds a chat.

Bearer token
Request body
FieldTypeDescription
providerrequired"email" | "telegram" | "gmail"Provider to connect. Gmail is retired for self-serve connections.
inbox_idrequiredstringInbox that receives the messages.
addressstring (email)Email only: the address that will send commands and receive replies. Required when provider is email.
Responses
201 Success
FieldTypeDescription
channelrequiredobjectThe channel that was created, still pending until the provider confirms.
auth_urlrequiredstring | null (uri)Retired Gmail OAuth URL. Always null for email and Telegram.
connect_urlrequiredstring | null (uri)Deep link that binds a chat for Telegram, null otherwise.
verify_sentrequiredboolean | nullEmail only: whether the confirmation link was handed to the mail provider. Null for other providers.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/channels/{id}

Get a channel.

Returns one channel's state and external identity.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable channel identifier.
inbox_idrequiredstringInbox that receives the messages.
providerrequired"email" | "telegram" | "gmail"External platform.
statusrequired"pending" | "connected" | "needs_reauth" | "revoked"Connection state.
external_accountrequiredstring | nullExternal identity, such as a mailbox address or chat id.
last_event_atrequiredstring | null (date-time)Last inbound activity, or null.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
command_tokenrequiredstring | nullEmail only: the code a sender includes before the address is trusted. Null for other providers.
verified_atrequiredstring | null (date-time)When the endpoint was confirmed. Null while pending.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/channels/{id}

Disconnect a channel.

Revokes the stored credential and stops delivery. Messages already stored follow inbox retention.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/channels/{id}/test

Send a test message.

Sends one message through the channel to the external account, proving the credential works.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
sentrequiredbooleanWhether the provider accepted the message.
detailrequiredstring | nullProvider response or failure reason.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/usage

Get usage.

Metered send, receive, and storage totals for the current period.

Bearer token
Responses
200 Success
FieldTypeDescription
period_startrequiredstring (date-time)Timestamp in UTC.
period_endrequiredstring (date-time)Timestamp in UTC.
messages_sentrequiredintegerOutbound messages in the period.
messages_receivedrequiredintegerInbound messages in the period.
storage_bytesrequiredintegerRaw bytes currently stored.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/artifacts/{id}

Get an artifact.

Returns metadata and a signed download URL that expires with the run.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringArtifact identifier.
run_idrequiredstringRun that produced it.
filenamerequiredstringFile name inside the run workspace.
content_typerequiredstringMedia type.
size_bytesrequiredintegerSize in bytes.
urlrequiredstring | null (uri)Signed download URL.
expires_atrequiredstring (date-time)Timestamp in UTC.
created_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/billing

Get the billing state.

The plan in force, the lifetime AppSumo codes behind it, and the next tier one more code would grant.

Bearer token
Responses
200 Success
FieldTypeDescription
planrequired"sandbox" | "build" | "team" | "appsumo_solo" | "appsumo_studio" | "appsumo_agency"Effective plan, after taking the larger of the workspace plan and the lifetime tier.
namerequiredstringDisplay name of the effective plan.
lifetimerequiredbooleanTrue when at least one AppSumo code has been redeemed on this workspace.
codesrequiredintegerAppSumo codes this workspace has redeemed.
max_codesrequiredintegerCodes that still change the tier. A further code is accepted but adds no capacity.
code_pricerequiredintegerOne-time price of one code, in US cents.
limitrequiredobjectAllowances the effective plan enforces.
limit.monthlyrequiredintegerAccepted inbound messages plus outbound recipients per UTC calendar month.
limit.dailyrequiredintegerThe same unit, per UTC day.
limit.per_secondrequiredintegerSustained write requests per second.
nextrequiredone ofThe tier one more code would grant, or null at the top tier or before the first code.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/billing/appsumo/redeem

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

Bearer token
Request body
FieldTypeDescription
coderequiredstringThe code from the AppSumo receipt. Case-insensitive.
Responses
200 Success
FieldTypeDescription
planrequired"appsumo_solo" | "appsumo_studio" | "appsumo_agency"Effective lifetime plan.
codesrequiredintegerCodes this workspace has redeemed, after this call.
already_redeemedrequiredbooleanTrue when this workspace had already redeemed this code; the call is a no-op.
workspacerequiredobjectThe workspace after the grant, with its new plan.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/api-keys

List API keys.

Returns key metadata only: prefix, last four characters, scopes, and revocation state.

Bearer token
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectKeys in this page.
next_cursorrequiredstring | nullAlways null.
has_morerequiredbooleanAlways false.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/api-keys

Create an API key.

Issues a key with an explicit scope set, never wider than the creator's own. The secret is returned once.

Bearer token
Request body
FieldTypeDescription
namerequiredstringOperator label.
scopesrequiredarray of stringScopes to grant. It can never exceed the creator's own scopes.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable key identifier.
namerequiredstringOperator label.
prefixrequiredstringNon-secret prefix for identification.
last4requiredstringLast four characters of the secret.
scopesrequiredarray of stringEffective scopes for this key.
created_atrequiredstring (date-time)Timestamp in UTC.
revoked_atrequiredstring | null (date-time)Revocation time, or null while active.
secretrequiredstringThe full secret. Store it now; it cannot be read again.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/api-keys/{id}

Get an API key.

Returns metadata for one key. The secret is never included.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable key identifier.
namerequiredstringOperator label.
prefixrequiredstringNon-secret prefix for identification.
last4requiredstringLast four characters of the secret.
scopesrequiredarray of stringEffective scopes for this key.
created_atrequiredstring (date-time)Timestamp in UTC.
revoked_atrequiredstring | null (date-time)Revocation time, or null while active.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PATCH/v1/api-keys/{id}

Update an API key.

Renames a key or narrows its scopes.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
namestringOperator label.
scopesarray of stringNew scope set.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable key identifier.
namerequiredstringOperator label.
prefixrequiredstringNon-secret prefix for identification.
last4requiredstringLast four characters of the secret.
scopesrequiredarray of stringEffective scopes for this key.
created_atrequiredstring (date-time)Timestamp in UTC.
revoked_atrequiredstring | null (date-time)Revocation time, or null while active.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/api-keys/{id}

Revoke an API key.

Revocation is immediate; in-flight requests with the key start failing.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/api-keys/{id}/rotate

Rotate an API key.

Issues a new secret for the same key id and returns it once. The old secret stops working immediately.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable key identifier.
namerequiredstringOperator label.
prefixrequiredstringNon-secret prefix for identification.
last4requiredstringLast four characters of the secret.
scopesrequiredarray of stringEffective scopes for this key.
created_atrequiredstring (date-time)Timestamp in UTC.
revoked_atrequiredstring | null (date-time)Revocation time, or null while active.
secretrequiredstringThe full secret. Store it now; it cannot be read again.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

GET/v1/mcp-servers

List MCP servers.

Servers connected to this workspace, with the tools each listed at its last introspection.

Bearer token
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectServers.
next_cursorrequiredstring | nullAlways null.
has_morerequiredbooleanAlways false.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/mcp-servers

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

Bearer token
Request body
FieldTypeDescription
namerequiredstringLabel for the server.
urlrequiredstring (uri)HTTPS endpoint of the server.
transport"http" | "sse" = "http"Wire protocol.
auth_headerstring | nullBearer token sent to the server, stored encrypted.
Responses
201 Success
FieldTypeDescription
idrequiredstringStable server identifier.
namerequiredstringLabel chosen by the workspace.
urlrequiredstring (uri)Endpoint the workspace connected.
transportrequired"http" | "sse"Wire protocol used for introspection.
statusrequired"pending" | "connected" | "error"Result of the last introspection.
toolsrequiredarray of objectTools listed at the last introspection.
allowed_toolsrequiredarray of stringTool names a run may call. Empty means none.
server_inforequiredobject | nullName and version the server reported, or null.
last_errorrequiredstring | nullWhy the last introspection failed, or null.
last_introspected_atrequiredstring | null (date-time)Last successful or attempted introspection, or null.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/mcp-servers/{id}

Get an MCP server.

One server with its tools and allowlist.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable server identifier.
namerequiredstringLabel chosen by the workspace.
urlrequiredstring (uri)Endpoint the workspace connected.
transportrequired"http" | "sse"Wire protocol used for introspection.
statusrequired"pending" | "connected" | "error"Result of the last introspection.
toolsrequiredarray of objectTools listed at the last introspection.
allowed_toolsrequiredarray of stringTool names a run may call. Empty means none.
server_inforequiredobject | nullName and version the server reported, or null.
last_errorrequiredstring | nullWhy the last introspection failed, or null.
last_introspected_atrequiredstring | null (date-time)Last successful or attempted introspection, or null.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
PATCH/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.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
namestringNew label.
allowed_toolsarray of stringTool names a run may call. Must come from the last introspection.
auth_headerstring | nullReplacement bearer token, or null to remove it.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable server identifier.
namerequiredstringLabel chosen by the workspace.
urlrequiredstring (uri)Endpoint the workspace connected.
transportrequired"http" | "sse"Wire protocol used for introspection.
statusrequired"pending" | "connected" | "error"Result of the last introspection.
toolsrequiredarray of objectTools listed at the last introspection.
allowed_toolsrequiredarray of stringTool names a run may call. Empty means none.
server_inforequiredobject | nullName and version the server reported, or null.
last_errorrequiredstring | nullWhy the last introspection failed, or null.
last_introspected_atrequiredstring | null (date-time)Last successful or attempted introspection, or null.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
DELETE/v1/mcp-servers/{id}

Disconnect an MCP server.

Removes the server, its credential, and its allowlist.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
204 No content
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/mcp-servers/{id}/introspect

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

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
serverrequiredobjectThe server with its current snapshot.
statusrequired"connected" | "error"Outcome of the intro-spection.
detailrequiredstring | nullFailure reason, or null.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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

POST/v1/runs

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

Bearer token
Request body
FieldTypeDescription
inbox_idrequiredstringInbox the run acts for.
thread_idstring | nullAttach the run to a thread.
instructionrequiredstringWhat to do.
commandstringShell command executed in the sandbox. Omit to queue the run for a planning executor.
runtime"container" | "fly" | "computer"Execution runtime.
require_approvalbooleanHold the run until it is approved.
budget_secondsintegerWall-clock budget.
Responses
202 Success
FieldTypeDescription
idrequiredstringStable run identifier.
inbox_idrequiredstringInbox the run acts for.
thread_idrequiredstring | nullThread the run belongs to, when started from mail.
instructionrequiredstringWhat the run was asked to do.
runtimerequired"container" | "fly" | "computer"Where it executes.
statusrequired"pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled"Lifecycle state.
exit_coderequiredinteger | nullProcess exit code once finished.
budget_secondsrequiredintegerWall-clock budget.
started_atrequiredstring | null (date-time)Execution start.
finished_atrequiredstring | null (date-time)Execution end.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
approval_tokenstring | nullOne-time approval token, returned only when the run is created with require_approval.
approval_message_idstring | nullMessage that carried the approval request. Null when the run is not waiting for approval or no owner address exists.
run_tokenstring | nullShort-lived token bound to this run, its inbox, and its thread. Returned only on create.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/runs

List runs.

Runs ordered newest first, optionally filtered by inbox, thread, or status. Cursor-paged: pass next_cursor from the previous page.

Bearer token
Parameters
NameInTypeDescription
inbox_idquerystring
thread_idquerystring
statusquerystring
limitqueryinteger
cursorquerystring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectRuns in this page.
next_cursorrequiredstring | nullOpaque cursor, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/runs/{id}

Get one run.

Status, timings, exit code, and captured output.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable run identifier.
inbox_idrequiredstringInbox the run acts for.
thread_idrequiredstring | nullThread the run belongs to, when started from mail.
instructionrequiredstringWhat the run was asked to do.
runtimerequired"container" | "fly" | "computer"Where it executes.
statusrequired"pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled"Lifecycle state.
exit_coderequiredinteger | nullProcess exit code once finished.
budget_secondsrequiredintegerWall-clock budget.
started_atrequiredstring | null (date-time)Execution start.
finished_atrequiredstring | null (date-time)Execution end.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
approval_tokenstring | nullOne-time approval token, returned only when the run is created with require_approval.
approval_message_idstring | nullMessage that carried the approval request. Null when the run is not waiting for approval or no owner address exists.
run_tokenstring | nullShort-lived token bound to this run, its inbox, and its thread. Returned only on create.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/runs/{id}/events

List run events.

The append-only log for one run: started, output, artifacts, approval, finish.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectEvents in this page.
next_cursorrequiredstring | nullOpaque cursor, or null.
has_morerequiredbooleanWhether another page exists.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
GET/v1/runs/{id}/artifacts

List run artifacts.

Files the run produced, with signed download URLs.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
datarequiredarray of objectArtifacts.
next_cursorrequiredstring | nullAlways null.
has_morerequiredbooleanAlways false.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/runs/{id}/cancel

Cancel a run.

Stops a queued or running run. A finished run cannot be cancelled.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable run identifier.
inbox_idrequiredstringInbox the run acts for.
thread_idrequiredstring | nullThread the run belongs to, when started from mail.
instructionrequiredstringWhat the run was asked to do.
runtimerequired"container" | "fly" | "computer"Where it executes.
statusrequired"pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled"Lifecycle state.
exit_coderequiredinteger | nullProcess exit code once finished.
budget_secondsrequiredintegerWall-clock budget.
started_atrequiredstring | null (date-time)Execution start.
finished_atrequiredstring | null (date-time)Execution end.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
approval_tokenstring | nullOne-time approval token, returned only when the run is created with require_approval.
approval_message_idstring | nullMessage that carried the approval request. Null when the run is not waiting for approval or no owner address exists.
run_tokenstring | nullShort-lived token bound to this run, its inbox, and its thread. Returned only on create.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/runs/{id}/approve

Approve a run.

Consumes the one-time approval token and queues the run for execution. A token cannot be reused.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
tokenrequiredstringOne-time approval token returned when the run was created.
Responses
200 Success
FieldTypeDescription
idrequiredstringStable run identifier.
inbox_idrequiredstringInbox the run acts for.
thread_idrequiredstring | nullThread the run belongs to, when started from mail.
instructionrequiredstringWhat the run was asked to do.
runtimerequired"container" | "fly" | "computer"Where it executes.
statusrequired"pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled"Lifecycle state.
exit_coderequiredinteger | nullProcess exit code once finished.
budget_secondsrequiredintegerWall-clock budget.
started_atrequiredstring | null (date-time)Execution start.
finished_atrequiredstring | null (date-time)Execution end.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
approval_tokenstring | nullOne-time approval token, returned only when the run is created with require_approval.
approval_message_idstring | nullMessage that carried the approval request. Null when the run is not waiting for approval or no owner address exists.
run_tokenstring | nullShort-lived token bound to this run, its inbox, and its thread. Returned only on create.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/runs/{id}/reject

Reject a run.

Denies a pending run and marks it failed.

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Responses
200 Success
FieldTypeDescription
idrequiredstringStable run identifier.
inbox_idrequiredstringInbox the run acts for.
thread_idrequiredstring | nullThread the run belongs to, when started from mail.
instructionrequiredstringWhat the run was asked to do.
runtimerequired"container" | "fly" | "computer"Where it executes.
statusrequired"pending_approval" | "queued" | "running" | "succeeded" | "failed" | "cancelled"Lifecycle state.
exit_coderequiredinteger | nullProcess exit code once finished.
budget_secondsrequiredintegerWall-clock budget.
started_atrequiredstring | null (date-time)Execution start.
finished_atrequiredstring | null (date-time)Execution end.
created_atrequiredstring (date-time)Timestamp in UTC.
updated_atrequiredstring (date-time)Timestamp in UTC.
approval_tokenstring | nullOne-time approval token, returned only when the run is created with require_approval.
approval_message_idstring | nullMessage that carried the approval request. Null when the run is not waiting for approval or no owner address exists.
run_tokenstring | nullShort-lived token bound to this run, its inbox, and its thread. Returned only on create.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
POST/v1/runs/{id}/tools/call

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

Bearer token
Parameters
NameInTypeDescription
idrequiredpathstring
Request body
FieldTypeDescription
server_idrequiredstringConnected MCP server.
toolrequiredstringTool name as the server listed it at the last introspection.
argumentsobject | nullArguments passed to the tool as JSON, or null for none.
Responses
200 Success
FieldTypeDescription
server_idrequiredstringServer that answered the call.
toolrequiredstringTool that was called.
resultrequiredobject | nullThe tool's JSON-RPC result, or null when the call failed.
is_errorrequiredbooleanWhether the tool reported an error of its own.
errorrequiredstring | nullWhy the call failed, or null.
duration_msrequiredintegerRound trip in milliseconds.
default Error envelope from contracts/errors.json
FieldTypeDescription
errorrequiredobjectThe error body: a stable code, a human message, and a correlation ID.
error.typerequiredstringBroad error class.
error.coderequiredstringStable machine-readable error code.
error.messagerequiredstringHuman-readable error message generated from the error catalog.
error.paramstring | nullThe parameter associated with the failure, when applicable.
error.request_idrequiredstringCorrelation ID for logs and support.
error.detailsarray of objectValidation 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\""
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}