Skip to main content
All credential management is performed by Yonne admin staff — not by the courier’s system. This page documents the full lifecycle so courier engineering teams understand what to expect and what to ask for.

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:
On first call, the platform creates three credentials and returns them in plaintext exactly once:
The admin must copy these values and hand them to your team immediately. After this single reveal, the api_secret and webhook_secret are stored only as hashes — they cannot be retrieved again. If they are lost, the admin must rotate.
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

This flips 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:
Rotation requires OTP verification. It:
  • Generates a new api_key, api_secret, and webhook_secret immediately.
  • Revokes the old credentials — any tokens issued with the old key stop working.
  • Preserves the existing webhook URL.
What your team needs to do after a rotate:
  1. Receive the new credentials from the Yonne admin.
  2. Update COURIER_API_KEY and COURIER_API_SECRET in your environment variables.
  3. Restart or redeploy your service so the new credentials take effect.
  4. Verify by calling /api/courier/s2s/auth/token — a successful response confirms the new credentials are working.

Revoke (disable) the integration

Sets 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:
Response:
Status summaries: The api_key is returned redacted (first 8 + last 4 characters).

Set a webhook URL

Sets the URL where Yonne will deliver webhook events for this courier. The webhook_secret (generated with credentials) is used to sign payloads — verify it on your end using HMAC.

All admin endpoints