## Assign or clear a phone number's SIP profile

`sip_profiles.assign(strphone_number, SipProfileAssignParams**kwargs)  -> SipProfileAssignResponse`

**put** `/v3/phone-numbers/{phoneNumber}/sip-profile`

## SIP configuration

Your Linq representative provides the signaling and media IP ranges and
ports to allow through your firewall during onboarding.

Set `primary_uri` to your endpoint as scheme + host — `sips:` for TLS or
`sip:` for UDP, with no user part (we add it). Each call arrives at your
endpoint as:

```
sip:<called-number>@<your-host>
```

so you can route on the dialed number. The caller's number is in the
`From` header in E.164.

---

Assign a SIP profile to route inbound calls to its SIP URI. This takes
precedence over an existing `forwarding_number` without clearing it.
Send `sip_profile_id: null` to remove the SIP assignment and resume
existing forwarding, if configured. Allow about 5 minutes for routing
changes to propagate. The phone number must belong to the authenticated
partner.

### Parameters

- `phone_number: str`

- `sip_profile_id: Optional[str]`

  The SIP profile to assign, or null to clear the number's current assignment.

### Returns

- `class SipProfileAssignResponse: …`

  - `phone_number: str`

    The phone number whose assignment changed

  - `sip_profile_id: Optional[str]`

    The assigned SIP profile id, or null when cleared

### Example

```python
import os
from linq import LinqAPIV3

client = LinqAPIV3(
    api_key=os.environ.get("LINQ_API_V3_API_KEY"),  # This is the default and can be omitted
)
response = client.sip_profiles.assign(
    phone_number="+14254758217",
    sip_profile_id="sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c",
)
print(response.sip_profile_id)
```

#### Response

```json
{
  "phone_number": "+14254758217",
  "sip_profile_id": "sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c"
}
```
