Números
Listar números
O inventário de números de telefone da organização.
GET https://api.diska.ai/v1/phone-numbers
Âmbito: phone-numbers:read
Os números importados por SIP trazem também os campos do trunk; a palavra-passe SIP nunca é devolvida, só sip_password_configured.
Parâmetros
Na query string
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
search | string | null | Não | Texto no número, no nome ou no domínio SIP. Até 200 caracteres. |
number_type | string | null | Não | purchased (números DISKA) ou imported (números próprios por SIP). |
Exemplos
curl "https://api.diska.ai/v1/phone-numbers" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.get(
"https://api.diska.ai/v1/phone-numbers",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 ou superior, num ficheiro .mjs
const response = await fetch('https://api.diska.ai/v1/phone-numbers', {
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/phone-numbers');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
Experimentar
Envie o pedido a partir desta página, com a sua chave. A chave fica só nesta página: não é guardada e só é enviada para api.diska.ai. Use uma chave de teste com os âmbitos mínimos.
GET
https://api.diska.ai/v1/phone-numbersComeça por dsk_. Fica só neste separador do browser.
query
query
Introduza uma chave API (dsk_…).
Resposta 200
| Campo | Tipo | Descrição |
|---|---|---|
items | array | Os números. |
items[].id | string | Identificador. |
items[].organization_id | string | Organização a que pertence. |
items[].e164 | string | O número em formato E.164. |
items[].friendly_name | string | null | Nome dado ao número. |
items[].number_type | string | purchased (número DISKA) ou imported (número próprio por SIP). Padrão: purchased. |
items[].status | string | active ou inactive. Padrão: active. |
items[].country_code | string | País do número (ISO 3166). Padrão: AO. |
items[].capabilities | object | O que o número suporta. |
items[].capabilities.calls | boolean | Faz e recebe chamadas. Padrão: true. |
items[].capabilities.sms | boolean | Envia SMS. Padrão: true. |
items[].monthly_price_kz | number | null | Preço mensal em kwanzas, quando aplicável. |
items[].provider | string | null | Operador do número. |
items[].provider_sid | string | null | Identificador do número no operador. |
items[].agent_id | string | null | Agente principal do número. |
items[].agents | array | Agentes que usam o número. |
items[].agents[].id | string | Agente. |
items[].agents[].name | string | Nome do agente. |
items[].agents[].status | string | null | Estado do agente. |
items[].sip_domain | string | null | Trunk SIP: domínio do servidor. |
items[].sip_username | string | null | Trunk SIP: utilizador. |
items[].sip_password_configured | boolean | true quando a palavra-passe SIP está definida (nunca é devolvida). Padrão: false. |
items[].sip_outbound_proxy | string | null | Trunk SIP: proxy de saída. |
items[].sip_auth_username | string | null | Trunk SIP: utilizador de autenticação, se diferente. |
items[].sip_outbound_register | boolean | true quando a Diska se regista no servidor SIP. Padrão: false. |
items[].origination_uri | string | null | Endereço SIP para onde o operador envia as chamadas recebidas. |
items[].sip_status | string | null | Estado do trunk SIP. Um de: pending_credentials, pending_provisioning, ready, error. |
items[].sip_status_detail | string | null | Detalhe do estado do trunk. |
items[].sip_transport | string | Transporte SIP. Um de: udp, tcp. Padrão: udp. |
items[].sip_allowed_ips | array | Endereços IP autorizados a enviar chamadas. |
items[].created_at | string | null | Data de criação (ISO 8601). |
items[].updated_at | string | null | Data da última alteração (ISO 8601). |
total | integer | Quantos números. |
{
"items": [
{
"id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"organization_id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"e164": "+244900000000",
"friendly_name": "Linha principal",
"number_type": "purchased",
"status": "active",
"country_code": "AO",
"capabilities": {
"calls": true,
"sms": true
},
"monthly_price_kz": 0,
"provider": "africell",
"provider_sid": null,
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"agents": [
{
"id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"name": "Recepção",
"status": "active"
}
],
"sip_domain": null,
"sip_username": null,
"sip_password_configured": false,
"sip_outbound_proxy": null,
"sip_auth_username": null,
"sip_outbound_register": false,
"origination_uri": null,
"sip_status": null,
"sip_status_detail": null,
"sip_transport": "udp",
"sip_allowed_ips": [],
"created_at": "2026-10-25T18:40:00Z",
"updated_at": "2026-10-25T18:40:00Z"
}
],
"total": 1
}
Erros
Este endpoint não tem erros próprios.
Os erros comuns a todos os endpoints (401, 403, 422, 429 e 5xx) estão em Erros.

