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 theuserIdcollection variable.token.id— the driver’s session token. Save this as theaccessTokencollection 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 rawAuthorizationheader 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 readrunnerfor this app.
Failure: HTTP 200 with { "status": <code>, "message": "<reason>" } in the body. See Auth & Login for sessions, logout and errors.
Request body
Section titled “Request body”{ "username": "5551234567", "password": "123456"}Examples
Section titled “Examples”curl --request POST 'https://api.firstdelivery.com/api/login?pin=1&countryCode=1' \ --header 'Content-Type: application/json' \ --data '{ "username": "5551234567", "password": "123456"}'const response = await fetch("https://api.firstdelivery.com/api/login?pin=1&countryCode=1", { "method": "POST", "headers": { "Content-Type": "application/json" }, "body": "{\n \"username\": \"5551234567\",\n \"password\": \"123456\"\n}"})const data = await response.json()import requests
response = requests.request( "POST", "https://api.firstdelivery.com/api/login?pin=1&countryCode=1", headers={ 'Content-Type': 'application/json'}, data="{\n \"username\": \"5551234567\",\n \"password\": \"123456\"\n}",)response.raise_for_status()Saved responses
Section titled “Saved responses”{ "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 }}
