Skip to main content
POST
/
api-keys
Create API key
curl --request POST \
  --url https://api.sevalla.com/v3/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My API Key",
  "role_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "capabilities": [
    {
      "permission": "APP:READ",
      "id_resource": "fb5e5168-4281-4bec-94c5-0d1584e9e657"
    }
  ],
  "expired_at": "2025-12-31T23:59:59Z"
}
'
{
  "token": "svl_abc123...",
  "name": "My API Key"
}

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token in the Authorization header.

Body

application/json
name
string
required

Human-readable name for the API key

Required string length: 1 - 255
Example:

"My API Key"

role_ids
string<uuid>[]

List of role IDs to assign to the API key. At least one role or capability is required

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
capabilities
object[]

List of granular capabilities to assign. At least one role or capability is required

expired_at
string<date-time>

ISO 8601 timestamp when the API key should expire. Omit for no expiration

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Example:

"2025-12-31T23:59:59Z"

Response

Default Response

token
string
required

The raw API key token. This is the only time the full token is returned - store it securely

Example:

"svl_abc123..."

name
string
required

Name of the created API key

Example:

"My API Key"