Skip To Content
DocsAPI

Runs API

Start a run from your own code and read back what it did.

The Runs API starts a run on a ticket and returns what the run did. Use it to connect a tool that is not built in, or to start runs from your own code.

Authentication

Create a key under Settings, API keys and send it as a bearer token. Keys belong to a workspace and can be limited to chosen categories.

Start a run

Terminal
curl https://api.kestrel.example/v1/runs \  -H "Authorization: Bearer $KESTREL_KEY" \  -H "Content-Type: application/json" \  -d '{ "ticket": "81226", "category": "refunds" }'

The call returns at once with the run's id. The work happens in the background.

JSON
{  "id": "run_48213",  "status": "running",  "ticket": "81226"}

Read a run

Terminal
curl https://api.kestrel.example/v1/runs/run_48213 \  -H "Authorization: Bearer $KESTREL_KEY"

A finished run lists every step with its time, the tool it used and the result.

JSON
{  "id": "run_48213",  "status": "resolved",  "outcome": "acted_alone",  "steps": [    { "did": "read_ticket", "seconds": 0.8 },    { "did": "found_charge", "tool": "stripe", "seconds": 1.9 },    { "did": "refunded", "amount": 4900, "seconds": 3.2 },    { "did": "replied", "seconds": 0.6 }  ]}

Statuses

  • running means the work is in progress.
  • waiting means Kestrel asked a person and has not had an answer.
  • resolved means the ticket is closed.
  • handed_over means the ticket went to your team.

Limits

One hundred requests a minute for each key. A request over the limit gets a 429 with a Retry-After header.

To hear about a run without asking again and again, use Webhooks.

Give Kestrel one category this week.

Start with refunds. Connect your help desk and billing, set a limit, and watch the first hundred runs before it works alone.

Talk To Sales