canonical: https://jentic.com/apis/pubnub.com/pubnub

# PubNub REST API

PubNub is a real-time messaging platform providing publish/subscribe messaging, presence detection, message storage, push notifications, access control, and channel group management via a REST API. The API exposes 30 endpoints.

## For AI agents

Programmatically publish a message to a channel (get), publish a message to a channel (post). Covers 30 operations.

## Scope

Does not handle payments, crm, or developer tools - use for communications only.

## Capabilities

- Publish a message to a channel (GET)
- Send a signal to a channel
- Subscribe to channels
- Here Now for a channel
- Global Here Now
- Where Now

## Use cases

### Communications Operations

Use the PubNub REST API to perform communications operations programmatically. The API provides 30 endpoints covering core functionality including publish a message to a channel (get), publish a message to a channel (post), send a signal to a channel.

Example prompt: Call GET /publish/{pub_key}/{sub_key}/0/{channel}/{callback}/{payload} to publish a message to a channel (get)

### Automated Publish Management

Automate publish operations by combining multiple PubNub REST API endpoints. Agents can publish a message to a channel (post) and then send a signal to a channel in a single workflow.

Example prompt: Call POST /publish/{pub_key}/{sub_key}/0/{channel}/{callback} to publish a message to a channel (post), then verify the result

### AI Agent Integration via Jentic

AI agents discover and call PubNub REST API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle none tokens manually.

Example prompt: Search Jentic for 'publish a message to a channel (get)', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /publish/{pub_key}/{sub_key}/0/{channel}/{callback}/{payload} | Publish a message to a channel (GET) |
| POST | /publish/{pub_key}/{sub_key}/0/{channel}/{callback} | Publish a message to a channel (POST) |
| GET | /signal/{pub_key}/{sub_key}/0/{channel}/0/{payload} | Send a signal to a channel |
| GET | /subscribe/{sub_key}/{channel}/{callback}/{timetoken} | Subscribe to channels |
| GET | /v2/presence/sub-key/{sub_key}/channel/{channel} | Here Now for a channel |
| GET | /v2/presence/sub-key/{sub_key} | Global Here Now |
| GET | /v2/presence/sub-key/{sub_key}/uuid/{uuid} | Where Now |
| GET | /v2/presence/sub-key/{sub_key}/channel/{channel}/uuid/{uuid} | Get presence state |

## Key resources

- **Publish** — Publish messages to channels
- **Subscribe** — Subscribe to channels and channel groups for real-time messages
- **Signal** — Send lightweight signals to channels
- **Presence** — Detect who is online, join/leave events, and user state
- **Storage & Playback** — Message history, fetch historical messages, delete messages, and message counts

## Why Jentic

- **Setup:** Wiring the PubNub REST API by hand means assembling its publish and subscribe URLs with your pub and sub keys and encoding channel names and payloads yourself. Through Jentic you install once, import the PubNub REST API from the API Directory, store the keys once, and your agent calls it.
- **Permission scoping:** PubNub puts the channel in the URL path (/publish/{pub_key}/{sub_key}/0/{channel}/...), so a rule can pin your agent to one channel: it can publish and read presence there and nothing else. You choose the operations it may call, so writes like publishing a message are not included unless you add them.
- **Credential handling:** Your PubNub publish and subscribe keys are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'publish a message to a channel' or 'read presence for a channel', and Jentic returns the matching PubNub operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Twilio** — Alternative communications API
- **Sendgrid** — Alternative communications API
- **Pusher** — Complementary communications API

## FAQ

### What authentication does the PubNub REST API use?

The PubNub REST API uses no authentication. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I publish a message to a channel (get) with the PubNub REST API?

Yes. Use the GET /publish/{pub_key}/{sub_key}/0/{channel}/{callback}/{payload} endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the PubNub REST API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I publish a message to a channel (get) through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'publish a message to a channel (get)'. Jentic returns the matching PubNub REST API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the PubNub REST API have?

The PubNub REST API exposes 30 endpoints covering publish, subscribe, signal operations.

### Can I limit what my agent is allowed to do with the PubNub REST API?

Yes. Jentic One runs self-hosted, so your own rules decide which PubNub operations and keys the agent may use. Because PubNub puts the channel in the URL path (/publish/{pub_key}/{sub_key}/0/{channel}/...), a rule can pin the agent to a single channel and to read-only presence lookups such as Here Now and Where Now. Write operations like publishing a message or sending a signal are excluded unless you explicitly add them, and your publish and subscribe keys stay under your control.
