Releasesv0.1.0
Api referenceEndpointsAdmin

Create a tenant and its first API key (instance admin)

POST
/v1/admin/tenants

A new tenant, never an instance admin (making one stays ohs admin tenant, run on the server), with its first key, as ohs admin tenant create makes. The whole key is in this answer only. Idempotency-Key is not honoured: a replay would mean storing the key. Recorded as tenant.create in the caller's audit log and in the new tenant's.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Request Body

application/json
  1. body
name*string

Surrounding spaces are trimmed; what is left must be 1 to 100 characters, none of them a control character.

Lengthlength <= 100

Response Body

The tenant, with its first key and the key's secret. Sent with Cache-Control: no-store.

application/json
  1. response
id*string
Formatuuid
name*string
admin*boolean

True for an instance admin tenant, whose keys reach the /v1/admin routes.

created_at*string
Formatdate-time
active_keys*integer

The tenant's keys that are not revoked.

key*

The tenant's first key, with its secret, returned this once.

curl -X POST 'http://localhost:8080/v1/admin/tenants' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "admin": true,  "created_at": "2019-08-24T14:15:22Z",  "active_keys": 0,  "key": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "prefix": "string",    "created_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "revoked_at": "2019-08-24T14:15:22Z",    "current": true,    "key": "string"  }}
Edit on GitHub