API-Referenz / Numbers
Numbers
Die Endpoints der Gruppe Numbers der Voiceland AI API, mit Parametern, Schemata und Beispielen mit curl.
Zuletzt aktualisiert:
Die Beschreibungen der Endpoints und der Felder erscheinen auf Englisch, genau so, wie die API sie ausliefert. Das ist Absicht: Sie lesen hier, was Sie auch in den Antworten sehen.
POST /v1/numbers#
Claim a number. Claims a specific number, or any available number when the body is empty.
Anfragetext
application/json Schema: NumberClaimRequest
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
e164 |
string | The specific number to claim (E.164). Omit to claim any available. |
Antworten
| Code | Beschreibung |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Beispielanfrage
curl -X POST "https://api.voiceland.ai/v1/numbers" \
-H "Authorization: Bearer VL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"e164": "+15550000001"
}'
Eine erfolgreiche Antwort liefert ein NumberClaimResponse.
Beispielantwort
{
"e164": "+15550000001",
"status": "claimed"
}
GET /v1/numbers/available#
List available numbers. Numbers you can claim from the pool.
Parameter
| Name | Ort | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
limit |
query |
integer | Max rows (default 50). |
Antworten
| Code | Beschreibung |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Beispielanfrage
curl "https://api.voiceland.ai/v1/numbers/available" \
-H "Authorization: Bearer VL_API_KEY"
Beispielantwort
{
"items": [
"+15550000001"
]
}
POST /v1/numbers/register#
Register an external number. Records an externally-provisioned number as claimed and (optionally) routed to an agent in one call.
Anfragetext
application/json Schema: NumberRegisterRequest
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
agent |
string | Ja | Agent to route the number to. |
e164 |
string | Ja | The number to register (E.164). |
Antworten
| Code | Beschreibung |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Beispielanfrage
curl -X POST "https://api.voiceland.ai/v1/numbers/register" \
-H "Authorization: Bearer VL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent": "front-desk",
"e164": "+15550000009"
}'
Eine erfolgreiche Antwort liefert ein NumberRouteResponse.
Beispielantwort
{
"agent": "front-desk",
"e164": "+15550000009"
}
DELETE /v1/numbers/{e164}#
Release a number. Returns a claimed number to the pool.
Parameter
| Name | Ort | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
e164 |
path |
string | Ja | Claimed number in E.164. |
Antworten
| Code | Beschreibung |
|---|---|
204 |
Released. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Beispielanfrage
curl -X DELETE "https://api.voiceland.ai/v1/numbers/{e164}" \
-H "Authorization: Bearer VL_API_KEY"
POST /v1/numbers/{e164}/route#
Route a number to an agent. Binds a claimed number to an agent; calls to it reach that agent.
Parameter
| Name | Ort | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
e164 |
path |
string | Ja | Claimed number in E.164. |
Anfragetext
application/json Schema: NumberRouteRequest
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
agent |
string | Ja | Agent the number should reach. |
Antworten
| Code | Beschreibung |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Beispielanfrage
curl -X POST "https://api.voiceland.ai/v1/numbers/{e164}/route" \
-H "Authorization: Bearer VL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent": "front-desk"
}'
Eine erfolgreiche Antwort liefert ein NumberRouteResponse.
Beispielantwort
{
"agent": "front-desk",
"e164": "+15550000001"
}
Schemata#
Error#
Error envelope returned for non-2xx responses.
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
error |
object | Ja |
NumberClaimRequest#
Claim a number. Empty body claims any available number.
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
e164 |
string | The specific number to claim (E.164). Omit to claim any available. |
NumberClaimResponse#
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
e164 |
string | Ja | The claimed number. |
status |
string | Ja | Claim status. |
NumberRegisterRequest#
Register an externally-provisioned number as claimed (and optionally routed).
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
agent |
string | Ja | Agent to route the number to. |
e164 |
string | Ja | The number to register (E.164). |
NumberRouteRequest#
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
agent |
string | Ja | Agent the number should reach. |
NumberRouteResponse#
| Feld | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
agent |
string | Ja | The agent it now reaches. |
e164 |
string | Ja | The number. |