# Device Types API

The Device Types API returns the list of device series and models that Chartboost recognizes, for example
"iPhone 5". Use it to look up device types for device targeting.
See [Targeting](/en/monetization/publishing/monetization-settings/#targeting).

## Before you get started

Complete the [API Access & Authentication](/en/monetization/reference/api-access-authentication/#api-access-url-endpoint)
process. You will not be able to get device types programmatically until this step is completed.

## Endpoints

<div class="alert alert-info" role="alert">
  <b>Note:</b> This endpoint replaces the legacy version 3 endpoint <code>GET /v3/device_types</code>, which will be
  retired on <b>August 13, 2027</b>. See <a href="#migrating-from-version-3">Migrating from version 3</a>.
</div>

| Version 5 Endpoint | Description |
| ------------------ | ----------- |
| [`GET /v5/device-types`](#get-the-list-of-device-types) | Get all device series and models. |

***

### Get the list of device types

| Version 5 |
| --------- |
| `GET /v5/device-types` |

Returns every device series and model in one response, sorted by `id`. The endpoint takes no parameters and does not
support filtering or pagination.

#### Required Headers

```text
Authorization: Bearer {access-token}
```

#### Request Example

```text
GET /v5/device-types HTTP/1.1
Host: api.chartboost.com
Authorization: Bearer czZCaGRSa3F0MzpnWDFmQmF0M2J
```

#### Response Example

```javascript
{
  "records": [
    {
      "id": "532b283c673c926230d05192",
      "name": "iPhone 5",
      "codes": ["iPhone5,1", "iPhone5,2"],
      "platforms": ["ios"],
      "type": "model",
      "series_id": "52f5227bfd7d37d4a37d9d14"
    },
    ...
  ]
}
```

| Field | Type | Description |
| ----- | ---- | ----------- |
| `id` | string | ID of the device type. |
| `name` | string | Display name, for example `iPhone 5`. |
| `codes` | array of strings | Hardware codes that identify this device type, for example `iPhone5,1`. |
| `platforms` | array of strings | Platforms the device type runs on: `ios`, `android` or `amazon`. |
| `type` | string | `series` for a device family, or `model` for a single model. |
| `series_id` | string or null | For a model, the `id` of the series it belongs to. `null` when not set. |

#### Responses

- 200 - OK. Successful response.
- 401 - Unauthorized. The access token is missing or invalid. The response has no body.

## Migrating from version 3

The legacy version 3 endpoint will be retired on **August 13, 2027**. After that date it returns HTTP `410 Gone`.

| | Version 3 (retiring) | Version 5 |
| - | -------------------- | --------- |
| **Endpoint** | `GET /v3/device_types` | `GET /v5/device-types` |
| **Host** | `dashapi.chartboost.com` | `api.chartboost.com` |
| **Authentication** | `user_id` + `user_signature` | `Authorization: Bearer {access-token}`. See [API Access & Authentication](/en/monetization/reference/api-access-authentication/). |
| **Response** | List in `response`, plus `code` and `time` | List in `records`. Use the HTTP status instead of `code`. |
| **Platforms** | `1`, `2` or `3` | `ios`, `android` or `amazon` |
| **`series_id`** | Only present when set | Always present, `null` when not set |
| **Other fields** | `id`, `name`, `codes`, `type` | Unchanged |
