Esc
Documentation
On this page

DSUI’s server exposes two HTTP interfaces for scripts, CI jobs, and other tools: the event log and the routes that adapters declare. The workspace also calls other endpoints under /api/v1. This page doesn’t cover them, and they can change between releases.

The examples use http://localhost:4192. Replace it with the address of your DSUI instance.

Authentication#

Without an authentication plugin, DSUI treats every request as the local owner, so you send no credentials. With an authentication plugin, send whatever credentials that plugin expects. See access control.

Read events#

GET /api/v1/events returns the events that adapters and plugins have published, newest first. It needs the inspect permission.

bash
curl "http://localhost:4192/api/v1/events?signalId=airflow.dag-failed&limit=10"

Query parameters#

ParameterDefaultMeaning
limit100Number of events to return, from 1 to 500
afterNoneAn ISO timestamp. Returns only events that occurred after it
serviceIdNoneReturns only events for this service
signalIdNoneReturns only this signal, written as <source id>.<signal id>, such as airflow.dag-failed

Response#

The response is a JSON object with an items array. Each item has these fields:

FieldMeaning
idUnique ID of the event
signalIdThe signal, written as <source id>.<signal id>
typeinfo, success, warning, or error
sourceTypeadapter, plugin, or host
sourceIdFor an adapter event, the ID of the service that it came from. For a plugin event, the ID of the plugin. For a host event, dsui
serviceIdThe service the event is about. Absent when the event isn’t about one service
payloadThe data of the signal. Each signal defines its own fields
occurredAtWhen the event happened, as an ISO timestamp
actorThe principal ID of the person whose request caused the event, such as someone running an action. Absent for background work and in local single-user mode

To poll for new events, send the occurredAt of the newest event you’ve seen as after.

Errors#

StatusCause
400limit isn’t an integer from 1 to 500, or after isn’t a valid timestamp
403The caller lacks the inspect permission

Call an adapter route#

An adapter can publish HTTP routes. DSUI serves every one of them under one address:

text
/adapters/v1/services/<service id>/<route path>

Routes live outside /api/v1, so a caller that holds a token doesn’t need a DSUI sign-in. The adapter declares each route’s method, path, and how it authenticates. DSUI handles authentication, body size limits, timeouts, and the reply headers, so an adapter never sees the caller’s credentials.

How a route authenticates#

  • Token: the caller sends Authorization: Bearer <token>. The token is a field of the service’s connection. DSUI compares it in constant time and answers 401 when it’s missing or wrong
  • Principal: the caller authenticates as a DSUI user, and DSUI checks the route’s permission against the service. DSUI answers 401 when the caller isn’t authenticated and 403 when the permission is missing

An unknown route answers 404.

Example#

The dbt adapter’s push method uses a token route to receive artifacts from CI:

bash
curl --fail --request PUT \
  --header "Authorization: Bearer $DBT_PUSH_TOKEN" \
  --data-binary "@target/run_results.json" \
  "http://localhost:4192/adapters/v1/services/dbt/artifacts/run_results.json"

See dbt for the details. To declare routes in your own adapter, see routes.