> For the complete documentation index, see [llms.txt](https://user.netmera.com/netmera-developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/push-notifications/send-transactional-notification.md). Agents can also search and read this documentation through its [MCP server](https://user.netmera.com/netmera-developer-guide/~gitbook/mcp).

# Send Transactional Notification

Sends a notification definition to individual users, for example an OTP or an order update. The definition is referenced by its `notificationKey`.

{% hint style="danger" %}
**Requests sent from Test it are real.** Test it opens a request panel; pressing **Send** in that panel calls the live API with the key you enter. With a production API key the message goes to every user, device or address in the request, and an array sends to each of them. Use a test application's key or your own test user.
{% endhint %}

#### Capabilities

* **Single or batch sends** — Send one request object, or an array of them to send several messages in one call.
* **Flexible recipients** — Identify users by `extId`, `deviceToken`, `msisdn`, `email`, `wpNumber`, `iid`, or profile attributes in `target.pa`.
* **Per-call personalization** — Fill the definition's placeholders with `message.params` and override options such as `customJson`, `ttl` or the click action.

#### How it works

1. Create the definition in the panel or with `createNotificationDefinition`.
2. Send its `notificationKey` with a `target` for each message.
3. Netmera applies the per-call values in `message` and delivers the notification.

<details>

<summary>Notes</summary>

* When one request contains several sends, a send that fails is skipped, for example one with an unknown notification key or an unknown user. The call still returns 200.
* Only a malformed request fails as a whole.
* If every `target.pa` key is unknown to the application, the request returns HTTP 400, code `2001`, "An unexpected error occurred. Retry later.", and nothing is sent.

</details>

```json
{"openapi":"3.1.0","info":{"title":"Netmera REST API","version":"3.0"},"tags":[{"name":"Push Notifications","description":"Send push notifications to an audience or to individual users.\n\n<table data-view=\"cards\"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type=\"content-ref\"></th></tr></thead><tbody><tr><td><strong>Send Bulk Notification</strong></td><td><code>POST</code> Send one message to an audience: tags, segments, profile attributes, a location or everyone.</td><td><a href=\"https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/push-notifications/send-bulk-notification\">Send Bulk Notification</a></td></tr><tr><td><strong>Create Notification Definition</strong></td><td><code>POST</code> Create a reusable transactional message once; use its key for every personal send.</td><td><a href=\"https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/push-notifications/create-notification-definition\">Create Notification Definition</a></td></tr><tr><td><strong>Send Transactional Notification</strong></td><td><code>POST</code> Send a personal message, such as an OTP or an order update, to one or more users.</td><td><a href=\"https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/push-notifications/send-transactional-notification\">Send Transactional Notification</a></td></tr><tr><td><strong>Start, Update or End Live Activity</strong></td><td><code>POST</code> Start, update or end an iOS Live Activity for a group.</td><td><a href=\"https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/push-notifications/start-update-or-end-live-activity\">Start, Update or End Live Activity</a></td></tr></tbody></table>\n"}],"servers":[{"url":"https://restapi.netmera.com","description":"Netmera REST API"}],"security":[{"REST-API-key":[]}],"components":{"securitySchemes":{"REST-API-key":{"type":"apiKey","in":"header","name":"X-netmera-api-key","description":"REST API key. Available in the Netmera Panel under Developers > API.\n"}},"schemas":{"SendNotificationRequest":{"type":"object","description":"A single transactional notification send request.","required":["target"],"properties":{"notificationKey":{"type":"string","description":"Key of the notification definition, created in the panel or returned by\n`createNotificationDefinition`; required unless `extRef` is sent. Must be a JSON string (for\nexample `\"106\"`): a JSON number returns HTTP 400, code `2004` (\"Field 'notificationKey' should\nbe a text\").\n"},"target":{"$ref":"#/components/schemas/Target"},"message":{"$ref":"#/components/schemas/TransactionalMessage"},"lastActiveDevice":{"type":"boolean","description":"`true` sends only to the user's last active device; `false` sends to all devices.\n"},"extRef":{"type":"string","description":"External reference of an existing message, as an alternative to `notificationKey`. Used\nonly when `notificationKey` is empty; it must match the `extRef` of an existing message\n(otherwise HTTP 400, code `2004`).\n"},"labels":{"description":"Labels of the notification, read only when a `message` object is also sent. When\n`notificationKey` is `custom-label` (case-insensitive), a notification definition is found or\ncreated by these labels.\n","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"additionalProperties":true},"Target":{"type":"object","description":"Recipients of the notification. It cannot be empty, so set `sendToAll` to `true` to reach all users\nof the selected platforms; profile attribute codes are listed in the panel under **Developers >\nProfile Attributes > Code**, several attributes in one `profile` object are combined with AND, and\nvalues of one attribute with OR.\n","properties":{"sendToAll":{"type":"boolean","description":"When true, the notification is dispatched to all users selected for the specified\nplatforms.\n"},"tag":{"$ref":"#/components/schemas/TargetOperatorList"},"segment":{"$ref":"#/components/schemas/TargetOperatorList"},"profile":{"type":"object","description":"Profile attribute conditions: each key is a profile attribute code and each value a single\nvalue, an array of values, or an operator object such as `{\"$exists\": true}`. The operators\n`$or` and `$and` can also wrap a group of attribute conditions.\n","additionalProperties":true},"pa":{"type":"object","description":"Profile attribute targeting used by `sendNotification`. Each key is a profile\nattribute code and each value a single value or an array of values (OR).\n","additionalProperties":true},"location":{"$ref":"#/components/schemas/Location"},"extId":{"description":"External ID of the target user, or an array of external IDs.\n","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"deviceToken":{"description":"Device token of the target device, or an array of device tokens.\n","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"email":{"type":"string","description":"Target email address."},"msisdn":{"type":"string","description":"Target phone number."},"wpNumber":{"description":"WhatsApp number in E.164 format (for example `+90xxxxxxxxxx`) or an array of numbers, used by\n`sendNotification` and `sendEmailAndSms`; an invalid number returns HTTP 400, code `2009`, and\n`sendEmailAndSms` creates a user when no user has the number. Only one identifier type is used\nper request; when several are sent, the first in this order wins: `extId`, `deviceToken`,\n`msisdn`, `email`, `wpNumber`, `iid`, `pa`.\n","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"iid":{"description":"Installation ID of the target device, or an array of installation IDs, used by\n`sendNotification` and `sendEmailAndSms`. Only one identifier type is used per request; when\nseveral are sent, the first in this order wins: `extId`, `deviceToken`, `msisdn`, `email`,\n`wpNumber`, `iid`, `pa`.\n","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"additionalProperties":true},"TargetOperatorList":{"description":"A single value, an array of values (OR), or an operator object using `$or`, `$and` or\n`$not`.\n","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"object","properties":{"$or":{"type":"array","items":{"type":"string"}},"$and":{"type":"array","items":{"type":"string"}},"$not":{"type":"array","items":{"type":"string"}}},"additionalProperties":true}]},"Location":{"type":"object","description":"Geographical area used to target users based on their location.","required":["latitude","longitude","radius"],"properties":{"latitude":{"type":"number","description":"The latitude of the center point."},"longitude":{"type":"number","description":"The longitude of the center point."},"radius":{"type":"number","description":"The radius value, in kilometers, from the center to search for users.\n"}}},"TransactionalMessage":{"type":"object","description":"Per-call overrides of a transactional notification definition.","properties":{"params":{"type":"object","description":"Custom parameters that personalize the notification: a message \"Hello @{name}\" with a `name`\nparameter becomes \"Hello John\" or \"Hello Mary\". A request value overwrites the parameter\nconfigured in the panel.\n","additionalProperties":true},"click":{"$ref":"#/components/schemas/ClickAction"},"customJson":{"type":"object","description":"Custom parameters available on the device when the push is received.","additionalProperties":true},"buttonSet":{"$ref":"#/components/schemas/ButtonSet"},"ios":{"$ref":"#/components/schemas/IosOptions"},"android":{"$ref":"#/components/schemas/AndroidOptions"},"ttl":{"type":"string","description":"Time to live of the notification. For example `15d` is 15 days, `20h` 20 hours and `30m` 30\nminutes.\n"},"inbox":{"type":"boolean","description":"Whether to display the push notification in the inbox."},"doNotNotify":{"type":"boolean","description":"Whether to show the push notification in the notification center."},"context":{"type":"object","description":"Context values forwarded with the send request.\n","additionalProperties":true},"groupId":{"type":"string","description":"Group identifier of the live activity. Required when the notification definition is a\nlive activity (otherwise HTTP 400, code `2009`).\n"},"liveActEndDate":{"type":"string","format":"date-time","description":"End date of the live activity as an ISO-8601 instant, for example\n`2030-01-01T10:00:00Z`. Must be in the future (otherwise HTTP 400, code `2009`); an\nunparseable value returns HTTP 400 with code `2001`.\n"}},"additionalProperties":true},"ClickAction":{"type":"object","description":"Click behavior of the notification: `url` opens a web page in the default browser, and `deeplink`\nopens the app through a registered, correctly configured deeplink URI (both iOS and Android).\n`doNothing` (Android only) turns off automatic click handling, so the app must implement a custom\nclick handler.\n","properties":{"url":{"type":"string","description":"Web page opened in the device's default browser."},"deeplink":{"type":"string","description":"Registered deeplink URI that launches the app."},"doNothing":{"type":"boolean","description":"Android only. No action is triggered when the user taps the notification."},"deeplinkCustomMapParams":{"type":"object","description":"Custom parameters applied with `deeplink`, accepted by `sendNotification` and\n`createNotificationDefinition`; in `sendNotification` each entry's `queryMaps` holds at most\n1000 entries (otherwise HTTP 400, code `2004`). `sendBulkNotification` rejects it with HTTP 400,\ncode `2009`.\n","additionalProperties":true}},"additionalProperties":true},"ButtonSet":{"type":"object","description":"Button set attached to the notification, created first in the panel under **Settings > Button\nSets**; the button name itself is not mandatory. Each additional key is a button name mapped to its\naction URL (`$buttonSetName: $actionUrl`).\n","properties":{"id":{"type":"integer","description":"Button set ID, visible in the panel under Settings > Button Sets.\n"},"buttonNames":{"type":"object","description":"Renames buttons by mapping each old button name to a new one. If this field is\nomitted, notifications are sent with the existing button names.\n","additionalProperties":{"type":"string"}},"setAttrOrTag":{"type":"object","description":"Maps a button name to the profile attribute or tag set when that button is clicked.\n","additionalProperties":{"$ref":"#/components/schemas/SetAttrOrTagEntry"}}},"additionalProperties":true},"SetAttrOrTagEntry":{"type":"object","description":"Profile attribute or tag set when a button is clicked. The button click action must be\nset to \"Open App\"; the operation is triggered after the push open event inside the\napplication module.\n","properties":{"setOnClick":{"type":"string","description":"`PROFILE_ATTR` for the profile attribute flow.\n"},"attrName":{"type":"string","description":"Profile attribute name."},"attrValue":{"type":"string","description":"Profile attribute value."},"tagName":{"type":"string","description":"Tag name applied on click."}},"additionalProperties":true},"IosOptions":{"type":"object","description":"Optional parameters specific to iOS.","properties":{"title":{"type":"string","description":"Title of the push notification on iOS."},"subtitle":{"type":"string"},"sound":{"type":"string","description":"Name of a sound defined in the panel under Developers > Sounds, per platform.\n"},"badge":{"type":"boolean","description":"Badge display. Badges are enabled only for iOS."},"mediaUrl":{"type":"string","description":"Rich media URL. On iOS an image, sound or video may be used."},"thumbnailUrl":{"type":"string"},"limit":{"type":"integer","description":"Maximum number of iOS users the notification is sent to."},"click":{"$ref":"#/components/schemas/ClickAction"},"carousel":{"type":"array","items":{"$ref":"#/components/schemas/CarouselItem"}},"slider":{"type":"array","items":{"$ref":"#/components/schemas/SliderItem"}},"icon":{"type":"string","description":"Name of the notification icon on iOS.\n"}},"additionalProperties":true},"CarouselItem":{"type":"object","description":"One item of a carousel push.","properties":{"title":{"type":"string"},"content":{"type":"string"},"itemImageUrl":{"type":"string"},"clickAction":{"$ref":"#/components/schemas/CarouselItemClickAction"}},"additionalProperties":true},"CarouselItemClickAction":{"type":"object","description":"Click action of a carousel or slider item.","properties":{"action":{"type":"string","description":"Action type, for example DEEP_LINK."},"url":{"type":"string"},"deeplinkType":{"type":"string","description":"Deeplink type, for example URL."},"deepLinkUrl":{"type":"string"}},"additionalProperties":true},"SliderItem":{"type":"object","description":"One item of a slider push.","properties":{"itemImageUrl":{"type":"string"},"clickAction":{"$ref":"#/components/schemas/CarouselItemClickAction"}},"additionalProperties":true},"AndroidOptions":{"type":"object","description":"Optional parameters specific to Android.","properties":{"title":{"type":"string","description":"Title of the push notification on Android."},"subtitle":{"type":"string"},"sound":{"type":"string","description":"Name of a sound defined in the panel under Developers > Sounds, per platform.\n"},"vibration":{"type":"boolean","description":"Android only. Enables or disables vibration when a device receives the push\nnotification.\n"},"bigText":{"type":"string"},"mediaUrl":{"type":"string","description":"Rich media URL. On Android an image may be used."},"thumbnailUrl":{"type":"string"},"limit":{"type":"integer","description":"Maximum number of Android users the notification is sent to."},"click":{"$ref":"#/components/schemas/ClickAction"},"carousel":{"type":"array","items":{"$ref":"#/components/schemas/CarouselItem"}},"slider":{"type":"array","items":{"$ref":"#/components/schemas/SliderItem"}},"channelName":{"type":"string","description":"Name of an existing Android notification channel of the app; when set, `sound` and `soundUrl`\nare ignored. Accepted by `sendBulkNotification` and `sendNotification`.\n"},"soundUrl":{"type":"string","description":"URL of a custom notification sound. Used only when `sound` is empty.\n"},"icon":{"type":"string","description":"Name of the small notification icon. As a per-call override in `sendNotification` it is\nnot applied.\n"},"iconDark":{"type":"string","description":"Name of the small notification icon used in dark mode. As a per-call override in\n`sendNotification` it is not applied.\n"}},"additionalProperties":true},"NetmeraError":{"type":"object","description":"Standard Netmera error body.","required":["code","error"],"properties":{"code":{"type":"integer","description":"Netmera error code. See the error table in the API description."},"error":{"type":"string","description":"Human readable error message."}}}},"responses":{"InvalidApiKey":{"description":"The `X-netmera-api-key` header is missing or the key is not valid.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetmeraError"}}}},"IpNotAllowed":{"description":"The application restricts REST calls to a list of allowed IP addresses and the caller's\nIP is not on it. The check runs after the API key is validated and before the request\nbody and parameters are validated, so a restricted application returns this error even\nfor a malformed request.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetmeraError"}}}}}},"paths":{"/rest/3.0/sendNotification":{"post":{"operationId":"sendNotification","tags":["Push Notifications"],"summary":"Send Transactional Notification","description":"Sends a notification definition to individual users, for example an OTP or an order update. The\ndefinition is referenced by its `notificationKey`.\n\n{% hint style=\"danger\" %}\n**Requests sent from Test it are real.** Test it opens a request panel; pressing **Send** in\nthat panel calls the live API with the key you enter. With a production API key the message\ngoes to every user, device or address in the request, and an array sends to each of them. Use\na test application's key or your own test user.\n{% endhint %}\n\n### Capabilities\n\n- **Single or batch sends** — Send one request object, or an array of them to send several messages\n  in one call.\n- **Flexible recipients** — Identify users by `extId`, `deviceToken`, `msisdn`, `email`, `wpNumber`,\n  `iid`, or profile attributes in `target.pa`.\n- **Per-call personalization** — Fill the definition's placeholders with `message.params` and\n  override options such as `customJson`, `ttl` or the click action.\n\n### How it works\n\n1. Create the definition in the panel or with `createNotificationDefinition`.\n2. Send its `notificationKey` with a `target` for each message.\n3. Netmera applies the per-call values in `message` and delivers the notification.\n\n<details>\n\n<summary>Notes</summary>\n\n- When one request contains several sends, a send that fails is skipped, for example one with an\n  unknown notification key or an unknown user. The call still returns 200.\n- Only a malformed request fails as a whole.\n- If every `target.pa` key is unknown to the application, the request returns HTTP 400, code `2001`,\n  \"An unexpected error occurred. Retry later.\", and nothing is sent.\n\n</details>\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SendNotificationRequest"},{"type":"array","items":{"$ref":"#/components/schemas/SendNotificationRequest"}}]}}}},"responses":{"200":{"description":"The notification was accepted for delivery. The response is an empty JSON object.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"No target, unknown notification key or invalid JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetmeraError"}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"403":{"$ref":"#/components/responses/IpNotAllowed"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/push-notifications/send-transactional-notification.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
