Remotehost Docs

Mint an organization-bound API key

POST
/orgs/{orgId}/api-keys

Requires a user session with api_keys.manage. API keys cannot mint keys. Both choices are required: what the key may do (scopes, a template, or unscoped: true) and when it stops (expiresInDays or neverExpires: true); a request missing either is refused with 400. Scopes narrow the creator's permissions, and [] grants none. Store the returned token securely: it is shown only once.

Authorization

bearerAuth
AuthorizationBearer <token>

A RemoteHost API key (rh_sk_...) or a user session token.

In: header

Path Parameters

orgId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/orgs/string/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "scopes": [      "string"    ],    "expiresInDays": 1  }'
{  "apiKey": {    "id": "string",    "org_id": "string",    "name": "string",    "key_prefix": "string",    "last_used_at": "string",    "created_at": "string",    "revoked_at": "string",    "expires_at": "string",    "scopes": [      "string"    ],    "created_by": "string",    "workspace_id": "string"  },  "token": "string"}