Skip to content

Message Queue

Managed message queue: publish and consume messages, batch, dead-letter queues (DLQ), redrive and push subscriptions.

1. Overview

Base path: https://api.infrai.cc/v1/queue
Auth header: Authorization: Bearer $INFRAI_API_KEY
bash
# Call any /v1/queue capability over raw HTTP — no SDK to install.
# curl:
curl https://api.infrai.cc/v1/queue/... \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json"

2. Methods (15)

2.1queue.publish

POST /v1/queue/publish

Publish a message to a queue, optionally delayed.

Parameters

NameTypeRequiredDescription
queuestring
Required
The queue name.
payloadobject
Required
Message payload.
delay_secondsnumberOptionalDelay before delivery in seconds.
0–604800default: 0
idempotency_keystringOptionalOptional dedup key; identical retries return the same result.

Returns

{ message_id }
NameTypeDescription
message_idstringUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
queuestringQueue name this message or subscription belongs to
ackedbooleanWhether the message was acknowledged (queue.ack response)
nackedbooleanWhether the message was rejected (queue.nack response)
requeuebooleanWhether the rejected message was requeued (queue.nack response)
account_idstringAccount identifier that owns this resource
payloadobjectPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
status"available" | "in_flight" | "deleted" | "dlq"Current status of this resource
delivery_countintegerNumber of delivery attempts for this message
≥ 0
visibility_timeout_expires_atstring | nullISO 8601 timestamp when visibility timeout expires
format: date-time
published_atstringISO 8601 timestamp when the event was published
format: date-time
available_atstringISO 8601 timestamp when the message becomes available for consumption
format: date-time
priorityintegerPriority for MX or SRV records
0–10default: 0
message_group_idstring | nullFIFO only.
deduplication_idstring | nullFIFO only; 5-min dedup window.

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/publish \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "orders", "payload": {"order_id": "o_123"}, "priority": 5}'

2.2queue.create

POST /v1/queue/create

Create a message queue

Parameters

NameTypeRequiredDescription
namestring
Required
queue name
3–80 charspattern: ^[a-z0-9._-]+$
type"standard" | "fifo"OptionalQueue type: standard standard / fifo first in first out
default: "standard"
dead_letter_queuestringOptionalThe name of the dead letter queue for receiving failed messages (must already exist)
max_retriesnumberOptionalNumber of nacks allowed before transferring to DLQ
≥ 1
message_retention_daysnumberOptionalMessage retention days
1–30
visibility_timeout_defaultnumberOptionalDefault visibility timeout (lease) seconds
0–43200
enable_prioritybooleanOptionalWhether to enable priority
idempotency_keystringOptionalIdempotent keys to avoid duplicate creation

Returns

QueueRecord { queue, type, dead_letter_queue?, max_retries, visibility_timeout_default }
NameTypeDescription
namestringHuman-readable name for this resource
3–80 charspattern: ^[a-z0-9._-]+$
type"standard" | "fifo"Type discriminator for this resource
account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
message_retention_daysintegerNumber of days to retain queue messages
1–30
max_message_size_kbintegerMaximum message size in kilobytes
1–256
visibility_timeout_defaultintegerDefault visibility timeout in seconds.
0–43200
delivery_delay_secondsintegerDelay before message delivery in seconds
0–900
enable_prioritybooleanWhether priority-based delivery is enabled
dlq_namestring | nullName of the dead-letter queue
max_receive_countintegerNack count after which message moves to DLQ.
≥ 1
created_atstringISO 8601 timestamp when this resource was created
format: date-time
updated_atstringISO 8601 timestamp when this resource was last updated
format: date-time

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/create \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "example"}'

2.3queue.get

GET /v1/queue/get/{queue}

Get queue configuration details

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name

Returns

QueueRecord { queue, type, dead_letter_queue?, max_retries, visibility_timeout_default }
NameTypeDescription
namestringHuman-readable name for this resource
3–80 charspattern: ^[a-z0-9._-]+$
type"standard" | "fifo"Type discriminator for this resource
account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
message_retention_daysintegerNumber of days to retain queue messages
1–30
max_message_size_kbintegerMaximum message size in kilobytes
1–256
visibility_timeout_defaultintegerDefault visibility timeout in seconds.
0–43200
delivery_delay_secondsintegerDelay before message delivery in seconds
0–900
enable_prioritybooleanWhether priority-based delivery is enabled
dlq_namestring | nullName of the dead-letter queue
max_receive_countintegerNack count after which message moves to DLQ.
≥ 1
created_atstringISO 8601 timestamp when this resource was created
format: date-time
updated_atstringISO 8601 timestamp when this resource was last updated
format: date-time

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/queue/get/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.4queue.list

GET /v1/queue/list

List all queues in pagination

Parameters

NameTypeRequiredDescription
cursorstringOptionalPaging cursor, from previous page next_cursor
limitnumberOptionalReturn quantity per page

Returns

{ items: QueueRecord[], next_cursor? }
NameTypeDescription
itemsobject[]Array of result items in this page
items[].namestringHuman-readable name for this resource
3–80 charspattern: ^[a-z0-9._-]+$
items[].type"standard" | "fifo"Type discriminator for this resource
items[].account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
items[].message_retention_daysintegerNumber of days to retain queue messages
1–30
items[].max_message_size_kbintegerMaximum message size in kilobytes
1–256
items[].visibility_timeout_defaultintegerDefault visibility timeout in seconds.
0–43200
items[].delivery_delay_secondsintegerDelay before message delivery in seconds
0–900
items[].enable_prioritybooleanWhether priority-based delivery is enabled
items[].dlq_namestring | nullName of the dead-letter queue
items[].max_receive_countintegerNack count after which message moves to DLQ.
≥ 1
items[].created_atstringISO 8601 timestamp when this resource was created
format: date-time
items[].updated_atstringISO 8601 timestamp when this resource was last updated
format: date-time
next_cursorstring | nullOpaque cursor to fetch the next page; null/absent if this is the last page

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/queue/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.5queue.update

PATCH /v1/queue/update/{queue}

Update queue configuration

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
dead_letter_queuestringOptionalDead letter queue name
max_retriesnumberOptionalNumber of nacks allowed before transferring to DLQ
≥ 1
message_retention_daysnumberOptionalMessage retention days
1–30
visibility_timeout_defaultnumberOptionalDefault visibility timeout seconds
0–43200
enable_prioritybooleanOptionalWhether to enable priority
idempotency_keystringOptionalIdempotent keys to avoid repeated execution

Returns

QueueRecord { queue, max_retries, visibility_timeout_default }
NameTypeDescription
namestringHuman-readable name for this resource
3–80 charspattern: ^[a-z0-9._-]+$
type"standard" | "fifo"Type discriminator for this resource
account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
message_retention_daysintegerNumber of days to retain queue messages
1–30
max_message_size_kbintegerMaximum message size in kilobytes
1–256
visibility_timeout_defaultintegerDefault visibility timeout in seconds.
0–43200
delivery_delay_secondsintegerDelay before message delivery in seconds
0–900
enable_prioritybooleanWhether priority-based delivery is enabled
dlq_namestring | nullName of the dead-letter queue
max_receive_countintegerNack count after which message moves to DLQ.
≥ 1
created_atstringISO 8601 timestamp when this resource was created
format: date-time
updated_atstringISO 8601 timestamp when this resource was last updated
format: date-time

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X PATCH https://api.infrai.cc/v1/queue/update/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

2.6queue.delete

DELETE /v1/queue/delete/{queue}

Delete a queue

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
idempotency_keystringOptionalIdempotent keys to avoid repeated execution

Returns

{ queue, deleted }
NameTypeDescription
queuestringName of the (attempted) deleted queue
deletedbooleanWhether the queue was deleted
status"not_found" | nullSet to 'not_found' when the queue did not exist (deleted=false)

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X DELETE https://api.infrai.cc/v1/queue/delete/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.7queue.purge

POST /v1/queue/purge/{queue}

Clear all messages in the queue

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
idempotency_keystringOptionalIdempotent keys to avoid repeated execution

Returns

{ queue, purged }
NameTypeDescription
queuestringName of the (attempted) purged queue
purgedinteger | nullNumber of messages purged
foundbooleanSet to false when the queue did not exist (purged omitted)

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/purge/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "sample"}'

2.8queue.stats

GET /v1/queue/stats/{queue}

Get queue statistics

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name

Returns

QueueStats { queue, available, in_flight, dlq, oldest_age_seconds? }
NameTypeDescription
queuestringQueue name this message or subscription belongs to
message_countintegeravailable + in_flight.
≥ 0
available_countintegerNumber of messages available for consumption
≥ 0
in_flight_countintegerNumber of messages currently being processed
≥ 0
delayed_countintegerNumber of delayed messages
≥ 0
dlq_countintegerNumber of messages in the dead-letter queue
≥ 0
oldest_message_age_secondsintegerAge of the oldest message in the queue in seconds
≥ 0

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/queue/stats/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.9queue.publish_batch

POST /v1/queue/publish_batch

Publish multiple messages to the queue in batches

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
messagesQueueMessage[]
Required
Array of messages to be published
1–100 items
idempotency_keystringOptionalIdempotent keys to avoid duplicate publishing

Returns

{ message_ids }
NameTypeDescription
itemsobject[]Array of result items in this page
items[].message_idstringUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
items[].queuestringQueue name this message or subscription belongs to
items[].ackedbooleanWhether the message was acknowledged (queue.ack response)
items[].nackedbooleanWhether the message was rejected (queue.nack response)
items[].requeuebooleanWhether the rejected message was requeued (queue.nack response)
items[].account_idstringAccount identifier that owns this resource
items[].payloadobjectPayload data for the message or request body
items[].headersobject | nullCustom HTTP headers to include in requests or responses
items[].status"available" | "in_flight" | "deleted" | "dlq"Current status of this resource
items[].delivery_countintegerNumber of delivery attempts for this message
≥ 0
items[].visibility_timeout_expires_atstring | nullISO 8601 timestamp when visibility timeout expires
format: date-time
items[].published_atstringISO 8601 timestamp when the event was published
format: date-time
items[].available_atstringISO 8601 timestamp when the message becomes available for consumption
format: date-time
items[].priorityintegerPriority for MX or SRV records
0–10default: 0
items[].message_group_idstring | nullFIFO only.
items[].deduplication_idstring | nullFIFO only; 5-min dedup window.
next_cursorstring | nullOpaque cursor to fetch the next page; null/absent if this is the last page

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/publish_batch \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "sample", "messages": [{"payload": {}}]}'

2.10queue.consume

POST /v1/queue/consume

Pull a batch of messages from the queue for consumption

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
max_messagesnumberOptionalThe maximum number of messages pulled at a time
1–10default: 10
visibility_timeoutnumberOptionalThe number of lease seconds for this batch of messages; the default is the queue configuration
0–43200

Returns

{ messages: QueueMessage[] }
NameTypeDescription
itemsobject[]Array of result items in this page
items[].message_idstringUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
items[].queuestringQueue name this message or subscription belongs to
items[].ackedbooleanWhether the message was acknowledged (queue.ack response)
items[].nackedbooleanWhether the message was rejected (queue.nack response)
items[].requeuebooleanWhether the rejected message was requeued (queue.nack response)
items[].account_idstringAccount identifier that owns this resource
items[].payloadobjectPayload data for the message or request body
items[].headersobject | nullCustom HTTP headers to include in requests or responses
items[].status"available" | "in_flight" | "deleted" | "dlq"Current status of this resource
items[].delivery_countintegerNumber of delivery attempts for this message
≥ 0
items[].visibility_timeout_expires_atstring | nullISO 8601 timestamp when visibility timeout expires
format: date-time
items[].published_atstringISO 8601 timestamp when the event was published
format: date-time
items[].available_atstringISO 8601 timestamp when the message becomes available for consumption
format: date-time
items[].priorityintegerPriority for MX or SRV records
0–10default: 0
items[].message_group_idstring | nullFIFO only.
items[].deduplication_idstring | nullFIFO only; 5-min dedup window.
next_cursorstring | nullOpaque cursor to fetch the next page; null/absent if this is the last page

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/consume \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "sample"}'

2.11queue.ack

POST /v1/queue/ack

Confirm a consumed message

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
message_idstring
Required
Message ID
pattern: ^qmsg_[A-Za-z0-9]{20,}$
idempotency_keystringOptionalIdempotent keys to avoid repeated execution

Returns

{ message_id, acked }
NameTypeDescription
message_idstringUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
queuestringQueue name this message or subscription belongs to
ackedbooleanWhether the message was acknowledged (queue.ack response)
nackedbooleanWhether the message was rejected (queue.nack response)
requeuebooleanWhether the rejected message was requeued (queue.nack response)
account_idstringAccount identifier that owns this resource
payloadobjectPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
status"available" | "in_flight" | "deleted" | "dlq"Current status of this resource
delivery_countintegerNumber of delivery attempts for this message
≥ 0
visibility_timeout_expires_atstring | nullISO 8601 timestamp when visibility timeout expires
format: date-time
published_atstringISO 8601 timestamp when the event was published
format: date-time
available_atstringISO 8601 timestamp when the message becomes available for consumption
format: date-time
priorityintegerPriority for MX or SRV records
0–10default: 0
message_group_idstring | nullFIFO only.
deduplication_idstring | nullFIFO only; 5-min dedup window.

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/ack \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "sample", "message_id": "hello"}'

2.12queue.nack

POST /v1/queue/nack

Deny a message to requeue or forward it to deadmail

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
message_idstring
Required
Message ID
pattern: ^qmsg_[A-Za-z0-9]{20,}$
requeuebooleanOptionaltrue to re-enter the queue; false to directly transfer to the dead letter
default: true
idempotency_keystringOptionalIdempotent keys to avoid repeated execution

Returns

{ message_id, nacked, requeued }
NameTypeDescription
message_idstringUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
queuestringQueue name this message or subscription belongs to
ackedbooleanWhether the message was acknowledged (queue.ack response)
nackedbooleanWhether the message was rejected (queue.nack response)
requeuebooleanWhether the rejected message was requeued (queue.nack response)
account_idstringAccount identifier that owns this resource
payloadobjectPayload data for the message or request body
headersobject | nullCustom HTTP headers to include in requests or responses
status"available" | "in_flight" | "deleted" | "dlq"Current status of this resource
delivery_countintegerNumber of delivery attempts for this message
≥ 0
visibility_timeout_expires_atstring | nullISO 8601 timestamp when visibility timeout expires
format: date-time
published_atstringISO 8601 timestamp when the event was published
format: date-time
available_atstringISO 8601 timestamp when the message becomes available for consumption
format: date-time
priorityintegerPriority for MX or SRV records
0–10default: 0
message_group_idstring | nullFIFO only.
deduplication_idstring | nullFIFO only; 5-min dedup window.

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/nack \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "sample", "message_id": "hello"}'

2.13queue.dlq.list

GET /v1/queue/dlq/list/{queue}

Paginated list of messages in the dead letter queue

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
cursorstringOptionalPaging cursor, from previous page next_cursor
limitnumberOptionalReturn quantity per page

Returns

{ items: QueueMessage[], next_cursor? }
NameTypeDescription
itemsobject[]Array of result items in this page
items[].message_idstringUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
items[].queuestringQueue name this message or subscription belongs to
items[].ackedbooleanWhether the message was acknowledged (queue.ack response)
items[].nackedbooleanWhether the message was rejected (queue.nack response)
items[].requeuebooleanWhether the rejected message was requeued (queue.nack response)
items[].account_idstringAccount identifier that owns this resource
items[].payloadobjectPayload data for the message or request body
items[].headersobject | nullCustom HTTP headers to include in requests or responses
items[].status"available" | "in_flight" | "deleted" | "dlq"Current status of this resource
items[].delivery_countintegerNumber of delivery attempts for this message
≥ 0
items[].visibility_timeout_expires_atstring | nullISO 8601 timestamp when visibility timeout expires
format: date-time
items[].published_atstringISO 8601 timestamp when the event was published
format: date-time
items[].available_atstringISO 8601 timestamp when the message becomes available for consumption
format: date-time
items[].priorityintegerPriority for MX or SRV records
0–10default: 0
items[].message_group_idstring | nullFIFO only.
items[].deduplication_idstring | nullFIFO only; 5-min dedup window.
next_cursorstring | nullOpaque cursor to fetch the next page; null/absent if this is the last page

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/queue/dlq/list/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY"

2.14queue.dlq.redrive

POST /v1/queue/dlq/redrive/{queue}

Redeploy the dead letter message back to the original queue

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
message_idstringOptionalThe ID of a single message when re-delivered; if omitted, re-delivery will occur in batches
pattern: ^qmsg_[A-Za-z0-9]{20,}$
sincestringOptionalBatch resubmission: all messages entered into the dead letter at this moment and after
format: date-time
idempotency_keystringOptionalIdempotent keys to avoid repeated re-investments

Returns

{ queue, redriven }
NameTypeDescription
okbooleanWhether the redrive was initiated
redriven_countinteger | nullNumber of messages redriven

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/dlq/redrive/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "orders", "max_messages": 100}'

2.15queue.push_subscribe

POST /v1/queue/push_subscribe/{queue}

Configure push subscriptions for queues

Parameters

NameTypeRequiredDescription
queuestring
Required
queue name
urlstring
Required
https push destination address (SSRF verified)
format: uri
secretstringOptionalKey for HMAC signing of push requests
max_retriesnumberOptionalNumber of failed push retries
≥ 0
visibility_timeoutnumberOptionalVisibility timeout seconds
0–43200
dead_letter_queuestringOptionalDead letter queue name
idempotency_keystringOptionalIdempotent keys to avoid duplicate subscriptions

Returns

PushSubscription { subscription_id, queue, url }
NameTypeDescription
subscription_idstringUnique identifier for this subscription
pattern: ^sub_[A-Za-z0-9]{20,}$
queuestringQueue name this message or subscription belongs to
account_idstringAccount identifier that owns this resource
pattern: ^acct_(anon|email)_[A-Za-z0-9_]…
concurrencyintegerNumber of concurrent consumers for push subscriptions
≥ 1
max_retriesintegerMaximum number of delivery retries
≥ 0
dead_letter_queuestring | nullDead-letter queue name for failed messages
activebooleanWhether this resource is currently active
started_atstringISO 8601 timestamp when execution started
format: date-time
stopped_atstring | nullISO 8601 timestamp when the subscription was stopped
format: date-time

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/queue/push_subscribe/QUEUE \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"queue": "orders", "url": "https://api.acme.com/order-handler"}'

3. All capabilities

Every routed capability in this module — the complete public REST contract. The methods above are the guided walkthrough; this index is the full reference.

queue.ackPOST /v1/queue/ack

Acknowledge (ack) a consumed message to remove it from the queue.

Parameters (3)
NameTypeRequiredDescription
queuestringRequiredQueue name this message or subscription belongs to
message_idstringRequiredUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.consumePOST /v1/queue/consume

Pull a batch of messages from a queue for processing.

Parameters (3)
NameTypeRequiredDescription
queuestringRequiredQueue name this message or subscription belongs to
max_messagesintegerOptionalMaximum number of messages to consume in one batch
1–10default: 10
visibility_timeoutinteger | nullOptionalLease seconds; defaults to queue's visibility_timeout_default.
0–43200
queue.createPOST /v1/queue/create

Create a message queue (standard or FIFO, with optional dead-letter queue).

Parameters (9)
NameTypeRequiredDescription
namestringRequiredHuman-readable name for this resource
3–80 charspattern: ^[a-z0-9._-]+$
type"standard" | "fifo"OptionalType discriminator for this resource
default: "standard"
dead_letter_queuestring | nullOptionalName of an existing queue to receive failed messages.
max_retriesinteger | nullOptionalNack count before moving to DLQ.
≥ 1
message_retention_daysinteger | nullOptionalNumber of days to retain queue messages
1–30
visibility_timeout_defaultinteger | nullOptionalDefault visibility timeout in seconds
0–43200
delivery_delay_secondsinteger | nullOptionalDefault delay applied when a published message omits delay_seconds.
0–604800
enable_priorityboolean | nullOptionalWhether priority-based delivery is enabled
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.deleteDELETE /v1/queue/delete/{queue}

Delete a message queue and discard all of its pending messages (use queue.purge to keep the queue); idempotent.

Parameters (1)
NameTypeRequiredDescription
queuestringRequiredPath parameter.
queue.dlq.listGET /v1/queue/dlq/list/{queue}

List messages in a queue's dead-letter queue (DLQ) with pagination.

Parameters (1)
NameTypeRequiredDescription
queuestringRequiredPath parameter.
queue.dlq.redrivePOST /v1/queue/dlq/redrive/{queue}

Redrive dead-letter messages back to the source queue, individually or in bulk.

Parameters (4)
NameTypeRequiredDescription
queuestringRequiredQueue name this message or subscription belongs to
message_idstring | nullOptionalRedrive a single message; omit for bulk.
pattern: ^qmsg_[A-Za-z0-9]{20,}$
sincestring | nullOptionalBulk redrive all DLQ messages dead-lettered at/after this time.
format: date-time
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.getGET /v1/queue/get/{queue}

Retrieve a queue's configuration details.

Parameters (1)
NameTypeRequiredDescription
queuestringRequiredPath parameter.
queue.listGET /v1/queue/list

List all message queues with pagination.

No request parameters.

queue.nackPOST /v1/queue/nack

Negatively acknowledge (nack) a message to requeue it or route it to the DLQ.

Parameters (4)
NameTypeRequiredDescription
queuestringRequiredQueue name this message or subscription belongs to
message_idstringRequiredUnique identifier for this message
pattern: ^qmsg_[A-Za-z0-9]{20,}$
requeuebooleanOptionalfalse → straight to DLQ.
default: true
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.publishPOST /v1/queue/publish

Publish a single message to a queue (idempotent).

Parameters (8)
NameTypeRequiredDescription
queuestringRequiredQueue name this message or subscription belongs to
payloadobjectRequiredPayload data for the message or request body
delay_secondsintegerOptional0..604800 (7 days).
0–604800default: 0
priorityintegerOptionalPriority for MX or SRV records
0–9default: 0
message_group_idstring | nullOptionalFIFO only.
deduplication_idstring | nullOptionalFIFO only; 5-min dedup window.
headersobject | nullOptionalCustom HTTP headers to include in requests or responses
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.publish_batchPOST /v1/queue/publish_batch

Publish multiple messages to a queue in a single batch.

Parameters (3)
NameTypeRequiredDescription
queuestringRequiredQueue name this message or subscription belongs to
messagesobject[]RequiredList of messages to publish or process
1–100 items
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.purgePOST /v1/queue/purge/{queue}

Purge all messages from a queue.

Parameters (2)
NameTypeRequiredDescription
queuestringRequiredName of the queue to purge.
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.push_subscribePOST /v1/queue/push_subscribe/{queue}

Configure a push subscription to deliver queue messages to a callback URL.

Parameters (7)
NameTypeRequiredDescription
queuestringRequiredQueue name this message or subscription belongs to
urlstringRequiredhttps:// push target; SSRF-validated.
format: uri
secretstring | nullOptionalHMAC signing secret for pushed deliveries.
max_retriesinteger | nullOptionalMaximum number of delivery retries
≥ 0
visibility_timeoutinteger | nullOptionalVisibility timeout in seconds
0–43200
dead_letter_queuestring | nullOptionalDead-letter queue name for failed messages
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry
queue.push_subscription.deleteDELETE /v1/queue/push_subscription/delete/{queue}/{subscription_id}

Delete a queue webhook push subscription.

Parameters (2)
NameTypeRequiredDescription
subscription_idstringRequiredPath parameter.
queuestringRequiredPath parameter.
queue.push_subscription.listGET /v1/queue/push_subscription/list/{queue}

List webhook push subscriptions for a queue.

Parameters (1)
NameTypeRequiredDescription
queuestringRequiredPath parameter.
queue.statsGET /v1/queue/stats/{queue}

Retrieve queue metrics: available, in-flight, and dead-lettered message counts.

Parameters (1)
NameTypeRequiredDescription
queuestringRequiredPath parameter.
queue.updatePATCH /v1/queue/update/{queue}

Update a queue's DLQ, retry, and retention settings.

Parameters (8)
NameTypeRequiredDescription
queuestringRequiredPath parameter.
dead_letter_queuestring | nullOptionalDead-letter queue name for failed messages
max_retriesinteger | nullOptionalMaximum number of delivery retries
≥ 1
message_retention_daysinteger | nullOptionalNumber of days to retain queue messages
1–30
visibility_timeout_defaultinteger | nullOptionalDefault visibility timeout in seconds
0–43200
delivery_delay_secondsinteger | nullOptionalDefault delay applied when a published message omits delay_seconds.
0–604800
enable_priorityboolean | nullOptionalWhether priority-based delivery is enabled
idempotency_keystring | nullOptionalClient-provided idempotency key; prevents duplicate execution on retry

4. End-to-end example

A production-style walkthrough of this module: configure once, then run the flow. It exercises most of the module's APIs.

A copy-paste-runnable single-file Python program (stdlib only, no SDK): set your INFRAI_API_KEY, run it, and walk this module's core flow with REAL billed calls — later steps reuse real fields returned by earlier ones. The 12-line helper is the entire integration.

python
#!/usr/bin/env python3
"""Infrai · queue — runnable real-app example (single file, zero deps).

Copy this file, set your key, run it: every step is a REAL call to
api.infrai.cc, billed at the real (tiny) per-call price, printing the
live JSON response. Get a key at https://infrai.cc/login (Google/
GitHub sign-in grants $2 free credit); add funds at
https://infrai.cc/billing. No SDK — the 12-line helper below is the
entire integration."""
import json
import os
from urllib import error, request

KEY = os.environ.get("INFRAI_API_KEY") or "ifr_..."  # <- your key
BASE = "https://api.infrai.cc"


# Same raw HTTPS POST/GET as every per-method example on this page —
# wrapped once for reuse. There is nothing else to it: no SDK.
def infrai(method, path, body=None):
    req = request.Request(
        BASE + path, method=method,
        data=json.dumps(body).encode() if body is not None else None,
        headers={"Authorization": f"Bearer {KEY}",
                 "Content-Type": "application/json"})
    try:
        with request.urlopen(req, timeout=60) as r:
            return json.loads(r.read())
    except error.HTTPError as e:
        return json.loads(e.read())


def show(label, resp):
    print(f"\n== {label} ==")
    print(json.dumps(resp, indent=2, ensure_ascii=False))
    return resp


# 1) queue.create — POST /v1/queue/create · Create a message queue (standard or FIFO, with optional dead-letter queue).
r1 = show("queue.create", infrai("POST", "/v1/queue/create", {"name":"jobs"}))

# 2) queue.publish — POST /v1/queue/publish · Publish a single message to a queue (idempotent).
r2 = show("queue.publish", infrai("POST", "/v1/queue/publish", {"queue":"jobs","payload":{"hello":"world"}}))

# 3) queue.consume — POST /v1/queue/consume · Pull a batch of messages from a queue for processing.
r3 = show("queue.consume", infrai("POST", "/v1/queue/consume", {"queue":"jobs","max_messages":1}))

5. Developer guides

Move from endpoint details to complete workflows, production patterns and troubleshooting guides verified against the live API.

Message Queue developer guides