> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. Atoms is the
> voice-agent platform.

# Import a SIP phone number

POST https://api.smallest.ai/atoms/v1/product/import-phone-number
Content-Type: application/json

Bring your own SIP trunk by importing an existing phone number with its SIP termination URL.
Atoms creates both inbound and outbound SIP trunks so your number works for making and receiving calls through the platform.

If `name` is omitted, a name is auto-generated from the phone number and user ID.


Reference: https://docs.smallest.ai/atoms/api-reference/api-reference/phone-numbers/import-a-sip-phone-number

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: atoms
  version: 1.0.0
paths:
  /product/import-phone-number:
    post:
      operationId: import-a-sip-phone-number
      summary: Import a SIP phone number
      description: >
        Bring your own SIP trunk by importing an existing phone number with its
        SIP termination URL.

        Atoms creates both inbound and outbound SIP trunks so your number works
        for making and receiving calls through the platform.


        If `name` is omitted, a name is auto-generated from the phone number and
        user ID.
      tags:
        - subpackage_phoneNumbers
      parameters:
        - name: Authorization
          in: header
          description: >-
            API key from the console ApiKey collection, sent as Bearer token.
            Also accepts session cookies for browser-based auth.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Phone number imported successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Phone
                  Numbers_importASipPhoneNumber_Response_200
        '400':
          description: >
            Bad request — missing required fields or phone number already
            imported.

            Exact error when a duplicate number is submitted: `"Number already
            present"`
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ImportASipPhoneNumberRequestBadRequestError
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phoneNumber:
                  type: string
                  description: >-
                    Your existing phone number. E.164 format is recommended but
                    not enforced server-side — any non-empty string is accepted.
                sipTerminationUrl:
                  type: string
                  description: >-
                    The SIP URI where calls should be routed to your
                    infrastructure
                name:
                  type: string
                  description: A friendly display name for this number
                sipUsername:
                  type: string
                  description: Username for SIP authentication (if your trunk requires it)
                sipPassword:
                  type: string
                  description: Password for SIP authentication (if your trunk requires it)
              required:
                - phoneNumber
                - sipTerminationUrl
servers:
  - url: https://api.smallest.ai/atoms/v1
    description: Production server
components:
  schemas:
    ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaDataProductType:
      type: string
      enum:
        - custom
      description: The type of product created — always `custom` for imported SIP numbers
      title: >-
        ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaDataProductType
    ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaDataAttributes:
      type: object
      properties:
        name:
          type: string
          description: Display name for the number
        phoneNumber:
          type: string
          description: The imported phone number
        outboundSipTrunkId:
          type: string
          description: Identifier for the outbound SIP trunk created
        inboundSipTrunkId:
          type: string
          description: Identifier for the inbound SIP trunk created
      title: >-
        ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaDataAttributes
    ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaData:
      type: object
      properties:
        _id:
          type: string
          description: Unique identifier of the created product
        productType:
          $ref: >-
            #/components/schemas/ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaDataProductType
          description: >-
            The type of product created — always `custom` for imported SIP
            numbers
        isActive:
          type: boolean
          description: Whether the number is active and ready to use
        attributes:
          $ref: >-
            #/components/schemas/ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaDataAttributes
        agentId:
          type:
            - string
            - 'null'
          description: ID of the agent assigned to this number (null if unassigned)
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the product was created
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the product was last updated
      title: ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaData
    Phone Numbers_importASipPhoneNumber_Response_200:
      type: object
      properties:
        status:
          type: boolean
        data:
          $ref: >-
            #/components/schemas/ProductImportPhoneNumberPostResponsesContentApplicationJsonSchemaData
      title: Phone Numbers_importASipPhoneNumber_Response_200
    ImportASipPhoneNumberRequestBadRequestError:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
          description: List of validation error messages
      title: ImportASipPhoneNumberRequestBadRequestError
    UnauthorizedErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: UnauthorizedErrorResponse
    InternalServerErrorResponse:
      type: object
      properties:
        status:
          type: boolean
        errors:
          type: array
          items:
            type: string
      title: InternalServerErrorResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from the console ApiKey collection, sent as Bearer token. Also
        accepts session cookies for browser-based auth.

```

## Examples



**Request**

```json
{
  "phoneNumber": "+14155551234",
  "sipTerminationUrl": "sip:trunk.your-provider.com",
  "name": "Main Support Line",
  "sipUsername": "",
  "sipPassword": ""
}
```

**Response**

```json
{
  "status": true,
  "data": {
    "_id": "507f1f77bcf86cd799439011",
    "productType": "custom",
    "isActive": true,
    "attributes": {
      "name": "Main Support Line",
      "phoneNumber": "+14155551234",
      "outboundSipTrunkId": "ST_xxxxxxxxxxxx",
      "inboundSipTrunkId": "ST_xxxxxxxxxxxx"
    },
    "agentId": "string",
    "createdAt": "2026-03-16T12:00:00.000Z",
    "updatedAt": "2026-03-16T12:00:00.000Z"
  }
}
```

**SDK Code**

```typescript Phone Numbers_importASipPhoneNumber_example
import { SmallestAIClient } from "smallestai";

async function main() {
    const client = new SmallestAIClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.atoms.phoneNumbers.importASipPhoneNumber({
        phoneNumber: "+14155551234",
        sipTerminationUrl: "sip:trunk.your-provider.com",
        name: "Main Support Line",
        sipUsername: "",
        sipPassword: "",
    });
}
main();

```

```python Phone Numbers_importASipPhoneNumber_example
from smallestai import SmallestAI

client = SmallestAI(
    token="YOUR_TOKEN_HERE",
)

client.atoms.phone_numbers.import_a_sip_phone_number(
    phone_number="+14155551234",
    sip_termination_url="sip:trunk.your-provider.com",
    name="Main Support Line",
    sip_username="",
    sip_password="",
)

```

```go Phone Numbers_importASipPhoneNumber_example
package main

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

func main() {

	url := "https://api.smallest.ai/atoms/v1/product/import-phone-number"

	payload := strings.NewReader("{\n  \"phoneNumber\": \"+14155551234\",\n  \"sipTerminationUrl\": \"sip:trunk.your-provider.com\",\n  \"name\": \"Main Support Line\",\n  \"sipUsername\": \"\",\n  \"sipPassword\": \"\"\n}")

	req, _ := http.NewRequest("POST", 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 Phone Numbers_importASipPhoneNumber_example
require 'uri'
require 'net/http'

url = URI("https://api.smallest.ai/atoms/v1/product/import-phone-number")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"phoneNumber\": \"+14155551234\",\n  \"sipTerminationUrl\": \"sip:trunk.your-provider.com\",\n  \"name\": \"Main Support Line\",\n  \"sipUsername\": \"\",\n  \"sipPassword\": \"\"\n}"

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

```java Phone Numbers_importASipPhoneNumber_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.smallest.ai/atoms/v1/product/import-phone-number")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"phoneNumber\": \"+14155551234\",\n  \"sipTerminationUrl\": \"sip:trunk.your-provider.com\",\n  \"name\": \"Main Support Line\",\n  \"sipUsername\": \"\",\n  \"sipPassword\": \"\"\n}")
  .asString();
```

```php Phone Numbers_importASipPhoneNumber_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.smallest.ai/atoms/v1/product/import-phone-number', [
  'body' => '{
  "phoneNumber": "+14155551234",
  "sipTerminationUrl": "sip:trunk.your-provider.com",
  "name": "Main Support Line",
  "sipUsername": "",
  "sipPassword": ""
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Phone Numbers_importASipPhoneNumber_example
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/product/import-phone-number");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"phoneNumber\": \"+14155551234\",\n  \"sipTerminationUrl\": \"sip:trunk.your-provider.com\",\n  \"name\": \"Main Support Line\",\n  \"sipUsername\": \"\",\n  \"sipPassword\": \"\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Phone Numbers_importASipPhoneNumber_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "phoneNumber": "+14155551234",
  "sipTerminationUrl": "sip:trunk.your-provider.com",
  "name": "Main Support Line",
  "sipUsername": "",
  "sipPassword": ""
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/product/import-phone-number")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```