> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://agentphone.to/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://agentphone.to/docs/_mcp/server.

# Update Sip Trunk

PATCH https://api.agentphone.ai/v1/sip-trunks/{trunk_id}
Content-Type: application/json

Update a SIP trunk (name, transfers, origination URIs).

Reference: https://agentphone.to/docs/api-reference/sip-trunks/update-sip-trunk-v-1-sip-trunks-trunk-id-patch

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `trunk_id` (string, required)

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — Display name.
- `transfers` (enum, optional) — Which transfers the trunk allows.
  - Allowed values: `all`, `sip`, `none`
- `transfer_caller_id` (enum, optional) — Caller ID presented on a transferred leg. "transferCallerId" is accepted as an alias.
  - Allowed values: `transferee`, `transferor`
- `transferCallerId` (enum, optional) — Alias of "transfer_caller_id"; send one or the other.
  - Allowed values: `transferee`, `transferor`
- `origination` (V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOrigination, optional) — Where inbound calls to this trunk are delivered.

## Response

### 200

Successful Response

- `id` (string, required)
- `name` (string, required)
- `provider` (string, required)
- `encrypted` (boolean, required)
- `transport` (string, required)
- `mediaEncryption` (string, required)
- `transfers` (string, required)
- `transferCallerId` (string, required)
- `terminationSipUri` (string, required)
- `createdAt` (string, required)
- `originationUris` (list of OriginationUri, optional)
- `allowedIps` (list of AllowedIp, optional)
- `proxyIps` (list of string, optional)
- `credentials` (list of SipTrunkCredential, optional, nullable)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOrigination

Where inbound calls to this trunk are delivered.

- `uris` (list of V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOriginationUrisItems, optional) — Empty or omitted clears the origination URIs (only allowed when no numbers are attached).

### OriginationUri

- `sip_uri` (string, required)
- `name` (string, optional, default: )
- `priority` (integer, optional, default: 10)
- `weight` (integer, optional, default: 10)

### AllowedIp

- `cidr` (string, required)
- `name` (string, optional, default: )

### SipTrunkCredential

- `username` (string, required)
- `password` (string, optional, nullable)
- `passwordLast4` (string, optional, nullable)
- `credentialListName` (string, optional, nullable)

### ValidationError

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

### V1SipTrunksTrunkIdPatchRequestBodyContentApplicationJsonSchemaOriginationUrisItems

- `sip_uri` (string, required) — Destination SIP URI, e.g. sip:host.example.com or sip:host;transport=tls.
- `name` (string, optional) — Optional label.
- `priority` (integer, optional, nullable, default: 10)
- `weight` (integer, optional, nullable, default: 10)

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
{
  "origination": {
    "uris": [
      {
        "sip_uri": "sip:example.sip.livekit.cloud;transport=tls",
        "priority": 10,
        "weight": 10
      }
    ]
  }
}
```

**Response**

```json
{
  "id": "string",
  "name": "string",
  "provider": "string",
  "encrypted": true,
  "transport": "string",
  "mediaEncryption": "string",
  "transfers": "string",
  "transferCallerId": "string",
  "terminationSipUri": "string",
  "createdAt": "string",
  "originationUris": [
    {
      "sip_uri": "string",
      "name": "",
      "priority": 10,
      "weight": 10
    }
  ],
  "allowedIps": [
    {
      "cidr": "string",
      "name": ""
    }
  ],
  "proxyIps": [
    "string"
  ],
  "credentials": [
    {
      "username": "string",
      "password": "string",
      "passwordLast4": "string",
      "credentialListName": "string"
    }
  ]
}
```

**SDK Code**

```python sip-trunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch_example
import requests

url = "https://api.agentphone.ai/v1/sip-trunks/trunk_id"

payload = { "origination": { "uris": [
            {
                "sip_uri": "sip:example.sip.livekit.cloud;transport=tls",
                "priority": 10,
                "weight": 10
            }
        ] } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript sip-trunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch_example
const url = 'https://api.agentphone.ai/v1/sip-trunks/trunk_id';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"origination":{"uris":[{"sip_uri":"sip:example.sip.livekit.cloud;transport=tls","priority":10,"weight":10}]}}'
};

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

```go sip-trunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch_example
package main

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

func main() {

	url := "https://api.agentphone.ai/v1/sip-trunks/trunk_id"

	payload := strings.NewReader("{\n  \"origination\": {\n    \"uris\": [\n      {\n        \"sip_uri\": \"sip:example.sip.livekit.cloud;transport=tls\",\n        \"priority\": 10,\n        \"weight\": 10\n      }\n    ]\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 sip-trunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch_example
require 'uri'
require 'net/http'

url = URI("https://api.agentphone.ai/v1/sip-trunks/trunk_id")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"origination\": {\n    \"uris\": [\n      {\n        \"sip_uri\": \"sip:example.sip.livekit.cloud;transport=tls\",\n        \"priority\": 10,\n        \"weight\": 10\n      }\n    ]\n  }\n}"

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

```java sip-trunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.agentphone.ai/v1/sip-trunks/trunk_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"origination\": {\n    \"uris\": [\n      {\n        \"sip_uri\": \"sip:example.sip.livekit.cloud;transport=tls\",\n        \"priority\": 10,\n        \"weight\": 10\n      }\n    ]\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.agentphone.ai/v1/sip-trunks/trunk_id', [
  'body' => '{
  "origination": {
    "uris": [
      {
        "sip_uri": "sip:example.sip.livekit.cloud;transport=tls",
        "priority": 10,
        "weight": 10
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp sip-trunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch_example
using RestSharp;

var client = new RestClient("https://api.agentphone.ai/v1/sip-trunks/trunk_id");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"origination\": {\n    \"uris\": [\n      {\n        \"sip_uri\": \"sip:example.sip.livekit.cloud;transport=tls\",\n        \"priority\": 10,\n        \"weight\": 10\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift sip-trunks_update_sip_trunk_v1_sip_trunks__trunk_id__patch_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["origination": ["uris": [
      [
        "sip_uri": "sip:example.sip.livekit.cloud;transport=tls",
        "priority": 10,
        "weight": 10
      ]
    ]]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentphone.ai/v1/sip-trunks/trunk_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()
```