> For the complete documentation index, see [llms.txt](https://docs.klai.studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.klai.studio/engineering-reference-docs/creating-a-pwa/getting-started/sending-a-push-notification-from-the-api-endpoint.md).

# Sending a Push Notification from the API Endpoint

Hitting <mark style="color:red;">`/pushdata/sendnotification`</mark> endpoint ( Eg calling from FileMaker Server)

* Create a <mark style="color:red;">`POST`</mark> request to the following endpoint: <mark style="color:red;">`https://your.domain.com/pushdata/sendnotification`</mark>
* Set the <mark style="color:red;">`body`</mark> of the request will be as follows:

```json
{
    "apiKey": "BFAPI_YOUR_KEY",
    "body": "Hello from BF push notification!",
    "data": {
        "dateOfArrival_calc": "Date.now()",
        "path": "/"
    },
    "icon": "LINK_TO_YOUR_ICON",
    "title": "BF's New Feature!!!",
    "vibrate": [100, 50, 100],
    "filter": {
        "users": ["BF_USER_ID"]
    },
    "ttl": 300
}
```

{% hint style="warning" %}
The <mark style="color:red;">`filter`</mark> key is optional, only needed when push notifications should be sent only to specific users. General push notifications can be sent without the <mark style="color:red;">`filter`</mark> key. Another optional key is <mark style="color:red;">`ttl`</mark>, which defines how long a notification will stay alive if a user is offline (e.g.: ttl is set to 300 seconds, so if a user is offline, the notification will be delivered to the user if the user comes back online within 5 minutes). The default value set to ttl, if no value is passed, is 300 seconds.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klai.studio/engineering-reference-docs/creating-a-pwa/getting-started/sending-a-push-notification-from-the-api-endpoint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
