Basilisk
API referenceReference

Issue an organization service token

POST
/v1/admin/service-tokens

Service tokens are not tied to a person and grant read-only access to the whole API: the Pixi audit routes (/v1/query, /v1/querybatch, /v1/audit, /v1/vulns/{id}) and every authenticated read (/v1/auth/me, /v1/jobs*). Any write is 403, and token management requires a browser session. The plaintext token is returned in this response only.

Authorization

sessionCookie
basilisk_session<token>

Browser session minted by the prefix.dev OIDC login.

In: cookie

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/admin/service-tokens" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "organization_slug": "string"  }'
{  "service_token": {    "created_at": "2019-08-24T14:15:22Z",    "created_by": "string",    "description": "string",    "expires_at": "2019-08-24T14:15:22Z",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "key_id": "string",    "last_used_at": "2019-08-24T14:15:22Z",    "name": "string",    "organization": {      "name": "string",      "slug": "string"    },    "revoked_at": "2019-08-24T14:15:22Z",    "status": "active"  },  "token": "string"}