Skip to main content
POST /auth/login accepts two login modes in a single endpoint, selected by the provider field. For the local provider you supply an email and password directly. For OAuth providers such as Coinbase, you supply the code and state values your application received from the OAuth callback — these are exchanged for a session token server-side. In both cases, a successful response includes a token that you pass as Authorization: Bearer <token> on all subsequent authenticated requests.

POST /auth/login

Authenticates a user and returns a session token.

Request body

The shape of the credentials object depends on the provider you select.
string
required
Must be "local".
object
required

Response — 200 OK

string
required
Your session token. Pass this as Authorization: Bearer <token> on all protected requests.
object
required
string
required
The provider used to authenticate, e.g. "local" or "coinbase".
string
required
ISO 8601 timestamp indicating when the session token expires. Refresh before this time using POST /auth/refresh.

Errors

Response
Store the token securely. All protected endpoints — including GET /auth/me, POST /auth/refresh, and every Sources API call — require it in the Authorization header.