Authentication methods
| Method | Best for | Token lifetime |
|---|---|---|
| Private Integration | Internal tools, testing, quick prototypes | Long-lived (account scoped) |
| OAuth 2.0 Authorization Code | Marketplace apps, multi-tenant integrations | 24 hours (refresh to renew) |
Required headers
Every API request must include these headers:| Header | Value | Required |
|---|---|---|
Authorization | Bearer <access_token> | Always |
Version | 2021-07-28 | Always |
Content-Type | application/json | For POST/PUT/PATCH |
Option 1: Private integrations
Private Integrations are the fastest way to get started. They generate a scoped API key tied to a single account.Create a new integration
Click Create Integration, give it a name, and select the scopes (permissions) your integration needs.
Private Integration keys are scoped to a single account and do not expire automatically. Treat them like passwords — store them securely and rotate them periodically.
Option 2: OAuth 2.0 authorization code flow
For marketplace apps or multi-tenant integrations, use the standard OAuth 2.0 Authorization Code flow.Step 1: Register your app
Create an app in the HoopAI Marketplace. You’ll receive:- Client ID — identifies your app
- Client Secret — used to exchange the authorization code for tokens
Step 2: Redirect to authorize
Send the user to the authorization URL:| Parameter | Description |
|---|---|
response_type | Always code |
redirect_uri | Your registered callback URL |
client_id | Your app’s Client ID |
scope | Space-separated list of OAuth scopes |
Step 3: Exchange the code for tokens
After the user authorizes, they’re redirected to yourredirect_uri with a code parameter. Exchange it:
Step 4: Refresh the token
Access tokens expire after 24 hours. Use the refresh token to get a new one:Token scopes
Scopes control what your app can access. Request only the scopes you need.| Scope | Access |
|---|---|
contacts.readonly | Read contacts |
contacts.write | Create, update, delete contacts |
conversations.readonly | Read conversations and messages |
conversations.write | Send messages |
calendars.readonly | Read calendars and appointments |
calendars.write | Create and manage appointments |
opportunities.readonly | Read pipeline data |
opportunities.write | Manage opportunities |
Security best practices
Store tokens securely
Store tokens securely
Never store access tokens or refresh tokens in client-side code, version control, or logs. Use environment variables or a secrets manager.
Use minimal scopes
Use minimal scopes
Request only the permissions your app actually needs. This limits exposure if a token is compromised.
Handle token expiration gracefully
Handle token expiration gracefully
Build automatic refresh logic into your integration. If a refresh fails, prompt the user to re-authorize.
Validate webhook signatures
Validate webhook signatures
When receiving webhooks, always verify the signature to ensure the payload came from HoopAI.
.png?fit=max&auto=format&n=EQK5eX9kTD8NzWwA&q=85&s=878008bf159fcc4964d0c0d508b6e400)