Authenticate API requests using your workspace Bearer token.
Overview
Every API request must include your workspace API key as a Bearer token in the Authorization header. There is one API key per workspace - all requests made with it operate within that workspace's scope.
text
Authorization: Bearer <your-api-key>
Getting Your API Key
Log in to your Sarufi workspace
Navigate to Settings → API Keys
Click Generate API Key
Copy the key - it will only be shown once
Keep your key secret
Treat your API key like a password. Never expose it in client-side code, public repositories, or logs. Regenerate it immediately if it is compromised.
Using the Key
Include the key in every request header:
bash
curl -X GET https://developers.sarufi.io/api/dev/v1/me \ -H "Authorization: Bearer sk-your-api-key-here"curl -X GET https://developers.sarufi.io/api/dev/v1/me \ -H "Authorization: Bearer sk-your-api-key-here"