> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Move Phone Number

PATCH https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/{phone_assignment_id}
Content-Type: application/json

Move a phone number to a different receptionist in the same workspace, which answers its calls from then on. Returns 409 `phone_number_not_attached` for a number no receptionist answers yet (attach it with `POST /v1/reception/phone-numbers/assignments`).

Reference: https://elevenlabs.io/docs/api-reference/reception/phone-numbers/update

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `phone_assignment_id` (string, required)

### Headers

- `xi-workspace-id` (string, optional, nullable) — The customer workspace a reseller's API key acts on.

### Body (application/json)

This endpoint expects a ReassignPhoneRequest.

- `customer_facing_agent_id` (string, required) — The receptionist that answers calls to the number from now on.

## Response

### 200

Erfolgreiche Antwort

- `_id` (string, required)
- `is_active` (boolean, required)
- `accepts_public_calls` (boolean, required) — Whether inbound calls from the public may reach the receptionist.
- `phone_number` (string, optional, nullable) — Phone number in E.164 format.
- `is_byo` (boolean, optional, default: false) — True when the phone is bring-your-own: registered by the workspace using their own telephony provider (Twilio credentials or SIP trunk). BYO phones are never part of the shared pool, do not count against the plan's phone number limit, and are deleted (rather than returned to the pool) on release.
- `provider` (enum, optional, default: twilio) — Telephony provider for this phone number.
  - Allowed values: `twilio`, `sip_trunk`
- `nanp_area_code` (integer, optional, default: 0) — US/Canada NANP area code (NPA) as an integer.
- `customer_facing_agent_id` (string, optional, nullable) — The receptionist that answers this number. Null when the workspace holds the number but no receptionist answers it yet.
- `deactivated_at_unix` (integer, optional, nullable) — Unix timestamp when this number was deactivated; it is released 14 days later. Null when active.
- `deactivation_reason` (enum, optional, nullable) — Why this number was deactivated. Null when active.
  - Allowed values: `tier_downgrade`, `no_entitlement`, `user`
- `regulatory_status` (enum, optional, nullable) — Null for numbers that need no paperwork. `held` while the workspace's own application is under review, `approved` once it passed and the number is fully usable.
  - Allowed values: `held`, `approved`
- `regulatory_number_type` (enum, optional, nullable) — The regulated number type this number was issued as. Null for numbers that need no paperwork.
  - Allowed values: `local`, `mobile`
- `regulatory_country` (string, optional, nullable) — ISO country the regulated number was issued in. Null for numbers that need no paperwork.
- `created_at_unix` (integer, optional) — Unix timestamp (seconds since epoch)
- `updated_at_unix` (integer, optional) — Unix timestamp (seconds since epoch)

## Errors

### 422 Unprocessable Entity Error

Validierungsfehler

- `detail` (list of ValidationError, optional)

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
{
  "customer_facing_agent_id": "string"
}
```

**Response**

```json
{
  "_id": "string",
  "is_active": true,
  "accepts_public_calls": true,
  "phone_number": "string",
  "is_byo": false,
  "provider": "twilio",
  "nanp_area_code": 0,
  "customer_facing_agent_id": "string",
  "deactivated_at_unix": 1,
  "deactivation_reason": "tier_downgrade",
  "regulatory_status": "held",
  "regulatory_number_type": "local",
  "regulatory_country": "string",
  "created_at_unix": 1,
  "updated_at_unix": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id"

payload = { "customer_facing_agent_id": "string" }
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json'},
  body: '{"customer_facing_agent_id":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id"

	payload := strings.NewReader("{\n  \"customer_facing_agent_id\": \"string\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_facing_agent_id\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_facing_agent_id\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id', [
  'body' => '{
  "customer_facing_agent_id": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_facing_agent_id\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["customer_facing_agent_id": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/reception/phone-numbers/assignments/phone_assignment_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```