ThoughtAPI

Docs c3

Sign in (c3)

WhatsApp sign-in, session tokens and logout for the ChingChing.Club API.

Base URL
https://c3.thought.bz/
Version
v1
Auth
Bearer session token in the Authorization header, except where an endpoint says None
Status
Beta

This page is part of the c3 (ChingChing.Club) API reference.

Sign in uses a WhatsApp code. The same two calls also prove a number for sensitive steps such as adding a phone, by changing purpose.

POST /v1/auth/otp#

Send a 4 digit code to a phone number on WhatsApp.

Auth None

NameInTypeDescription
e164 requiredbodystringThe phone number with a plus and the country code, for example +27831234567.
purpose requiredbodystringlogin, add_phone, bank_change or withdraw_confirm. Use login to sign in and add_phone to prove a new number. The other two are for steps that are not open yet.

Request

bash
curl -X POST "https://c3.thought.bz/v1/auth/otp" \
  -H "Idempotency-Key: <16 to 128 characters>" \
  -H "Content-Type: application/json" \
  -d '{"e164": "+27831234567", "purpose": "login"}'

Response

json
{
  "sent": true,
  "expiresAt": "2026-12-03T02:15:15Z",
  "reused": false
}
StatusMeaning
400The number or the purpose is not valid. Codes invalid_phone and invalid_body.
403This number's country is not accepted. Code country_blocked.
429Too many requests. Wait for the Retry-After seconds. Code rate_limited.
503The code could not be sent. Try again shortly.

If a code was sent a moment ago, the same code is kept and reused is true. The Idempotency-Key header is optional on this call. Needs no token.

POST /v1/auth/otp/verify#

Exchange the WhatsApp code for a token.

Auth None

NameInTypeDescription
e164 requiredbodystringThe same number the code was sent to.
purpose requiredbodystringThe same purpose the code was requested with.
code requiredbodystringThe 4 digit code.

Request

bash
curl -X POST "https://c3.thought.bz/v1/auth/otp/verify" \
  -H "Idempotency-Key: <16 to 128 characters>" \
  -H "Content-Type: application/json" \
  -d '{"e164": "+27831234567", "purpose": "login", "code": "1234"}'

Response

json
{
  "token": "<token>",
  "tokenType": "session",
  "expiresAt": "2027-01-01T14:15:15Z",
  "memberId": "u12345abcde"
}
StatusMeaning
400The body is not valid. Code invalid_body.
401The code is wrong, expired or already used. Codes invalid_code, expired_code and used_code.
403This number cannot do that. Code forbidden.
429Too many wrong codes. The number is locked until the time in the message. Code too_many_attempts.

tokenType is session for an existing member, pending_registration for a new number (no memberId yet), and otpToken for a sensitive step. Send the device name in the x-c3-device header if you want it to show in the session list.

POST /v1/auth/logout#

End the current session.

Auth Member session token

Request

bash
curl -X POST "https://c3.thought.bz/v1/auth/logout" \
  -H "Authorization: Bearer <token>" \
  -H "Idempotency-Key: <16 to 128 characters>"

Response

json
{ "ok": true }
StatusMeaning
400Logout does not take a body. Code invalid_body.
401No valid token. Code unauthorised.

Send no body, or an empty JSON object.

GET /v1/auth/session#

Read what the current token is and when it expires.

Auth Member session token

Request

bash
curl "https://c3.thought.bz/v1/auth/session" \
  -H "Authorization: Bearer <token>"

Response

json
{
  "memberId": "u12345abcde",
  "roles": ["member-female"],
  "scopes": ["member"],
  "expiresAt": "2027-01-01T14:15:15Z"
}
StatusMeaning
401No valid token. Codes unauthorised and expired_token.
429Too many reads. Code rate_limited.

Each use of a session pushes its expiry out.

Updated 2026-12-02