# Get Onboarded Carriers

**Authentication**

* Include your **`Access-Token`** in the header of your requests.
* Include your **`x-api-key`** The API key provided by GenLogs. This header must be included in the request.

#### Permissions <a href="#permissions" id="permissions"></a>

The `external-api-get-onboarded-carrier-contact` permission is required to access this endpoint.

#### **Endpoint** <a href="#endpoint" id="endpoint"></a>

* **URL:** `https://api.genlogs.io/onboarded-carrier/contacts`
* **Method:** GET

#### **Headers** <a href="#headers" id="headers"></a>

* **Access-Token**: (string, required): Access token obtained from the "Create Access Token" endpoint.
* **x-api-key** (string, required): The API key provided by GenLogs.

#### **Request Body:** <a href="#request-body" id="request-body"></a>

* **usdot\_number** (string, optional): Carrier USDOT number or numbers comma separated. Must be a non-empty value.
* **page** (string, optional): Expected page to be listed.
* **page\_size** (string, optional): Amount of items per page

#### Request Example: <a href="#request-example" id="request-example"></a>

```sh
curl --location 'https://api.genlogs.io/onboarded-carrier/contacts?page=4&page_size=2' \
--header 'access-token: <your-access-token>' \
--header 'x-api-key: <your-x-api-key>'
```

#### **Response:** <a href="#response" id="response"></a>

* **200 OK:** A JSON object containing the information of carrier contacts.
* **400 Bad Request:** If the provided parameters are malformed or invalid.
* **401 Unauthorized:** If the authentication credentials (Access-Token) is missing or incorrect.
* **403 Forbidden**: If the permission has not been added to your user.
* **500 Internal Server Error:** If there is an issue on the server that prevents processing the request.

#### **Response Body:** <a href="#response-body" id="response-body"></a>

200 OK – Contacts listed Successfully

```json
{
  "contacts": [
    {
      "contact_id": "00-11-22-33-44",
      "dot_number": "123456",
      "customer_id": 3,
      "contact_name": "John",
      "contact_email": "john@email.com",
      "contact_phone": "(555) 555-5555",
      "contact_source": "GENLOGS"
    },
    {
      "contact_id": "11-22-33-44-55",
      "dot_number": "765432",
      "customer_id": 3,
      "contact_name": "Mike",
      "contact_email": "mike@email.com",
      "contact_phone": "(555) 555-5566",
      "contact_source": "GENLOGS"
    }
  ],
  "pagination": {
    "page_size": 2,
    "current_page": 4,
    "total_pages": 10
  }
}
```

400 Bad RequestReturned when:

* `usdot_number` is invalid, empty or equal to zero
* `page` value is out of bounds or not a valid integer
* `page_size` value is out of bounds or not a valid integer

```json
{
    "detail": "usdot_number cannot be empty"
}
```

```json
{
    "detail": "page 2 is out of range. Maximum page is 1"
}
```

403 Forbidden

```json
{
  "detail": "User not allowed to access this endpoint"
}
```

## Retrieve onboarded carrier contacts

> Returns a paginated list of onboarded carrier contacts for the authenticated customer. Only contacts belonging to the customer identified in the JWT are returned. Requires the external-api-get-onboarded-carrier-contact permission.<br>

```json
{"openapi":"3.0.3","info":{"title":"Onboarded Carrier Contacts API","version":"1.0.0"},"servers":[{"url":"https://api.genlogs.io"}],"security":[{"Access-Token":[],"X-Api-Key":[]}],"components":{"securitySchemes":{"Access-Token":{"type":"apiKey","in":"header","name":"Access-Token","description":"JWT provided directly in the Access-Token header.\n"}}},"paths":{"/onboarded-carrier/contacts":{"get":{"summary":"Retrieve onboarded carrier contacts","description":"Returns a paginated list of onboarded carrier contacts for the authenticated customer. Only contacts belonging to the customer identified in the JWT are returned. Requires the external-api-get-onboarded-carrier-contact permission.\n","tags":["Onboarded Carriers"],"parameters":[{"name":"page","in":"query","required":false,"description":"Page number of results to return.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"page_size","in":"query","required":false,"description":"Number of results per page (max 200).","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"usdot_number","in":"query","required":false,"description":"USDOT number(s) to filter by. Supports a single value or a comma-separated list.\n","schema":{"type":"string"}}],"responses":{"200":{"description":"Onboarded carrier contacts retrieved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","description":"List of onboarded carrier contacts.","items":{"type":"object","properties":{"contact_id":{"type":"string","format":"uuid","description":"Unique identifier of the onboarded carrier contact."},"dot_number":{"type":"string","description":"USDOT number associated with the carrier."},"customer_id":{"type":"integer","description":"Identifier of the customer that owns the contact."},"contact_name":{"type":"string","description":"Full name of the contact."},"contact_email":{"type":"string","description":"Email address of the contact."},"contact_phone":{"type":"string","description":"Phone number of the contact."},"contact_source":{"type":"string","description":"Source of the onboarded contact record."}}}},"pagination":{"type":"object","description":"Pagination metadata.","properties":{"page_size":{"type":"integer","description":"Number of results per page."},"current_page":{"type":"integer","description":"Current page number."},"total_pages":{"type":"integer","description":"Total number of available pages."}}}}}}}},"400":{"description":"Bad Request – Invalid query parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}},"401":{"description":"Unauthorized – Invalid or missing authentication headers.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"object","properties":{"message":{"type":"string"},"subcode":{"type":"string"}}}}}}}},"403":{"description":"Forbidden – User does not have required permission.","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}},"500":{"description":"Internal Server Error.","content":{"application/json":{"schema":{"type":"string"}}}}}}}}}
```
