Releasesv0.1.0
Tokens

Mint a user token

POST
/v1/users/{id}/tokens

Returns an opaque ohs_ut_ token for one active user, shown only in this response (Cache-Control: no-store). Lifetime: one hour by default, at most 24 hours; a token whose only scope is read may live up to 30 days (2592000 s), for a person's own AI agent configuration (MCP). Idempotency-Key is ignored here.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid

Header Parameters

Authorization*string

The tenant API key, as a bearer secret.

Request Body

application/json
  1. body
scopes*array<>
Items1 <= items
ttl_seconds?integer

Lifetime in seconds. 0 or absent means 3600. At most 86400, or 2592000 (30 days) when read is the only scope.

Range0 <= value <= 2592000

Response Body

Minted.

application/json
  1. response
token*string

ohs_ut_ token. Shown only once.

expires_at*string
Formatdate-time
scopes*array<>
curl -X POST 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/tokens' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{  "scopes": [    "upload"  ]}'
{  "token": "string",  "expires_at": "2019-08-24T14:15:22Z",  "scopes": [    "upload"  ]}
Edit on GitHub