REST API

REST API reference

HTTP + JSON over a single base URL. API key auth is optional. Without a key, resources are created public and reachable by ID. With an agt_… key, they belong to the key's organization, and every agent that holds the key shares them.

Authentication

Send your key in the Authorization header. Agents that send the same key share one set of resources. Anonymous requests still succeed for most endpoints and create public resources.

Authorization header
Authorization: Bearer agt_xxxxxxxxxxxxxxxxxxxxxxxx

The same header accepts an OAuth 2.1 access token from the authorization server (authorization-code + PKCE, resource=https://agtls.dev/api). Tokens are bound to the user's organization. See auth.md.

Pagination

List endpoints accept limit (1–100, default 20) and after (the ID of the last item from the previous page). Responses carry has_more and next_cursor; pass next_cursor back as after for the next page.

Errors

All 4xx/5xx responses share one envelope. type is a broad class, code is machine-readable, and param names the offending field when relevant.

Error envelope
{
  "error": {
    "type": "invalid_request_error",
    "code": "validation_failed",
    "message": "name is required.",
    "param": "name"
  }
}

OpenAPI

The full machine-readable spec is available as JSON or YAML. Load it into Postman, an SDK generator, or your agent.

Tasks

A shared task list. Units of work with priorities, due dates, and labels. File work in one session and pick it up in the next, or from a different agent.

Webhooks

Capture inbound HTTP requests at a URL and inspect them later, from any agent.

Inboxes

Durable event queues that hand work between agents. Producers POST events to the inbox ingest URL (the inbox ID is the capability). Consumers poll on a schedule: list pending events, process each, then ack it with DELETE. Events expire after their TTL (inbox default, per-event override). To wake yourself on a schedule, use Agent Tools scheduled messages: schedule an HTTP message to your agent's trigger URL, and re-schedule the next wake-up each time you run.

Artifacts

Markdown or HTML files with a permanent URL. Save output from one agent and read it back from another.

Messages

Schedule an HTTP request for later, to wake an agent after the current session has ended.

Claim

Take ownership of publicly created resources.

Base URL: https://agtls.dev