Update a device registration

PATCH /push/deviceRegistrations/{device_id}

Specific attributes of an existing registration can be updated. Only clientId, metadata and push.recipient are mutable.

Path parameters

Body

  • id string

    Unique identifier for the device generated by the device itself.

  • clientId string

    Optional trusted client identifier for the device.

  • Form factor of the push device.

    Values are phone, tablet, desktop, tv, watch, car, or embedded.

  • metadata object

    Optional metadata object for this device. The metadata for a device may only be set by clients with push-admin privileges and will be used more extensively in the future with smart notifications.

  • platform string

    Platform of the push device.

    Values are ios or android.

  • Secret value for the device.

  • Push recipient details for a device.

    Hide push.recipient attributes Show push.recipient attributes object
    • Defines which push platform is being used.

      Values are apns, fcm, or gcm.

    • when using APNs, specifies the required device token.

    • when using GCM or FCM, specifies the required registration token.

    • clientId string

      Client ID of recipient

    • deviceId string

      Client ID of recipient

Responses

  • OK

    Hide response attributes Show response attributes object
    • id string

      Unique identifier for the device generated by the device itself.

    • clientId string

      Optional trusted client identifier for the device.

    • Form factor of the push device.

      Values are phone, tablet, desktop, tv, watch, car, or embedded.

    • metadata object

      Optional metadata object for this device. The metadata for a device may only be set by clients with push-admin privileges and will be used more extensively in the future with smart notifications.

    • platform string

      Platform of the push device.

      Values are ios or android.

    • Secret value for the device.

    • Push recipient details for a device.

      Hide push.recipient attributes Show push.recipient attributes object
      • Defines which push platform is being used.

        Values are apns, fcm, or gcm.

      • when using APNs, specifies the required device token.

      • when using GCM or FCM, specifies the required registration token.

    • the current state of the push device.

      Values are Active, Failing, or Failed.

  • Error

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
PATCH /push/deviceRegistrations/{device_id}
curl \
 -X PATCH https://rest.ably.io/push/deviceRegistrations/{device_id} \
 -H "Content-Type: application/json" \
 -d '{"id":"string","clientId":"string","formFactor":"phone","metadata":{},"platform":"ios","deviceSecret":"string","push.recipient":{"transportType":"apns","deviceToken":"string","registrationToken":"string","clientId":"string","deviceId":"string"}}'
Request example
{
  "id": "string",
  "clientId": "string",
  "formFactor": "phone",
  "metadata": {},
  "platform": "ios",
  "deviceSecret": "string",
  "push.recipient": {
    "transportType": "apns",
    "deviceToken": "string",
    "registrationToken": "string",
    "clientId": "string",
    "deviceId": "string"
  }
}
Request examples
{
  "id": "string",
  "clientId": "string",
  "formFactor": "phone",
  "metadata": {},
  "platform": "ios",
  "deviceSecret": "string",
  "push.recipient": {
    "transportType": "apns",
    "deviceToken": "string",
    "registrationToken": "string",
    "clientId": "string",
    "deviceId": "string"
  }
}
Response examples (2XX)
{
  "id": "string",
  "clientId": "string",
  "formFactor": "phone",
  "metadata": {},
  "platform": "ios",
  "deviceSecret": "string",
  "push.recipient": {
    "transportType": "apns",
    "deviceToken": "string",
    "registrationToken": "string"
  },
  "push.state": "Active"
}
Response examples (2XX)
{
  "id": "string",
  "clientId": "string",
  "formFactor": "phone",
  "metadata": {},
  "platform": "ios",
  "deviceSecret": "string",
  "push.recipient": {
    "transportType": "apns",
    "deviceToken": "string",
    "registrationToken": "string"
  },
  "push.state": "Active"
}
Response examples (default)
# Headers
x-ably-errorcode: 42
x-ably-errormessage: string
x-ably-serverid: string

# Payload
{
  "message": "string",
  "code": 42,
  "statusCode": 42,
  "href": "string",
  "serverId": "string"
}
Response examples (default)
# Headers
x-ably-errorcode: 42
x-ably-errormessage: string
x-ably-serverid: string

# Payload
{
  "message": "string",
  "code": 42,
  "statusCode": 42,
  "href": "string",
  "serverId": "string"
}