Skip to main content
API keys authenticate SDK requests to Pikarc. Each workspace has one active API key at a time. The key format is lg_<prefix>_<secret>.

Get Active Key

GET /v1/api-keys/
Returns the active API key for your workspace. The full key is returned if it was stored encrypted; otherwise only the prefix is available. Auth: JWT or API Key

Response 200

{
  "id": "aa0e8400-e29b-41d4-a716-446655440000",
  "prefix": "a1b2c3d4",
  "key": "lg_a1b2c3d4_e5f6a7b8c9d0e1f2a3b4c5d6e7f8",
  "label": null,
  "is_active": true,
  "created_at": "2025-01-01T00:00:00Z"
}
FieldTypeDescription
idstringKey UUID
prefixstringKey prefix (first 8 characters after lg_)
keystring | nullFull key if decryptable, otherwise null
labelstring | nullOptional label
is_activebooleanWhether this key is active
created_atstringISO 8601 creation timestamp

Response 404

{
  "detail": "No active API key"
}

Regenerate Key

POST /v1/api-keys/regenerate
Revokes all existing keys and generates a new one. The plaintext key is returned once — store it securely. Auth: JWT or API Key

Response 200

{
  "id": "bb0e8400-e29b-41d4-a716-446655440000",
  "prefix": "x9y8z7w6",
  "label": null,
  "key": "lg_x9y8z7w6_a1b2c3d4e5f6a7b8c9d0e1f2",
  "created_at": "2025-01-15T12:00:00Z"
}
After regeneration, the old key immediately stops working. Update your SDK configuration with the new key.