Admin API reference

Every endpoint of the OrbitMQ admin REST API, generated from its OpenAPI document.

Endpoints

MethodPathSummary
GET/metricsPrometheus metrics
GET/api/v1/statusNode status
GET/api/v1/clientsList sessions (connected and stored), sorted by client identifier
GET/api/v1/clients/{id}Session details, including subscriptions
DELETE/api/v1/clients/{id}Disconnect the client (kick)
DELETE/api/v1/sessions/{id}Delete a stored session
GET/api/v1/subscriptionsList subscriptions, sorted by topic filter then client identifier
GET/api/v1/retainedList retained messages, sorted by topic
GET/api/v1/configEffective configuration
GET/api/v1/alarmsActive and recently cleared alarms
POST/api/v1/alarms/{id}/ackAcknowledge an active alarm
GET/api/v1/logsStream recent and new broker log lines (server-sent events)
GET/api/v1/metrics/streamLive node metrics, one JSON sample per second (server-sent events)
GET/api/v1/rulesSQL rules
POST/api/v1/rulesCreate a rule
POST/api/v1/rules/testEvaluate SQL against a sample message
GET/api/v1/rules/{id}One rule
PUT/api/v1/rules/{id}Replace a rule
DELETE/api/v1/rules/{id}Delete a rule
GET/api/v1/rules/{id}/metricsCounters of a rule and its actions
GET/api/v1/connectorsConnectors used by rule actions
GET/dashboard/{path}The embedded dashboard (no authentication)
GET/licenses.txtThird-party licence notices (no authentication)
GET/api/v1/auth/{chain}An authentication or authorization chain
PUT/api/v1/auth/{chain}/orderReorder a chain
POST/api/v1/auth/{chain}/sourcesAdd a source
PUT/api/v1/auth/{chain}/sources/{name}Replace a source's configuration
PATCH/api/v1/auth/{chain}/sources/{name}Enable or disable a source
DELETE/api/v1/auth/{chain}/sources/{name}Remove a source

Every request needs Authorization: Bearer <token> unless the API runs with insecure = true on loopback. Errors use the JSON body {"error": "<code>", "message": "<text>"}. A task-oriented introduction with curl examples is in the Admin REST API guide. The interactive reference below is generated from the broker's OpenAPI document.

Prometheus metrics

GET
/metrics

Prometheus text exposition (format 0.0.4) of the node's metrics (prefix orbitmq_).

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

Metrics.

response?stringtext/plain
curl -X GET 'http://127.0.0.1:18083/metrics'
"string"

Node status

GET
/api/v1/status

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

Version, uptime, cores, listeners and the I/O backend.

application/json
  1. response
version*string
uptime_seconds*integer
Range0 <= value
started_at*integer

Unix time in seconds.

cores*integer
Range1 <= value
listeners*array<>
io_backend*string

Data-plane I/O backend the cores run on. Linux uses io_uring when the kernel and the seccomp profile allow it and falls back to epoll; macOS uses kqueue.

Value in"io_uring""epoll""kqueue""iocp""poll""mixed"
io_uring_unavailable*|

On Linux without io_uring, why it is not in use (e.g. io_uring_setup returned EPERM: blocked by seccomp (container default profile)); null otherwise.

curl -X GET 'http://127.0.0.1:18083/api/v1/status'
{  "version": "string",  "uptime_seconds": 0,  "started_at": 0,  "cores": 1,  "listeners": [    {      "name": "string",      "kind": "tcp",      "address": "0.0.0.0:1883"    }  ],  "io_backend": "io_uring",  "io_uring_unavailable": "string"}
GET
/api/v1/clients

Authorization

bearer
headerAuthorizationBearer <token>

Query Parameters

limit?integer

Page size (1 to 1000).

Range1 <= value <= 1000
Default100
cursor?string

The next_cursor of the previous page.

client_id_prefix?string

Only client identifiers starting with this prefix.

Response Body

One page.

application/json
  1. response
data*array<>
next_cursor*|

Pass as cursor for the next page; null on the last page.

curl -X GET 'http://127.0.0.1:18083/api/v1/clients'
{  "data": [    {      "client_id": "string",      "connected": true,      "core": 0,      "protocol": "3.1",      "listener": "string",      "peer": "string",      "username": "string",      "session_expiry_interval": 0,      "expires_in": 0,      "subscription_count": 0,      "inflight": 0,      "queued": 0,      "dropped": 0,      "subscriptions": [        {          "client_id": "string",          "topic_filter": "string",          "qos": 0,          "no_local": true,          "retain_as_published": true,          "retain_handling": 0,          "subscription_identifier": 0,          "share_group": "string"        }      ]    }  ],  "next_cursor": "string"}
GET
/api/v1/clients/{id}

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Client identifier (percent-encoded).

Response Body

The session.

application/json
  1. response
client_id*string
connected*boolean
core*integer

Data-plane core holding the session.

protocol*|

Protocol version of the attached connection.

Value in"3.1""3.1.1""5.0"null
listener*string|null
peer*string

Address of the (last) connection.

username*|

Authenticated user name.

session_expiry_interval*integer

Seconds; 4294967295 = never expires.

expires_in*|

Seconds until a disconnected session expires.

subscription_count*integer
inflight*integer

Unacknowledged outgoing QoS 1/2 messages.

queued*integer

Messages waiting in the session queue.

dropped*integer

Messages dropped for this session so far.

subscriptions?array<>

Only in GET /api/v1/clients/{id}.

curl -X GET 'http://127.0.0.1:18083/api/v1/clients/string'
{  "client_id": "string",  "connected": true,  "core": 0,  "protocol": "3.1",  "listener": "string",  "peer": "string",  "username": "string",  "session_expiry_interval": 0,  "expires_in": 0,  "subscription_count": 0,  "inflight": 0,  "queued": 0,  "dropped": 0,  "subscriptions": [    {      "client_id": "string",      "topic_filter": "string",      "qos": 0,      "no_local": true,      "retain_as_published": true,      "retain_handling": 0,      "subscription_identifier": 0,      "share_group": "string"    }  ]}
DELETE
/api/v1/clients/{id}

Closes the client's connection. MQTT 5.0 clients first receive DISCONNECT with reason code 0x98 (Administrative action). The session then follows its expiry rules (a session with a non-zero Session Expiry Interval is kept; use DELETE /api/v1/sessions/{id} to remove it). The Will Message is published as for any server-initiated disconnect.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Client identifier (percent-encoded).

Response Body

Disconnected.

curl -X DELETE 'http://127.0.0.1:18083/api/v1/clients/string'
Empty

Delete a stored session

DELETE
/api/v1/sessions/{id}

Deletes the stored session of a client that is not connected: its subscriptions, queued and in-flight messages (MQTT 3.1 §2.2 administrative deletion; also used for 3.1.1 / 5.0 persistent sessions). A pending Will Message is published, as when a session ends.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Client identifier (percent-encoded).

Response Body

Deleted.

curl -X DELETE 'http://127.0.0.1:18083/api/v1/sessions/string'
Empty
GET
/api/v1/subscriptions

Authorization

bearer
headerAuthorizationBearer <token>

Query Parameters

topic_filter_prefix?string

Only filters (as subscribed, including $share/{group}/) starting with this prefix.

limit?integer
Range1 <= value <= 1000
Default100

Response Body

Subscriptions.

application/json
  1. response
data*array<>
truncated*boolean

More entries matched than limit.

curl -X GET 'http://127.0.0.1:18083/api/v1/subscriptions'
{  "data": [    {      "client_id": "string",      "topic_filter": "string",      "qos": 0,      "no_local": true,      "retain_as_published": true,      "retain_handling": 0,      "subscription_identifier": 0,      "share_group": "string"    }  ],  "truncated": true}
GET
/api/v1/retained

Authorization

bearer
headerAuthorizationBearer <token>

Query Parameters

topic_prefix?string
limit?integer
Range1 <= value <= 1000
Default100

Response Body

Retained messages (metadata only).

application/json
  1. response
data*array<>
truncated*boolean
curl -X GET 'http://127.0.0.1:18083/api/v1/retained'
{  "data": [    {      "topic": "string",      "qos": 0,      "payload_size": 0,      "expires_in": 0,      "content_type": "string"    }  ],  "truncated": true}

Effective configuration

GET
/api/v1/config

The node's configuration after environment overrides, with the keys of orbitmq.toml (listener and auth.backend are arrays). Secrets are never returned: admin tokens and inline backend secrets read "<redacted>", secrets given by reference read {"env": "NAME"} or {"file": "/path"}, and user information and query strings of backend URLs are redacted.

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

The configuration.

application/json
  1. response
[key: string]?any
curl -X GET 'http://127.0.0.1:18083/api/v1/config'
{}
GET
/api/v1/alarms

Evaluated every 5 seconds from the cores' metrics, with hysteresis:

  • connection_limit (subject: listener name, or node): raised at 95% of the listener's max_connections (or mqtt.max_connections) or when the limit refused a CONNECT (critical at the limit); value = connections, threshold = the limit; cleared at 85% after 30 s without refusals.
  • queue_memory_budget (subject node): queued messages were shed because the node's memory budget was exceeded; value = messages shed in the last 5 s; cleared after 30 s without shedding.
  • tls_cert_expiring (subject: listener name): the listener's certificate expires within 30 days (critical within 7, or expired); value = days left (negative when expired), threshold = 30; cleared above 31 days.
  • auth_backend_errors (subject: backend name): errors, timeouts or overload refusals of an [[auth.backend]] (critical when every check failed); value = errors in the last 5 s; cleared after 30 s without errors.

Active alarms come first (newest first), then up to 100 cleared ones (newest first).

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

Alarms.

application/json
  1. response
data*array<>
curl -X GET 'http://127.0.0.1:18083/api/v1/alarms'
{  "data": [    {      "id": "connection_limit:default",      "kind": "connection_limit",      "subject": "string",      "severity": "warning",      "state": "active",      "message": "string",      "value": 0,      "threshold": 0,      "raised_at": 0,      "cleared_at": 0,      "acknowledged": true,      "acknowledged_at": 0    }  ]}
POST
/api/v1/alarms/{id}/ack

Idempotent. An escalation to critical clears the acknowledgement.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Alarm id (kind:subject, percent-encoded).

Response Body

Acknowledged.

curl -X POST 'http://127.0.0.1:18083/api/v1/alarms/string/ack'
Empty
GET
/api/v1/logs

Starts with up to backlog recent lines, then follows new ones. Each event has id: <seq> and a JSON LogLine as data; a Last-Event-ID header resumes after that line instead of sending the backlog. Keep-alive comments every 15 s. The node keeps the last 1000 lines that pass its log filter (log); configured secrets are replaced by <redacted>.

Authorization

bearer
headerAuthorizationBearer <token>

Query Parameters

level?string

Least severity sent.

Default"trace"
Value in"trace""debug""info""warn""error"
backlog?integer

Recent lines sent first.

Range0 <= value <= 1000
Default200

Header Parameters

Last-Event-ID?integer

Response Body

An event stream of LogLine objects.

text/event-stream
  1. response
seq*integer

Increasing sequence number (the event id).

ts*integer

Unix time in milliseconds.

level*string
Value in"TRACE""DEBUG""INFO""WARN""ERROR"
target*string

Module that logged the line.

message*string

Message, then its fields as key=value.

curl -X GET 'http://127.0.0.1:18083/api/v1/logs'
{  "seq": 0,  "ts": 0,  "level": "TRACE",  "target": "string",  "message": "string"}
GET
/api/v1/metrics/stream

One sampler serves every stream. Rates are per second over the interval since the previous sample. Keep-alive comments every 15 s.

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

An event stream of MetricsSample objects.

text/event-stream
  1. response
ts*integer

Unix time in milliseconds.

uptime_seconds*integer
connections*integer

Connected clients.

sessions*integer

Sessions

subscriptions*integer
retained*integer

Retained messages.

queued*integer

Messages waiting in session queues.

inflight*integer

Unacknowledged outgoing QoS 1/2 messages.

messages_in_per_sec*number
messages_out_per_sec*number
bytes_in_per_sec*number
bytes_out_per_sec*number
dropped_per_sec*number
deliver_latency_p99_ms*|

99th percentile of cross-core publish-to-delivery latency in the interval (bucket upper bound); null without such deliveries.

core_busy*number

Mean share of time the cores spent in event handlers (0 to 1).

curl -X GET 'http://127.0.0.1:18083/api/v1/metrics/stream'
{  "ts": 0,  "uptime_seconds": 0,  "connections": 0,  "sessions": 0,  "subscriptions": 0,  "retained": 0,  "queued": 0,  "inflight": 0,  "messages_in_per_sec": 0,  "messages_out_per_sec": 0,  "bytes_in_per_sec": 0,  "bytes_out_per_sec": 0,  "dropped_per_sec": 0,  "deliver_latency_p99_ms": 0,  "core_busy": 0}

SQL rules

GET
/api/v1/rules

Every rule, sorted by id: those from [[rule]] in orbitmq.toml (source: config, read-only here) and those created through this API (source: api). persisted is false without a state file ([rules] state_file, by default orbitmq.rules-state.toml next to the configuration file): API changes are then lost on restart. Webhook header values written inline read back as ******.

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

Rules.

application/json
  1. response
rules*array<>
persisted*boolean
curl -X GET 'http://127.0.0.1:18083/api/v1/rules'
{  "rules": [    {      "id": "string",      "description": "string",      "sql": "string",      "enabled": true,      "actions": [        {          "type": "republish",          "topic": "string",          "qos": 0,          "retain": true,          "payload": "string",          "url": "string",          "method": "POST",          "headers": {},          "body": "string",          "timeout_ms": 0,          "allow_http": true,          "connector": "string",          "key": "string",          "value": "string",          "batch_max": 0,          "linger_ms": 0,          "max_retries": 0,          "dead_letter_topic": "string"        }      ],      "source": "config",      "from": [        "string"      ],      "metrics": {        "matched": 0,        "passed": 0,        "failed": 0,        "dropped": 0      }    }  ],  "persisted": true}

Create a rule

POST
/api/v1/rules

The rule takes effect at once on every core. Its SQL, templates and connector references are validated first.

Authorization

bearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
id?string

Required on create.

Match^[A-Za-z0-9_-]{1,64}$
description?string
sql*string

SELECT … FROM "topic/filter" [WHERE …]

enabled?boolean
Defaulttrue
actions?array<>

Response Body

The created rule.

application/json
  1. response
id*string

Required on create.

Match^[A-Za-z0-9_-]{1,64}$
description?string
sql*string

SELECT … FROM "topic/filter" [WHERE …]

enabled?boolean
Defaulttrue
actions?array<>
source*string
Value in"config""api"
from*array<string>

The FROM topic filters.

metrics*
curl -X POST 'http://127.0.0.1:18083/api/v1/rules' \  -H 'Content-Type: application/json' \  -d '{  "sql": "string"}'
{  "id": "string",  "description": "string",  "sql": "string",  "enabled": true,  "actions": [    {      "type": "republish",      "topic": "string",      "qos": 0,      "retain": true,      "payload": "string",      "url": "string",      "method": "POST",      "headers": {},      "body": "string",      "timeout_ms": 0,      "allow_http": true,      "connector": "string",      "key": "string",      "value": "string",      "batch_max": 0,      "linger_ms": 0,      "max_retries": 0,      "dead_letter_topic": "string"    }  ],  "source": "config",  "from": [    "string"  ],  "metrics": {    "matched": 0,    "passed": 0,    "failed": 0,    "dropped": 0  }}
POST
/api/v1/rules/test

Nothing is stored and no action runs. The id test is reserved for this path.

Authorization

bearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
sql*string
context?

Response Body

The outcome.

application/json
  1. response
matched*boolean

Whether the topic matches a FROM filter.

passed*boolean

Whether WHERE is true.

output*|

The SELECT output.

curl -X POST 'http://127.0.0.1:18083/api/v1/rules/test' \  -H 'Content-Type: application/json' \  -d '{  "sql": "string"}'
{  "matched": true,  "passed": true,  "output": {}}

One rule

GET
/api/v1/rules/{id}

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Response Body

The rule.

application/json
  1. response
id*string

Required on create.

Match^[A-Za-z0-9_-]{1,64}$
description?string
sql*string

SELECT … FROM "topic/filter" [WHERE …]

enabled?boolean
Defaulttrue
actions?array<>
source*string
Value in"config""api"
from*array<string>

The FROM topic filters.

metrics*
curl -X GET 'http://127.0.0.1:18083/api/v1/rules/string'
{  "id": "string",  "description": "string",  "sql": "string",  "enabled": true,  "actions": [    {      "type": "republish",      "topic": "string",      "qos": 0,      "retain": true,      "payload": "string",      "url": "string",      "method": "POST",      "headers": {},      "body": "string",      "timeout_ms": 0,      "allow_http": true,      "connector": "string",      "key": "string",      "value": "string",      "batch_max": 0,      "linger_ms": 0,      "max_retries": 0,      "dead_letter_topic": "string"    }  ],  "source": "config",  "from": [    "string"  ],  "metrics": {    "matched": 0,    "passed": 0,    "failed": 0,    "dropped": 0  }}

Delete a rule

DELETE
/api/v1/rules/{id}

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Response Body

Deleted; messages already queued for its actions are still delivered.

curl -X DELETE 'http://127.0.0.1:18083/api/v1/rules/string'
Empty

Replace a rule

PUT
/api/v1/rules/{id}

The body is a RuleInput (an id, if present, must match the path; the view's read-only fields are ignored). A webhook header value sent as ****** keeps the stored value. The rule's counters are kept; its actions restart with fresh queues and counters.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Request Body

application/json
  1. body
id?string

Required on create.

Match^[A-Za-z0-9_-]{1,64}$
description?string
sql*string

SELECT … FROM "topic/filter" [WHERE …]

enabled?boolean
Defaulttrue
actions?array<>

Response Body

The updated rule.

application/json
  1. response
id*string

Required on create.

Match^[A-Za-z0-9_-]{1,64}$
description?string
sql*string

SELECT … FROM "topic/filter" [WHERE …]

enabled?boolean
Defaulttrue
actions?array<>
source*string
Value in"config""api"
from*array<string>

The FROM topic filters.

metrics*
curl -X PUT 'http://127.0.0.1:18083/api/v1/rules/string' \  -H 'Content-Type: application/json' \  -d '{  "sql": "string"}'
{  "id": "string",  "description": "string",  "sql": "string",  "enabled": true,  "actions": [    {      "type": "republish",      "topic": "string",      "qos": 0,      "retain": true,      "payload": "string",      "url": "string",      "method": "POST",      "headers": {},      "body": "string",      "timeout_ms": 0,      "allow_http": true,      "connector": "string",      "key": "string",      "value": "string",      "batch_max": 0,      "linger_ms": 0,      "max_retries": 0,      "dead_letter_topic": "string"    }  ],  "source": "config",  "from": [    "string"  ],  "metrics": {    "matched": 0,    "passed": 0,    "failed": 0,    "dropped": 0  }}
GET
/api/v1/rules/{id}/metrics

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

id*string

Response Body

Counters since start-up (or since the rule was created).

application/json
  1. response
id*string
matched*integer

Messages whose topic matched FROM.

passed*integer

Messages for which WHERE was true.

filtered*integer

Messages for which WHERE was not true.

failed*integer

Evaluation errors.

dropped*integer

Dropped because a core's rules queue was full.

actions*array<>
curl -X GET 'http://127.0.0.1:18083/api/v1/rules/string/metrics'
{  "id": "string",  "matched": 0,  "passed": 0,  "filtered": 0,  "failed": 0,  "dropped": 0,  "actions": [    {      "index": 0,      "type": "string",      "success": 0,      "failed": 0,      "dropped": 0,      "retried": 0,      "dead_lettered": 0,      "queued": 0    }  ]}
GET
/api/v1/connectors

The [[connector]] tables of orbitmq.toml with their status (no credentials).

Authorization

bearer
headerAuthorizationBearer <token>

Response Body

Connectors.

application/json
  1. response
connectors*array<>
curl -X GET 'http://127.0.0.1:18083/api/v1/connectors'
{  "connectors": [    {      "name": "string",      "kind": "kafka",      "target": "string",      "status": "connected",      "last_error": "string",      "success": 0,      "failed": 0,      "queued": 0    }  ]}
GET
/dashboard/{path}

Static files of the dashboard compiled into the binary. Paths without a file extension outside assets/ return index.html (single-page app routes). Hashed files under assets/ are cached for a year (immutable), everything else is no-cache with an ETag. gzip or Brotli encoding per Accept-Encoding. / and /dashboard redirect here. Absent when [admin] dashboard = false.

Path Parameters

path*string

File below /dashboard/ (empty for index.html).

Response Body

The file.

curl -X GET 'http://127.0.0.1:18083/dashboard/string'
Empty
GET
/licenses.txt

The licence texts and notices of the third-party software compiled into this binary (Rust crates and the embedded dashboard's packages), as plain text. The same text as orbitmq --licenses and the THIRD_PARTY_NOTICES.txt shipped with the source.

Response Body

The notices.

response?stringtext/plain
curl -X GET 'http://127.0.0.1:18083/licenses.txt'
"string"
GET
/api/v1/auth/{chain}

The sources of the chain in priority order, each with its kind, state, redacted configuration and counters, plus the chain-end settings and the revision to send back with a change. Secrets are never returned.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

chain*string

The chain.

Value in"authentication""authorization"

Response Body

The chain.

application/json
  1. response
chain*string
Value in"authentication""authorization"
revision*integer

Changes so far; send it back to detect concurrent edits.

persisted*boolean

Whether changes are written to the auth state file.

state_file?string|null
from_state_file?boolean

The chains were loaded from the state file at start-up.

allow_anonymous?boolean

Authentication chain end for clients without a user name, as in force: the configured value or, when unset, whether the chain has no source.

no_match?string

Authorization chain end.

Value in"allow""deny""ignore"
sources*array<>
curl -X GET 'http://127.0.0.1:18083/api/v1/auth/authentication'
{  "chain": "authentication",  "revision": 0,  "persisted": true,  "state_file": "string",  "from_state_file": true,  "allow_anonymous": true,  "no_match": "allow",  "sources": [    {      "name": "string",      "kind": "password_file",      "enabled": true,      "position": 0,      "status": "active",      "config": {},      "metrics": {        "allow": 0,        "deny": 0,        "ignore": 0,        "checks": 0,        "errors": 0,        "cache_hits": 0,        "last_error_at": 0      }    }  ]}

Reorder a chain

PUT
/api/v1/auth/{chain}/order

Sets the priority order. order must name every source of the chain exactly once. Connections authenticating while the order changes finish on the order they started with; the change is persisted to the auth state file when one is configured.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

chain*string

The chain.

Value in"authentication""authorization"

Request Body

application/json
  1. body
order*array<string>
revision?integer

Refuse with 409 if the chains changed since.

Response Body

The chain after the change.

application/json
  1. response
chain*string
Value in"authentication""authorization"
revision*integer

Changes so far; send it back to detect concurrent edits.

persisted*boolean

Whether changes are written to the auth state file.

state_file?string|null
from_state_file?boolean

The chains were loaded from the state file at start-up.

allow_anonymous?boolean

Authentication chain end for clients without a user name, as in force: the configured value or, when unset, whether the chain has no source.

no_match?string

Authorization chain end.

Value in"allow""deny""ignore"
sources*array<>
curl -X PUT 'http://127.0.0.1:18083/api/v1/auth/authentication/order' \  -H 'Content-Type: application/json' \  -d '{  "order": [    "string"  ]}'
{  "chain": "authentication",  "revision": 0,  "persisted": true,  "state_file": "string",  "from_state_file": true,  "allow_anonymous": true,  "no_match": "allow",  "sources": [    {      "name": "string",      "kind": "password_file",      "enabled": true,      "position": 0,      "status": "active",      "config": {},      "metrics": {        "allow": 0,        "deny": 0,        "ignore": 0,        "checks": 0,        "errors": 0,        "cache_hits": 0,        "last_error_at": 0      }    }  ]}

Add a source

POST
/api/v1/auth/{chain}/sources

source holds the keys of a [[authentication]] / [[authorization]] table (for example {"kind": "postgres", "name": "pg", "url": {"env": "PG_URL"}, "acl_query": "..."}). Network connections are opened lazily, so an unreachable database does not fail the request.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

chain*string

The chain.

Value in"authentication""authorization"

Request Body

application/json
  1. body
source*
position?integer

0-based; default: the end.

Range0 <= value
revision?integer

Response Body

The chain after the change.

application/json
  1. response
chain*string
Value in"authentication""authorization"
revision*integer

Changes so far; send it back to detect concurrent edits.

persisted*boolean

Whether changes are written to the auth state file.

state_file?string|null
from_state_file?boolean

The chains were loaded from the state file at start-up.

allow_anonymous?boolean

Authentication chain end for clients without a user name, as in force: the configured value or, when unset, whether the chain has no source.

no_match?string

Authorization chain end.

Value in"allow""deny""ignore"
sources*array<>
curl -X POST 'http://127.0.0.1:18083/api/v1/auth/authentication/sources' \  -H 'Content-Type: application/json' \  -d '{  "source": {}}'
{  "chain": "authentication",  "revision": 0,  "persisted": true,  "state_file": "string",  "from_state_file": true,  "allow_anonymous": true,  "no_match": "allow",  "sources": [    {      "name": "string",      "kind": "password_file",      "enabled": true,      "position": 0,      "status": "active",      "config": {},      "metrics": {        "allow": 0,        "deny": 0,        "ignore": 0,        "checks": 0,        "errors": 0,        "cache_hits": 0,        "last_error_at": 0      }    }  ]}
PATCH
/api/v1/auth/{chain}/sources/{name}

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

chain*string

The chain.

Value in"authentication""authorization"
name*string

The source's name.

Request Body

application/json
  1. body
enabled*boolean
revision?integer

Response Body

The chain after the change.

application/json
  1. response
chain*string
Value in"authentication""authorization"
revision*integer

Changes so far; send it back to detect concurrent edits.

persisted*boolean

Whether changes are written to the auth state file.

state_file?string|null
from_state_file?boolean

The chains were loaded from the state file at start-up.

allow_anonymous?boolean

Authentication chain end for clients without a user name, as in force: the configured value or, when unset, whether the chain has no source.

no_match?string

Authorization chain end.

Value in"allow""deny""ignore"
sources*array<>
curl -X PATCH 'http://127.0.0.1:18083/api/v1/auth/authentication/sources/string' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true}'
{  "chain": "authentication",  "revision": 0,  "persisted": true,  "state_file": "string",  "from_state_file": true,  "allow_anonymous": true,  "no_match": "allow",  "sources": [    {      "name": "string",      "kind": "password_file",      "enabled": true,      "position": 0,      "status": "active",      "config": {},      "metrics": {        "allow": 0,        "deny": 0,        "ignore": 0,        "checks": 0,        "errors": 0,        "cache_hits": 0,        "last_error_at": 0      }    }  ]}

Remove a source

DELETE
/api/v1/auth/{chain}/sources/{name}

Refused with 409 last_source for the last authentication source while allow_anonymous is unset, because the broker would then accept anonymous clients; disabling it is allowed.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

chain*string

The chain.

Value in"authentication""authorization"
name*string

The source's name.

Query Parameters

revision?integer

Response Body

The chain after the change.

application/json
  1. response
chain*string
Value in"authentication""authorization"
revision*integer

Changes so far; send it back to detect concurrent edits.

persisted*boolean

Whether changes are written to the auth state file.

state_file?string|null
from_state_file?boolean

The chains were loaded from the state file at start-up.

allow_anonymous?boolean

Authentication chain end for clients without a user name, as in force: the configured value or, when unset, whether the chain has no source.

no_match?string

Authorization chain end.

Value in"allow""deny""ignore"
sources*array<>
curl -X DELETE 'http://127.0.0.1:18083/api/v1/auth/authentication/sources/string'
{  "chain": "authentication",  "revision": 0,  "persisted": true,  "state_file": "string",  "from_state_file": true,  "allow_anonymous": true,  "no_match": "allow",  "sources": [    {      "name": "string",      "kind": "password_file",      "enabled": true,      "position": 0,      "status": "active",      "config": {},      "metrics": {        "allow": 0,        "deny": 0,        "ignore": 0,        "checks": 0,        "errors": 0,        "cache_hits": 0,        "last_error_at": 0      }    }  ]}
PUT
/api/v1/auth/{chain}/sources/{name}

The source keeps its position. Secrets must be restated (or referenced with {"env": ...} / {"file": ...}): the API never returns them. Sessions connected before the change keep the ACLs they loaded from the old configuration until they reconnect.

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

chain*string

The chain.

Value in"authentication""authorization"
name*string

The source's name.

Request Body

application/json
  1. body
source*
revision?integer

Response Body

The chain after the change.

application/json
  1. response
chain*string
Value in"authentication""authorization"
revision*integer

Changes so far; send it back to detect concurrent edits.

persisted*boolean

Whether changes are written to the auth state file.

state_file?string|null
from_state_file?boolean

The chains were loaded from the state file at start-up.

allow_anonymous?boolean

Authentication chain end for clients without a user name, as in force: the configured value or, when unset, whether the chain has no source.

no_match?string

Authorization chain end.

Value in"allow""deny""ignore"
sources*array<>
curl -X PUT 'http://127.0.0.1:18083/api/v1/auth/authentication/sources/string' \  -H 'Content-Type: application/json' \  -d '{  "source": {}}'
{  "chain": "authentication",  "revision": 0,  "persisted": true,  "state_file": "string",  "from_state_file": true,  "allow_anonymous": true,  "no_match": "allow",  "sources": [    {      "name": "string",      "kind": "password_file",      "enabled": true,      "position": 0,      "status": "active",      "config": {},      "metrics": {        "allow": 0,        "deny": 0,        "ignore": 0,        "checks": 0,        "errors": 0,        "cache_hits": 0,        "last_error_at": 0      }    }  ]}