Auth

Start SIWE authentication: returns a single-use challenge

POST/v1/auth/challenge

Request body

  • address string (required)
  • chain_id integer

Responses

200SIWE challenge (10-minute, single-use nonce)

  • message string (required)
  • nonce string (required)
  • domain string (required)
  • uri string (required)
  • version "1" (required)
  • chain_id integer (required)
  • issued_at object (required)
  • expiration_time object (required)

400Invalid request

Example

curl -X POST https://api.cofferline.com/v1/auth/challenge \
  -H "content-type: application/json" \
  -d '{"address":"…"}'

Complete SIWE authentication: exchanges a signed challenge for a session

POST/v1/auth/verify

Exchanges a signed SIWE challenge for a bearer session, creating the account row on first sign-in.

On the dev environment only, sending x-cofferline-test-account: 1 marks a NEWLY created account as an automated-test fixture (#227): it is left out of the operator's tenant counts and is the only kind of row the housekeeping sweep deletes. It never changes an account that already exists, and it is ignored entirely in production.

Request body

  • message string (required)
  • signature string (required)

Responses

200Bearer session token (returned once)

  • token string (required)
  • address string (required)
  • expires_at object (required)

401Expired/used nonce or invalid signature

Example

curl -X POST https://api.cofferline.com/v1/auth/verify \
  -H "content-type: application/json" \
  -d '{"message":"…","signature":"…"}'

Identify the authenticated account

GET/v1/me

Responses

200The wallet address and credential kind

  • address string (required)
  • auth_kind "session" | "api_key" | "cf_access" | "payment" (required)

401Missing or invalid credential

Example

curl -X GET https://api.cofferline.com/v1/me \
  -H "authorization: Bearer $TOKEN"