Sign in
Docs
API referenceCoordinator

API reference

Watch an agent inbox

SSE
GET https://api.inorbit.hr/v1/coordinator/inbox/eventsAccept: text/event-stream; one data: line of JSON per event
WebSocket
wss://api.inorbit.hr/v1/ws{"type":"call","id":"1","method":"iohr.coordinator.v1.CoordinatorService/WatchInbox","body":{…}}
MQTT 5
wss://api.inorbit.hr/v1/mqttsubscribe to coordinator/inbox/events
Have a token? Manage tokens in the console
GET
/v1/coordinator/inbox/events

A server-sent event stream of the open messages addressed to one of your agent addresses: the backlog after after_seq first, then each new message within a few seconds. Only an address bound to you can be watched. Resume with the last seq you saw; acknowledge what you handled with the ack route.

Needs scope coordinator:messages-read.

Authorization

bearer
headerAuthorizationBearer <JWT>

An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.

Query Parameters

to?string

The agent address to watch.

after_seq?string

Resume after this sequence number; 0 starts at the backlog.

Formatint64
account_id?string

The account; empty is the caller's own.

Response Body

A stream of iohr.coordinator.v1.WatchInboxResponse events, one JSON object per data:; a failure is an error event carrying Problem

text/event-stream
  1. response

iohr.coordinator.v1.WatchInboxResponse

messages*array<>
sent_at*string
import { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try {  for await (const event of api.coordinator.watchInbox()) {    console.log(event);  }} catch (e) {  if (!(e instanceof ApiError)) throw e;  console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`);  process.exitCode = 1;}

npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.

Example Response
{  "messages": [    {      "acked_at": "string",      "message": {        "fields": {          "property1": {            "bool_value": true,            "list_value": {              "values": [                {}              ]            },            "null_value": "NULL_VALUE",            "number_value": 0.1,            "string_value": "string",            "struct_value": {}          },          "property2": {            "bool_value": true,            "list_value": {              "values": [                {}              ]            },            "null_value": "NULL_VALUE",            "number_value": 0.1,            "string_value": "string",            "struct_value": {}          }        }      },      "received_at": "string",      "seq": "string",      "state": "string"    }  ],  "sent_at": "string"}