Ably Platform

Real-time messaging and pub/sub platform

ably.com/docs/api ↗
Version
1.1.0
OpenAPI
3.0.1
Endpoints
22
Schemas
14
Updated
3 days ago
Infrastructure realtime messaging pubsub
Use this API in your AI agent

Query structured spec data via REST or MCP. Get exactly what your agent needs.

Get API Key

Server URLs

https://rest.ably.io

Authentication

basic bearer

Endpoints

Clear filters

Push 1 endpoints

PUT /push/deviceRegistrations/{device_id}

Device registrations can be upserted (the existing registration is replaced entirely) with a PUT operation. Only clientId, metadata and push.recipient are mutable.

operationId: putPushDeviceDetails

Parameters

Name In Required Type Description
optional

Request Body

{
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/DeviceDetails"
      }
    },
    "application/x-msgpack": {
      "schema": {
        "$ref": "#/components/schemas/DeviceDetails"
      }
    },
    "application/x-www-form-urlencoded": {
      "schema": {
        "$ref": "#/components/schemas/DeviceDetails"
      }
    }
  }
}

Responses

default
2XX OK
PUT /push/deviceRegistrations/{device_id}

Schemas

object ChannelDetails
{
  "type": "object",
  "required": [
    "channelId"
  ],
  "properties": {
    "region": {
      "type": "string",
      "description": "In events relating to the activity of a channel in a specific region, this optionally identifies the region."
    },
    "status": {
      "$ref": "#/components/schemas/ChannelStatus"
    },
    "channelId": {
      "type": "string",
      "description": "The required name of the channel including any qualifier, if any."
    },
    "isGlobalMaster": {
      "type": "boolean",
      "description": "In events relating to the activity of a channel in a specific region, this optionally identifies whether or not that region is responsible for global coordination of the channel."
    }
  }
}
object ChannelStatus
{
  "type": "object",
  "required": [
    "isActive"
  ],
  "properties": {
    "isActive": {
      "type": "boolean",
      "description": "A required boolean value indicating whether the channel that is the subject of the event is active. For events indicating regional activity of a channel this indicates activity in that region, not global activity."
    },
    "occupancy": {
      "$ref": "#/components/schemas/Occupancy"
    }
  },
  "description": "A ChannelStatus instance."
}
object DeviceDetails
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the device generated by the device itself."
    },
    "clientId": {
      "type": "string",
      "description": "Optional trusted client identifier for the device."
    },
    "metadata": {
      "type": "object",
      "description": "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": {
      "enum": [
        "ios",
        "android"
      ],
      "type": "string",
      "description": "Platform of the push device."
    },
    "formFactor": {
      "enum": [
        "phone",
        "tablet",
        "desktop",
        "tv",
        "watch",
        "car",
        "embedded"
      ],
      "type": "string",
      "description": "Form factor of the push device."
    },
    "push.state": {
      "enum": [
        "Active",
        "Failing",
        "Failed"
      ],
      "type": "string",
      "readOnly": true,
      "description": "the current state of the push device."
    },
    "deviceSecret": {
      "type": "string",
      "description": "Secret value for the device."
    },
    "push.recipient": {
      "$ref": "#/components/schemas/Recipient"
    }
  }
}
object Error
{
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "description": "Error code."
    },
    "href": {
      "type": "string",
      "description": "Link to help with error."
    },
    "message": {
      "type": "string",
      "description": "Message explaining the error's cause."
    },
    "serverId": {
      "type": "string",
      "description": "Server ID with which error was encountered."
    },
    "statusCode": {
      "type": "integer",
      "description": "Status error code."
    }
  },
  "description": "Returned error from failed REST."
}
object Extras
{
  "type": "object",
  "properties": {
    "push": {
      "$ref": "#/components/schemas/Push"
    }
  },
  "description": "Extras object. Currently only allows for [push](https://www.ably.io/documentation/general/push/publish#channel-broadcast-example) extra."
}
object Message
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true,
      "description": "A Unique ID that can be specified by the publisher for [idempotent publishing](https://www.ably.io/documentation/rest/messages#idempotent)."
    },
    "data": {
      "type": "string",
      "description": "The string encoded payload, with the encoding specified below."
    },
    "name": {
      "type": "string",
      "description": "The event name, if provided."
    },
    "extras": {
      "$ref": "#/components/schemas/Extras"
    },
    "clientId": {
      "type": "string",
      "description": "The [client ID](https://www.ably.io/documentation/core-features/authentication#identified-clients) of the publisher of this message."
    },
    "encoding": {
      "type": "string",
      "description": "This will typically be empty as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute will contain the remaining transformations not applied to the data payload."
    },
    "timestamp": {
      "type": "integer",
      "format": "int64",
      "readOnly": true,
      "description": "Timestamp when the message was received by the Ably, as milliseconds since the epoch."
    },
    "connectionId": {
      "type": "string",
      "description": "The connection ID of the publisher of this message."
    }
  },
  "description": "Message object."
}
object Notification
{
  "type": "object",
  "properties": {
    "body": {
      "type": "string",
      "description": "Text below title on the expanded notification."
    },
    "icon": {
      "type": "string",
      "description": "Platform-specific icon for the notification."
    },
    "sound": {
      "type": "string",
      "description": "Platform-specific sound for the notification."
    },
    "title": {
      "type": "string",
      "description": "Title to display at the notification."
    },
    "collapseKey": {
      "type": "string",
      "description": "Platform-specific, used to group notifications together."
    }
  }
}
object Occupancy
{
  "type": "object",
  "properties": {
    "publishers": {
      "type": "integer",
      "description": "The number of connections attached to the channel that are authorised to publish."
    },
    "subscribers": {
      "type": "integer",
      "description": "The number of connections attached that are authorised to subscribe to messages."
    },
    "presenceMembers": {
      "type": "integer",
      "description": "The number of members currently entered into the presence channel."
    },
    "presenceConnections": {
      "type": "integer",
      "description": "The number of connections that are authorised to enter members into the presence channel."
    },
    "presenceSubscribers": {
      "type": "integer",
      "description": "The number of connections that are authorised to subscribe to presence messages."
    }
  },
  "description": "An Occupancy instance indicating the occupancy of a channel. For events indicating regional activity of a channel this indicates activity in that region, not global activity."
}
object PresenceMessage
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true,
      "description": "Unique ID assigned by Ably to this presence update."
    },
    "data": {
      "type": "string",
      "description": "The presence update payload, if provided."
    },
    "action": {
      "enum": [
        "ABSENT",
        "PRESENT",
        "ENTER",
        "LEAVE",
        "UPDATE"
      ],
      "type": "string",
      "readOnly": true,
      "description": "The event signified by a PresenceMessage."
    },
    "extras": {
      "$ref": "#/components/schemas/Extras"
    },
    "clientId": {
      "type": "string",
      "description": "The client ID of the publisher of this presence update."
    },
    "encoding": {
      "type": "string",
      "description": "This will typically be empty as all presence updates received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute will contain the remaining transformations not applied to the data payload."
    },
    "timestamp": {
      "type": "integer",
      "format": "int64",
      "readOnly": true,
      "description": "Timestamp when the presence update was received by Ably, as milliseconds since the epoch."
    },
    "connectionId": {
      "type": "string",
      "description": "The connection ID of the publisher of this presence update."
    }
  }
}
object Push
{
  "type": "object",
  "properties": {
    "fcm": {
      "type": "object",
      "properties": {
        "notification": {
          "$ref": "#/components/schemas/Notification"
        }
      },
      "description": "Extends and overrides generic values when delivering via GCM/FCM. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)"
    },
    "web": {
      "type": "object",
      "properties": {
        "notification": {
          "$ref": "#/components/schemas/Notification"
        }
      },
      "description": "Extends and overrides generic values when delivering via web. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)"
    },
    "apns": {
      "type": "object",
      "properties": {
        "notification": {
          "$ref": "#/components/schemas/Notification"
        }
      },
      "description": "Extends and overrides generic values when delivering via APNs. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)"
    },
    "data": {
      "type": "string",
      "description": "Arbitrary [key-value string-to-string payload](https://www.ably.io/documentation/general/push/publish#channel-broadcast-example)."
    },
    "notification": {
      "$ref": "#/components/schemas/Notification"
    }
  }
}
object Recipient
{
  "type": "object",
  "properties": {
    "clientId": {
      "type": "string",
      "writeOnly": true,
      "description": "Client ID of recipient"
    },
    "deviceId": {
      "type": "string",
      "writeOnly": true,
      "description": "Client ID of recipient"
    },
    "deviceToken": {
      "type": "string",
      "description": "when using APNs, specifies the required device token."
    },
    "transportType": {
      "enum": [
        "apns",
        "fcm",
        "gcm"
      ],
      "type": "string",
      "description": "Defines which push platform is being used."
    },
    "registrationToken": {
      "type": "string",
      "description": "when using GCM or FCM, specifies the required registration token."
    }
  },
  "description": "Push recipient details for a device."
}
object SignedTokenRequest
{
  "allOf": [
    {
      "$ref": "#/components/schemas/TokenRequest"
    },
    {
      "type": "object",
      "required": [
        "mac"
      ],
      "properties": {
        "mac": {
          "type": "string",
          "description": "A signature, generated as an HMAC of each of the above components, using the key secret value."
        }
      }
    }
  ]
}
object TokenDetails
{
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "The Ably Token."
    },
    "issued": {
      "type": "integer",
      "description": "Timestamp of token creation."
    },
    "expires": {
      "type": "integer",
      "description": "Timestamp of token expiration."
    },
    "keyName": {
      "type": "string",
      "description": "Name of the key used to create the token"
    },
    "capability": {
      "type": "string",
      "description": "Regular expression representation of the capabilities of the token."
    }
  }
}
object TokenRequest
{
  "type": "object",
  "required": [
    "keyName",
    "capability",
    "timestamp",
    "nonce"
  ],
  "properties": {
    "nonce": {
      "type": "string",
      "description": "An unquoted, un-escaped random string of at least 16 characters. Used to ensure the Ably TokenRequest cannot be reused."
    },
    "keyName": {
      "type": "string",
      "example": "xVLyHw.LMJZxw",
      "description": "Name of the key used for the TokenRequest. The keyName comprises of the app ID and key ID on an API Key."
    },
    "clientId": {
      "type": "string",
      "description": "The [client ID](https://www.ably.io/documentation/core-features/authentication#identified-clients) to be assosciated with the token. Can be set to * to allow for any client ID to be used."
    },
    "timestamp": {
      "type": "integer",
      "description": "Time of creation of the Ably TokenRequest."
    },
    "capability": {
      "type": "object",
      "example": {
        "channel1": [
          "publish",
          "subscribe"
        ]
      },
      "description": "The [capabilities](https://www.ably.io/documentation/core-features/authentication#capabilities-explained) (i.e. a set of channel names/namespaces and, for each, a set of operations) which should be a subset of the set of capabilities associated with the key specified in keyName."
    }
  }
}