canonical: https://jentic.com/apis/googleapis.com/pubsub-lite

# Google Pub/Sub Lite API

Google Cloud Pub/Sub Lite is a zonal, partition-based messaging service that offers lower per-message cost than Pub/Sub at the expense of zonal availability and explicit partition and capacity management. The admin API exposes topics, subscriptions, reservations, and partition statistics, while the cursor and topicStats APIs let consumers manage commit positions and inspect lag and throughput. Pub/Sub Lite is well suited for log ingestion, event archival, and telemetry pipelines that can tolerate zonal scope in exchange for predictable economics.

## For AI agents

Manage Google Cloud Pub/Sub Lite topics, subscriptions, reservations, and partition cursors for cost-efficient zonal streaming workloads.

## Scope

Does not handle global multi-region messaging, push subscription delivery, or schema-validated topics - use for zonal partition-based streaming, capacity reservations, and cursor management only.

## Capabilities

- Create and configure Pub/Sub Lite topics with explicit partition counts and per-partition throughput
- Create subscriptions on a topic with delivery and backlog retention settings
- Manage reservations to share throughput capacity across multiple topics
- Inspect partition statistics, message backlog, and consumer lag for a topic
- Commit cursor positions for subscriptions to track consumer progress
- Seek subscriptions to a published time or starting offset for replay

## Use cases

### Cost-Efficient Log Ingestion

Pub/Sub Lite ingests application logs and telemetry at lower cost than Pub/Sub by trading global delivery for zonal partition-based throughput. Operators size partitions to expected throughput, attach subscriptions for downstream consumers, and use reservations to amortize capacity across topics.

Example prompt: Create a topic with 4 partitions and 4 MiB/s publish capacity per partition, then create a subscription named app-logs-archive for downstream archival.

### Backlog Monitoring and Capacity Sizing

Operators monitor partition statistics and consumer lag to spot under-provisioned consumers and to decide when to scale partition counts. The topicStats and admin APIs expose backlog size and committed cursor positions per partition so dashboards can be built without polling consumers directly.

Example prompt: Compute backlog by partition for subscription telemetry-sub and alert when any partition has more than 60 seconds of unacked messages.

### Replay and Reprocessing Pipelines

When a downstream consumer ships bad logic or a sink fails, operators rewind a Pub/Sub Lite subscription to a prior publish time and reprocess the affected window. The seek operation on the admin API issues this rewind without disturbing other subscriptions on the same topic.

Example prompt: Call seek on subscription orders-archive-sub with target publish_time set to one hour before the bad deploy to re-emit messages from that window.

### Agent-Driven Streaming Operations

An ops agent uses Jentic to inspect Pub/Sub Lite lag, scale partitions, and trigger replays in response to alerts, so on-call engineers can resolve issues by describing intent rather than memorizing admin API paths.

Example prompt: Search Jentic for seek a pubsub lite subscription, load the schema for the admin seek operation, and execute it with the publish_time payload.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v1/admin/{+parent}/topics | List Pub/Sub Lite topics under a parent |
| GET | /v1/admin/{+parent}/subscriptions | List subscriptions in a parent |
| GET | /v1/admin/{+parent}/reservations | List reservations in a parent |
| GET | /v1/admin/{+name}/partitions | Get partition information for a topic |
| POST | /v1/admin/{+name}:seek | Seek a subscription to a publish time or offset |
| POST | /v1/admin/{+name}:cancel | Cancel a long-running operation |

## Key resources

- **topics** — Partition-based topics with explicit throughput and storage capacity
- **subscriptions** — Consumer subscriptions with backlog retention and delivery settings
- **reservations** — Shared throughput capacity pools across topics in a region
- **partitions** — Per-topic partitions with their own publish, deliver, and storage limits
- **cursor** — Committed cursor positions tracking consumer progress per partition
- **topicStats** — Backlog and throughput statistics per topic and partition

## Why Jentic

- **Setup:** Wiring the Pub/Sub Lite API by hand means setting up Google OAuth 2.0, minting scoped access tokens, and threading zonal topic, subscription, and reservation resource names through the admin endpoints on pubsublite.googleapis.com. Through Jentic you install once, import the Pub/Sub Lite API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** This API puts the topic and subscription in the URL path (/v1/admin/{+name} and /v1/admin/{+parent}/topics), so a rule can pin your agent to one topic or subscription: it can list and inspect within that scope and nothing else. You choose the operations it may call, so state-changing ones like seeking a subscription or cancelling an operation are not included unless you add them.
- **Credential handling:** Your Google OAuth credential is stored once, encrypted, by your own Jentic One instance and a scoped access token is injected at execution time. The credential never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a Pub/Sub Lite topic' or 'inspect partition lag', and Jentic returns the matching Pub/Sub Lite admin or topicStats operation with its input schema so the agent calls the right endpoint without parsing the discovery doc.

## Related APIs

- **Cloud Pub/Sub API** — Globally distributed, autoscaled messaging service with push subscriptions and schemas
- **Cloud Dataflow API** — Stream and batch processing engine that consumes Pub/Sub Lite topics
- **BigQuery API** — Analytics warehouse that ingests Pub/Sub Lite-derived event streams

## FAQ

### What authentication does the Pub/Sub Lite API use?

The API uses Google OAuth 2.0 with the cloud-platform scope, sent as a Bearer token. Through Jentic the OAuth credentials live in the vault and short-lived access tokens are minted per call so the refresh token never enters the agent context.

### How is Pub/Sub Lite different from Pub/Sub?

Pub/Sub Lite is zonal and partition-based with explicitly provisioned throughput, which makes it cheaper but means topics live in a single zone and consumers must understand partitions. Pub/Sub is regional or global, autoscaled, and supports push subscriptions and schemas, but at higher per-message cost.

### What are the rate limits for the Pub/Sub Lite API?

Throughput is governed by per-topic and per-partition publish and subscribe capacity, expressed in MiB/s, that you allocate at topic creation or via reservations. Admin API calls themselves are subject to standard Google Cloud project quotas.

### How do I seek a subscription back in time through Jentic?

Search Jentic for seek a pubsub lite subscription, load the schema for the admin subscriptions seek operation which maps to POST /v1/admin/{+name}:seek, and execute it with a publish_time or starting offset payload.

### Is the Pub/Sub Lite API free?

No, Pub/Sub Lite is billed by reserved publish and subscribe throughput per partition and by stored bytes. Pricing is published on the Google Cloud Pub/Sub Lite pricing page; you pay for capacity even when topics are idle, which is the trade-off for the lower per-message cost.

### How do I see how far behind a consumer is?

Use the topicStats endpoints to fetch backlog size per partition and the cursor endpoints to see committed offsets. Subtracting committed offset from head offset gives a per-partition lag in messages.

### Can I limit what my agent is allowed to do with the Pub/Sub Lite API?

Yes. Because your Jentic One instance is self-hosted, your own rules decide which Pub/Sub Lite operations and credentials the agent may use. Since the topic and subscription live in the URL path (/v1/admin/{+parent}/topics and /v1/admin/{+name}), you can pin the agent to a single topic or subscription and allow only read operations like listing topics or inspecting partition statistics. State-changing calls such as seeking a subscription (/v1/admin/{+name}:seek) or cancelling an operation stay out of scope unless you explicitly grant them.
