API reference
Events
Generated HTTP reference for the 1 operation the published OpenAPI document describes under events.
2 min read
Events
This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
POST /v1/events/{event_id}/replay
Re-dispatch a stored event to its subscribers
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
event_id | string | yes | Id of a stored event in the calling credential's org and project. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
trigger_id | string | no | Narrow the fan-out to one subscription. It must live in the same org and project, subscribe to this event's type, and be active; each of those is a different refusal below. |
Responses
| Status | Body | Description |
|---|---|---|
202 | object | Accepted — the dispatches were handed off. It is not a statement that any receiver answered. |
400 | object | The named subscription is subscribed to a different event type than the stored event. details carries trigger_event and event_type so the mismatch does not have to be guessed. |
404 | object | No such event, or no such subscription, inside the calling credential's org and project. The two codes are distinct so a caller can tell which of the two ids was wrong. |
409 | object | The named subscription exists and matches the event type but is not active. details.status carries the state it is actually in. |
Response 202
| Field | Type | Required | Description |
|---|---|---|---|
dispatched | integer | yes | Active subscriptions the event was handed to. Counted before delivery, so a failing receiver does not lower it. |
event_id | string | yes | Echoes the replayed event. Unchanged: replay does not mint a new event. |
trigger_id | string,null | yes | Echoes the query parameter, or null when the fan-out was not narrowed. |
Example response
{
"event_id": "event_0000000000000000",
"dispatched": 0
}Example request
curl -X POST https://api.codespar.dev/v1/events/{event_id}/replay \
-H "Authorization: Bearer $CODESPAR_API_KEY"