Releasesv0.1.0
Api referenceEndpointsAdmin

Create an API key for a tenant (instance admin)

POST
/v1/admin/tenants/{tenant_id}/keys

As ohs admin key create --tenant makes. The whole key is in this answer only; Idempotency-Key is not honoured. Recorded as key.create in the caller's audit log and in the tenant's.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

tenant_id*string

The id of a tenant; any other value is a 404.

Formatuuid

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Request Body

Empty, or an empty object.

application/json
  1. body

Response Body

The key, with its secret. Sent with Cache-Control: no-store.

application/json
  1. response
id*string
Formatuuid
prefix*string

The start of the key, kept in clear to tell keys apart.

created_at*string
Formatdate-time
last_used_at*|
Formatdate-time
revoked_at*|
Formatdate-time
current*boolean

True for the key making the call.

key*string

The whole key, returned this once.

curl -X POST 'http://localhost:8080/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/keys' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{}'
{  "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