Releasesv0.1.0
Api referenceEndpointsTenant

Create an API key for the tenant

POST
/v1/keys

A new key of the calling key's tenant, as ohs admin key create makes. The whole key is in this answer only. To rotate: deploy the new key, then revoke the old one. Recorded in the audit log as key.create.

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

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/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