Getting StartedAuthentication

Authentication

Learn how to authenticate your requests to the Twenty2 API.

All Twenty2 API requests must include a valid API key in the request header. API keys are scoped per workspace — a key from one workspace cannot access resources in another.


How to Get Your API Key

  1. Log in to your Twenty2 workspace

  2. Go to Profile → Integrations → Build with Twenty2 API

  3. Click API Keys → Create New

  4. Copy the generated key and store it securely

Never expose your API Key in client-side code or public repositories. Treat it like a password.


Using Your API Key

Pass your API key as a Bearer token in the Authorization header on every request.

curl -X POST https://api.twentytwo.in/api/calls \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Authentication Errors

HTTP StatusCodeMeaning
401UNAUTHORIZEDAPI key is missing or invalid
403FORBIDDENAPI key does not have access to this resource

If you receive a 401, double-check that you're passing the key correctly as Bearer YOUR_API_KEY with no extra spaces or characters.


Managing API Keys

You can create, view, and revoke API keys anytime from Profile → Integrations → Build with Twenty2 API → API Keys. If a key is compromised, revoke it immediately and generate a new one.


Next Steps