Authentication Methods
AllCare supports two authentication methods:API Keys
Simple authentication for server-to-server integrations
OAuth 2.0
Standard OAuth flow for user-delegated access
API Key Authentication
Obtaining an API Key
1
Request Access
Contact your account manager to enable API access for your organization
2
Generate Key
Log in to AllCare Dashboard:
- Navigate to Settings > API Access
- Click “Generate New API Key”
- Provide a descriptive name
- Set permissions and scopes
- Copy the key immediately (shown only once)
3
Store Securely
Store the API key in a secure location:
- Environment variables
- Secrets management service (AWS Secrets Manager, Azure Key Vault, etc.)
- Never commit to source control
Using API Keys
Include the API key in theAuthorization header of each request:
API Key Scopes
API keys can be configured with specific permissions:| Scope | Description | Access Level |
|---|---|---|
read:doctors | Read provider data | Read-only |
write:doctors | Create/update providers | Read-write |
read:patients | Read patient data | Read-only |
write:patients | Create/update patients | Read-write |
read:facilities | Read facility data | Read-only |
write:facilities | Manage facilities | Read-write |
admin | Full access | All operations |
OAuth 2.0 Authentication
For applications that access AllCare on behalf of users:OAuth Flow
1
Register Application
Register your application in the AllCare Developer Portal:
- Application name
- Redirect URI(s)
- Requested scopes
- Client ID
- Client Secret
2
Authorization Request
Redirect user to authorization endpoint:
3
User Authorizes
User logs in and approves access to requested scopes
4
Receive Authorization Code
User is redirected back to your application:
5
Exchange for Access Token
Exchange authorization code for access token:Response:
6
Use Access Token
Include token in API requests:
Refreshing Tokens
Access tokens expire after 1 hour. Use refresh token to obtain new access token:Security Best Practices
Key Management
Rotating Keys
To rotate an API key:- Generate new key in dashboard
- Update application with new key
- Test thoroughly
- Revoke old key
- Monitor for any issues
Keep both keys active during transition period to avoid downtime.
Revoking Keys
Revoke keys immediately if:- Key is compromised or exposed
- Employee with key access leaves organization
- Integration is deprecated
- Suspicious activity detected
Testing Authentication
Verify API Key
Test your API key:Error Responses
401 Unauthorized
Missing or invalid credentials:403 Forbidden
Insufficient permissions:429 Rate Limit Exceeded
Too many requests:Support
Need help with authentication?Developer Support
Email: [email protected]Include:
- Client ID (never send client secret!)
- Error messages
- Request/response examples (remove credentials)