API Keys

Create, list, and revoke API keys programmatically.

Create a key

curlbash
curl -X POST https://api.fileswitch.co/api/v1/integrations/api-keys \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "ci-server", "expiresInDays": 90}'

Response (201) — the full key is shown exactly once:

Responsejson
{
  "success": true,
  "data": {
    "id": "c47afec6-083c-4228-a108-2271ce598dff",
    "name": "ci-server",
    "keyPrefix": "fc_ab12cd34",
    "lastFour": "5678",
    "lastUsedAt": null,
    "expiresAt": "2026-10-29T13:00:00.000Z",
    "revokedAt": null,
    "createdAt": "2026-07-31T13:00:00.000Z",
    "fullKey": "fc_ab12cd34..."
  }
}
  • name is required (1–100 characters). expiresInDays is optional (1–365); omit it for a non-expiring key.
  • Returns HTTP 403 with code API_KEYS_REQUIRE_PAID_PLAN on a free plan.
  • Returns HTTP 403 with code API_KEY_LIMIT_REACHED when the plan allowance is exhausted.

Endpoints

MethodEndpointAuthDescription
GET/integrations/api-keysJWTList API keys for the authenticated user.
POST/integrations/api-keysJWTCreate an API key (paid plans only).
POST/integrations/api-keys/:id/revokeJWTPermanently revoke an API key.

Keys are scoped to the authenticated user; attempting to revoke another user's key returns 404.