---
title: "Issue an API credential"
method: POST
path: "/v1/credentials"
---

# Issue an API credential

`POST /v1/credentials`

## Request

- Base URL: `https://docs.greatwait.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.greatwait.dev/v1/credentials`
- Auth: HTTP bearer

Issues an API credential bound to one project and environment, with scopes capped by the issuing member's current role. The full secret is in this response and in no other, is not recoverable afterwards, and there is deliberately no reveal endpoint. The value is the sixteen-character display prefix followed immediately by thirty-two more characters; the example below is a visible placeholder rather than that shape, because a realistic credential in a committed file is one the repository's own secret scanner refuses.

## Request body

- object
  - `environmentKind` 'test' | 'live', required
  - `project` string, required
  - `scopes` string[], required

## Response `201`

Issue an API credential

- object
  - `createdAt` string, required
  - `displayPrefix` string, required
  - `environmentKind` 'test' | 'live', required
  - `expiresAt` string
  - `id` string, required
  - `issuedBy` string
  - `lastUsedAt` string
  - `project` string, required
  - `revokedAt` string
  - `supersededBy` string
  - `scopes` string[], required
  - `secret` string, required
  - `shownOnce` true, required

## Other responses

- `400`: Problem document. Possible codes at this status: invalid_request.
- `401`: Problem document. Possible codes at this status: authentication_required, credential_expired, credential_revoked.
- `403`: Problem document. Possible codes at this status: scope_missing.
- `404`: Problem document. Possible codes at this status: not_found.
- `409`: Problem document. Possible codes at this status: project_archived.
- `429`: Problem document. Possible codes at this status: rate_limited.
- `503`: Problem document. Possible codes at this status: capability_not_configured, service_unavailable.

---

[API](https://skmtc.dev/greatwait/apis/greatwait-v1.md) · [All operations](https://skmtc.dev/greatwait/apis/greatwait-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/greatwait/apis/greatwait-v1/revisions/6855bce23e72?raw)
