API reference

API reference · Agents

Add a schedule or a webhook

POST/api/account/agents/{id}/triggersSigned in session

A schedule runs the agent on its cron with the stated input; a webhook runs it when a signed delivery arrives, and its secret is in this answer once and never again. Same origin only. A 404 while hosted runs or triggers (ANTIMATTER_AGENT_TRIGGERS) are off on the deployment.

Parameters

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringThe agent's id.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
kindrequiredanyOne of "schedule", "webhook".
cronstring
inputrequiredstring

Example

{
  "kind": "schedule",
  "cron": "string",
  "input": "Say hello in five words."
}

Answer 201

The trigger (a webhook's with its secret).

The answer's fields are not named in the document.

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 404OpenAI shaped error.
  • 409OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter