Sign in (c3)
WhatsApp sign-in, session tokens and logout for the ChingChing.Club API.
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
| Name | In | Type | Description |
|---|---|---|---|
e164 required | body | string | The phone number with a plus and the country code, for example +27831234567. |
purpose required | body | string | login, 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
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
{
"sent": true,
"expiresAt": "2026-12-03T02:15:15Z",
"reused": false
}
| Status | Meaning |
|---|---|
400 | The number or the purpose is not valid. Codes invalid_phone and invalid_body. |
403 | This number's country is not accepted. Code country_blocked. |
429 | Too many requests. Wait for the Retry-After seconds. Code rate_limited. |
503 | The 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
| Name | In | Type | Description |
|---|---|---|---|
e164 required | body | string | The same number the code was sent to. |
purpose required | body | string | The same purpose the code was requested with. |
code required | body | string | The 4 digit code. |
Request
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
{
"token": "<token>",
"tokenType": "session",
"expiresAt": "2027-01-01T14:15:15Z",
"memberId": "u12345abcde"
}
| Status | Meaning |
|---|---|
400 | The body is not valid. Code invalid_body. |
401 | The code is wrong, expired or already used. Codes invalid_code, expired_code and used_code. |
403 | This number cannot do that. Code forbidden. |
429 | Too 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
curl -X POST "https://c3.thought.bz/v1/auth/logout" \
-H "Authorization: Bearer <token>" \
-H "Idempotency-Key: <16 to 128 characters>"
Response
{ "ok": true }
| Status | Meaning |
|---|---|
400 | Logout does not take a body. Code invalid_body. |
401 | No 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
curl "https://c3.thought.bz/v1/auth/session" \
-H "Authorization: Bearer <token>"
Response
{
"memberId": "u12345abcde",
"roles": ["member-female"],
"scopes": ["member"],
"expiresAt": "2027-01-01T14:15:15Z"
}
| Status | Meaning |
|---|---|
401 | No valid token. Codes unauthorised and expired_token. |
429 | Too many reads. Code rate_limited. |
Each use of a session pushes its expiry out.
Updated 2026-12-02