All API endpoints require authentication. The recommended method for integrations is an API key.
API key authentication
Pass your API key in the X-API-Key header:
curl -X GET "https://api.socrateslabs.io/api/contacts" \
-H "X-API-Key: sk_your_api_key_here"
API keys use the prefix sk_ followed by a random string:
sk_a1b2c3d4e5f6g7h8i9j0...
Creating an API key
- Log in to your Socrates CRM dashboard
- Go to Settings > Developer Settings
- Click Create API Key
- Copy the key immediately (it won’t be shown again)
API keys grant full access to your account’s data. Never expose them in client-side code, public repositories, or logs.
Alternative: JWT authentication
For browser-based sessions, the API also accepts JWT tokens from Supabase Auth:
Authorization: Bearer <jwt_token>
X-Account-ID: <account_uuid>
JWT authentication requires both headers. This method is primarily used by the Socrates CRM web application.
Authentication errors
| Status | Meaning |
|---|
401 | Missing or invalid API key / token |
403 | Valid credentials but insufficient permissions |