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

Publish multiple messages in batch

Publish up to 100 messages in a single request.

Against a key budget a batch costs one unit per message, and admission is all-or-nothing: a batch that does not fit the remaining cap is refused whole with 429 BUDGET_EXCEEDED and none of its messages are enqueued. Split the batch or raise the cap.

POST/api/v2/messages/batch
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

Default queue for messages without a body-level queue.

matches ^[a-zA-Z0-9_-]+$
Request body
requiredapplication/json
messagesPublishMessageRequest[]required
min items 1 · max items 100
Show properties
Array of PublishMessageRequest
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

Batch published successfully

successboolean
dataobject
Show properties
publishedobject[]
Show properties
Array of object
messageIdstringrequired
matches ^msg_
indexintegerrequired
min 0
failedobject[]
Show properties
Array of object
indexintegerrequired
min 0
errorstringrequired
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/batch' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "messages": [
    {
      "url": "https://example.com/webhook",
      "method": "POST",
      "body": {
        "event": "user_created",
        "userId": 123
      }
    },
    {
      "url": "https://example.com/webhook",
      "method": "POST",
      "body": {
        "event": "user_created",
        "userId": 124
      },
      "executeAt": 1798761599
    }
  ]
}'
Response
{
  "success": true,
  "data": {
    "published": [
      {
        "messageId": "msg_1234567890abcdef",
        "index": 0
      }
    ],
    "failed": [
      {
        "index": 1,
        "error": "Destination URL is not allowed"
      }
    ]
  }
}