API Reference

This section of the documentation contains the API references for Ably.

The following API references are available:

Depending on availability, an Ably client library SDK may support both a realtime interface and a REST interface. Some SDKs only provide a REST interface. You can check availability on the SDK page.

The realtime interface allows your client to both publish and subscribe to a channel, but the REST interface only allows you to publish to a channel. The REST interface can also be used for non-recurring operations such as obtaining statistics, or checking status. The REST interface has less resource impact, as it is much simpler than the realtime interface.

Typically the REST interface is used on the server, as the server’s main task is to authenticate clients, but does not usually need to subscribe to a channel to obtain realtime events.

API references generated from the source code are available for the realtime and REST client library SDKs. They have been generated for each SDK using tooling common to that language, such as Jazzy for Swift and Objective-C, and YARD for Ruby.

The API references generated from source code are structured by classes. The combined API references, featuring all languages, are organized by Ably features and strictly separate the realtime and REST interfaces.

The SDKs that have API references generated from source code are:

A raw REST API is also provided – you don’t need to install any SDK to use this. This is used where an Ably client library SDK is not available for your chosen platform, or you do not wish to use a client library SDK due to resource constraints.

The Ably Server-Sent Events API, and raw HTTP streaming API, provide a way to get a realtime stream of events from Ably in circumstances where using a full Ably Realtime client library, or even an MQTT library, is impractical due to resource constraints. HTTP streaming can be used where an SSE client is not supported.

Ably Control API is a REST API that enables you to manage your Ably account programmatically. The Control API also enables you to build web apps and command-line tools, to create and manage your Ably realtime infrastructure.

The API reference for the Spaces SDK is generated using TypeDoc. Spaces enables you to build collaborative environments in your applications, with features such as an avatar stack, live cursors and component locking.

In addition to the API references listed previously, our developer documentation also provides information on how these interfaces are used, and this covers key concepts such as connections, channels, messages and the pub/sub pattern. You can find that information on the following pages:

Client library SDKs