Skip to main content
The REST API is the most straightforward way to integrate with Placet. Send HTTP requests to create messages, request human reviews, and poll for responses. Works from any language, any environment — no persistent connections or public endpoints required. This is the recommended connection type for scripts, CLI tools, serverless functions, and any agent that runs as a short-lived process.

Authentication

All API requests require an API key passed in the x-api-key header:
API keys are created in the Placet dashboard under Settings > API Keys. They always start with hp_.

Sending Messages

Informational Messages

Send status updates, logs, reports, or any content that doesn’t require a response. Messages support full markdown.
Status indicators: info (blue), success (green), warning (yellow), error (red)

Messages with Reviews

Send a message that requires human interaction:
See Review Types for all available review types and their payloads.

Streaming Replies

For agents that produce a reply token-by-token, Placet supports a draft-then-update model:
  1. Start the draftPOST /api/v1/messages with streamId (a stable id for this turn), streamState: "streaming", and the partial text so far. The response contains the persisted message id.
  2. Append updatesPATCH /api/v1/messages/streams/:streamId with the latest accumulated text whenever new tokens arrive. Throttle these to a few per second; the WebSocket message:delta event drives instant UI updates between PATCH calls.
  3. FinalisePATCH /api/v1/messages/streams/:streamId with the final text and complete: true. The frontend stops treating the row as a live draft and pins it back into chronological order.
The (channelId, streamId) pair is unique, so the first POST is idempotent: a retried POST returns the existing draft rather than creating a duplicate row. Refreshing the chat mid-stream redisplays whatever has been PATCHed so far — the streamed reply never disappears on reload.

Long-Polling

The simplest way to wait for a human response. Your agent sends a request and blocks until the human responds (or the poll times out).

Usage

Parameters

Response States

A single poll waits up to 30 seconds. For reviews that may take minutes or hours, simply loop the poll call. The review stays active until the human responds or it expires.

Python Example


TypeScript Example


Delivery Acknowledgment

Acknowledge that your agent received and processed a message. This updates the delivery status shown in the Placet dashboard (WhatsApp-style checkmarks).

API Endpoints

For the full API reference with request/response schemas, see the REST API Reference.