API keys
Create, list, and revoke workspace API keys.
Create a key
Requires a full-access key or portal session.
curl -X POST https://api.postbound.app/api-keys \
-H "Authorization: Bearer pb_…" \
-H "Content-Type: application/json" \
-d '{
"name": "Production sender",
"permission": "sending_access",
"domain_id": "…"
}'| Field | Required | Notes |
|---|---|---|
name | Yes | Label shown in the portal |
permission | Yes | full_access or sending_access |
domain_id | No | Only valid with sending_access |
Response (token shown once):
{
"id": "…",
"token": "pb_…"
}Store the token immediately
Postbound stores a hash of the key. If you lose the token, create a new key and revoke the old one.
List keys
curl https://api.postbound.app/api-keys \
-H "Authorization: Bearer pb_…"Returns a list object. Secrets are never included.
Revoke a key
curl -X DELETE https://api.postbound.app/api-keys/<key_id> \
-H "Authorization: Bearer pb_…"Revocation is immediate. In-flight requests that already authenticated may finish; new requests with that token fail.
Security practices
- Prefer
sending_access+domain_idfor production senders. - Rotate keys after staff changes or suspected leakage.
- Never embed keys in mobile apps or public frontend code.
- Pass
Idempotency-Keyon sends so retries stay safe if a key is rotated mid-deploy.