Skip to Content
API ReferenceAuthentication

Authentication

All Onsomble API requests require authentication using Bearer tokens.

Getting Your Token

Go to Settings

Navigate to Settings → API Keys in your Onsomble account.

Generate a token

Click Create New API Key and give it a descriptive name.

Copy and store securely

Copy the token immediately — it won’t be shown again.

Warning

Treat your API token like a password. Never share it publicly or commit it to version control.

Using Your Token

Include the token in the Authorization header of all requests:

curl -X GET "https://api.onsomble.ai/api/notebooks" \ -H "Authorization: Bearer YOUR_API_TOKEN"

Token Security

Best Practices

  • Use environment variables — Never hardcode tokens in your code
  • Rotate regularly — Generate new tokens periodically
  • Minimum scope — Create separate tokens for different applications
  • Monitor usage — Check API logs for unexpected activity

Revoking Tokens

If a token is compromised:

  1. Go to Settings → API Keys
  2. Find the compromised token
  3. Click Revoke
  4. Generate a new token

Error Responses

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENToken valid but insufficient permissions

Example Error

{ "error": { "code": "UNAUTHORIZED", "message": "Invalid or expired API token" } }

Learn More

Last updated on