POST
/
auth
/
token
cURL
curl --request POST \
  --url http://localhost:8080/auth/token \
  --header 'Content-Type: application/json' \
  --data '
{
  "id_proof": {
    "number": "<string>"
  },
  "phone_country_code": "+91",
  "phone_number": "<string>"
}
'
{
  "access_token": "<string>",
  "user_id": "012345678901"
}

Body

application/json
id_proof
object
required
phone_country_code
string
required
Example:

"+91"

phone_number
string
required

Response

Token issued

access_token
string
required
user_id
string
required

A validated 12-digit numeric user identifier.

Every external entry point validates:

  • JSON Deserialize runs [UserId::parse] (outer whitespace trimmed, length and digit-only enforced) via #[serde(try_from = "String")].
  • DB FromSql runs [UserId::parse] on every row read.

Display / Deref<Target = str> / AsRef<str> / Into<String> are derived via derive_more — the inner String is pass-through for every read-only borrow, display, and move-out.

Example:

"012345678901"