Skip to content

Create a queue

Last updated 

PUT /spools/{spool}/queues/{queue}

Creates the queue on the spool. Queue names are unique within the spool; the name is immutable after creation, the settings can be changed with updateQueue. Creating an existing queue fails with 409 regardless of settings.

Sample

sh
curl -X PUT "$SPOOLER_API/spools/<spool>/queues/<queue>" \
  -H "Authorization: Bearer $SPOOLER_KEY" \
  -H "Content-Type: application/json" \
  --data '{}'

Parameters

NameInTypeRequiredDescription
spoolpathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe spool name.
queuepathIdentName, 1–64 chars, ^[A-Za-z0-9_:-]+$yesThe queue name.

Request body

Optional; application/json.

FieldTypeRequiredDescription
leaseTimeoutSecondsinteger, 0–31,536,000, default 300noSeconds to wait before an unacked delivery is auto-nacked; 0 disables the timeout, at most a year. The server default applies when omitted.
maxRetriesinteger, 0–65,535, default 10noRedeliveries before a message lands in the failure queue; 0 means no retries. The server default applies when omitted.
dedupWindowSecondsinteger, 0–300noSeconds a dedup key is remembered for deduplication, at most five minutes. Omitted or 0 disables dedup.
retentionSecondsinteger, ≥ 60noSeconds a message is kept before it is discarded; at least a minute, at most the plan's retention limit. Omitted means the server default, clamped to the plan's limit.
effectiveRetentionSecondsinteger, ≥ 0noThe retention actually enforced: retentionSeconds bounded by the plan's retention limit. Response-only; ignored in requests.
recvRateLimitRateLimitnoCaps the rate Recv hands out messages; absent means no limit.

Responses

StatusDescription
201Created.
400The request is malformed; the kind names the problem.
401The API key is missing or not recognized.
402The account is suspended.
403A plan limit refuses the operation; the kind names it.
404The spool or queue does not exist; the kind says which.
409Concurrent state refuses the operation; the kind names it.
429The per-account request rate cap is exceeded; retry after the Retry-After delay.
503The spool is momentarily unavailable.

429 headers

HeaderDescription
Retry-AfterSeconds until the next request is admitted.