Create Token
Create a token for use across the API.
To obtain your Client ID and Client Secret, visit the API Settings page in your Serval dashboard.
Authentication
This endpoint uses HTTP Basic Authentication where:
- Username: Your Client ID
- Password: Your Client Secret
The Authorization header should contain Basic <base64-encoded-credentials>, where the credentials are client_id:client_secret encoded in base64.
Example Request
curl -X POST https://public.api.serval.com/v2/auth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "your-client-id:your-client-secret" \
-d "grant_type=client_credentials"
Or with explicit Basic auth header:
# First, base64 encode your credentials: client_id:client_secret
# For example, if client_id=abc123 and client_secret=secret456
# echo -n "abc123:secret456" | base64
# Result: YWJjMTIzOnNlY3JldDQ1Ng==
curl -X POST https://public.api.serval.com/v2/auth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Basic YWJjMTIzOnNlY3JldDQ1Ng==" \
-d "grant_type=client_credentials"
Using the Access Token
Once you receive the access token, use it in subsequent API requests:
curl -X GET https://public.api.serval.com/v2/workflows \
-H "Authorization: Bearer your-access-token"
Scoped keys
If your Client ID/Secret pair comes from a scoped API key, the resulting access token is restricted to that key’s scopes. This endpoint’s request/response shape is unchanged — scoping only affects which requests the token is later authorized to make.
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
client_credentials 
