Endpoints
The URLs webhooks go to, each with its signing secrets, static headers, and whether it is active. A subscription names an endpoint as its target.
Deliveries explains how an endpoint is sent to, signed, and disabled. Receive webhooks sets one up.
Paths are relative to https://api.agentpost.tools/v1/events, and every request follows the API basics. Who may call explains each kind of caller.
Create an endpoint
POST /endpoints
Creates an endpoint and answers with it and its signing secret, secret, whsec_…, shown this once.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Body
| Name | Type | Required | Description |
|---|---|---|---|
url |
string |
Yes | A public HTTPS URL for your receiver; up to 2048 characters. |
description |
string |
No | Up to 2000 characters. |
headers |
object |
No | Each value is a string. |
workspace |
string |
No | The workspace it belongs to, when the app groups its principals into workspaces; 1–200 characters. |
Response
201 Created, with:
| Name | Type | Present | Description |
|---|---|---|---|
endpoint |
EndpointRecord |
Always | |
secret |
string |
Always |
Errors
invalid_request(400)payload_too_large(413)
Any operation can also answer with the codes Conventions lists.
List endpoints
GET /endpoints
Endpoints, newest first.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Pages:
limit, 1 to 200, default 50, withnextandafter. Lists has the rule.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
status |
"active" or "disabled" |
No | |
after |
string |
No | |
limit |
integer |
No | 1–200; default 50. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
endpoints |
EndpointRecord array |
Always | |
next |
string |
When set |
Errors
invalid_request(400)
Any operation can also answer with the codes Conventions lists.
Get an endpoint
GET /endpoints/:id
One endpoint.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
endpoint |
EndpointRecord |
Always |
Errors
not_found(404)
Any operation can also answer with the codes Conventions lists.
Update an endpoint
PATCH /endpoints/:id
Changes an endpoint’s URL, description, or static headers; a field you leave out keeps its value, and null clears it.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
url |
string |
No | A public HTTPS URL for your receiver; up to 2048 characters. |
description |
string or null |
No | |
headers |
object or null |
No | Each value is a string. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
endpoint |
EndpointRecord |
Always |
Errors
not_found(404)invalid_request(400)payload_too_large(413)
Any operation can also answer with the codes Conventions lists.
Delete an endpoint
DELETE /endpoints/:id
Deletes an endpoint. A subscription that still sends to it answers conflict: delete or retarget it first.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Response
204 No Content, with no body.
Errors
Any operation can also answer with the codes Conventions lists.
Enable an endpoint
POST /endpoints/:id/enable
Turns a disabled endpoint back on. Deliveries skipped while it was off stay skipped; recover them to send them.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
endpoint |
EndpointRecord |
Always |
Errors
not_found(404)
Any operation can also answer with the codes Conventions lists.
Disable an endpoint
POST /endpoints/:id/disable
Turns an endpoint off. Its new deliveries are skipped until it is enabled.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
endpoint |
EndpointRecord |
Always |
Errors
not_found(404)
Any operation can also answer with the codes Conventions lists.
Rotate a signing secret
POST /endpoints/:id/secrets/rotate
Adds a new signing secret, secret, shown this once. The old one keeps signing beside it until expiresIn passes, so the receiver can switch without missing a delivery.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
expiresIn |
string |
Yes | How long the old secrets keep signing beside the new one: a duration from "0s", which retires them at once, to "7d". |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
endpoint |
EndpointRecord |
Always | |
secret |
string |
Always |
Errors
not_found(404)payload_too_large(413)invalid_request(400)
Any operation can also answer with the codes Conventions lists.
Test an endpoint
POST /endpoints/:id/test
Publishes a tools.agentpost.events.endpoint.test event and delivers it to the endpoint at once, through the same signing and sending as any delivery, and answers with the first attempt. A disabled endpoint answers conflict.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Response
201 Created, with:
| Name | Type | Present | Description |
|---|---|---|---|
eventSequence |
number |
Always | |
delivery |
DeliveryRecord |
Always | |
attempts |
AttemptRecord array |
Always |
Errors
Any operation can also answer with the codes Conventions lists.
Recover failed deliveries
POST /endpoints/:id/recover
Queues failed deliveries and deliveries skipped because the endpoint was disabled, when they were created at or after since. Enable the endpoint first.
- Who may call: Your server, with your project’s secret key.
- Credential: the examples send your project’s
devsecret key,sk_test_…, asAuthorization: Bearer <token>. - Idempotency-Key: optional. Retrying a write has the rule.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | An endpoint ID, end_…. The id of a EndpointRecord. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
since |
string |
Yes | An ISO 8601 date and time. |
Response
200 OK, with RecoverResponse.
Errors
not_found(404)conflict(409)payload_too_large(413)invalid_request(400)
Any operation can also answer with the codes Conventions lists.
The EndpointRecord object
| Name | Type | Present | Description |
|---|---|---|---|
id |
string |
Always | An endpoint ID, end_…. |
url |
string |
Always | |
description |
string |
When set | |
status |
"active" or "disabled" |
Always | |
disabledReason |
string |
When set | One of "manual", "gone", or "failing". |
secrets |
object[] |
Always | The signing secrets by ID. The secret itself is shown once, when the endpoint is created or a secret rotated. |
secrets[]. |
string |
Always | |
secrets[]. |
"hmac-sha256" |
Always | |
secrets[]. |
string |
Always | |
secrets[]. |
string |
When set | |
hasHeaders |
boolean |
Always | Whether static headers are set. Their values are never returned. |
workspace |
string |
When set | The workspace it belongs to, when the app groups its principals into workspaces. |
failingSince |
string |
When set | |
lastSuccessAt |
string |
When set | |
createdAt |
string |
Always | |
createdBy |
string |
Always | |
updatedAt |
string |
Always |
The RecoverResponse object
| Name | Type | Present | Description |
|---|---|---|---|
endpointId |
string |
Always | An endpoint ID, end_…. |
recovered |
number |
Always | Deliveries put back to pending. |