> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.milenow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.milenow.com/_mcp/server.

# 5. Assign your driver

Use this when your own driver runs the trip. To give the trip to a transporter instead, see [outsource a trip](/ftl-trips/guides/outsource).

#### Pick a driver

List your drivers with the existing [drivers endpoint](/api-reference/drivers/get-app-apiv-1-trackingapi-getalldrivers) and take the `id`. Drivers who belong to a transporter are rejected.

#### Assign the driver

Call [`POST /api/v1/partners/shipment-trips/{tripId}/driver`](/ftl-trips/api-reference/ftl-trips/assign-ftl-trip-driver).

```bash
curl -X POST "https://lastmile.milenow.com/index.php/api/v1/partners/shipment-trips/412/driver" \
  -H "Authorization: Bearer $MILE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "driver_id": 7009107 }'
```

#### Check the result

The response is the full trip. These fields change:

```json
{
  "status": 200,
  "msg": "Driver assigned",
  "msgs": [],
  "data": {
    "id": 412,
    "status": { "id": 4, "name": "Dispatch" },
    "driver": {
      "id": 7009107,
      "name": "Omar Khalid",
      "phone": "+966500000000",
      "vehicle": { "id": 7002187, "name": "Flatbed 1", "plate": "ABC 1234" }
    },
    "stops": [
      { "order_id": 70003943807, "shipment": { "id": 301, "status": { "id": 23, "name": "Local Dispatch" } } }
    ],
    "warnings": []
  }
}
```

* The trip status becomes `4 Dispatch`.
* The FTLs are dispatched to the driver and move to `Local Dispatch`.
* The stops are re-ordered and the ETA plan is recalculated from the driver's shift and vehicle.

You can also assign drivers in the Mile web app.

## Change the driver

Send another `driver_id` to the same endpoint. This works until the trip starts.

> **Warning**
>
> The API cannot remove a driver from a trip. A trip with a driver cannot be outsourced or offered. Decide between your fleet and a transporter before you assign a driver.

## Errors

| Error                                                                                  | Cause                                     | Fix                                                                                                                          |
| -------------------------------------------------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| 409 `Omar Khalid is busy on Shipment Trip #405 from 03 Nov 08:00 to 03 Nov 16:41, ...` | The driver's other trip overlaps this one | Pick another driver, or change the stop times. See [driver availability](/ftl-trips/business-rules#drivers)                  |
| 409 `This trip is outsourced to a partner. ...`                                        | The trip is with a transporter            | The transporter assigns its own driver. Or [take the trip back](/ftl-trips/guides/outsource#take-a-trip-back) in the web app |
| 409 `This trip has already started and can no longer be changed`                       | Status 5 or later                         | None                                                                                                                         |
| 412 `driver_id ... belongs to the transporter ...`                                     | A transporter's driver                    | Outsource the trip to that transporter in the web app                                                                        |
| 412 `driver_id not found`                                                              | Not an active driver in your company      | Check the id                                                                                                                 |

Next: [outsource a trip](/ftl-trips/guides/outsource).