Skip to the content

Authentication

Every request carries a secret API key. The key decides the business, the application, the environment and what the request may do.

Sending the key

Put the secret in the Authorization header as a bearer token. Cookies are ignored.

HTTP
Authorization: Bearer evp_test_…

Keep keys on your servers, in environment variables or a secrets manager. Never put one in a website, a mobile app or a code repository. If a key may have leaked, roll or revoke it in the developer portal straight away.

Environments

Environments
SandboxProduction
Key starts withevp_test_evp_live_
CarriersA test carrier onlyThe carriers available to your business
MoneyNoneBookings are paid from your EviPostal wallet
AvailableAlwaysAfter EviPostal turns on production access

Both use the same address, https://api.evipostal.com/v1. Every sandbox answer has the header EviPostal-Environment: sandbox and every sandbox object has test: true.

Scopes

A key only does what its scopes allow; a missing scope is 403 insufficient_scope. New keys get every scope unless you untick some. GET /me needs no scope.

Scopes
ScopeAllowsEndpoints
rates:readGet shipping rates for a packagePOST /rates
shipments:readSee the shipments this application createdGET /shipments, GET /shipments/{id}
shipments:writeBook and cancel shipments (production bookings are paid from your wallet)POST /shipments, POST /shipments/{id}/cancel
labels:readDownload shipping labelsGET /shipments/{id}/label
tracking:readRead tracking status and historyGET /shipments/{id}/tracking
webhooks:readSee webhook endpoints and past eventsGET /webhook-endpoints, GET /events, GET /events/{id}
webhooks:writeAdd and remove webhook endpointsPOST /webhook-endpoints, DELETE /webhook-endpoints/{id}

Rolling and revoking

  • Roll creates a new secret with the same name and scopes. You choose how long the old one keeps working: at once, 1 hour, 24 hours or 7 days.
  • Revoke stops a key immediately and for good.
  • Each application can have up to 10 working keys per environment. Keys are stored only as a fingerprint: EviPostal cannot show a secret again.

When a key is refused

Authentication errors
StatusCodeWhy
401authentication_requiredNo Authorization header.
401invalid_api_keyThe key is not recognised.
401api_key_revokedThe key was revoked, or rolled and its time ran out.
403insufficient_scopeThe key lacks the scope this request needs.
403application_disabledThe application is turned off in the portal.
403production_access_requiredA production key before production access is on.