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

Publish a single message

Publish immediately or schedule delivery with a Unix timestamp. The legacy scheduledFor field remains accepted for compatibility.

POST/api/v2/messages/publish
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
Anlyon-Queuestring

Queue name; overrides the request-body queue.

matches ^[a-zA-Z0-9_-]+$
Request body
requiredapplication/json
urlstring<uri>required

Destination URL for the message

methodstring

HTTP method to use

default: "POST"
Allowed:GETPOSTPUTPATCHDELETE
headersobject

Custom headers to include in the request

bodyany

Request body (can be any JSON value)

queuestring

Named queue for this delivery. Anlyon-Queue header takes precedence.

matches ^[a-zA-Z0-9_-]+$
executeAtinteger<int64>

Unix timestamp in seconds. Cannot be combined with scheduledFor.

min 0
scheduledForstring<date-time>deprecated

Deprecated ISO 8601 delivery time retained for compatibility. Use executeAt. Cannot be combined with executeAt.

maxRetriesinteger

Maximum number of retry attempts

min 0 · max 10 · default: 3
contentIdstring

Optional 24-hour content-deduplication identifier. This is independent of the Idempotency-Key header.

callbackUrlstring<uri>

URL to receive delivery status updates

failureCallbackUrlstring<uri>

URL to receive failure notifications

runIdstring

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

max length 80
parentSpanIdstring

Optional parent span within runId.

max length 80
flowControlobject
Show properties
keystringrequired
min length 1 · max length 100 · matches ^[a-zA-Z0-9_-]+(?::[a-zA-Z0-9_-]+)*$
rateLimitinteger
min 1 · max 10000
rateLimitWindowinteger
min 1 · max 3600
parallelisminteger
min 1 · max 1000
Responses
200

Message published successfully

successboolean
dataobject
Show properties
messageIdstring
statusstring
Allowed:pendingscheduled
scheduledForstring<date-time> | null
queuestring | null
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
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/messages/publish' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://example.com/webhook",
  "method": "POST",
  "body": {
    "event": "user_created",
    "userId": 123
  }
}'
Response
{
  "success": true,
  "data": {
    "messageId": "msg_1234567890abcdef",
    "status": "scheduled",
    "scheduledFor": "2024-12-31T23:59:59Z",
    "queue": "critical"
  }
}