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).
Request body
Section titled “Request body”{ "min_hours": 10, "max_hours": 40, "expected_hours": 20, "days_available": "[1,2,3,4,5]", "shifts_available": "[\"morning\",\"evening\"]"}Examples
Section titled “Examples”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\"]"}'const response = await fetch("https://api.firstdelivery.com/api/runners/REPLACE_WITH_USER_ID/availability", { "method": "PUT", "headers": { "Content-Type": "application/json" }, "body": "{\n \"min_hours\": 10,\n \"max_hours\": 40,\n \"expected_hours\": 20,\n \"days_available\": \"[1,2,3,4,5]\",\n \"shifts_available\": \"[\\\"morning\\\",\\\"evening\\\"]\"\n}"})const data = await response.json()import requests
response = requests.request( "PUT", "https://api.firstdelivery.com/api/runners/REPLACE_WITH_USER_ID/availability", headers={ 'Content-Type': 'application/json'}, data="{\n \"min_hours\": 10,\n \"max_hours\": 40,\n \"expected_hours\": 20,\n \"days_available\": \"[1,2,3,4,5]\",\n \"shifts_available\": \"[\\\"morning\\\",\\\"evening\\\"]\"\n}",)response.raise_for_status()Saved responses
Section titled “Saved responses”{ "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"]}
