---
title: "Create device"
method: POST
path: "/{sub_domain}/api/devices"
tags: ["Devices"]
---

# Create device

`POST /{sub_domain}/api/devices`

## Request

- Base URL: `https://api.commpeak.com/pbx`
- URL: `https://api.commpeak.com/pbx/{sub_domain}/api/devices`
- Auth: API key in header `Authorization`

Create a new device (extension).

**When to use.** Provision a new extension that can register and place or receive calls.

**Request body.** `extension` (required): an integer between 100 and 9999. `name` (required): a label for the device. A registration password is generated automatically and returned in the response.

**Shape.** `{ "devices": [ <device> ] }` for the created device, including its generated `password`.

## Path parameters

- `sub_domain` string, required: PBX Name (subdomain)

## Request body

- CreateDeviceInput
  - `extension` string, required: Device extension. Must be an integer between 100 and 9999.
  - `name` string, required: Device name / description.

## Response `201`

Successful Response

- DevicesResponse
  - `devices` DeviceItem[], required
    - `id` integer, nullable: Device ID.
    - `name` string, nullable: Device name / description.
    - `extension` integer, nullable: Device extension.
    - `password` string, nullable: Registration password.
    - `created_at` string, nullable: Creation timestamp.
    - `updated_at` string, nullable: Last update timestamp.
    - `login_user_id` integer, nullable: ID of the user last logged in to the device.
    - `last_login` string, nullable: Last login timestamp, or null.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/commpeak/apis/commpeak-pbx-api.md) - [All operations](https://skmtc.dev/commpeak/apis/commpeak-pbx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/commpeak/apis/commpeak-pbx-api/revisions/0b1e8c7fd3f6?raw)
