Event subscriptions (webhooks)
Event subscriptions push real-time events (calls, call records, voicemail, messages, presence and more) to a URL on your server, so you don't have to poll.
In the Key Admin this is the Event subscriptions (webhooks) switch. Read lets a key call the GET endpoints below. Write lets it call the ones that change data.
List event subscriptions
/domains/~/subscriptionsReturns the event subscriptions on the account.
Read Key Admin switch: Event subscriptions (webhooks), Read. Read only keys also work.
Example request
curl -X GET "https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions", {
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/~/subscriptions",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 200
[
{
"id": "string",
"model": "agent",
"post-url": "https://example.com/webhooks/noodlevoice",
"subscription-geo-support": "yes",
"user-scope": "Basic User",
"reseller": "string",
"domain": "*",
"user": "*",
"...": "7 more fields"
}
]Response fields (15)
| Field | Type | Notes |
|---|---|---|
id | string | The item's ID. |
model | string | Which kind of event to send. One of: agent, auditlog, auditlog_lite, call, call_origid, cdr, message, messagesession, subscriber, presence, voicemail |
post-url | string | The HTTPS address events are sent to. It needs a valid certificate. |
subscription-geo-support | string | One of: yes, no Default yes |
user-scope | string | The user's permission level, such as Basic User or Office Manager. One of: Basic User, Simple User, Advanced User, Call Center Agent, Site Manager, Call Center Supervisor, Office Manager, Reseller, Super User, NDP, No Portal Default Basic User |
reseller | string | The parent account group. Set by the platform. |
domain | string | The account the item belongs to. Default * |
user | string | The user ID (extension). Default * |
subscription-creation-datetime | string (date-time) | Subscription creation (date and time). |
subscription-expires-datetime | string (date-time) | Subscription expires (date and time). |
preferred-server | string (hostname) | |
current-active-server | string (hostname) | |
status | string | Current status. One of: pending, active, error |
error-count | integer | Number of error. |
posts-count | integer | Number of posts. |
Create an event subscription
/domains/~/subscriptionsAdds a new event subscription on the account.
Write Key Admin switch: Event subscriptions (webhooks), Write.
Request body application/json
| Field | Type | Notes |
|---|---|---|
model | string | Which kind of event to send. One of: agent, auditlog, auditlog_lite, call, call_origid, cdr, message, messagesession, subscriber, presence, voicemail |
post-url | string | The HTTPS address events are sent to. It needs a valid certificate. |
subscription-geo-support | string | One of: yes, no Default yes |
reseller | string | The parent account group. Set by the platform. |
domain | string | The account the item belongs to. Default * |
user | string | The user ID (extension). Default * |
subscription-expires-datetime | string (date-time) | Subscription expires (date and time). |
preferred-server | string (hostname) |
Example request
curl -X POST "https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "agent",
"post-url": "https://example.com/webhooks/noodlevoice",
"subscription-geo-support": "yes",
"reseller": "string",
"domain": "*"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "agent",
"post-url": "https://example.com/webhooks/noodlevoice",
"subscription-geo-support": "yes",
"reseller": "string",
"domain": "*"
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"model": "agent",
"post-url": "https://example.com/webhooks/noodlevoice",
"subscription-geo-support": "yes",
"reseller": "string",
"domain": "*"
},
)
print(r.status_code, r.json())Response 200
Returns a status code with a short JSON message.
Other responses: 400, 401, 404, 409. See errors.
Update an event subscription
/domains/~/subscriptions/{id}Changes an existing event subscription. Send the fields you want to set in the body.
Write Key Admin switch: Event subscriptions (webhooks), Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
id required | path | string | The ID of the item, as returned when you list or create it. |
Request body application/json
| Field | Type | Notes |
|---|---|---|
model | string | Which kind of event to send. One of: agent, auditlog, auditlog_lite, call, call_origid, cdr, message, messagesession, subscriber, presence, voicemail |
post-url | string | The HTTPS address events are sent to. It needs a valid certificate. |
subscription-geo-support | string | One of: yes, no Default yes |
subscription-expires-datetime | string (date-time) | Subscription expires (date and time). |
preferred-server | string (hostname) | |
error-count | integer | Number of error. |
posts-count | integer | Number of posts. |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions/{id}" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "agent",
"post-url": "https://example.com/webhooks/noodlevoice",
"subscription-geo-support": "yes",
"subscription-expires-datetime": "2026-11-02 09:00:00",
"preferred-server": "string"
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions/{id}", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "agent",
"post-url": "https://example.com/webhooks/noodlevoice",
"subscription-geo-support": "yes",
"subscription-expires-datetime": "2026-11-02 09:00:00",
"preferred-server": "string"
}),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions/{id}",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"model": "agent",
"post-url": "https://example.com/webhooks/noodlevoice",
"subscription-geo-support": "yes",
"subscription-expires-datetime": "2026-11-02 09:00:00",
"preferred-server": "string"
},
)
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. |
Delete an event subscription
/domains/~/subscriptions/{id}Removes an event subscription. This can't be undone.
Write Key Admin switch: Event subscriptions (webhooks), Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
id required | path | string | The ID of the item, as returned when you list or create it. |
Example request
curl -X DELETE "https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions/{id}" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/subscriptions/{id}", {
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/~/subscriptions/{id}",
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. |