---
title: "Generate a project API key"
method: POST
path: "/v1/org/project/{projectId}/api-key"
tags: ["Organization Project API Key"]
---

# Generate a project API key

`POST /v1/org/project/{projectId}/api-key`

## Request

- Base URL: `https://api.roark.ai`
- URL: `https://api.roark.ai/v1/org/project/{projectId}/api-key`
- Auth: HTTP bearer

Mint a new project-scoped API key. The raw key value is returned exactly once in the `key` field: capture it now, it is unreadable afterwards. Defaults to full project access with READ + WRITE scope; narrow with `permissions` / `scopes`.

## Path parameters

- `projectId` string, required

## Request body

- CreateOrgProjectApiKeyInput
  - `name` string, required: Human label for the key
  - `scopes` string[]
  - `permissions` string[]

## Response `200`

The created key (value returned once)

- object
  - `data` CreateOrgProjectApiKeyResponse, required
    - `id` string, required
    - `name` string, required
    - `prefix` string, required
    - `suffix` string, required
    - `scopes` string[], nullable, required
    - `permissions` string[], required
    - `status` string, nullable, required
    - `lastUsedAt` string, nullable, required
    - `createdAt` string, required
    - `updatedAt` string, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error

## Changes

> 188 revisions in range; 1 not diffed.

- **2026-09-28** `f647fa40d8bb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/roarkhq/apis/roark-analytics-api/changes/v1/org/project/:projectId/api-key/post.md)

---

[API](https://skmtc.dev/roarkhq/apis/roark-analytics-api.md) - [All operations](https://skmtc.dev/roarkhq/apis/roark-analytics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/roarkhq/apis/roark-analytics-api/revisions/1a91a5c90e44?raw)
