---
title: "Create Api Key"
method: POST
path: "/v1/api-keys"
tags: ["API Keys"]
---

# Create Api Key

`POST /v1/api-keys`

## Request

- Base URL: `https://api.pinbridge.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pinbridge.io/v1/api-keys`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Create a new API key.

Returns the API key once - save it, it won't be shown again. Keys can be
restricted to a subset of scopes (`read`, `write`, `destructive`) and to
specific Pinterest accounts; an unrestricted key gets every scope.

## Headers

- `x-api-key` string, nullable
- `authorization` string, nullable

## Request body

- APIKeyCreate: Request schema for creating an API key.
  - `name` string, required: Human-readable name for this API key
  - `scopes` string[], nullable: Scopes granted to this key. `read` covers list/get endpoints, `write` covers creating and updating pins, schedules, boards, assets and webhooks, and `destructive` covers deletes and revocations. Omit to grant every scope.
  - `pinterest_account_ids` string[], nullable: Optional allow-list of Pinterest account IDs this key may act on. Omit or send null to allow every account in the workspace.

## Response `201`

Successful Response

- APIKeyCreateResponse: Response schema when creating an API key (includes the key once).
  - `id` string, uuid, required
  - `workspace_id` string, uuid, required
  - `name` string, required
  - `scopes` string[], required
  - `pinterest_account_ids` string[], nullable
  - `api_key` string, required: The actual API key - save this, it won't be shown again
  - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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