---
title: "Remove phone line"
method: DELETE
path: "/restapi/v2/accounts/{accountId}/devices/{deviceId}"
tags: ["Devices"]
---

# Remove phone line

`DELETE /restapi/v2/accounts/{accountId}/devices/{deviceId}`

Disassociates a phone line (DL & Device) from an extension:

 - if the value of `keepAssetsInInventory` is `true`,
the given device is moved to unassigned devices and the number is moved to the number inventory;
 - if the value of `keepAssetsInInventory` is `false`, the given device and number is removed from the account;
 - if the parameter `keepAssetsInInventory` is not set (empty body), default value `true` is set.

## Path parameters

- `accountId` string, required
- `deviceId` string, required

## Request body

- RemoveLineRequest
  - `keepAssetsInInventory` boolean, required — The flag that controls what to do with the number and device: - if the value of `keepAssetsInInventory` is `true`, the given device is moved to unassigned devices and the number is moved to the number inventory; - if the value of `keepAssetsInInventory` is `false`, the given device and number is removed from the account; - if the parameter `keepAssetsInInventory` is not set (empty body) or the value of the parameter is empty, default value `true` is set.

## Response `200`

Successful response (when `keepAssetsInInventory` is `true`)

- RemoveLineResponse
  - `id` string, required — Internal identifier of a source device
  - `type` 'HardPhone' | 'SoftPhone' | 'OtherPhone' | 'MobileDevice' | 'BLA' | 'Paging' | 'WebPhone' | 'WebRTC' | 'ZoomMobile' | 'ZoomPhone' | 'Room' | 'Unknown', required — Device type
  - `name` string, required — The display name of a source device
  - `serial` string — Serial number of a device (HardPhone)

## Other responses

- `204` — Successful response (when `keepAssetsInInventory` is `false`)
- `400` — General response with **HTTP 400 "Bad request"** status.<br> Reasons: unparsable request, path, query or body parameters are invalid. The error description may contain reference to particular parameter(s) which haven't passed the validation.
- `404` — General response with **HTTP 404 "Not found"** status.<br> Reasons: the entity with given ID (typically specified in a path parameter), is not found or inaccessible
- `500` — General response with **HTTP 500 "Internal Server Error"** status.<br> Reasons: general server-side error.

---

[API](https://skmtc.net/ringcentral/apis/ringcentral-api.md) · [All operations](https://skmtc.net/ringcentral/apis/ringcentral-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ringcentral/ringcentral-api/revisions/8d602198ec97/schema)
