DOCS / API REFERENCE

Create an API token

POST /v1/tokens

POSTHenHouse API v1

Request

POST /v1/tokens

Authenticate with a bearer token. Create one with POST /v1/tokens or cluck login.

Parameters

NameTypeDescription
namestringToken name
scopesarrayScopes to grant
expires_inintegerSeconds until expiry

Example

curl -X POST https://api.pollosoft.example/v1/tokens \
  -H "Authorization: Bearer $COOP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "example-name", "scopes": [], "expires_in": 10}'

Response

A successful call returns 201 Created with JSON like this:

{
  "id": "tok_3f90",
  "name": "ci-deploy",
  "scopes": 2,
  "expires_in": 2592000
}

Errors

IdempotencySend an Idempotency-Key header to make retries safe. We will return the original result instead of laying a second egg.