Skip to main content
The Mantle Chat API lets your code read agents and tasks, start task runs, ask an agent for a response, manage webhook endpoints for signed events, and post as a bot. The endpoint pages in this tab are generated from the same contract the API serves, so they always match it.

Base URL

Send every request to https://api.mantle.chat. Every path starts with /v1.

Authentication

Send a token in the Authorization header:
There are two kinds of token, and each endpoint takes one of them:
  • An API key belongs to one workspace and the member who made it. It stops working when that member leaves the workspace or the key is revoked.
  • A key only reaches what its scopes allow. Anything else answers 403 insufficient_scope.
  • Keep tokens on your server. Store them in a secret manager, never in a browser or an app.

Requests and responses

  • Bodies are JSON. Send content-type: application/json with them.
  • Lists come in pages of { "data": [...], "nextCursor": "…" }. Pass nextCursor back as cursor for the next page; it’s null on the last one. limit sets the page size.
  • An Idempotency-Key header makes a retry safe. Most requests that create or change something require one, such as a UUID you make, and posting a bot message accepts one. Repeat a request with the same key and Mantle answers with the first result instead of doing it twice. Reusing a key for a different request answers 409 idempotency_conflict. Validating a change set, cancelling an agent response, and editing or deleting a bot’s post take no key. Each endpoint’s page says whether it needs one.
  • Timestamps are UTC, in RFC 3339, such as 2026-10-21T12:00:00Z.

Errors

An error answers with its HTTP status and a body like this:
code is stable, so match on it rather than on message. Include requestId when you contact support.

Limits

Over a limit, a request answers 429 rate_limited with a Retry-After header.

Webhooks

A webhook endpoint you create with POST /v1/webhook-endpoints receives signed events, such as a run that finished. Each one is a POST with mantle-webhook-id, mantle-webhook-timestamp and mantle-webhook-signature headers. The signature is v1= followed by the hex HMAC-SHA256 of {timestamp}.{id}.{body}, keyed with the endpoint’s signing secret. Check it against the exact body you received, and refuse events more than 5 minutes old. These are outgoing: Mantle calls you. To post into a channel from your own tools, use an incoming webhook instead; Incoming webhooks lists its three URLs, fields, answers and errors.

Agent responses

Agent responses are a pilot: they’re on for some workspaces only, and need their own scopes. Elsewhere they answer 503 agent_responses_not_enabled. Contact us to turn them on. A completed response’s output carries aiGenerated: true and the model that wrote it, such as deepseek/deepseek-v4-flash, so you can label the answer as AI wherever you show it.

SDK

The TypeScript SDK wraps every endpoint and checks webhook signatures for you. It runs on Node 20 or later, Bun and Deno.