Skip to main content

Getting Your API Key

1

Sign in to Sentrial

2

Go to Settings → API Keys

Navigate to your organization settings.
3

Create a new API key

Click “Create API Key”, name it, and copy the key immediately.
Store your API key securely. API keys are only shown once. Store them in environment variables or a secrets manager. Never commit them to code.

Using API Keys

Include your API key in the Authorization header:

cURL Example

Python SDK

TypeScript SDK

API Key Format

Sentrial API keys follow this format:
  • sentrial_ — prefix identifying Sentrial keys
  • live_ — environment (live for production)
  • Random string — unique identifier

Error Responses

401 Unauthorized

Missing or invalid API key.

403 Forbidden

API key doesn’t have permission for this action.

Security Best Practices

  • Use environment variables — Store API keys in env vars, not in code
  • Never commit keys — Add .env to .gitignore and use secrets managers in CI/CD
  • Rotate keys regularly — Create new keys periodically and revoke old ones
  • Use separate keys per environment — Different keys for dev, staging, and production
  • Revoke compromised keys immediately — If a key is exposed, delete it in Settings right away

Next Steps

Sessions API

Create and manage sessions.

Events API

Track events within sessions.