> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreflux.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Pushover

> Client-mode REST API connector for a curated Pushover Message API v1 slice: send notifications (incl. emergency priority), validate user keys, poll receipts, list sounds, and update glances widgets

Technical Preview

## Overview

A client-mode connector for a **curated messaging** slice of the [Pushover Message API](https://pushover.net/api):

| Catalog connector event | Entity / path | Notes |
| - | - | - |
| POST messages.json | `POST /messages.json` | Push alert; `priority=2` + `retry`/`expire` for critical alarms |
| GET receipts/\{id}.json | `GET /receipts/{receipt_id}.json` | Poll emergency acknowledgement |
| POST glances.json | `POST /glances.json` | Live KPI text/count on glances widgets |
| POST users/validate.json (smoke) | `POST /users/validate.json` | Credential check → `status: 1` + devices |
| GET sounds.json | `GET /sounds.json` | Built-in (+ custom) sound list |

Default `BASE_ADDRESS` is `https://api.pushover.net/1`. Topics use `messaging/pushover/<object>/<verb>`.

> [!NOTE]
>
> Auth is **not** OAuth: include application `token` (APP\_TOKEN) and recipient `user` (USER\_KEY) in the JSON body for POSTs, or `token` as a query parameter for GETs. Prefer Hub secrets `PUSHOVER_API_TOKEN` (alias `PUSHOVER_APP_TOKEN`) and `PUSHOVER_USER_KEY`. Status remains blocked until an authenticated live smoke succeeds.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
# Coreflux REST_API template — Pushover Message API v1
# Auth: token + user in JSON body / query (no Authorization header)
# BASE_ADDRESS: https://api.pushover.net/1

DEFINE ROUTE PushoverRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://api.pushover.net/1"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Sendmessage
        WITH SOURCE_TOPIC "messaging/pushover/message/send"
        WITH DESTINATION_TOPIC "messaging/pushover/message/send/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/messages.json"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Validateuser
        WITH SOURCE_TOPIC "messaging/pushover/user/validate"
        WITH DESTINATION_TOPIC "messaging/pushover/user/validate/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/users/validate.json"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
    ADD EVENT Getreceipt
        WITH SOURCE_TOPIC "messaging/pushover/receipt/get"
        WITH DESTINATION_TOPIC "messaging/pushover/receipt/get/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/receipts/{value.json.receipt_id}.json?token={value.json.token}"
        WITH HEADERS
            ADD "Accept" "application/json"
    ADD EVENT Listsounds
        WITH SOURCE_TOPIC "messaging/pushover/sound/list"
        WITH DESTINATION_TOPIC "messaging/pushover/sound/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/sounds.json?token={value.json.token}"
        WITH HEADERS
            ADD "Accept" "application/json"
    ADD EVENT Updateglance
        WITH SOURCE_TOPIC "messaging/pushover/glance/update"
        WITH DESTINATION_TOPIC "messaging/pushover/glance/update/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/glances.json"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
        WITH BODY "{payload}"
```

## Events

| Event | Method | Endpoint | Request topic | Response topic |
| - | - | - | - | - |
| Sendmessage | POST | `/messages.json` | `messaging/pushover/message/send` | `messaging/pushover/message/send/response` |
| Validateuser | POST | `/users/validate.json` | `messaging/pushover/user/validate` | `messaging/pushover/user/validate/response` |
| Getreceipt | GET | `/receipts/{receipt_id}.json` | `messaging/pushover/receipt/get` | `messaging/pushover/receipt/get/response` |
| Listsounds | GET | `/sounds.json` | `messaging/pushover/sound/list` | `messaging/pushover/sound/list/response` |
| Updateglance | POST | `/glances.json` | `messaging/pushover/glance/update` | `messaging/pushover/glance/update/response` |

## Auth

1. [Register an application](https://pushover.net/apps/build) to get an API token (`APP_TOKEN`). Copy your user key from the [Pushover dashboard](https://pushover.net/).
2. Set connector `BASE_ADDRESS` to `https://api.pushover.net/1`.
3. Pass `token` and `user` on MQTT JSON payloads for POSTs. For GETs, pass `token` (and `receipt_id` for Getreceipt) so query/path placeholders resolve.
4. Store secrets in Hub / `GET SECRET "PUSHOVER_API_TOKEN"` and `GET SECRET "PUSHOVER_USER_KEY"`. Never commit real credentials.
5. Successful validate/send returns **HTTP 200** with `status: 1`. Emergency (`priority: 2`) responses include a `receipt` for polling.

## Example payloads

**validateUser (smoke):**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "token": "YOUR_PUSHOVER_API_TOKEN",
  "user": "YOUR_PUSHOVER_USER_KEY"
}
```

**sendMessage (high priority):**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "token": "YOUR_PUSHOVER_API_TOKEN",
  "user": "YOUR_PUSHOVER_USER_KEY",
  "title": "Coreflux alarm — Zone A",
  "message": "RMS exceeded limit on Zone A",
  "priority": 1,
  "sound": "siren"
}
```

**sendMessage (emergency / priority 2):**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "token": "YOUR_PUSHOVER_API_TOKEN",
  "user": "YOUR_PUSHOVER_USER_KEY",
  "title": "CRITICAL — Zone A trip",
  "message": "Emergency stop engaged. Acknowledge required.",
  "priority": 2,
  "retry": 60,
  "expire": 1800,
  "sound": "persistent"
}
```

**listSounds:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "token": "YOUR_PUSHOVER_API_TOKEN"
}
```

**getReceipt:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "token": "YOUR_PUSHOVER_API_TOKEN",
  "receipt_id": "YOUR_30_CHAR_RECEIPT"
}
```

**updateGlance:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "token": "YOUR_PUSHOVER_API_TOKEN",
  "user": "YOUR_PUSHOVER_USER_KEY",
  "title": "Zone A",
  "text": "vibration_rms",
  "subtext": "12.4",
  "count": 3,
  "percent": 82
}
```

## Install

1. The template ships with the broker. List it with `-listTemplates` or fetch it from the Hub catalog.
2. Deploy with `-addRoute` from `PushoverRestApi.lot` (not `hub-metadata.lot`).

## See also

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API Apps](/latest/lot-language/routes/rest-api-apps)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.