Authentication
OAuth 2.0 client-credentials grant.
Request an access token with POST /oauth/token, the only supported grant being client credentials.
Then send it on each request:
Authorization: Bearer <token>Authenticate to the token endpoint with HTTP Basic, or with client_id and client_secret in the body. Never use both, and never put them in a URL.
The token endpoint is behind a feature flag that is off by default. While it is off, every request is a 501.
Revoke a token you no longer need with POST /oauth/revoke.
Refused requests
401: the token is missing, expired, revoked or not issued to a client. The response has aWWW-Authenticate: Bearerchallenge.403: the token is valid, but its scope does not allow the operation for that organization.
A token stops working as soon as its client is deactivated, its secret is rotated or it is deleted. For organization operations, it also stops within a minute of the client's creator ceasing to be an owner or admin of the organization.
Scopes
Creating a campaign uses organization:{organizationId}:admin. This scope is proposed and not decided yet.