Releasesv0.1.0
Operations

Create the first tenant and its API key with the setup token

POST
/v1/setup

The first run without a terminal: the body carries OHS_SETUP_TOKEN (compared in constant time) instead of a bearer credential. It works once: while the instance has no tenant, it creates one with its first API key and returns the key, shown only this once. Any tenant existing, however it was created, closes it for good (409). The body is at most 4 KiB. The creation is recorded in the new tenant's audit log (tenant.create, actor system / setup). With no OHS_SETUP_TOKEN the route is not mounted (404). See docs/setup.md.

Request Body

application/json
  1. body
setup_token*string

The instance's OHS_SETUP_TOKEN.

tenant_name?string

Name of the tenant; surrounding spaces are trimmed. Empty or absent means default. No control character.

Lengthlength <= 100

Response Body

The tenant and its first API key. Sent with Cache-Control: no-store.

application/json
  1. response
tenant_id*string
Formatuuid
api_key*string

The tenant API key (ohs_sk_...), shown only this once.

curl -X POST 'http://localhost:8080/v1/setup' \  -H 'Content-Type: application/json' \  -d '{  "setup_token": "string"}'
{  "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",  "api_key": "string"}
Edit on GitHub