Skip to main content

Authenticate via API

Use the /service-accounts/token endpoint to obtain a bearer token.

Request

curl -sS --location "$API_URL/service-accounts/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grantType": "client_credentials",
    "clientId": "sa_xxxxxxxxxxxxxxxx",
    "clientSecret": "sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  }'

Response

{
  "success": true,
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIs...",
    "tokenType": "Bearer",
    "expiresIn": 14400
  }
}
The token expires in 4 hours (14400 seconds). Use the accessToken in the Authorization: Bearer {token} header for subsequent requests.

Using the Token

Include the access token in all API requests:
curl -sS --location "$API_URL/executions" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{...}'

Environment Variables

For convenience, set these variables in your shell:
API_URL="https://api.voidr.co/v1"
ACCESS_TOKEN="your_access_token_here"

Token Refresh

When your token expires (after 4 hours), simply request a new one using the same /service-accounts/token endpoint with your clientId and clientSecret.