API

Webhook

Where an agent's events are posted: list, add or remove one. Adding one returns its signing secret.

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /agents/{id}/webhooks create The webhook and its secret
GET /agents/{id}/webhooks list The webhooks
DELETE /agents/{id}/webhooks/{webhookId} remove Events are no longer posted there

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

webhooks, err := client.Webhook(nil).List(map[string]any{"agent_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(webhooks)
created, err := client.Webhook(nil).Create(map[string]any{"agent_id": "example", "url": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
removed, err := client.Webhook(nil).Remove(map[string]any{"agent_id": "example", "id": "example_id"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(removed)

Lua

Construct client as shown in the Lua setup, then call the operations:

local webhooks, err = client:Webhook():list({ agent_id = "example" })
local created, err = client:Webhook():create({ agent_id = "example", url = "example" })
local removed, err = client:Webhook():remove({ agent_id = "example", id = "example_id" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$webhooks = $client->Webhook()->list(["agent_id" => "example"]);
$created = $client->Webhook()->create(["agent_id" => "example", "url" => "example"]);
$client->Webhook()->remove(["agent_id" => "example", "id" => "example_id"]);

Python

Construct client as shown in the Python setup, then call the operations:

webhooks = client.Webhook().list({"agent_id": "example"})
created = client.Webhook().create({ "agent_id": "example", "url": "example" })
client.Webhook().remove({"agent_id": "example", "id": "example_id"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

webhooks = client.Webhook.list({ "agent_id" => "example" })
created = client.Webhook.create({ "agent_id" => "example", "url" => "example" })
client.Webhook.remove({ "agent_id" => "example", "id" => "example_id" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const webhooks = await client.Webhook().list({ agent_id: "example" })
const created = await client.Webhook().create({ agent_id: "example", url: "example" })
await client.Webhook().remove({ agent_id: "example", id: "example_id" })

Fields

Field Type Required Description
attempts integer Yes How many times the event Artil is retrying has failed
bearerToken string No A token Artil sends as Authorization: Bearer with each delivery, for an endpoint that checks one instead of the signature, like a Grok Bot routine or a Claude scheduled task's API trigger.
createdAt string Yes Created At
deliveredAt any Yes Delivered At
error one,string,null Yes Why the last delivery failed
erroredAt any Yes Errored At
id string Yes Id
retryAt any Yes When Artil next retries a failed event
url string Yes Where Artil posts the agent's events

create

POST /agents/{id}/webhooks

Operation ID: addWebhook.

Authentication: bearer token (token) or oauth2 (oauth).

Parameters

Parameter In Type Required Description
id path string Yes The agent's id

Request body

application/json

Property Type Required Description
bearerToken string No A token Artil sends as Authorization: Bearer with each delivery, for an endpoint that checks one instead of the signature, like a Grok Bot routine or a Claude scheduled task's API trigger. A new one replaces the token of a URL added before.
url string (uri) Yes

Responses

201: The webhook and its secret

application/json

Property Type Required Description
attempts integer Yes How many times the event Artil is retrying has failed
createdAt string (date-time) Yes
deliveredAt string (date-time) or null Yes
error string,null Yes Why the last delivery failed
erroredAt string (date-time) or null Yes
id string (uuid) Yes
retryAt string (date-time) or null Yes When Artil next retries a failed event
secret string Yes The Standard Webhooks key each delivery is signed with
url string (uri) Yes Where Artil posts the agent's events
4XX: The request failed; the error says why

application/json

Property Type Required Description
error object Yes
error.code enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... Yes
error.message string Yes
5XX: The request failed; the error says why

application/json

Property Type Required Description
error object Yes
error.code enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... Yes
error.message string Yes

list

GET /agents/{id}/webhooks

Operation ID: listWebhooks.

Authentication: bearer token (token) or oauth2 (oauth).

Parameters

Parameter In Type Required Description
id path string Yes The agent's id

Responses

200: The webhooks

application/json

Property Type Required Description
[].attempts integer Yes How many times the event Artil is retrying has failed
[].createdAt string (date-time) Yes
[].deliveredAt string (date-time) or null Yes
[].error string,null Yes Why the last delivery failed
[].erroredAt string (date-time) or null Yes
[].id string (uuid) Yes
[].retryAt string (date-time) or null Yes When Artil next retries a failed event
[].url string (uri) Yes Where Artil posts the agent's events
4XX: The request failed; the error says why

application/json

Property Type Required Description
error object Yes
error.code enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... Yes
error.message string Yes
5XX: The request failed; the error says why

application/json

Property Type Required Description
error object Yes
error.code enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... Yes
error.message string Yes

remove

DELETE /agents/{id}/webhooks/{webhookId}

Operation ID: removeWebhook.

Authentication: bearer token (token) or oauth2 (oauth).

Parameters

Parameter In Type Required Description
id path string Yes The agent's id
webhookId path string Yes

Responses

204: Events are no longer posted there
4XX: The request failed; the error says why

application/json

Property Type Required Description
error object Yes
error.code enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... Yes
error.message string Yes
5XX: The request failed; the error says why

application/json

Property Type Required Description
error object Yes
error.code enum: invalid_input, unauthorized, forbidden, plan_limit, not_found, conflict, ... Yes
error.message string Yes