API Reference

Full reference for the Verne Relay HTTP API. All endpoints are served from https://api.vernesoft.com.

Examples are shown as raw curl requests and as calls through the official SDKs — see Installation to set one up. SDK snippets assume an initialized verne client.


1. Authentication

Every request must include a Bearer token in the Authorization header. Relay tokens follow the format:

vrn_relay_<environment>_<secret>
PrefixEnvironment
vrn_relay_test_Sandbox — events are accepted but not delivered.
vrn_relay_live_Production — full delivery pipeline.

Example header:

Authorization: Bearer vrn_relay_live_sk_9f8a7...

Tokens are scoped to a single tenant and can be rotated from the Dashboard → Keys page.


2. Send Event

POST /v1/relay/messages

Publishes a new event to all endpoints subscribed to the given event_type.

Request Body

FieldTypeRequiredDescription
event_typestringYesDot-notated event name (e.g. user.created).
payloadobjectYesArbitrary JSON payload delivered to subscribers.
idempotency_keystringNoPrevents duplicate delivery within a 24 h window.
channelsstring[]NoRestrict delivery to endpoints listening on these channels.

Example Request

curl -X POST https://api.vernesoft.com/v1/relay/messages \
  -H 'Authorization: Bearer vrn_relay_test_123' \
  -H 'Content-Type: application/json' \
  -d '{
    "event_type": "user.created",
    "payload": { "id": "123" },
    "idempotency_key": "evt_abc",
    "channels": ["team-a"]
  }'

Response

{
  "id": "msg_2hV9kLmNpQ",
  "event_type": "user.created",
  "status": "accepted",
  "timestamp": "2026-03-17T12:00:00Z"
}
Status CodeMeaning
202 AcceptedEvent queued for delivery.
400 Bad RequestInvalid payload or missing required fields.
401 UnauthorizedMissing or invalid Bearer token.
409 ConflictDuplicate idempotency_key.
429 Too Many RequestsRate limit exceeded — retry after Retry-After header.

3. List Events

GET /v1/relay/messages

Returns a paginated list of previously sent events for the current tenant.

Query Parameters

ParameterTypeDefaultDescription
limitinteger20Items per page (max 100).
cursorstringPagination cursor from a previous response.
event_typestringFilter by event type.

Example Request

curl 'https://api.vernesoft.com/v1/relay/messages?limit=5&event_type=user.created' \
  -H 'Authorization: Bearer vrn_relay_test_123'

Response

{
  "data": [
    {
      "id": "msg_2hV9kLmNpQ",
      "event_type": "user.created",
      "status": "delivered",
      "timestamp": "2026-03-17T12:00:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Error Format

All errors follow a consistent structure. The SDKs surface these fields as a typed error:

{
  "error": {
    "code": "invalid_payload",
    "message": "Field 'event_type' is required.",
    "request_id": "req_abc123"
  }
}

Include the request_id when contacting support for faster resolution.