The Surventrics API uses API keys for authentication. Each key is scoped to your organization and can be configured with specific permissions.
Important: API keys are only shown once when created. Store your key securely - you won't be able to retrieve it again.
Include your API key in the Authorization header as a Bearer token:
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxcurl -X GET "https://surventrics.ai/api/v1/surveys" \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json"API keys are created with specific scopes that control what actions they can perform. Request only the scopes you need:
| Scope | Permission |
|---|---|
surveys:read | View surveys and their settings |
surveys:write | Create, update, and delete surveys |
questions:read | View survey questions |
questions:write | Create, update, and delete questions |
responses:read | View survey responses |
responses:export | Export response data (CSV/JSON) |
analytics:read | View analytics and metrics |
Authentication errors return a 401 Unauthorized or 403 Forbidden status:
{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key"
}
}{
"error": {
"code": "forbidden",
"message": "Missing required scope: surveys:write"
}
}{
"error": {
"code": "expired_key",
"message": "API key has expired"
}
}