Authentication
API keys, OAuth bearer tokens, and how to authenticate requests to the ClientCasa v1 API.
The v1 API accepts two credential types: personal API keys (issued to a single user inside a single organization) and OAuth 2.0 bearer tokens (issued to third-party apps acting on behalf of a user).
API keys
Create keys at Settings → API Keys in your dashboard. Each key is scoped to a single organization and has its own scope list. Keys are revealed once at creation; copy and store immediately.
curl https://www.clientcasa.com/api/v1/clients \
-H "x-api-key: sk_live_xxxxxxxxxxxx"You can also send keys as a Bearer token:
curl https://www.clientcasa.com/api/v1/clients \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxx"Organization scoping
API keys are pinned to your active organization at creation time. They cannot read or write data outside that org, even if you switch organizations in the dashboard later.
OAuth 2.0 (third-party apps)
For partners that need to act on behalf of users (Zapier-class integrations), use the OAuth 2.0 authorization-code flow with PKCE. Register an app at Settings → OAuth Apps, then direct users through:
GET /api/auth/oauth2/authorize?client_id=…&response_type=code&redirect_uri=…&scope=…&code_challenge=…POST /api/auth/oauth2/tokento exchange the code for an access token
Access tokens are JWTs valid for 1 hour. Refresh tokens are valid for 30 days. The organizationId is stamped into the access token's claims at consent time — every request acts on that organization.
curl https://www.clientcasa.com/api/v1/clients \
-H "Authorization: Bearer eyJhbGc..."Scopes
Both credential types use the same scope vocabulary. A scope of <resource>:<action> (e.g. clients:read, invoices:write) grants access to one resource. The same scope can be written <action>:<resource> (read:clients, write:invoices) — both forms are accepted by the API.
| Resource | Read | Write |
|---|---|---|
| Clients | clients:read | clients:write |
| Contacts | contacts:read | contacts:write |
| Projects | projects:read | projects:write |
| Invoices | invoices:read | invoices:write |
| Proposals | proposals:read | proposals:write |
| Contracts | contracts:read | contracts:write |
| Payments | payments:read | payments:write |
| Payouts | payouts:read | payouts:write |
| Time Entries | time-entries:read | time-entries:write |
| Milestones | milestones:read | milestones:write |
| Calendar Events | calendar-events:read | calendar-events:write |
| Inquiries | inquiries:read | inquiries:write |
| Transactions | transactions:read | transactions:write |
| Catalog Items | catalog-items:read | catalog-items:write |
| Webhooks | webhooks:read | webhooks:write |
A request without the required scope returns 403 forbidden.