Hanzo

Mq

Package mq is queue and stream admin for your org: create them, watch them drain, ack what you pulled.

Package mq is queue and stream admin for your org: create them, watch them drain, ack what you pulled.

Base URLhttps://api.hanzo.ai
Operations15
AuthAuthorization: Bearer $HANZO_API_KEY

mq

GET /v1/mq/health

Reports whether the message plane behind this surface answers.

GET /v1/mq/info

Returns the broker's identity and the org's stream count.

DELETE /v1/mq/streams/{name}/messages/{seq}

Erases one message by sequence; the sequence gap remains.

ParameterInTypeRequiredDescription
namepathstringyesName is the stream name, from the path.
seqpathintegeryesSeq is the message's stream sequence, from the path.

GET /v1/mq/streams/{name}/messages

Reads stored messages without a consumer: by sequence, by newest on a subject, or walking a subject forward from a sequence.

ParameterInTypeRequiredDescription
namepathstringyesName is the stream name, from the path.
seqqueryintegerSeq reads the message at this sequence (with next_by_subject: the walk's start).
last_by_subjectquerystringLastBySubject reads the newest message on this org-relative subject.
next_by_subjectquerystringNextBySubject walks forward from seq collecting messages on this org-relative subject (wildcards supported).
limitqueryintegerLimit caps a next_by_subject walk (1–1000, default 100).

POST /v1/mq/streams/{name}/purge

Removes messages from a stream, leaving its consumers in place.

ParameterInTypeRequiredDescription
namepathstringyesName is the stream name, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
filterstringFilter purges only messages on this org-relative subject (wildcards supported).
keepintegerKeep retains that many newest messages.
namestringName is the stream name, from the path.

GET /v1/mq/streams/{name}

Returns one stream's configuration and live state.

ParameterInTypeRequiredDescription
namepathstringyesName is the stream name, from the path.

PUT /v1/mq/streams/{name}

Reconfigures an existing stream; the path names the stream, and the immutable fields (storage, retention) must restate what they are.

ParameterInTypeRequiredDescription
namepathstringyesName is the stream name, unique within the org (alphanumeric, hyphens, underscores).

Request bodyapplication/json (required)

FieldTypeRequiredDescription
max_agestringMaxAge caps message age, e.g.
max_bytesintegerMaxBytes caps the stream's total stored bytes; -1 (default) is unlimited.
max_msg_sizeintegerMaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit.
max_msgsintegerMaxMsgs caps the number of stored messages; -1 (default) is unlimited.
namestringName is the stream name, unique within the org (alphanumeric, hyphens, underscores).
num_replicasintegerReplicas is the number of stream replicas (1–5); this plane runs 1.
retentionstringRetention is the retention policy: limits (default), interest, or workqueue.
storagestringStorage is the storage backend: file (default) or memory.
subjectsstring[]Subjects are the org-relative subjects bound to this stream (wildcards supported).

DELETE /v1/mq/streams/{name}

Removes a stream with all its messages and consumers. Irreversible.

ParameterInTypeRequiredDescription
namepathstringyesName is the stream name, from the path.

POST /v1/mq/streams/{stream}/consumers/{name}/next

Pulls the consumer's next batch. Delivered messages are acknowledged on delivery — the broker will not redeliver what this call returns; an empty wait answers 408.

ParameterInTypeRequiredDescription
streampathstringyesStream is the stream name, from the path.
namepathstringyesName is the consumer name, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
batchintegerBatch is how many messages to pull (1–1000, default 1).
expiresstringExpires is how long to wait for messages, e.g.
namestringName is the consumer name, from the path.
no_waitbooleanNoWait answers immediately with whatever is available instead of waiting.
streamstringStream is the stream name, from the path.

GET /v1/mq/streams/{stream}/consumers/{name}

Returns one consumer's configuration and delivery state.

ParameterInTypeRequiredDescription
streampathstringyesStream is the stream name, from the path.
namepathstringyesName is the consumer name, from the path.

DELETE /v1/mq/streams/{stream}/consumers/{name}

Removes a consumer and its delivery state; unacknowledged messages stay in the stream.

ParameterInTypeRequiredDescription
streampathstringyesStream is the stream name, from the path.
namepathstringyesName is the consumer name, from the path.

GET /v1/mq/streams/{stream}/consumers

Returns a stream's consumers, name-ordered, with delivery state.

ParameterInTypeRequiredDescription
streampathstringyesStream is the stream name, from the path.
limitqueryintegerLimit caps the consumers returned (1–1000, default 100).
offsetqueryintegerOffset skips that many consumers, name-ordered.

POST /v1/mq/streams/{stream}/consumers

Creates a durable pull consumer on a stream and returns it.

ParameterInTypeRequiredDescription
streampathstringyesStream is the stream name, from the path.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
ack_policystring
ack_waitstring
deliver_policystring
descriptionstring
durable_namestring
filter_subjectstring
max_ack_pendinginteger
max_deliverinteger
opt_start_seqinteger
opt_start_timestring
replay_policystring
streamstringStream is the stream name, from the path.

GET /v1/mq/streams

Returns the org's streams, name-ordered, with their live state.

ParameterInTypeRequiredDescription
limitqueryintegerLimit caps the streams returned (1–1000, default 100).
offsetqueryintegerOffset skips that many streams, name-ordered.

POST /v1/mq/streams

Creates a durable stream in the org's namespace and returns it.

Request bodyapplication/json (required)

FieldTypeRequiredDescription
max_agestringMaxAge caps message age, e.g.
max_bytesintegerMaxBytes caps the stream's total stored bytes; -1 (default) is unlimited.
max_msg_sizeintegerMaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit.
max_msgsintegerMaxMsgs caps the number of stored messages; -1 (default) is unlimited.
namestringName is the stream name, unique within the org (alphanumeric, hyphens, underscores).
num_replicasintegerReplicas is the number of stream replicas (1–5); this plane runs 1.
retentionstringRetention is the retention policy: limits (default), interest, or workqueue.
storagestringStorage is the storage backend: file (default) or memory.
subjectsstring[]Subjects are the org-relative subjects bound to this stream (wildcards supported).

Mq guide · All Hanzo APIs · Interactive reference

How is this guide?

On this page