---
title: "Issue a credential for a customer"
method: POST
path: "/api/v1/businesses/{id}/keys"
tags: ["businesses"]
---

# Issue a credential for a customer

`POST /api/v1/businesses/{id}/keys`

## Request

- Base URL: `https://app.blueticked.com`
- URL: `https://app.blueticked.com/api/v1/businesses/{id}/keys`
- Auth: HTTP bearer

Mint an API key restricted to one existing business, for rotation, or a second narrower key.

`{id}` is the business id returned when you created the customer.

Use this to rotate a customer's credential after a leak: mint the replacement, deploy it, then revoke the old one. There is no window where that customer cannot send.

`monthly_spend_cap_rands` is the per-customer spend guardrail. All customers draw on your one workspace wallet, so a cap per key is what stops one customer's runaway loop from spending another's headroom.

Omit `scopes` to copy your own. Anything you do not hold is dropped rather than erroring, so issuing 500 keys from one template does not fail when your own scopes change.

`key` is returned ONCE. Only a hash is stored.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string
  - `scopes` string[]
  - `expires_in_days` number
  - `monthly_spend_cap_rands` number

## Response `201`

Success

- object
  - `id` string, uuid, required
  - `business_id` string, uuid, required
  - `prefix` string, required
  - `scopes` string[], required
  - `expires_at` string, date-time, nullable, required
  - `key` string, required
  - `request_id` string, required

## Other responses

- `400`: Validation failed
- `401`: Unauthorized: missing or invalid API key
- `402`: Insufficient wallet balance
- `403`: Forbidden: scope, plan limit, or suspension
- `404`: Not found
- `409`: Conflict (idempotency-key reuse or resource in use)
- `413`: Request body above the endpoint's size limit
- `422`: Understood but refused: the request is well-formed, the action is not permitted for this resource
- `429`: Rate limited
- `500`: Internal error
- `502`: An upstream provider refused or failed the request
- `503`: Channel or send queue unavailable

---

[API](https://skmtc.dev/blueticked/apis/blueticked-api.md) · [All operations](https://skmtc.dev/blueticked/apis/blueticked-api/llms.txt) · [OpenAPI document](https://skmtc.dev/blueticked/apis/blueticked-api/revisions/07132284f4ff?raw)
