> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thinnest.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Phone Number

> Update phone number settings (e.g. assign to different agent)

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.thinnest.ai/v2/phone-numbers/{phone_id} \
    -H "Authorization: Bearer $THINNESTAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "agent_id": "ag_new_agent_id"
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.thinnest.ai/v2/phone-numbers/{phone_id}"
  headers = {
      "Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
      "Content-Type": "application/json",
  }

  payload = {
    "agent_id": "ag_new_agent_id"
  }

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

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.thinnest.ai/v2/phone-numbers/{phone_id}", {
    method: "PATCH",
    headers: {
      "Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
    "agent_id": "ag_new_agent_id"
  }),
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

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

  func main() {
      payload := []byte(`{
    "agent_id": "ag_new_agent_id"
  }`)
      req, _ := http.NewRequest("PATCH", "https://api.thinnest.ai/v2/phone-numbers/{phone_id}", bytes.NewBuffer(payload))
      req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
      req.Header.Set("Content-Type", "application/json")

      resp, err := http.DefaultClient.Do(req)
      if err != nil { panic(err) }
      defer resp.Body.Close()
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</RequestExample>

```http theme={null}
PATCH /v2/phone-numbers/{phone_number_id}
```

## Request Body

```json theme={null}
{
  "agent_id": "ag_new_agent_id"
}
```

## Response

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "pn_abc123",
    "number": "+919876543210",
    "provider": "vobiz",
    "status": "active",
    "agent_id": "ag_new_agent_id",
    "monthly_cost_inr": 150.00,
    "created_at": "2026-03-25T10:00:00Z",
    "updated_at": "2026-03-25T12:00:00Z"
  }
  ```
</ResponseExample>
