Skip to content

Virtual numbers list

Retrieves the list of virtual numbers in Liner. On success, returns all virtual numbers.

Note

Pagination is not implemented — the full list of virtual numbers is returned.


URL and method

GET /v2/sip-endpoint/


Request example

curl -X GET "https://YOUR_LINER_API_HOST/v2/sip-endpoints/" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_TOKEN"
<?php

$host = 'https://YOUR_LINER_API_HOST';
$token = 'YOUR_API_TOKEN';

$ch = curl_init($host . '/v2/sip-endpoints/');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: ' . $token,
    ],
    CURLOPT_TIMEOUT => 15,
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($response === false) {
    throw new RuntimeException('cURL error: ' . curl_error($ch));
}

curl_close($ch);

echo "HTTP {$httpCode}\n";
echo $response;
const host = "https://YOUR_LINER_API_HOST";
const token = "YOUR_API_TOKEN";

const res = await fetch(`${host}/v2/sip-endpoints/`, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": token
  }
});

const data = await res.json();
console.log("HTTP", res.status, data);

Response example

{
  "success": true,
  "message": "",
  "data": [
    {
      "id": 123,
      "title": "Virtual number",
      "orderId": null,
      "connectionType": "pstn",
      "params": {"phone": "+79001234567"},
      "isDefault": false,
      "outgoing": true,
      "incoming": true,
      "channels": 2
    }
  ]
}

Response fields

Field Type Description
id int Virtual number identifier.
title string Virtual number title.
orderId int | null Personal order the virtual number is assigned to. If not assigned — null.
connectionType string Virtual number type. Allowed values: pstn, sip-reg, sip-wo-reg.
params object Virtual number parameters: phone number (for pstn) or SIP configuration (for sip-reg / sip-wo-reg).
isDefault bool Whether it is used by default.
outgoing bool Whether outgoing calls are enabled for this number.
incoming bool Whether incoming calls are enabled for this number.
channels int Number of channels. From 2 to 10.

Note

The structure of the data field is described above. For the general API response format, see Request schema