Create Runner
POST {{BASE_HABITAT_URL}}/api/v3/runners
Required scope: runners:write
Creates a runner in a given territory. The id field in a successful response should be saved on your end - this needs to be sent as the runner_id field when assigning orders.
| Field | Data Type | Required | Valid Inputs | Description | Default |
|---|---|---|---|---|---|
| name | string | Yes | Any string | Runner name | |
| string | Yes | Valid email address | Runner email | ||
| phone | string | Yes | Valid phone number | Runner phone number | |
| address | string | Yes | Any string | Runner address | |
| territory_id | UUID | Yes | Valid UUID | Runner territory id (see GET /territories) | |
| transport_type | string | No | ‘car’, ‘bike’ | Transportation type used for scheduling | ‘car’ |
| profile_pic | string (optional) | No | Valid URI | Runner profile picture |
Request body
Section titled “Request body”{ "address": "2000 Market Street, Philadelphia PA, 19125", "email": "{{$randomEmail}}", "name": "{{$randomFullName}}", "phone": "{{$randomPhoneNumber}}", "transport_type": "car", "territory_id": "db93f018-36e2-416b-8196-5d3a36033440"}Examples
Section titled “Examples”curl --request POST '${BASE_HABITAT_URL}/api/v3/runners' \ --data '{ "address": "2000 Market Street, Philadelphia PA, 19125", "email": "{{$randomEmail}}", "name": "{{$randomFullName}}", "phone": "{{$randomPhoneNumber}}", "transport_type": "car", "territory_id": "db93f018-36e2-416b-8196-5d3a36033440"}'const response = await fetch("${BASE_HABITAT_URL}/api/v3/runners", { "method": "POST", "headers": {}, "body": "{\n \"address\": \"2000 Market Street, Philadelphia PA, 19125\",\n \"email\": \"{{$randomEmail}}\",\n \"name\": \"{{$randomFullName}}\",\n \"phone\": \"{{$randomPhoneNumber}}\",\n \"transport_type\": \"car\",\n \"territory_id\": \"db93f018-36e2-416b-8196-5d3a36033440\"\n}"})const data = await response.json()import requests
response = requests.request( "POST", "${BASE_HABITAT_URL}/api/v3/runners", headers={}, data="{\n \"address\": \"2000 Market Street, Philadelphia PA, 19125\",\n \"email\": \"{{$randomEmail}}\",\n \"name\": \"{{$randomFullName}}\",\n \"phone\": \"{{$randomPhoneNumber}}\",\n \"transport_type\": \"car\",\n \"territory_id\": \"db93f018-36e2-416b-8196-5d3a36033440\"\n}",)response.raise_for_status()Saved responses
Section titled “Saved responses”{ "type": "success", "user": { "id": "fe19da88-5ab9-4693-9786-ede9d8294126", "name": "Mike Smith", "email": "test-runnera@firstdelivery.com", "phone": "+15551234561", "address": "2000 Market Street, 2000 Market St, Philadelphia, PA 19103, USA", "profile_pic": null, "transport_type": "car", "archived": false, "territory_id": "db93f018-36e2-416b-8196-5d3a36033440" }}
