Phone numbers
Phone numbers (DIDs) are the numbers people dial to reach the account. Each one routes somewhere: a user, a call queue, an auto attendant or an outside number.
In the Key Admin this is the Phone numbers switch. Read lets a key call the GET endpoints below. Write lets it call the ones that change data.
List phone numbers
/domains/~/phonenumbersReturns every phone number (DID) on the account and where each one routes.
Read Key Admin switch: Phone numbers, Read. Read only keys also work.
Example request
curl -X GET "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers", {
method: "GET",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 200
[
{
"phonenumber": "15555550123",
"enabled": "yes",
"domain": "string",
"dial-rule-application": "available-number",
"dial-rule-parameter": "string",
"dial-rule-translation-destination-user": "1001",
"dial-rule-translation-destination-host": "[*]",
"dial-rule-translation-source-name": "[*]",
"...": "1 more fields"
}
]Response fields (9)
| Field | Type | Notes |
|---|---|---|
phonenumber | string | Phone number in E.164 digits, like 15555550123. |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
domain | string | The account the item belongs to. Max length 64 |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Count phone numbers
/domains/~/phonenumbers/countReturns how many phone numbers there are on the account, as {"total": n}.
Read Key Admin switch: Phone numbers, Read. Read only keys also work.
Example request
curl -X GET "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/count" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/count", {
method: "GET",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/count",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 200
{
"total": 1
}Response fields (1)
| Field | Type | Notes |
|---|---|---|
total | integer | How many items matched. |
Other responses: 400, 401, 404. See errors.
Get a phone number
/domains/~/phonenumbers/{phonenumber}Returns one phone number by its ID.
Read Key Admin switch: Phone numbers, Read. Read only keys also work.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
phonenumber required | path | string | The phone number in E.164 digits, like 15555550123. |
Example request
curl -X GET "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123", {
method: "GET",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 200
{
"phonenumber": "15555550123",
"enabled": "yes",
"domain": "string",
"dial-rule-application": "available-number",
"dial-rule-parameter": "string",
"dial-rule-translation-destination-user": "1001",
"dial-rule-translation-destination-host": "[*]",
"dial-rule-translation-source-name": "[*]",
"...": "1 more fields"
}Response fields (9)
| Field | Type | Notes |
|---|---|---|
phonenumber | string | Phone number in E.164 digits, like 15555550123. |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
domain | string | The account the item belongs to. Max length 64 |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Add a phone number
/domains/~/phonenumbersAdds a phone number to the account and sets where it routes.
Write Key Admin switch: Phone numbers, Write.
Request body application/json
| Field | Type | Notes |
|---|---|---|
phonenumber required | string | Phone number in E.164 digits, like 15555550123. |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user required | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Example request
curl -X POST "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 409. See errors.
Release a phone number to inventory
/domains/~/phonenumbersTakes a phone number out of service on the account and marks it available.
Write Key Admin switch: Phone numbers, Write.
Request body application/json
| Field | Type | Notes |
|---|---|---|
phonenumber required | string | Phone number in E.164 digits, like 15555550123. |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user required | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 409. See errors.
Forward a phone number to an outside number
/domains/~/phonenumbersSends calls for a phone number to a number outside the account.
Write Key Admin switch: Phone numbers, Write.
Request body application/json
| Field | Type | Notes |
|---|---|---|
phonenumber required | string | Phone number in E.164 digits, like 15555550123. |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user required | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 409. See errors.
Route a phone number to a call queue
/domains/~/phonenumbersPoints a phone number at a call queue.
Write Key Admin switch: Phone numbers, Write.
Request body application/json
| Field | Type | Notes |
|---|---|---|
phonenumber required | string | Phone number in E.164 digits, like 15555550123. |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user required | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 409. See errors.
Route a phone number to a user
/domains/~/phonenumbersPoints a phone number at a user, so calls to it ring that user's answer rules.
Write Key Admin switch: Phone numbers, Write.
Request body application/json
| Field | Type | Notes |
|---|---|---|
phonenumber required | string | Phone number in E.164 digits, like 15555550123. |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user required | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
}),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"phonenumber": "15555550123",
"dial-rule-translation-destination-user": "1001"
},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 409. See errors.
Update a phone number
/domains/~/phonenumbers/{phonenumber}Changes an existing phone number. Send the fields you want to set in the body.
Write Key Admin switch: Phone numbers, Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
phonenumber required | path | string | The phone number in E.164 digits, like 15555550123. |
Request body application/json
| Field | Type | Notes |
|---|---|---|
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
dial-rule-application | string | One of: available-number, to-voicemail-residential, to-callqueue, to-callqueue-announce-count-callers-ahead, to-callqueue-announce-expected-wait-time, to-connection, to-connection-or-user-no-failover, to-single-device, to-user, to-user-residential, to-voicemail, spam-screening, to-connection-block-caller-id, to-connection-no-timeout, to-connection-add-header-force-caller-id, to-connection-add-header-no-timeout, to-connection-add-header, to-single-device-add-header-allow-voicemail, to-single-device-add-header-allow-voicemail-residential, to-single-device-add-header, to-user-add-header, to-user-residential-add-header, to-user-notify-of-recording, hangup, to-user-answer-and-fake-ringback, toggle-timeframe |
dial-rule-parameter | string | |
dial-rule-translation-destination-user required | string | |
dial-rule-translation-destination-host | string | Default [*] |
dial-rule-translation-source-name | string | Name of the dial rule translation source. Default [*] |
dial-rule-description | string |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"dial-rule-translation-destination-user": "1001"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"dial-rule-translation-destination-user": "1001"
}),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"dial-rule-translation-destination-user": "1001"
},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 409. See errors.
Delete a phone number
/domains/~/phonenumbers/{phonenumber}Removes a phone number. This can't be undone.
Write Key Admin switch: Phone numbers, Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
phonenumber required | path | string | The phone number in E.164 digits, like 15555550123. |
Example request
curl -X DELETE "https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123", {
method: "DELETE",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.delete(
"https://api.noodlevoice.com/ns-api/v2/domains/~/phonenumbers/15555550123",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 409. See errors.