---
title: "Create API key"
method: POST
path: "/v1/api_keys"
tags: ["API Keys"]
---

# Create API key

`POST /v1/api_keys`

Create an API key.

## Parameters

- `#/paths/~1v1~1api_keys/get/parameters/0` — unresolved $ref

## Request body

- object
  - `api_key_id` string — The unique API key identifier. Prefix is "api" in production and "sbx_api" in sandbox.
  - `platform_id` string — The unique platform identifier. Prefix is "plt" in production and "sbx_plt" in sandbox.
  - `masked_api_key` string — The masked API key that is passed to the API.
  - `statements` object[] — Array of valid statements. See the [API keys guide](https://docs.rainforestpay.com/docs/api-keys) on how to define statements.
    - `permissions` string[], required — Array of valid permissions, defined by a `group` or `resource:action`
    - `constraints` object, required — Restrictions on actions allowed based on specific context of a resource.
  - `status` 'ENABLED' | 'DISABLED' | 'DELETED' — Status of the API key.
  - `created_at` string, date-time — Date and time API key was created at in UTC RFC 3339 format.
  - `updated_at` CreatedAt — unresolved $ref

## Response `200`

OK

- object
  - `status` Status — unresolved $ref
  - `data` object
    - `api_key_id` string — The unique session identifier. Prefix is "api" in production and "sbx_api" in sandbox.
    - `platform_id` PlatformId — unresolved $ref
    - `api_key` string — The API key to be passed to the API. This is the only time the API key can be accessed.
    - `statements` object[] — Array of valid statements. See the [API keys guide](https://docs.rainforestpay.com/docs/api-keys) on how to define statements.
    - `status` Status — unresolved $ref
    - `created_at` CreatedAt — unresolved $ref
    - `updated_at` CreatedAt — unresolved $ref
  - `errors` Errors — unresolved $ref

## Other responses

- `400` — unresolved $ref
- `401` — unresolved $ref
- `403` — unresolved $ref
- `5XX` — unresolved $ref

---

[API](https://skmtc.dev/rainforestpay/apis/authentication.md) · [All operations](https://skmtc.dev/rainforestpay/apis/authentication/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rainforestpay/authentication/revisions/529a0dab0f90/schema)
