---
title: "Publish a push notification to device(s)"
method: POST
path: "/push/publish"
tags: ["Push"]
---

# Publish a push notification to device(s)

`POST /push/publish`

A convenience endpoint to deliver a push notification payload to a single device or set of devices identified by their client identifier.

## Request body

- object
  - `recipient` Recipient, required — Push recipient details for a device.
    - `transportType` 'apns' | 'fcm' | 'gcm' | 'web' — Defines which push platform is being used.
    - `deviceToken` string — when using APNs, specifies the required device token.
    - `registrationToken` string — when using GCM or FCM, specifies the required registration token.
    - `encryptionKey` object — when using web push, specifies the required encryptionKey.
    - `clientId` string — Client ID of recipient
    - `deviceId` string — Client ID of recipient
  - `push` Push
    - `data` string — Arbitrary [key-value string-to-string payload](https://www.ably.io/documentation/general/push/publish#channel-broadcast-example).
    - `notification` Notification
      - `title` string — Title to display at the notification.
      - `body` string — Text below title on the expanded notification.
      - `icon` string — Platform-specific icon for the notification.
      - `sound` string — Platform-specific sound for the notification.
      - `collapseKey` string — Platform-specific, used to group notifications together.
    - `apns` object — Extends and overrides generic values when delivering via APNs. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)
      - `notification` Notification
        - `title` string — Title to display at the notification.
        - `body` string — Text below title on the expanded notification.
        - `icon` string — Platform-specific icon for the notification.
        - `sound` string — Platform-specific sound for the notification.
        - `collapseKey` string — Platform-specific, used to group notifications together.
    - `fcm` object — Extends and overrides generic values when delivering via GCM/FCM. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)
      - `notification` Notification
        - `title` string — Title to display at the notification.
        - `body` string — Text below title on the expanded notification.
        - `icon` string — Platform-specific icon for the notification.
        - `sound` string — Platform-specific sound for the notification.
        - `collapseKey` string — Platform-specific, used to group notifications together.
    - `web` object — Extends and overrides generic values when delivering via web. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)
      - `notification` Notification
        - `title` string — Title to display at the notification.
        - `body` string — Text below title on the expanded notification.
        - `icon` string — Platform-specific icon for the notification.
        - `sound` string — Platform-specific sound for the notification.
        - `collapseKey` string — Platform-specific, used to group notifications together.

## Response `2XX`

OK

## Other responses

- `default` — Error

## Changes

- **2024-06-24** (v1) `d9cf7e90bb58` — 12 info
  - added the new optional request property `recipient/encryptionKey` (media type: application/json)
  - added the new optional request property `recipient/encryptionKey` (media type: application/x-msgpack)
  - added the new optional request property `recipient/encryptionKey` (media type: application/x-www-form-urlencoded)
  - added the new optional request property `recipient/registrationToken/auth` (media type: application/json)
  - …8 more

[Change history](https://skmtc.dev/ably/apis/platform-api/changes/push/publish/post.md)

---

[API](https://skmtc.dev/ably/apis/platform-api.md) · [All operations](https://skmtc.dev/ably/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ably/platform-api/revisions/d9cf7e90bb58/schema)
