Replays
Send a range of history again, to one subscription or every subscription of an endpoint. A replay makes new matches and deliveries, with new webhook-id values and the events’ own id, and never changes the old ones.
Replays explains what a replay sends and how a receiver tells it apart.
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.
Replay events
POST /replays
Starts a replay, which answers 202 and runs in the background. With dryRun: true it answers 200 with preview, what it would send, and writes nothing: run that first, and start the replay once the counts are what you meant. A disabled endpoint, a deleted subscription with definitions: "current", and a subscription with a notification target answer 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.
Body
| Name | Type | Required | Description |
|---|---|---|---|
filter |
object |
No | |
filter. |
string[] |
No | 1–50 items. |
filter. |
string[] |
No | 1–50 items. |
filter. |
object |
No | Each value is a string or string[]. |
filter. |
string |
No | The workspace it belongs to, when the app groups its principals into workspaces; 1–200 characters. |
filter. |
string |
No | 1–500 characters. |
filter. |
object[] |
No | 1–20 items. |
filter. |
string |
Yes | 1–100 characters. |
filter. |
string |
No | 1–500 characters. |
filter. |
object |
No | Each value is a string or string[]. |
from |
string |
Yes | An ISO 8601 date and time. |
to |
string |
Yes | An ISO 8601 date and time. |
target |
object |
Yes | |
target. |
string |
No | |
target. |
string |
No | |
definitions |
string |
Yes | One of "current" or "historical". |
dryRun |
boolean |
No | Default false. |
Response
202 Accepted, with:
| Name | Type | Present | Description |
|---|---|---|---|
replay |
ReplayRecord |
When set | |
preview |
ReplayPreview |
When set |
Errors
not_found(404)conflict(409)payload_too_large(413)invalid_request(400)
Any operation can also answer with the codes Conventions lists.
List replays
GET /replays
Replays, 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 |
string |
No | One of "running", "completed", "canceled", or "failed". |
subscriptionId |
string |
No | |
endpointId |
string |
No | |
after |
string |
No | |
limit |
integer |
No | 1–200; default 50. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
replays |
ReplayRecord array |
Always | |
next |
string |
When set |
Errors
invalid_request(400)
Any operation can also answer with the codes Conventions lists.
Get a replay
GET /replays/:id
One replay, with its counts so far.
- 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 | A replay ID, rpl_…. The id of a ReplayRecord. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
replay |
ReplayRecord |
Always |
Errors
not_found(404)
Any operation can also answer with the codes Conventions lists.
Cancel a replay
POST /replays/:id/cancel
Stops a running replay. What it already queued is still delivered.
- 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 | A replay ID, rpl_…. The id of a ReplayRecord. |
Response
200 OK, with:
| Name | Type | Present | Description |
|---|---|---|---|
replay |
ReplayRecord |
Always |
Errors
Any operation can also answer with the codes Conventions lists.
The ReplayRecord object
| Name | Type | Present | Description |
|---|---|---|---|
id |
string |
Always | A replay ID, rpl_…. |
filter |
object |
Always | |
filter. |
string[] |
When set | 1–50 items. |
filter. |
string[] |
When set | 1–50 items. |
filter. |
object |
When set | Each value is a string or string[]. |
filter. |
string |
When set | The workspace it belongs to, when the app groups its principals into workspaces; 1–200 characters. |
filter. |
string |
When set | 1–500 characters. |
filter. |
object[] |
When set | 1–20 items. |
filter. |
string |
Always | 1–100 characters. |
filter. |
string |
When set | 1–500 characters. |
filter. |
object |
When set | Each value is a string or string[]. |
from |
string |
Always | |
to |
string |
Always | |
target |
object |
Always | |
target. |
string |
When set | |
target. |
string |
When set | |
definitions |
string |
Always | One of "current" or "historical". |
status |
string |
Always | One of "running", "completed", "canceled", or "failed". |
counts |
object |
Always | |
counts. |
number |
Always | Events in the range that met the filter. |
counts. |
number |
Always | Matches written, one per event and subscription. |
counts. |
number |
Always | Deliveries written, including those skipped for a disabled endpoint. |
cursor |
number |
When set | The last sequence scanned. Progress, and where a resumed replay would pick up. |
error |
string |
When set | Why it failed, when it did. |
requestedBy |
string |
Always | |
createdAt |
string |
Always | |
completedAt |
string |
When set |
The ReplayPreview object
The answer to a dry run: what a replay would do, with nothing written. It counts up to 5,000 events; partial marks a longer range.
| Name | Type | Present | Description |
|---|---|---|---|
dryRun |
true |
Always | |
target |
object |
Always | |
target. |
string |
When set | |
target. |
string |
When set | |
definitions |
string |
Always | One of "current" or "historical". |
counts |
object |
Always | |
counts. |
number |
Always | Events in the range that met the filter. |
counts. |
number |
Always | Matches written, one per event and subscription. |
counts. |
number |
Always | Deliveries written, including those skipped for a disabled endpoint. |
partial |
boolean |
When set | True when the preview stopped before the range’s end; cursor is the last sequence it counted. |
cursor |
number |
When set |