Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Publish an event

Accept an event for asynchronous fan-out. Publishing to the reserved anlyon topic is blocked. idempotencyKey provides durable topic-scoped deduplication; Idempotency-Key protects an HTTP retry.

POST/api/v2/events
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Idempotency-Keystring

Stable retry key for a mutation. The key is claimed atomically before the handler runs, so concurrent retries execute the side effect at most once. Replaying the key for the same request (same method, path, workspace and JSON body) returns the original response with an X-Idempotent-Replay: true header. Reusing the key for a different request returns 409 with error code idempotency_key_reuse. A duplicate arriving while the first is still in flight waits and then replays; if the first does not finish in time the duplicate gets 409 idempotency_request_in_progress. Keys are retained for 24 hours. Only successful (2xx) responses are stored; a failed request frees the key so it can be retried.

min length 1 · max length 255
Request body
requiredapplication/json
topicstringrequired

Public topic ID or name.

min length 1 · max length 100
typestringrequired
min length 1 · max length 200 · matches ^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*$
dataobject
default: {}
idempotencyKeystring

Durable deduplication key scoped to the workspace and topic.

min length 1 · max length 255
runIdstring

Existing run in this API key environment for event-delivery spans.

max length 80
parentSpanIdstring

Optional parent span within runId.

max length 80
Responses
200

Original event returned because the body idempotency key was already used for this topic.

successbooleanrequired
Allowed:true
dataEventPublishResultrequired
Show properties
idstringrequired
matches ^evt_
statusstringrequired
Allowed:receivedfanned_outno_subscribers
deduplicatedboolean

True when a prior event with the same body idempotency key was returned.

202

Event accepted for asynchronous fan-out.

successbooleanrequired
Allowed:true
dataEventPublishResultrequired
Show properties
idstringrequired
matches ^evt_
statusstringrequired
Allowed:receivedfanned_outno_subscribers
deduplicatedboolean

True when a prior event with the same body idempotency key was returned.

400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
402

Payment Required - Usage quota exceeded

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
409

The request conflicts with current resource state or a concurrent decision.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
429

Too Many Requests - Rate limit exceeded

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
503

A required provider or platform dependency is not configured or available.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.anlyon.com/api/v2/events' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "topic": "string",
  "type": "order.completed",
  "data": {},
  "idempotencyKey": "string",
  "runId": "string",
  "parentSpanId": "string"
}'
Response
{
  "success": true,
  "data": {
    "id": "string",
    "status": "received",
    "deduplicated": true
  }
}