# Import SIP trunk (/docs/api-reference/phone-numbers/importSipTrunk)

> Import a phone number associated with a SIP trunk.



**POST** `/phone_number/import/sip`

Import a phone number associated with a SIP trunk.

```yaml
operationId: importSipTrunk
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - phone_number
          - sip_host
          - sip_trunk_name
        properties:
          phone_number:
            type: string
            description: Phone number in E.164 format (starting with `+`).
            example: '+12025550123'
          sip_host:
            type: string
            description: SIP server hostname or IP.
            example: sip.yourprovider.com
          sip_trunk_name:
            type: string
            description: Name for this SIP trunk (must be unique within your account).
          name:
            type: string
            description: Optional friendly name for the imported number.
          sip_port:
            type: integer
            default: 5060
            description: SIP server port.
          sip_username:
            type: string
            description: SIP authentication username.
          sip_password:
            type: string
            format: password
            description: SIP authentication password.
          sip_dial_prefix:
            type: string
            description: >-
              Optional prefix to prepend before the destination number when dialing (e.g. to strip
              the country code).
          sip_strip_plus:
            type: boolean
            description: When true, strips the leading `+` from the dialed number.
responses:
  '200':
    description: SIP trunk imported.
    content:
      application/json:
        schema:
          type: object
          properties:
            success:
              type: boolean
            message:
              type: string
            id:
              type: integer
              description: ID of the newly imported phone number record. Use this with `/phone_number/attach`.
        example:
          success: true
          message: SIP trunk registered successfully
          id: 3360
```

**Python SDK**

```python
import os
from omnidimension import Client

# Initialize the client
api_key = os.environ.get('OMNIDIM_API_KEY')
client = Client(api_key)

# Import a SIP trunk
response = client.phone_number.import_sip_number(
    phone_number="+1234567890",
    sip_host="sip.yourprovider.com",
    sip_trunk_name="my-sip-trunk",
    name="My SIP Number",       # Optional
    sip_port=5060,               # Optional, defaults to 5060
    sip_username="user123",      # Optional
    sip_password="secret",       # Optional
)
print(response)
```

**curl**

```bash
curl -X POST "https://backend.omnidim.io/api/v1/phone_number/import/sip" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```
