# Sip Profiles

## Create a SIP profile

**post** `/v3/sip-profiles`

## 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.

---

Create a SIP routing profile for your inbound calls, then assign it to a
phone number to start routing calls to its SIP URI.

### Body Parameters

- `name: string`

- `primary_uri: string`

  Your SIP endpoint as scheme + host, e.g. `sips:sip.partner.example`. Must start with `sip:` (UDP) or `sips:` (TLS) — the scheme sets the transport. Do not include a user part: we set it to the called number on each call (`sip:<called-number>@<your-host>`). A bare host with no scheme is rejected.

- `backup_uri: optional string`

  Optional failover SIP URI

### Returns

- `SipProfile object { id, assigned_number_count, created_at, 5 more }`

  - `id: string`

    Unique identifier for the SIP profile

  - `assigned_number_count: number`

    How many phone numbers reference this profile

  - `created_at: string`

  - `name: string`

    Human-readable name

  - `primary_uri: string`

    Your SIP endpoint as scheme + host (`sip:` UDP / `sips:` TLS); no user part — we set it to the called number on each call.

  - `updated_at: string`

  - `version: number`

    Monotonic version, incremented on each update

  - `backup_uri: optional string`

    Optional failover SIP URI. Null when unset.

### Example

```http
curl https://api.linqapp.com/api/partner/v3/sip-profiles \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY" \
    -d '{
          "name": "byoc-primary",
          "primary_uri": "sips:sip.partner.example",
          "backup_uri": "sips:inbound-backup@sip.partner.example"
        }'
```

#### Response

```json
{
  "id": "sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c",
  "assigned_number_count": 0,
  "created_at": "2026-10-29T10:30:00Z",
  "name": "byoc-primary",
  "primary_uri": "sips:sip.partner.example",
  "updated_at": "2026-10-29T10:30:00Z",
  "version": 1,
  "backup_uri": null
}
```

## List SIP profiles

**get** `/v3/sip-profiles`

Retrieve all SIP profiles for the authenticated partner.

### Returns

- `sip_profiles: array of SipProfile`

  The partner's SIP profiles

  - `id: string`

    Unique identifier for the SIP profile

  - `assigned_number_count: number`

    How many phone numbers reference this profile

  - `created_at: string`

  - `name: string`

    Human-readable name

  - `primary_uri: string`

    Your SIP endpoint as scheme + host (`sip:` UDP / `sips:` TLS); no user part — we set it to the called number on each call.

  - `updated_at: string`

  - `version: number`

    Monotonic version, incremented on each update

  - `backup_uri: optional string`

    Optional failover SIP URI. Null when unset.

### Example

```http
curl https://api.linqapp.com/api/partner/v3/sip-profiles \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "sip_profiles": [
    {
      "id": "sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c",
      "assigned_number_count": 0,
      "created_at": "2026-10-29T10:30:00Z",
      "name": "byoc-primary",
      "primary_uri": "sips:sip.partner.example",
      "updated_at": "2026-10-29T10:30:00Z",
      "version": 1,
      "backup_uri": null
    }
  ]
}
```

## Get a SIP profile by ID

**get** `/v3/sip-profiles/{sipProfileId}`

Retrieve details for a specific SIP profile.

### Path Parameters

- `sipProfileId: string`

### Returns

- `SipProfile object { id, assigned_number_count, created_at, 5 more }`

  - `id: string`

    Unique identifier for the SIP profile

  - `assigned_number_count: number`

    How many phone numbers reference this profile

  - `created_at: string`

  - `name: string`

    Human-readable name

  - `primary_uri: string`

    Your SIP endpoint as scheme + host (`sip:` UDP / `sips:` TLS); no user part — we set it to the called number on each call.

  - `updated_at: string`

  - `version: number`

    Monotonic version, incremented on each update

  - `backup_uri: optional string`

    Optional failover SIP URI. Null when unset.

### Example

```http
curl https://api.linqapp.com/api/partner/v3/sip-profiles/$SIP_PROFILE_ID \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "id": "sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c",
  "assigned_number_count": 0,
  "created_at": "2026-10-29T10:30:00Z",
  "name": "byoc-primary",
  "primary_uri": "sips:sip.partner.example",
  "updated_at": "2026-10-29T10:30:00Z",
  "version": 1,
  "backup_uri": null
}
```

## Update a SIP profile

**put** `/v3/sip-profiles/{sipProfileId}`

Update a SIP profile. Only the fields you send are changed; omitted
fields keep their current value. Set `backup_uri` to an empty string to
clear it.

### Path Parameters

- `sipProfileId: string`

### Body Parameters

- `backup_uri: optional string`

  Set to "" to clear the backup URI.

- `name: optional string`

- `primary_uri: optional string`

### Returns

- `SipProfile object { id, assigned_number_count, created_at, 5 more }`

  - `id: string`

    Unique identifier for the SIP profile

  - `assigned_number_count: number`

    How many phone numbers reference this profile

  - `created_at: string`

  - `name: string`

    Human-readable name

  - `primary_uri: string`

    Your SIP endpoint as scheme + host (`sip:` UDP / `sips:` TLS); no user part — we set it to the called number on each call.

  - `updated_at: string`

  - `version: number`

    Monotonic version, incremented on each update

  - `backup_uri: optional string`

    Optional failover SIP URI. Null when unset.

### Example

```http
curl https://api.linqapp.com/api/partner/v3/sip-profiles/$SIP_PROFILE_ID \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY" \
    -d '{}'
```

#### Response

```json
{
  "id": "sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c",
  "assigned_number_count": 0,
  "created_at": "2026-10-29T10:30:00Z",
  "name": "byoc-primary",
  "primary_uri": "sips:sip.partner.example",
  "updated_at": "2026-10-29T10:30:00Z",
  "version": 1,
  "backup_uri": null
}
```

## Delete a SIP profile

**delete** `/v3/sip-profiles/{sipProfileId}`

Delete a SIP profile. The profile must not be assigned to any phone number; unassign it first or the request is rejected.

### Path Parameters

- `sipProfileId: string`

### Example

```http
curl https://api.linqapp.com/api/partner/v3/sip-profiles/$SIP_PROFILE_ID \
    -X DELETE \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY"
```

#### Response

```json
{
  "error": {
    "status": 401,
    "code": 2004,
    "message": "Unauthorized - missing or invalid authentication token",
    "doc_url": "https://docs.linqapp.com/channel/imessage/error/codes/2xxx/2004/"
  },
  "success": false
}
```

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

**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.

### Path Parameters

- `phoneNumber: string`

### Body Parameters

- `sip_profile_id: string`

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

### Returns

- `phone_number: string`

  The phone number whose assignment changed

- `sip_profile_id: string`

  The assigned SIP profile id, or null when cleared

### Example

```http
curl https://api.linqapp.com/api/partner/v3/phone-numbers/$PHONE_NUMBER/sip-profile \
    -X PUT \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $LINQ_API_V3_API_KEY" \
    -d '{
          "sip_profile_id": "sip_8a3f9c2b1d4e4f5a9b8c7d6e5f4a3b2c"
        }'
```

#### Response

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

## Domain Types

### Sip Profile

- `SipProfile object { id, assigned_number_count, created_at, 5 more }`

  - `id: string`

    Unique identifier for the SIP profile

  - `assigned_number_count: number`

    How many phone numbers reference this profile

  - `created_at: string`

  - `name: string`

    Human-readable name

  - `primary_uri: string`

    Your SIP endpoint as scheme + host (`sip:` UDP / `sips:` TLS); no user part — we set it to the called number on each call.

  - `updated_at: string`

  - `version: number`

    Monotonic version, incremented on each update

  - `backup_uri: optional string`

    Optional failover SIP URI. Null when unset.

### Sip Profile List Response

- `SipProfileListResponse object { sip_profiles }`

  - `sip_profiles: array of SipProfile`

    The partner's SIP profiles

    - `id: string`

      Unique identifier for the SIP profile

    - `assigned_number_count: number`

      How many phone numbers reference this profile

    - `created_at: string`

    - `name: string`

      Human-readable name

    - `primary_uri: string`

      Your SIP endpoint as scheme + host (`sip:` UDP / `sips:` TLS); no user part — we set it to the called number on each call.

    - `updated_at: string`

    - `version: number`

      Monotonic version, incremented on each update

    - `backup_uri: optional string`

      Optional failover SIP URI. Null when unset.

### Sip Profile Assign Response

- `SipProfileAssignResponse object { phone_number, sip_profile_id }`

  - `phone_number: string`

    The phone number whose assignment changed

  - `sip_profile_id: string`

    The assigned SIP profile id, or null when cleared
