Credential Protection
- Store credentials securely using environment variables or a secrets manager
- Rotate credentials periodically according to your security policies
- Use separate credentials for each environment (sandbox vs production)
Token Management
- Store tokens securely (never in localStorage for sensitive applications)
- Implement proper expiration handling
- Never pass tokens as URL parameters
- Cache tokens on your server to minimize token requests
Token Refresh Strategy
Request Security
- Always use HTTPS for all API calls
- Validate and sanitize all input data
- Implement appropriate error handling
- Verify webhook signatures on incoming webhooks, if you receive any (see below)
Webhooks are carrier-only
Webhook subscriptions exist on the Carrier & MGA API only:GET /v2/upstream/webhooks and POST /v2/upstream/webhooks/{webhookId}/test. If you hold a carrier or MGA credential, recompute the X-Turris-Signature HMAC and compare it before you trust a payload, and reject any delivery that fails. Webhooks has the signature scheme and a worked receiver.
There is no /v2/downstream/webhooks and there is no agency equivalent, so an agency credential cannot create a subscription and will never receive a delivery. Do not build an HMAC receiver against one. Agencies poll instead: Actions Required, plus Entity License Summary and Producer License Summary.
Access Control
- Limit access to API credentials to only those who need it
- Implement the principle of least privilege
- Monitor and audit API usage
- Revoke credentials immediately when team members leave
Data Protection
- Minimize the amount of sensitive data transmitted
- Implement proper data retention policies
- Handle sensitive data according to regulatory requirements
- Use secure channels for sharing API credentials within your team
Network Security
For additional security, consider:- IP allowlisting for your API servers
- Rate limiting on your end to prevent accidental overuse
- Logging all API requests for audit purposes
Checklist
Store credentials in environment variables or secrets manager
Never expose secrets in frontend code
Use HTTPS for all API calls
Implement token refresh before expiration
Verify webhook signatures (carriers and MGAs; agencies poll instead)
Log and monitor API usage
Rotate credentials periodically