Credential lifecycle at a glance
Step 1 — Generate credentials
The admin triggers an OTP to their verified email, verifies it, then calls generate. This must happen before your system can do anything. Admin endpoint:
After generate: your integration is still disabled (
s2s_enabled = false). The admin must explicitly enable it before your JWTs will be accepted.
Step 2 — Enable the integration
s2s_enabled to true. From this point, your system can authenticate and call S2S endpoints.
OTP requirement for credential actions
Generate and rotate both require the admin to complete an OTP challenge within the last 5 minutes. The flow:Rotate credentials
If credentials are exposed or need to be cycled, the admin rotates them:- Generates a new
api_key,api_secret, andwebhook_secretimmediately. - Revokes the old credentials — any tokens issued with the old key stop working.
- Preserves the existing webhook URL.
- Receive the new credentials from the Yonne admin.
- Update
COURIER_API_KEYandCOURIER_API_SECRETin your environment variables. - Restart or redeploy your service so the new credentials take effect.
- Verify by calling
/api/courier/s2s/auth/token— a successful response confirms the new credentials are working.
Revoke (disable) the integration
s2s_enabled = false. Your credentials are preserved — no new generate is needed to re-enable. The admin can restore access by calling toggle with { "enabled": true }.
Your system will receive 403 S2S_DISABLED on all endpoint calls while revoked.
Check integration status
The admin can check the current state of the integration at any time:
The
api_key is returned redacted (first 8 + last 4 characters).
Set a webhook URL
webhook_secret (generated with credentials) is used to sign payloads — verify it on your end using HMAC.
