---
title: "Create a Event Subscription for Domain"
method: POST
path: "/domains/{domain}/subscriptions"
tags: ["Event Subscriptions"]
---

# Create a Event Subscription for Domain

`POST /domains/{domain}/subscriptions`

## Request

- Base URL: `https://ns-api.com/ns-api/v2`
- URL: `https://ns-api.com/ns-api/v2/domains/{domain}/subscriptions`
- Auth: HTTP bearer

## Path parameters

- `domain` string, required: This is the main organization name. This is used to link resource to its group/tenant/organization/enterprise. Then using in path for GET you can set to "~" to use the domain name linked to your token/key instead of the domain name itself when reading for your own domain.

## Request body

- object
  - `model` 'agent' | 'auditlog' | 'auditlog_lite' | 'call' | 'call_origid' | 'cdr' | 'message' | 'messagesession' | 'subscriber' | 'presence' | 'voicemail': This is the type of data that will be sent. you will need to reqest multiple subscriptions if you want more than one model. Addtional details available in guide at https://docs.ns-api.com/docs/event-subscriptions-1
  - `post-url` string, url: This is the url the API will be posting data to. Should be in the format including https://. Can make a custom port if needed and the URL should have a valid SSL certificate as well. Http:// is supproted but not ideal for production.
  - `subscription-geo-support` 'yes' | 'no'
  - `reseller` string: This is the reseller that the subscription will filter data for. * will be used for all resellers, but only valid with Super User scope on the request.
  - `domain` string: This is the domain that the subscription will filter data for. "*" will be used for all domains, but only valid with Super User scope
  - `user` string: This is the user that the subscription will filter data for. * will be used for all users.
  - `subscription-expires-datetime` string, date-time: This timestamp in the format of YYYY-MM-DD HH:MM:SS will be with the subscription will expire. After it expires it will be removed after some amount of time. If left blank it will set the expires time to the expires time of the timed token used, if using a APIkey it will be 20 years from the creation date that it will set for the expires for the new subscription
  - `preferred-server` string, hostname: This is the server hostname for the prefered server for this subscription, meaning if this server is up and online it will be the one sending the events. It wil fail back to this servre after 60s of stability.

## Response `200`

- object

## Other responses

- `400`
- `401`
- `404`
- `409`: Subscription already exists

## Changes

- **2026-11-03** `bce16087d479`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ns-api/apis/netsapiens-api-v2/changes/domains/:domain/subscriptions/post.md)

---

[API](https://skmtc.dev/ns-api/apis/netsapiens-api-v2.md) - [All operations](https://skmtc.dev/ns-api/apis/netsapiens-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/ns-api/apis/netsapiens-api-v2/revisions/bce16087d479?raw)
