Hanzo
OpenapiPubsub

Publish puts one message on the org's bus.

Publish puts one message on the org's bus.

POST /v1/pubsub/publish

Addresshttps://api.hanzo.ai/v1/pubsub/publish
MethodPOST
Operationpost_pubsub_publish
AuthAuthorization: Bearer $HANZO_API_KEY

Publish puts one message on the org's bus. When a stream captures the subject the write is DURABLE — the receipt names the stream and sequence only after JetStream has it on storage, and a repeated Nats-Msg-Id header within the dedup window answers duplicate instead of storing twice. When nothing captures it, the message goes out core NATS: delivered to current subscribers, receipt {ok}, nothing retained.

Request

4 fields, body application/json (required).

FieldInTypeRequiredDescription
databodystringData is the payload, carried verbatim as UTF-8 text (typically JSON).
headersbodyobjectHeaders are optional message headers, one value per name.
headers.*bodystring
subjectbodystringSubject is the subject to publish to, in the org's own namespace — e.g.

Response

StatusBodyMeaning
200busAckok

200 body — 4 fields.

FieldInTypeAlwaysDescription
duplicatebodybooleanDuplicate is true when JetStream deduplicated the message by its Nats-Msg-Id instead of storing it again.
okbodybooleanOK is true when the bus accepted the message.
seqbodyintegerSeq is the message's sequence in that stream.
streambodystringStream is the stream that stored the message — absent when no stream captures the subject and the message went out core (fire-and-forget).

Failure carries the platform error shape — see Errors.

Examples

hanzo pubsub publish

Pubsub API · All Hanzo APIs · Interactive reference

How is this guide?

On this page