Skip to main content
API reference

Events

Generated HTTP reference for the 1 operation the published OpenAPI document describes under events.

2 min read
View MarkdownEdit on GitHub

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

NameTypeRequiredDescription
event_idstringyesId of a stored event in the calling credential's org and project.

Query parameters

NameTypeRequiredDescription
trigger_idstringnoNarrow 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

StatusBodyDescription
202objectAccepted — the dispatches were handed off. It is not a statement that any receiver answered.
400objectThe 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.
404objectNo 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.
409objectThe named subscription exists and matches the event type but is not active. details.status carries the state it is actually in.

Response 202

FieldTypeRequiredDescription
dispatchedintegeryesActive subscriptions the event was handed to. Counted before delivery, so a failing receiver does not lower it.
event_idstringyesEchoes the replayed event. Unchanged: replay does not mint a new event.
trigger_idstring,nullyesEchoes 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"
Events | CodeSpar