---
title: "Create API key"
method: POST
path: "/api/v1/projects/{projectId}/api-keys"
tags: ["API Keys"]
---

# Create API key

`POST /api/v1/projects/{projectId}/api-keys`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/projects/{projectId}/api-keys`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Generates a new API key for event ingestion. The key is shown only once.

## Path parameters

- `projectId` string, uuid, required

## Request body

- ApiKeyRequest
  - `name` string, required
  - `scope` 'READ_WRITE' | 'READ_ONLY'
  - `expiresAt` string, date-time

## Response `201`

API key created

---

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