API Key Authentication
The PeopleContext API uses API keys to authenticate requests. Include your API key in theAuthorization header as a Bearer token.
Making Authenticated Requests
Include your API key in theAuthorization header:
Environment Variables
Store your API key in environment variables to keep it secure:Error Responses
401 Unauthorized
Missing API key:403 Forbidden
Organization is inactive:429 Too Many Requests
Rate limit exceeded (1000 requests per minute):Rate Limits
Quota Tracking
All authenticated API responses include headers to help you monitor your monthly quota usage:| Header | Description |
|---|---|
X-Quota-Used | Number of requests used in the current billing period |
X-Quota-Limit | Total requests allowed in your plan |
X-Quota-Remaining | Number of requests remaining |
Example Response Headers
Best Practices
Security
Security
- Never hardcode API keys in your source code
- Use environment variables or secret management systems
- Rotate keys regularly
- Use different keys for development and production
Performance
Performance
- Implement exponential backoff for rate limit errors
- Cache responses when possible
- Monitor the rate limit headers
Error Handling
Error Handling
- Always check response status codes
- Implement retry logic for transient errors (500, 503)
- Handle rate limits gracefully