Authentication
Authenticate every request with a secret key in the Authorization header, scoped to what it needs.
Applies to
v1 + v2
→
Changed in v2
Code written for v1 needs a small update for this topic. The migration guide shows each change side by side.
API keys
Fernway uses secret API keys. Send the key as a Bearer token in the Authorization header on every request. Requests without a valid key return 401 unauthenticated. Keys are tied to one workspace and one environment, test or live.
Scopes
Each key carries scopes such as messages:write or webhooks:read. Give each service the smallest set of scopes it needs. A request outside a key's scopes returns 403 forbidden with the missing scope in the error body.
Changed in v2
v1 accepted keys as a query parameter. v2 only accepts the Authorization header, so update any client that still appends ?api_key= to URLs.