API

AgentWebhook

Operations

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

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/agents/{id}/spark/webhooks create Created connection; signing key is shown once
GET /api/v1/organizations/{organization_id}/agents/{id}/spark/webhooks/{endpoint_id} load Connection metadata without secrets or event content
PATCH /api/v1/organizations/{organization_id}/agents/{id}/spark/webhooks/{endpoint_id} update Updated connection; only a new rotation reveals a signing key

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:

agent_webhook, err := client.AgentWebhook(nil).Load(map[string]any{"agent_id": "example", "id": "example_id", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(agent_webhook)
created, err := client.AgentWebhook(nil).Create(map[string]any{"agent_id": "example", "organization_id": "example", "event_types": []any{}, "max_events_per_day": 1, "name": "example", "purpose": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)
updated, err := client.AgentWebhook(nil).Update(map[string]any{"id": "example_id", "agent_id": "example", "organization_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(updated)

Lua

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

local agent_webhook, err = client:AgentWebhook():load({ agent_id = "example", id = "example_id", organization_id = "example" })
local created, err = client:AgentWebhook():create({ agent_id = "example", organization_id = "example", event_types = {}, max_events_per_day = 1, name = "example", purpose = "example" })
local updated, err = client:AgentWebhook():update({ id = "example_id", agent_id = "example", organization_id = "example" })

PHP

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

$agent_webhook = $client->AgentWebhook()->load(["agent_id" => "example", "id" => "example_id", "organization_id" => "example"]);
$created = $client->AgentWebhook()->create(["agent_id" => "example", "organization_id" => "example", "event_types" => [], "max_events_per_day" => 1, "name" => "example", "purpose" => "example"]);
$updated = $client->AgentWebhook()->update(["id" => "example_id", "agent_id" => "example", "organization_id" => "example"]);

Python

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

agent_webhook = client.AgentWebhook().load({"agent_id": "example", "id": "example_id", "organization_id": "example"})
created = client.AgentWebhook().create({ "agent_id": "example", "organization_id": "example", "event_types": [], "max_events_per_day": 1, "name": "example", "purpose": "example" })
updated = client.AgentWebhook().update({"id": "example_id", "agent_id": "example", "organization_id": "example"})

Ruby

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

agent_webhook = client.AgentWebhook.load({ "agent_id" => "example", "id" => "example_id", "organization_id" => "example" })
created = client.AgentWebhook.create({ "agent_id" => "example", "organization_id" => "example", "event_types" => [], "max_events_per_day" => 1, "name" => "example", "purpose" => "example" })
updated = client.AgentWebhook.update({ "id" => "example_id", "agent_id" => "example", "organization_id" => "example" })

TypeScript

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

const agent_webhook = await client.AgentWebhook().load({ agent_id: "example", id: "example_id", organization_id: "example" })
const created = await client.AgentWebhook().create({ agent_id: "example", organization_id: "example", event_types: [], max_events_per_day: 1, name: "example", purpose: "example" })
const updated = await client.AgentWebhook().update({ id: "example_id", agent_id: "example", organization_id: "example" })

Fields

Field Type Required Description
action string Yes Action
connection object Yes Connection
deliveries array Yes Deliveries
event_types array Yes Event Types
expected_generation integer Yes Expected Generation
id string No Id
max_events_per_day integer Yes Max Events Per Day
name string Yes Name
purpose string Yes Purpose
signing_key one,string,null Yes Revealed only by the first successful creation or rotation response.

create

POST /api/v1/organizations/{organization_id}/agents/{id}/spark/webhooks

Operation ID: spark_webhooks_api_v1_organization_persistent_agent.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
Idempotency-Key header string Yes

Request body

application/json

Property Type Required Description
event_types array of string Yes
max_events_per_day integer Yes
name string Yes
purpose string Yes

Responses

201: Created connection; signing key is shown once

application/json

Property Type Required Description
connection object Yes
connection.actions array of enum: pause, resume, rotate, remove Yes
connection.event_types array of string Yes
connection.generation integer Yes
connection.last_received_at string (date-time) Yes
connection.locator string Yes
connection.max_events_per_day integer Yes
connection.name string Yes
connection.path string Yes
connection.paused_at string (date-time) Yes
connection.purpose string Yes
connection.receiver_path string Yes Generic JSON receiver URL path containing a secret token; available only to current bot managers.
connection.revoked_at string (date-time) Yes
signing_key string Yes Revealed only by the first successful creation or rotation response.
401: Authentication required
403: Bot management or inbox access required
409: Idempotency key belongs to different configuration
422: Invalid configuration

load

GET /api/v1/organizations/{organization_id}/agents/{id}/spark/webhooks/{endpoint_id}

Operation ID: get_api_v1_organizations_organization_id_agents_id_spark_webhooks_endpoint_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
endpoint_id path string Yes

Responses

200: Connection metadata without secrets or event content

application/json

Property Type Required Description
connection object Yes
connection.actions array of enum: pause, resume, rotate, remove Yes
connection.event_types array of string Yes
connection.generation integer Yes
connection.last_received_at string (date-time) Yes
connection.locator string Yes
connection.max_events_per_day integer Yes
connection.name string Yes
connection.path string Yes
connection.paused_at string (date-time) Yes
connection.purpose string Yes
connection.receiver_path string Yes Generic JSON receiver URL path containing a secret token; available only to current bot managers.
connection.revoked_at string (date-time) Yes
deliveries array of object Yes
deliveries[].event_id string Yes
deliveries[].received_at string (date-time) Yes
deliveries[].status enum: received, filtered, published, discarded Yes
401: Unauthorized
403: Forbidden
404: Source not found or not readable
422: Unprocessable entity
502: Bad gateway

update

PATCH /api/v1/organizations/{organization_id}/agents/{id}/spark/webhooks/{endpoint_id}

Operation ID: patch_api_v1_organizations_organization_id_agents_id_spark_webhooks_endpoint_id_.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
id path string Yes
endpoint_id path string Yes
Idempotency-Key header string Yes

Request body

application/json

Property Type Required Description
action enum: pause, resume, rotate, remove Yes
expected_generation integer Yes

Responses

200: Updated connection; only a new rotation reveals a signing key

application/json

Property Type Required Description
connection object Yes
connection.actions array of enum: pause, resume, rotate, remove Yes
connection.event_types array of string Yes
connection.generation integer Yes
connection.last_received_at string (date-time) Yes
connection.locator string Yes
connection.max_events_per_day integer Yes
connection.name string Yes
connection.path string Yes
connection.paused_at string (date-time) Yes
connection.purpose string Yes
connection.receiver_path string Yes Generic JSON receiver URL path containing a secret token; available only to current bot managers.
connection.revoked_at string (date-time) Yes
signing_key string Yes Revealed only by the first successful creation or rotation response.
401: Unauthorized
403: Bot management authority required
404: Source not found
409: Refresh the changed source
422: Invalid action or revoked source
502: Bad gateway