Skip to content

Update availability

PUT {{baseUrl}}/runners/{{userId}}/availability

Saves the driver’s weekly availability preferences. Source: models/runner_availability.ts modify(). Note days_available/shifts_available are sent as JSON-stringified arrays in the body (see RunnerAvailabilityUpdate type) even though the response returns them as real arrays.

Response: 200 with the same shape as “Get availability” (the freshly-saved row).

{
"min_hours": 10,
"max_hours": 40,
"expected_hours": 20,
"days_available": "[1,2,3,4,5]",
"shifts_available": "[\"morning\",\"evening\"]"
}
Terminal window
curl --request PUT 'https://api.firstdelivery.com/api/runners/REPLACE_WITH_USER_ID/availability' \
--header 'Content-Type: application/json' \
--data '{
"min_hours": 10,
"max_hours": 40,
"expected_hours": 20,
"days_available": "[1,2,3,4,5]",
"shifts_available": "[\"morning\",\"evening\"]"
}'
{
"id": "d4e5f6a7-2222-4a2b-9c3d-4e5f6a7b8c9d",
"user_id": "8e17d5db-da6e-453c-966f-bfc72c125094",
"min_hours": 10,
"max_hours": 40,
"expected_hours": 20,
"days_available": [1, 2, 3, 4, 5],
"shifts_available": ["morning", "evening"]
}