<!-- dev-portal
method: POST
title: Search Driver Associations
path: /v3/driver-associations/search
-->

### POST /v3/driver-associations/search

Retrieve driver associations

#### Request Parameters

| Name | Type    | Required | Description                                                        |
|------|---------|----------|--------------------------------------------------------------------|
| page | integer | No       | The index of the page to return. This starts at and defaults to 1. |
| size | integer | No       | The number of results to return per page. This defaults to 50.     |

#### Request Body

| Name         | Type          | Required | Description                                                                                                                         |
|--------------|---------------|----------|-------------------------------------------------------------------------------------------------------------------------------------|
| active       | boolean       | No       | If true will return only active driver associations.  If null, defaults false.                                                      |
| driverFilter | Array[UUID]   | No       | Drivers to retrieve associations for.  If null, will default to filter for driver making the request.                               |
| relations    | Array[string] | No       | Comma seperated list of relations to include in response.  ex: Driver, Vehicle.  If null, default behavior is to show no relations. |

#### Response

| Name    | Type                                                                     | Description                                                                                    |
|---------|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| content | Array[[DriverAssociationResponse](../../Schemas#driverassociationresponse)] | A list of Driver Association responses. See DriverAssociationResponse schema for more details. |
| page    | [OffsetPage](../../Schemas#offsetPage)                                      | Object detailing the page information for the current request.                                 |


##### Response Codes

| Name | Description                                                                                                               |
|------|---------------------------------------------------------------------------------------------------------------------------|
| 200  | Ok.                                                                                                                       |

#### Example

```bash
curl -X POST \
  -H "Authorization: Bearer ${AUTH_TOKEN}" \
  -H "Content-Type: application/json" \
  "https://${HOST}/vehicle-status-api/v3/driver-associations/search" \
  -d '{
    "active": true,
    "relations": ["Driver", "Vehicle"], 
    "driverFilter": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }'
```
Response:
```json
{
  "content":[
    {
        "id": "65570DED-76CD-4DA5-B321-05078479BC0C",
        "driverId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "vin": "1FMTF1RM2NMA94068",
        "startedAt": "2024-09-03T13:12:33.000Z",
        "endedAt": "2024-09-03T14:12:33.000Z",
        "relations": {
          "driver": {
            "firstName": "Sally",
            "lastName": "Smith",
            "countryCode": "US",
            "email": "sally.smith@email.com",
            "timezone": "UTC"
          },
          "vehicle": {
            "id": "106B2FB1-6E53-4C1A-E2EE-1CC17F26028B",
            "vin": "1FMTF1RM2NMA94068",
            "name": "MyCarName1234",
            "make": "Ford",
            "model": "F-150",
            "year": "2024"
          }
        }
    }
  ]
  "page": {
    "number": 1,
    "size": 50,
    "totalElements": 1,
    "totalPages": 1
  }
}

```
