Skip to main content
POST
Create a subscription

Authorizations

Authorization
string
header
required

A bearer JWT issued by Access Manager. The /v1 surface never reads a tenant from the body, path, or query. Machine callers obtain a token with the Access Manager client-credentials flow. The /admin surface authorizes against an operator scope and carries no tenant context.

Headers

X-Idempotency
string
required

A client-chosen unique key that makes this mutation at-most-once. A mutation sent without it is rejected before any write with 400 missing_idempotency_key. Reusing the same key with an identical request replays the original response byte-for-byte (with X-Idempotency-Replayed: true); reusing it with a different request body returns 409 idempotency_conflict. To re-drive a corrected request, mint a new key.

Body

application/json

The create body. It carries no tenant_id (the tenant is resolved from the JWT). Inline sink_config / credential fields are rejected with 422 inline_sink_config_forbidden — queue credentials arrive only via the credential PUT.

name
string
required

A human label for the subscription. Required and non-blank (whitespace-only is rejected).

Example:

"orders-webhook"

sink_kind
enum<string>
required

The delivery destination kind. webhook posts signed HTTPS requests; pull exposes an inbox read over GET /v1/events; sqs, rabbitmq, and eventbridge fan out to the named queue or bus.

Available options:
webhook,
pull,
sqs,
rabbitmq,
eventbridge
endpoint
string

The destination address, interpreted per sink kind. For webhook, an https:// URL with no embedded userinfo. For pull, omit it — the server synthesizes a pull://<id> value. For sqs, the https:// queue URL. For rabbitmq, an "<exchange>/<routingKey>" string (exchange required, routing key optional). For eventbridge, the event-bus name / detail-type addressing string. The broker host or AWS region for queue kinds lives in the encrypted credential, not here.

Example:

"https://hooks.example.com/lerian"

event_types
string[]

The eventKey values to deliver, as GET /v1/catalog serves them. Any well-formed key is accepted. A key no producer emits matches nothing.

Example:
origin
string

Pins the subscription to one producing application, by its ce-source. Omit it to receive the event types from any producer.

Example:

"midaz"

timeout_ms
integer

The per-attempt delivery timeout in milliseconds, from 1000 to 20000. For webhook subscriptions only: the hub refuses a non-zero value for any other sink kind. Omit it, or send 0, to use the 10000 default.

Example:

20000

schema_major
integer

Optional schema-major pin. When set, delivery follows the versioned topic for that major; when omitted, the subscription follows the base topic.

Example:

1

plan_tier
string

The plan tier for the subscription.

Example:

"standard"

Response

The subscription was created. signingSecret carries a secret only for a webhook sink. No read route returns it; a replay of the same X-Idempotency key returns this same response.

The create response. signingSecret carries a secret only for a webhook sink; it is stored only as ciphertext. No read route returns it; a replay of the same X-Idempotency key returns this same response.

subscription
object
required

The non-secret projection of a subscription. It never carries the signing secret or any credential material.

signingSecret
string
required

The webhook signing secret, minted server-side. No read route returns it; a replay of the same X-Idempotency key returns this same response. An empty string for any other sink kind.

Example:

"whsec_9f8c2b1e4a7d6055c3e2f10987ab4c21"