API Keys
Create, list, and revoke project API keys. Master keys are created automatically during organization setup and cannot be managed through this API.
Create Project Key#
POST
/api/v1/keysCreate a new project API key. The full key value is returned only once in the response and cannot be retrieved again.
Auth: Master key only
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| project_id | string | Required | UUID of the project this key belongs to |
| type | string | Required | Key type. Currently only "project" is supported. |
| name | string | Required | A human-readable label for the key (1-100 characters) |
Create a project key
curl -X POST https://logstitch.io/api/v1/keys \
-H "Authorization: Bearer mk_..." \
-H "Content-Type: application/json" \
-d '{
"project_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "project",
"name": "Production API Key"
}'201Success
Response
{
"key": "pk_abc123...",
"prefix": "pk_abc1",
"type": "project",
"name": "Production API Key",
"request_id": "req_abc123"
}Store your key securely
The full key is only shown once in this response. LogStitch stores a SHA-256 hash and cannot recover the plaintext. Copy it to a secrets manager immediately.
List Keys#
GET
/api/v1/keysList all API keys for your organization. Only the key prefix is returned -- the full key value is never exposed after creation.
Auth: Master key or Project key
List all keys
curl https://logstitch.io/api/v1/keys \
-H "Authorization: Bearer mk_..."200Success
Response
{
"keys": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"prefix": "pk_abc1",
"type": "project",
"name": "Production API Key",
"lastUsedAt": null,
"createdAt": "2026-01-15T09:30:00.000Z",
"revokedAt": null
}
],
"request_id": "req_abc123"
}Revoke Key#
DELETE
/api/v1/keys/:idPermanently revoke an API key. The key becomes immediately unusable. There is no grace period or undo.
Auth: Master key or Project key
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | UUID of the key to revoke |
Revoke a key
curl -X DELETE https://logstitch.io/api/v1/keys/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer mk_..."200Success
Response
{
"revoked": true,
"request_id": "req_abc123"
}