Skip to content

Login (phone + PIN)

POST {{baseUrl}}/login?pin=1&countryCode={{countryCode}}

Exchanges a phone number + PIN for an access token. Public endpoint, no auth required. Source: store.ts login().

Response fields:

  • user — the driver’s row: id, first_name/last_name, phone, username, role, operator_id, active_territory_id, transportation, tier, active.
  • user.id — save this as the userId collection variable.
  • token.id — the driver’s session token. Save this as the accessToken collection variable. It is a UUID today; f1rst_s1_<...> session tokens are rolling out, so treat it as an opaque string. The app sends it as the raw Authorization header value; Bearer <token> works too.
  • token.ttl — informational only. Legacy UUID tokens don’t expire; f1rst_s1_ driver sessions expire after 90 days without use.
  • token.user_role — should read runner for this app.

Failure: HTTP 200 with { "status": <code>, "message": "<reason>" } in the body. See Auth & Login for sessions, logout and errors.

{
"username": "5551234567",
"password": "123456"
}
Terminal window
curl --request POST 'https://api.firstdelivery.com/api/login?pin=1&countryCode=1' \
--header 'Content-Type: application/json' \
--data '{
"username": "5551234567",
"password": "123456"
}'
{
"user": {
"id": "8e17d5db-da6e-453c-966f-bfc72c125094",
"first_name": "Jane",
"last_name": "Doe",
"phone": "5551234567",
"username": "5551234567",
"role": "runner",
"operator_id": 42,
"active_territory_id": "b2b1c1a0-1111-4a2b-9c3d-4e5f6a7b8c9d",
"transportation": "Car",
"tier": 1,
"active": true
},
"token": {
"id": "f45114d0-0331-11ef-8407-67c0cf7a3a57",
"created_at": "2026-06-22T14:00:00.000Z",
"ttl": 1209600,
"user_id": "8e17d5db-da6e-453c-966f-bfc72c125094",
"user_role": "runner",
"operator_id": 42
}
}