Ably History API

The History API from Ably — 2 operation(s) for history.

Operations 2

GET /channels/{channel_id}/messages Get message history for a channel #
GET /channels/{channel_id}/presence/history Get presence history of a channel #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ably-history-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ably-history-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Platform History API
  description: The [REST API specification](https://www.ably.io/documentation/rest-api) for Ably.
  version: 1.1.1
  contact:
    name: Ably Support
    url: https://www.ably.io/contact
    email: support@ably.io
servers:
- url: https://rest.ably.io
security:
- basicAuth: []
- bearerAuth: []
tags:
- name: History
paths:
  /channels/{channel_id}/messages:
    parameters:
    - $ref: '#/components/parameters/versionHeader'
    - $ref: '#/components/parameters/responseFormat'
    get:
      summary: Get message history for a channel
      operationId: getMessagesByChannel
      tags:
      - History
      description: Get message history for a channel
      parameters:
      - $ref: '#/components/parameters/channelId'
      - $ref: '#/components/parameters/filterStart'
      - $ref: '#/components/parameters/filterLimit'
      - $ref: '#/components/parameters/filterEnd'
      - $ref: '#/components/parameters/filterDirection'
      responses:
        2XX:
          description: OK
          headers:
            link:
              $ref: '#/components/headers/Link'
            x-ably-serverid:
              $ref: '#/components/headers/ServerId'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Message'
            application/x-msgpack:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Message'
            text/html:
              schema:
                type: string
        default:
          description: Error
          headers:
            x-ably-errorcode:
              $ref: '#/components/headers/ErrorCode'
            x-ably-errormessage:
              $ref: '#/components/headers/ErrorMessage'
            x-ably-serverid:
              $ref: '#/components/headers/ServerId'
  /channels/{channel_id}/presence/history:
    parameters:
    - $ref: '#/components/parameters/versionHeader'
    - $ref: '#/components/parameters/responseFormat'
    get:
      summary: Get presence history of a channel
      operationId: getPresenceHistoryOfChannel
      description: Get presence on a channel
      tags:
      - History
      parameters:
      - $ref: '#/components/parameters/channelId'
      - $ref: '#/components/parameters/filterStart'
      - $ref: '#/components/parameters/filterLimit'
      - $ref: '#/components/parameters/filterEnd'
      - $ref: '#/components/parameters/filterDirection'
      responses:
        2XX:
          description: OK
          headers:
            link:
              $ref: '#/components/headers/Link'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PresenceMessage'
            application/x-msgpack:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PresenceMessage'
            text/html:
              schema:
                type: string
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    filterEnd:
      name: end
      in: query
      schema:
        type: string
        default: now
    responseFormat:
      in: query
      name: format
      schema:
        type: string
        enum:
        - json
        - jsonp
        - msgpack
        - html
      description: The response format you would like
    filterStart:
      name: start
      in: query
      schema:
        type: string
    channelId:
      name: channel_id
      in: path
      schema:
        type: string
      required: true
      description: The [Channel's ID](https://www.ably.io/documentation/rest/channels).
    filterDirection:
      name: direction
      in: query
      schema:
        type: string
        default: backwards
        enum:
        - forwards
        - backwards
    versionHeader:
      in: header
      name: X-Ably-Version
      schema:
        type: string
      description: The version of the API you wish to use.
    filterLimit:
      name: limit
      in: query
      schema:
        type: integer
        default: '100'
  schemas:
    Error:
      type: object
      description: Returned error from failed REST.
      properties:
        message:
          type: string
          description: Message explaining the error's cause.
        code:
          type: integer
          description: Error code.
        statusCode:
          type: integer
          description: Status error code.
        href:
          type: string
          description: Link to help with error.
        serverId:
          type: string
          description: Server ID with which error was encountered.
    Message:
      type: object
      description: Message object.
      properties:
        name:
          description: The event name, if provided.
          type: string
        data:
          description: The string encoded payload, with the encoding specified below.
          type: string
        id:
          description: A Unique ID that can be specified by the publisher for [idempotent publishing](https://www.ably.io/documentation/rest/messages#idempotent).
          type: string
          readOnly: true
        timestamp:
          description: Timestamp when the message was received by the Ably, as milliseconds since the epoch.
          type: integer
          format: int64
          readOnly: true
        encoding:
          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.
          type: string
        clientId:
          description: The [client ID](https://www.ably.io/documentation/core-features/authentication#identified-clients) of the publisher of this message.
          type: string
        connectionId:
          description: The connection ID of the publisher of this message.
          type: string
        extras:
          $ref: '#/components/schemas/Extras'
    Extras:
      type: object
      description: Extras object. Currently only allows for [push](https://www.ably.io/documentation/general/push/publish#channel-broadcast-example) extra.
      properties:
        push:
          $ref: '#/components/schemas/Push'
    Push:
      type: object
      properties:
        data:
          description: Arbitrary [key-value string-to-string payload](https://www.ably.io/documentation/general/push/publish#channel-broadcast-example).
          type: string
        notification:
          $ref: '#/components/schemas/Notification'
        apns:
          description: Extends and overrides generic values when delivering via APNs. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)
          type: object
          properties:
            notification:
              $ref: '#/components/schemas/Notification'
        fcm:
          description: Extends and overrides generic values when delivering via GCM/FCM. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)
          type: object
          properties:
            notification:
              $ref: '#/components/schemas/Notification'
        web:
          description: Extends and overrides generic values when delivering via web. [See examples](https://www.ably.io/documentation/general/push/publish#payload-structure)
          type: object
          properties:
            notification:
              $ref: '#/components/schemas/Notification'
    PresenceMessage:
      type: object
      properties:
        id:
          description: Unique ID assigned by Ably to this presence update.
          type: string
          readOnly: true
        action:
          description: The event signified by a PresenceMessage.
          type: string
          enum:
          - ABSENT
          - PRESENT
          - ENTER
          - LEAVE
          - UPDATE
          readOnly: true
        data:
          description: The presence update payload, if provided.
          type: string
        clientId:
          description: The client ID of the publisher of this presence update.
          type: string
        connectionId:
          description: The connection ID of the publisher of this presence update.
          type: string
        timestamp:
          description: Timestamp when the presence update was received by Ably, as milliseconds since the epoch.
          type: integer
          format: int64
          readOnly: true
        encoding:
          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.
          type: string
        extras:
          $ref: '#/components/schemas/Extras'
    Notification:
      type: object
      properties:
        title:
          description: Title to display at the notification.
          type: string
        body:
          description: Text below title on the expanded notification.
          type: string
        icon:
          description: Platform-specific icon for the notification.
          type: string
        sound:
          description: Platform-specific sound for the notification.
          type: string
        collapseKey:
          description: Platform-specific, used to group notifications together.
          type: string
  headers:
    ServerId:
      description: The ID for the server communicated with.
      schema:
        type: string
      required: true
    ErrorCode:
      description: The error code.
      schema:
        type: integer
    Link:
      description: Links to related resources, in the format defined by [RFC 5988](https://tools.ietf.org/html/rfc5988#section-5). This will potentially include a link with relation type `next`, `first`, and `current`, where appropiate.
      schema:
        type: string
        pattern: (<(.*)?>; rel=\"(first|current|last)?\",)*(<(.*)?>; rel=\"(first|current|last)?\")+
      required: true
    ErrorMessage:
      description: The error message.
      schema:
        type: string
  responses:
    Error:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
        application/x-msgpack:
          schema:
            $ref: '#/components/schemas/Error'
        text/html:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        x-ably-errorcode:
          $ref: '#/components/headers/ErrorCode'
        x-ably-errormessage:
          $ref: '#/components/headers/ErrorMessage'
        x-ably-serverid:
          $ref: '#/components/headers/ServerId'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Basic Authentication using an [API key](https://www.ably.io/documentation/core-features/authentication#basic-authentication).
    bearerAuth:
      type: http
      scheme: bearer
      description: Token Authentication using an [Ably Token](https://www.ably.io/documentation/core-features/authentication#basic-authentication), or optionally an [Ably JWT](https://www.ably.io/documentation/core-features/authentication#ably-jwt-process).