Issue an API key
const url = 'https://api.pealboard.com/v1/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Deploy script","scopes":[],"expiresAt":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pealboard.com/v1/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Deploy script", "scopes": [], "expiresAt": "2026-04-15T12:00:00Z" }'The key is in this response and is never shown again. Copy it now; Pealboard keeps only a digest of it.
The key acts with the role of the member who issued it, narrowed by scopes. An empty scopes is not narrowed and may do anything that member may do. keys:read and keys:write cannot be granted: a credential that can mint credentials makes revoking a leaked one a matter of enumerating its descendants rather than deleting a row.
Only a signed-in person may issue one, for the same reason.
Idempotency-Key is accepted and deliberately not honoured here: recording the answer would keep the key itself in storage for a day, which is the one thing this route promises not to do. A retry issues a second key; revoke whichever you did not keep.
Access. Requires the admin role or above (admin, owner). Issuing a credential that acts for the workspace is an administrative act. API-key scope: keys:write.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
What it is for. Shown in the list and in the audit log.
Example
Deploy scriptWhat the key may do. Empty means anything the member who issued it may do.
When it stops working. Omit for a key that does not expire.
Responses
Section titled “Responses”The key, once.
object
A UUID this API issued.
Every Pealboard key begins with this.
The last four characters, to tell two keys apart.
Empty means the key may do anything the membership that issued it may do.
A UUID this API issued.
Recorded at most once a minute, so a busy key does not write a row per request.
The key itself. This is the only time it is returned; Pealboard stores a SHA-256 digest.
Example
{ "prefix": "pb_", "scopes": [ "self:read" ], "key": "pb_AbCdEf0123456789AbCdEf0123456789AbCdEf01"}No valid credentials.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}Authenticated, but not permitted.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}No such resource, or it is not visible to you.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}The request conflicts with the current state.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}The request did not match the expected shape.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}Rate limited. Retry after the interval in the header.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}GitHub or another dependency refused or did not answer. Nothing in the workspace changed.
object
object
A stable identifier for the kind of failure. Safe to branch on.
What went wrong, written for a person.
Structured particulars, when there are any.
object
What to do about it, when there is something to do.
Quote this when asking about a specific failure.
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": { "additionalProperty": "example" }, "remedy": "example", "requestId": "example" }}