{"openapi":"3.1.0","info":{"title":"agtls API","version":"0.1.0","description":"Open-source infrastructure for AI agents. API key auth is optional: without a key, resources are created public (reachable by ID) and can later be claimed; with an `agt_live_…` key, resources are owned by the key's organization. All timestamps are Unix seconds. Lists use cursor pagination (`limit`, `after`).","license":{"name":"MIT","identifier":"MIT"}},"servers":[{"url":"https://agtls.dev"}],"security":[{},{"bearerAuth":[]}],"tags":[{"name":"Tasks","description":"Units of work with priorities, due dates, and labels for flexible grouping."},{"name":"Webhooks","description":"Capture and inspect inbound HTTP requests."},{"name":"Artifacts","description":"Markdown files an agent can store and recall."},{"name":"Messages","description":"Schedule HTTP requests to trigger an agent at a later time."},{"name":"Claim","description":"Take ownership of publicly-created resources."}],"paths":{"/api/tasks":{"get":{"tags":["Tasks"],"summary":"List tasks","description":"Lists tasks scoped to the caller's organizations, optionally filtered by `label`. Anonymous callers receive an empty list — public tasks remain reachable by ID but are never enumerable.","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"},{"$ref":"#/components/parameters/label"}],"security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"A list of tasks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"listTasks"},"post":{"tags":["Tasks"],"summary":"Create a task","description":"Creates a task. With an API key the task is owned by the key's organization; without one it is created public and the response includes a one-time `claim_token`.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string","enum":["low","medium","high","critical"]},"due_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"labels":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"The created task.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"createTask"}},"/api/tasks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The task ID (`tsk_…`).","schema":{"type":"string"}}],"get":{"tags":["Tasks"],"summary":"Get a task","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"The task.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getTask"},"patch":{"tags":["Tasks"],"summary":"Update a task","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"priority":{"type":"string","enum":["low","medium","high","critical"]},"due_at":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"labels":{"anyOf":[{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated task.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"updateTask"},"delete":{"tags":["Tasks"],"summary":"Delete a task","security":[{},{"bearerAuth":[]}],"responses":{"204":{"description":"The task was deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteTask"}},"/api/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"A list of webhook endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"listWebhookEndpoints"},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"Creates a webhook endpoint with a capture URL. Without an API key the response includes a one-time `claim_token`.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"max_events":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"The created webhook endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"createWebhookEndpoint"}},"/api/webhooks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook endpoint ID (`whe_…`).","schema":{"type":"string"}}],"get":{"tags":["Webhooks"],"summary":"Get a webhook endpoint","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"The webhook endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getWebhookEndpoint"},"patch":{"tags":["Webhooks"],"summary":"Update a webhook endpoint","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"max_events":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated webhook endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"updateWebhookEndpoint"},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint","security":[{},{"bearerAuth":[]}],"responses":{"204":{"description":"The endpoint was deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteWebhookEndpoint"}},"/api/webhooks/{id}/events":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook endpoint ID (`whe_…`).","schema":{"type":"string"}}],"get":{"tags":["Webhooks"],"summary":"List captured events for an endpoint","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"A list of captured events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"listWebhookEvents"},"delete":{"tags":["Webhooks"],"summary":"Delete all events for an endpoint","security":[{},{"bearerAuth":[]}],"responses":{"204":{"description":"All events were deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteAllWebhookEvents"}},"/api/webhooks/{id}/events/{eventId}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook endpoint ID (`whe_…`).","schema":{"type":"string"}},{"name":"eventId","in":"path","required":true,"description":"The webhook event ID (`wev_…`).","schema":{"type":"string"}}],"get":{"tags":["Webhooks"],"summary":"Get a captured event","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"The webhook event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getWebhookEvent"},"delete":{"tags":["Webhooks"],"summary":"Delete a captured event","security":[{},{"bearerAuth":[]}],"responses":{"204":{"description":"The event was deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteWebhookEvent"}},"/api/artifacts":{"get":{"tags":["Artifacts"],"summary":"List artifacts","description":"Lists artifacts scoped to the caller's organizations. Anonymous callers receive an empty list — public artifacts remain reachable by ID but are never enumerable.","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"A list of artifacts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"listArtifacts"},"post":{"tags":["Artifacts"],"summary":"Create an artifact","description":"Creates an artifact (markdown or html content). With an API key it is owned by the key's organization; without one it is created public and the response includes a one-time `claim_token`.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"string","maxLength":1000000},"format":{"type":"string","enum":["markdown","html"]}},"required":["name","content"],"additionalProperties":false}}}},"responses":{"201":{"description":"The created artifact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactCreateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"createArtifact"}},"/api/artifacts/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The artifact ID (`art_…`).","schema":{"type":"string"}}],"get":{"tags":["Artifacts"],"summary":"Get an artifact","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"The artifact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getArtifact"},"patch":{"tags":["Artifacts"],"summary":"Update an artifact","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"string","maxLength":1000000},"format":{"type":"string","enum":["markdown","html"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated artifact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"updateArtifact"},"delete":{"tags":["Artifacts"],"summary":"Delete an artifact","security":[{},{"bearerAuth":[]}],"responses":{"204":{"description":"The artifact was deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteArtifact"}},"/api/artifacts/{id}/raw":{"parameters":[{"name":"id","in":"path","required":true,"description":"The artifact ID (`art_…`).","schema":{"type":"string"}}],"get":{"tags":["Artifacts"],"summary":"Get an artifact's raw content","description":"Serves the artifact content directly with the content type matching its format — `text/html` for html artifacts, `text/markdown` for markdown. Useful as a shareable URL that renders in a browser.","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"The raw artifact content.","content":{"text/html":{"schema":{"type":"string"}},"text/markdown":{"schema":{"type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getArtifactRaw"}},"/api/messages":{"get":{"tags":["Messages"],"summary":"List scheduled messages","description":"Lists scheduled messages scoped to the caller's organizations. Anonymous callers receive an empty list.","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"A list of scheduled messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledMessageList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"listMessages"},"post":{"tags":["Messages"],"summary":"Schedule a message","description":"Schedules an HTTP request to fire at a later time. Provide exactly one of `scheduled_at` (absolute Unix seconds) or `delay_seconds` (relative to now). Without an API key the response includes a one-time `claim_token`.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["http"]},"url":{"type":"string","minLength":1,"maxLength":2000},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"body":{"anyOf":[{"type":"string","maxLength":1000000},{"type":"null"}]},"scheduled_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delay_seconds":{"type":"integer","minimum":0,"maximum":31622400}},"required":["url"],"additionalProperties":false}}}},"responses":{"201":{"description":"The scheduled message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledMessageCreateResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"scheduleMessage"}},"/api/messages/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The scheduled message ID (`msg_…`).","schema":{"type":"string"}}],"get":{"tags":["Messages"],"summary":"Get a scheduled message","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"The scheduled message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledMessage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"getMessage"},"patch":{"tags":["Messages"],"summary":"Reschedule or edit a message","description":"Updates a message that hasn't fired yet (status `scheduled`). Editing a delivered, in-flight, or canceled message returns 400.","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"headers":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},{"type":"null"}]},"body":{"anyOf":[{"type":"string","maxLength":1000000},{"type":"null"}]},"scheduled_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"delay_seconds":{"type":"integer","minimum":0,"maximum":31622400}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledMessage"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"updateMessage"},"delete":{"tags":["Messages"],"summary":"Cancel and delete a message","description":"Deletes the message. If it hasn't fired yet, this cancels it.","security":[{},{"bearerAuth":[]}],"responses":{"204":{"description":"The message was deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"deleteMessage"}},"/api/messages/dispatch":{"post":{"tags":["Messages"],"summary":"Dispatch due messages","description":"Delivers every scheduled message whose time has come. In production a Workers cron trigger calls this every minute; external schedulers can call it too, with GET or POST. If `CRON_SECRET` is configured, the caller must present it as `Authorization: Bearer <secret>`.","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"Summary of the dispatch run.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"dispatch_result"},"dispatched":{"type":"integer"},"delivered":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array","items":{"type":"object"}}},"required":["object","dispatched","delivered","failed","results"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"}},"operationId":"dispatchMessages"}},"/api/claim/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The ID of the public resource to claim (tsk_…, wh_…, art_…, or msg_…).","schema":{"type":"string"}}],"post":{"tags":["Claim"],"summary":"Claim a public resource","description":"Assigns a publicly-created resource to the caller's organization using its one-time `claim_token`. Requires an API key.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"claim_token":{"type":"string","minLength":1}},"required":["claim_token"],"additionalProperties":false}}}},"responses":{"200":{"description":"The claimed resource, now owned by the caller's organization.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Task"},{"$ref":"#/components/schemas/WebhookEndpoint"},{"$ref":"#/components/schemas/Artifact"},{"$ref":"#/components/schemas/ScheduledMessage"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"operationId":"claimResource"}},"/api/catch/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook endpoint ID (`whe_…`).","schema":{"type":"string"}}],"get":{"tags":["Webhooks"],"summary":"Capture an inbound GET request","description":"Records the inbound request (method, headers, query, body) as a webhook event. Always returns 200 and never reveals whether the endpoint exists. Accepts any content type.","responses":{"200":{"description":"The request was captured.","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","const":true},"event_id":{"type":"string"}},"required":["received","event_id"]}}}}},"operationId":"captureRequestGet"},"post":{"tags":["Webhooks"],"summary":"Capture an inbound POST request","description":"Records the inbound request (method, headers, query, body) as a webhook event. Always returns 200 and never reveals whether the endpoint exists. Accepts any content type.","requestBody":{"required":false,"content":{"*/*":{"schema":{}}}},"responses":{"200":{"description":"The request was captured.","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","const":true},"event_id":{"type":"string"}},"required":["received","event_id"]}}}}},"operationId":"captureRequestPost"},"put":{"tags":["Webhooks"],"summary":"Capture an inbound PUT request","description":"Records the inbound request (method, headers, query, body) as a webhook event. Always returns 200 and never reveals whether the endpoint exists. Accepts any content type.","requestBody":{"required":false,"content":{"*/*":{"schema":{}}}},"responses":{"200":{"description":"The request was captured.","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","const":true},"event_id":{"type":"string"}},"required":["received","event_id"]}}}}},"operationId":"captureRequestPut"},"patch":{"tags":["Webhooks"],"summary":"Capture an inbound PATCH request","description":"Records the inbound request (method, headers, query, body) as a webhook event. Always returns 200 and never reveals whether the endpoint exists. Accepts any content type.","requestBody":{"required":false,"content":{"*/*":{"schema":{}}}},"responses":{"200":{"description":"The request was captured.","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","const":true},"event_id":{"type":"string"}},"required":["received","event_id"]}}}}},"operationId":"captureRequestPatch"},"delete":{"tags":["Webhooks"],"summary":"Capture an inbound DELETE request","description":"Records the inbound request (method, headers, query, body) as a webhook event. Always returns 200 and never reveals whether the endpoint exists. Accepts any content type.","requestBody":{"required":false,"content":{"*/*":{"schema":{}}}},"responses":{"200":{"description":"The request was captured.","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","const":true},"event_id":{"type":"string"}},"required":["received","event_id"]}}}}},"operationId":"captureRequestDelete"}}},"components":{"schemas":{"Task":{"type":"object","description":"A task — a unit of work with a priority, an optional due date, and labels for flexible grouping.","properties":{"id":{"type":"string","description":"Unique identifier for the task, prefixed with `tsk_`.","examples":["tsk_xxxxxxxxxxxxxxxxxxxxxxxx"]},"object":{"type":"string","const":"task"},"organization_id":{"type":["string","null"],"description":"Owning organization ID, or null if the resource is public (created without an API key)."},"name":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"string","enum":["low","medium","high","critical"],"description":"Task priority. Defaults to `low`."},"due_at":{"type":["integer","null"],"description":"When the task is due. Unix timestamp in seconds."},"labels":{"type":"array","items":{"type":"string"},"description":"Labels attached to the task. Use ?label= on the list endpoint to filter. Defaults to []."},"created_at":{"type":["integer","null"],"description":"When the task was created. Unix timestamp in seconds."},"updated_at":{"type":["integer","null"],"description":"When the task was last updated. Unix timestamp in seconds."}},"required":["id","object","organization_id","name","description","priority","due_at","labels","created_at","updated_at"]},"WebhookEndpoint":{"type":"object","description":"A webhook endpoint that captures inbound HTTP requests.","properties":{"id":{"type":"string","description":"Unique identifier for the webhook endpoint, prefixed with `whe_`.","examples":["whe_xxxxxxxxxxxxxxxxxxxxxxxx"]},"object":{"type":"string","const":"webhook_endpoint"},"organization_id":{"type":["string","null"],"description":"Owning organization ID, or null if the resource is public (created without an API key)."},"name":{"type":"string"},"description":{"type":["string","null"]},"url":{"type":"string","description":"Public capture URL (…/api/catch/{id}) that records requests."},"max_events":{"type":"integer","description":"Maximum number of events retained. Defaults to 100."},"event_count":{"type":"integer","description":"Number of captured events. Present on single-resource reads."},"created_at":{"type":["integer","null"],"description":"When the endpoint was created. Unix timestamp in seconds."},"updated_at":{"type":["integer","null"],"description":"When the endpoint was last updated. Unix timestamp in seconds."}},"required":["id","object","organization_id","name","description","url","max_events","created_at","updated_at"]},"WebhookEvent":{"type":"object","description":"A captured inbound HTTP request to a webhook endpoint.","properties":{"id":{"type":"string","description":"Unique identifier for the webhook event, prefixed with `wev_`.","examples":["wev_xxxxxxxxxxxxxxxxxxxxxxxx"]},"object":{"type":"string","const":"webhook_event"},"endpoint_id":{"type":"string","description":"ID of the capturing endpoint (whe_…)."},"organization_id":{"type":["string","null"],"description":"Owning organization ID, or null if the resource is public (created without an API key)."},"method":{"type":"string","description":"HTTP method of the captured request."},"path":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"body":{"type":["string","null"],"description":"Raw request body."},"parsed_body":{"description":"Parsed body when the payload was JSON, otherwise null."},"query_params":{"type":"object","additionalProperties":{"type":"string"}},"source_ip":{"type":["string","null"]},"size_bytes":{"type":["integer","null"]},"received_at":{"type":["integer","null"],"description":"When the request was captured. Unix timestamp in seconds."}},"required":["id","object","endpoint_id","organization_id","method","path","headers","body","parsed_body","query_params","source_ip","size_bytes","received_at"]},"Artifact":{"type":"object","description":"An artifact — a file of content an agent can store and recall.","properties":{"id":{"type":"string","description":"Unique identifier for the artifact, prefixed with `art_`.","examples":["art_xxxxxxxxxxxxxxxxxxxxxxxx"]},"object":{"type":"string","const":"artifact"},"organization_id":{"type":["string","null"],"description":"Owning organization ID, or null if the resource is public (created without an API key)."},"name":{"type":"string"},"content":{"type":"string","description":"The stored content."},"format":{"type":"string","enum":["markdown","html"],"description":"Content format. Determines the content type the raw endpoint serves."},"raw_url":{"type":"string","description":"Path serving the raw content with the format's content type (`text/html` for html, `text/markdown` for markdown)."},"created_at":{"type":["integer","null"],"description":"When the artifact was created. Unix timestamp in seconds."},"updated_at":{"type":["integer","null"],"description":"When the artifact was last updated. Unix timestamp in seconds."}},"required":["id","object","organization_id","name","content","format","raw_url","created_at","updated_at"]},"ScheduledMessage":{"type":"object","description":"A message scheduled to fire at a later time to trigger an agent. Today the only channel is `http`: an HTTP request sent to `url` at `scheduled_at`.","properties":{"id":{"type":"string","description":"Unique identifier for the scheduled message, prefixed with `msg_`.","examples":["msg_xxxxxxxxxxxxxxxxxxxxxxxx"]},"object":{"type":"string","const":"scheduled_message"},"organization_id":{"type":["string","null"],"description":"Owning organization ID, or null if the resource is public (created without an API key)."},"channel":{"type":"string","enum":["http"],"description":"Delivery channel. Only `http` is supported today."},"url":{"type":"string","description":"Target URL the request is sent to."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"description":"HTTP method used for delivery."},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Request headers. Defaults to {}."},"body":{"type":["string","null"],"description":"Request body, if any."},"scheduled_at":{"type":["integer","null"],"description":"When the message will fire. Unix timestamp in seconds."},"status":{"type":"string","enum":["scheduled","delivering","delivered","failed","canceled"],"description":"Delivery state."},"attempts":{"type":"integer","description":"Number of delivery attempts made."},"response_status":{"type":["integer","null"],"description":"HTTP status returned by the target on the last attempt."},"last_error":{"type":["string","null"],"description":"Error from the last attempt, if it failed."},"delivered_at":{"type":["integer","null"],"description":"When the last delivery attempt ran. Unix timestamp in seconds."},"created_at":{"type":["integer","null"],"description":"When the message was created. Unix timestamp in seconds."},"updated_at":{"type":["integer","null"],"description":"When the message was last updated. Unix timestamp in seconds."}},"required":["id","object","organization_id","channel","url","method","headers","body","scheduled_at","status","attempts","response_status","last_error","delivered_at","created_at","updated_at"]},"TaskList":{"type":"object","description":"A paginated list of task objects.","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"ID to pass as ?after= for the next page, or null."},"total_count":{"type":"integer"}},"required":["object","data","has_more","next_cursor"]},"WebhookEndpointList":{"type":"object","description":"A paginated list of webhook endpoint objects.","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"ID to pass as ?after= for the next page, or null."},"total_count":{"type":"integer"}},"required":["object","data","has_more","next_cursor"]},"WebhookEventList":{"type":"object","description":"A paginated list of webhook event objects.","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"ID to pass as ?after= for the next page, or null."},"total_count":{"type":"integer"}},"required":["object","data","has_more","next_cursor"]},"ArtifactList":{"type":"object","description":"A paginated list of artifact objects.","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Artifact"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"ID to pass as ?after= for the next page, or null."},"total_count":{"type":"integer"}},"required":["object","data","has_more","next_cursor"]},"ScheduledMessageList":{"type":"object","description":"A paginated list of scheduled message objects.","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledMessage"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"ID to pass as ?after= for the next page, or null."},"total_count":{"type":"integer"}},"required":["object","data","has_more","next_cursor"]},"TaskCreateResponse":{"allOf":[{"$ref":"#/components/schemas/Task"}],"properties":{"claim_token":{"type":"string","description":"One-time token to claim ownership of this resource via POST /api/claim/{id}. Only present when created without an API key."},"claim_url":{"type":"string","description":"Relative URL for claiming the resource."}}},"WebhookEndpointCreateResponse":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"}],"properties":{"claim_token":{"type":"string","description":"One-time token to claim ownership of this resource via POST /api/claim/{id}. Only present when created without an API key."},"claim_url":{"type":"string","description":"Relative URL for claiming the resource."}}},"ArtifactCreateResponse":{"allOf":[{"$ref":"#/components/schemas/Artifact"}],"properties":{"claim_token":{"type":"string","description":"One-time token to claim ownership of this resource via POST /api/claim/{id}. Only present when created without an API key."},"claim_url":{"type":"string","description":"Relative URL for claiming the resource."}}},"ScheduledMessageCreateResponse":{"allOf":[{"$ref":"#/components/schemas/ScheduledMessage"}],"properties":{"claim_token":{"type":"string","description":"One-time token to claim ownership of this resource via POST /api/claim/{id}. Only present when created without an API key."},"claim_url":{"type":"string","description":"Relative URL for claiming the resource."}}},"Error":{"type":"object","description":"Standard error envelope returned for all 4xx/5xx responses.","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","authorization_error","not_found_error","rate_limit_error","api_error"]},"code":{"type":"string","description":"Machine-readable error code."},"message":{"type":"string","description":"Human-readable error message."},"param":{"type":["string","null"],"description":"The offending parameter, when applicable."}},"required":["type","code","message"]}},"required":["error"]}},"parameters":{"limit":{"name":"limit","in":"query","description":"Number of results to return (1–100).","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},"after":{"name":"after","in":"query","description":"Cursor for pagination — the ID of the last item from the previous page.","required":false,"schema":{"type":"string"}},"label":{"name":"label","in":"query","description":"Only return tasks carrying this label. May be repeated; a task must carry every requested label to match.","required":false,"schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"The request was malformed or failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"No valid API key was provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"WWW-Authenticate":{"description":"Advertises the protected-resource metadata URL (RFC 9728) so agents can bootstrap the agent-auth flow.","schema":{"type":"string"}}}},"Forbidden":{"description":"The caller is authenticated but lacks access to the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"The resource does not exist or is not visible to the caller.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Optional API key (e.g. `agt_live_…`) passed as `Authorization: Bearer <key>`. Without a key, resources are created public and reachable by ID; with a key, they are owned by the key's organization."}}}}