Respuestas a notificaciones
Haz una pregunta en una notificación y lee la respuesta desde la API. PushWard registra qué botón pulsó el usuario o qué respuesta escribió, así que no necesitas un webhook propio.
Send an action without a url, and without foreground, and PushWard records the tap itself: which action the user chose, and when. Add text_input: true to the same kind of action and the user can type a reply, which is recorded
with it. Your code then reads the answer from GET /notifications/answers/{id}.
curl -X POST https://api.pushward.app/notifications \
-H "Authorization: Bearer hlk_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Deploy to production?",
"body": "Build 1.11.0 passed staging.",
"source": "ci",
"actions": [
{ "id": "deploy", "title": "Deploy", "icon": "checkmark.circle" },
{ "id": "hold", "title": "Hold", "icon": "pause.circle", "destructive": true },
{
"id": "note",
"title": "Reply",
"icon": "arrowshape.turn.up.left",
"text_input": true,
"text_input_placeholder": "Why hold?"
}
]
}'The response is the notification, with answerable: true when the server will record the
answer. Keep its id:
{
"id": 1234,
"title": "Deploy to production?",
"body": "Build 1.11.0 passed staging.",
"source": "ci",
"actions": [
{ "id": "deploy", "title": "Deploy", "icon": "checkmark.circle" },
...
],
"answerable": true,
"answer_cursor": "57",
"pushed": true,
"created_at": "2026-09-28T12:00:00Z",
"delivery": "all"
}The actions in the response are the ones you sent. The links PushWard adds to record the
answer go only to your devices. answer_cursor is for reading answers from the answer stream.
Read the answer
curl "https://api.pushward.app/notifications/answers/1234?wait=25" \
-H "Authorization: Bearer hlk_YOUR_TOKEN"{
"notification_id": 1234,
"status": "answered",
"action_id": "note",
"text": "Waiting for the database migration.",
"answered_at": "2026-09-28T12:03:41Z"
}| Field | Description |
|---|---|
notification_id | The notification the answer belongs to. |
status | pending until the user answers, then answered. |
action_id | The id of the action the user tapped. Set once answered. |
text | What the user typed, for a text_input action. |
answered_at | When the answer was recorded (RFC 3339, UTC). |
collapse_id, thread_id | The ones the notification was sent with, when it had them. |
Without wait the request returns right away. With ?wait=N (0-25 seconds) it is
held open while the answer is pending and returns as soon as it lands; if the time runs out
first it returns with status: "pending". Repeat the request to wait longer. Agents on the MCP server can call wait_for_answer with the notification_id, which does this for them.
From Home Assistant, pushward.get_notification_answer does the same inside an automation. It
keeps waiting for as long as its timeout allows (up to 24 hours) and hands action_id and text to the next step. See Home Assistant for an example.
The answer stream
Code that asks many questions, such as an automation hub, a chat bot or a deploy pipeline, should not hold one
request open per notification. GET /notifications/answers returns the answers recorded after a
cursor, oldest first, with the cursor to pass next, so one loop sees every answer to the notifications your key
sent. Prefer it to polling GET /notifications/answers/{id} for each one. The Home
Assistant integration's pushward_notification_action event (0.55.0 and later) is built on it.
Call it once without after. That first response holds no answers, only the current cursor, so a new
reader starts from now instead of replaying the 30 days of answers PushWard keeps:
curl "https://api.pushward.app/notifications/answers" \
-H "Authorization: Bearer hlk_YOUR_TOKEN"{ "items": [], "cursor": "57" }Then wait for what comes after it:
curl "https://api.pushward.app/notifications/answers?after=57&wait=25" \
-H "Authorization: Bearer hlk_YOUR_TOKEN"{
"items": [
{
"notification_id": 1234,
"status": "answered",
"action_id": "note",
"text": "Waiting for the database migration.",
"answered_at": "2026-09-28T12:03:41Z",
"collapse_id": "deploy-1-11-0",
"thread_id": "deploys"
}
],
"cursor": "58"
}| Parameter | Description |
|---|---|
after | The cursor of your previous response. Leave it out on the first call. A cursor is an opaque
string: store it as it is. A malformed one is a 400 with cursor.invalid. |
wait | 0-25 seconds to hold the request open while nothing has arrived after the cursor. It returns as soon as an answer lands, or with no items and the same cursor when the time runs out. Ignored on the first call. |
limit | 1-100 answers per response, 100 by default. When a page comes back full, call again at once with its cursor. |
Each item has the shape of GET /notifications/answers/{id}, always with status: "answered". The stream carries no action title and none of the notification's text, so
match on notification_id, action_id or the collapse_id you sent. Store
the cursor after every response to pick up where you left off after a restart; answers older than 30 days are
gone by then.
Not missing an answer
Take the first cursor when the reader is set up, before it sends anything it waits for. A reader that already
holds a cursor keeps reading from it. A reader with no cursor yet takes the answer_cursor of its
first answerable send (a POST /notifications response with answerable: true) as its
cursor and keeps it; the answer_cursor of later sends adds nothing. Cursors are opaque and never
compared. A scheduled send's response has no answer_cursor: its answers come after it fires, so a cursor taken when you scheduled it covers
them.
Who sees what
- An integration key reads only answers to notifications it sent. For an organization key that is every member's answer to its sends.
- Waits on the stream have a limit of their own, apart from the single answer's
?wait: two at a time per integration key, and a limit per server. Past either, the call is a429withanswer_wait.limit_exceededandretry_after_ms. Retry after it, or call withoutwait. - Reading the stream needs
notificationsatsendor above, like sending did.
From the CLI and MCP
The CLI reads the stream with pushward notification answers (CLI
1.8.0 and later). Without --after it prints only the current cursor. --after takes the
cursor to read from, --wait 10m blocks until at least one answer comes in and exits 7 if
none does, and --limit sets the page size (1-100). --follow keeps reading and prints the
answers as they come in, one JSON page per line when piped, until you stop it; it then prints the cursor to resume
from on stderr. It rides out network errors, 5xx responses and rate limits, waiting 2 seconds at first
and doubling up to 30, with a line on stderr for each retry (none with -q). A key or cursor the server
refuses, or a used-up quota, ends it with the CLI's usual exit code.
cursor=$(pushward notification answers --jq .cursor)
api=$(pushward notify --title "Deploy api?" --body v2.4.0 --action go=Go --jq .id)
web=$(pushward notify --title "Deploy web?" --body v2.4.0 --action go=Go --jq .id)
pushward notification answers --after "$cursor" --follow \
--jq ".items[] | select(.notification_id == $api or .notification_id == $web)"The stream holds the answers to everything the key sent, so another script on the same key shows up in it too:
keep the id of each send and skip the rest, as the filter above does. To wait for a single
notification, pushward notify --wait or pushward notification answer <id> --wait 5m is simpler. The GitHub Action refuses --follow, which never ends.
On the MCP server (pushward-mcp 1.20.0 and later) the same call is list_notification_answers. It takes after (the cursor, passed as the string it came
as), wait_seconds (0-25, ignored without after) and limit (1-100), and
returns {"items", "cursor"} like the endpoint. An agent keeps one cursor for its whole loop,
however many questions it sends; for one notification, wait_for_answer is simpler.
Rules
- Only actions with no
urland noforegroundare recorded. A url-lessforegroundaction still just opens the app, and an action with aurlkeeps calling that URL and is never recorded. One notification can mix all three. - The first answer wins. Once one device has answered, later taps on any device change nothing.
- Answers are kept for 30 days.
- An integration key can read only answers to notifications it sent. Reading an answer needs
notificationsatsendor above, like sending the notification did. - A notification with nothing to record (none of its actions was url-less and silent), an unknown
idand an answer past its 30 days all return404with codenotification_answer.not_found. - Too many
waitrequests open at once for your account return429with codeanswer_wait.limit_exceeded. Retry shortly, or read withoutwait. - The recording links count toward the 4 KB push payload. If a long notification leaves no room for them,
plain url-less actions go out unrecorded and the response has no
answerable; a url-lesstext_inputaction fails with400instead. - Scheduled notifications are recorded the same way. Read
the answer with the
notification_ida sent schedule reports; each send of a repeating schedule is its own notification with its own answer.
Versions of the PushWard iOS app before 1.5 show a text_input action as a plain button. The
tap is still recorded, without text.
Esta sección describe una función de una actualización de la app que está pendiente de revisión en App Store. Se desbloquea aquí automáticamente en cuanto la actualización esté disponible.
The app shows the recorded answer on the notification's detail and marks the notification Needs Reply or Answered in the list; see In the app.
For a question that should stay on the Lock Screen until someone answers it, use an approval Live Activity. Its url-less options are recorded
the same way, and GET /activities/{slug}?wait=25 waits for the answer.