본문으로 건너뛰기

알림 답변

알림으로 질문하고 API에서 답변을 읽어 오세요. 사용자가 탭한 버튼이나 입력한 답장을 PushWard가 기록하므로 별도의 웹훅이 필요 없습니다.

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,
  "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.

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"
}
FieldDescription
notification_idThe notification the answer belongs to.
statuspending until the user answers, then answered.
action_idThe id of the action the user tapped. Set once answered.
textWhat the user typed, for a text_input action.
answered_atWhen the answer was recorded (RFC 3339, UTC).

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.

Rules

  • Only actions with no url and no foreground are recorded. A url-less foreground action still just opens the app, and an action with a url keeps 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 notifications at send or above, like sending the notification did.
  • A notification with nothing to record (none of its actions was url-less and silent), an unknown id and an answer past its 30 days all return 404 with code notification_answer.not_found.
  • Too many wait requests open at once for your account return 429 with code answer_wait.limit_exceeded. Retry shortly, or read without wait.
  • 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-less text_input action fails with 400 instead.
  • Scheduled notifications are recorded the same way. Read the answer with the notification_id a 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.

앱 버전 1.15.0에서 제공 예정

이 섹션은 App Store 심사를 기다리고 있는 앱 업데이트의 기능을 설명합니다. 업데이트가 출시되면 여기에서 자동으로 잠금 해제됩니다.

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.