Skip to main content
@postqueen/node is a thin, typed wrapper over the Public API. Every method maps 1:1 to a REST endpoint.

Installation

Authentication

The SDK authenticates with your Public API key, sent as the Authorization header on every request. Get it from app.postqueen.aiSettingsDevelopersPublic APIReveal.

Quickstart

integrations() coming back with your channels means the key is valid and the client is pointed at the right host.

Constructor

Self-hosted instances pass their own backend URL, either through the second constructor argument or the POSTQUEEN_API_URL environment variable:
Set POSTQUEEN_API_URL once in the environment and every new PostQueen(...) in your codebase needs only the key.

Methods

integrations()

GET /public/v1/integrations. Returns the list of connected channels; use each channel’s id as integration.id when creating posts.

post(dto)

POST /public/v1/posts. Creates, schedules, or updates posts across one or more channels in a single call. settings is platform-specific and carries a __type discriminator (e.g. { __type: 'x', who_can_reply_post: 'everyone' }). Full schema and per-platform settings: Create Post.

postList(filters)

GET /public/v1/posts. Lists posts in a date range.

upload(file, extension)

POST /public/v1/upload (multipart). Uploads a media file and returns the hosted media object ({ id, path, ... }).
Media must be uploaded before posting. post() expects hosted media objects in value[].image, not raw files or base64, so upload first and pass the returned object straight through.

deletePost(id)

DELETE /public/v1/posts/{id}. Deletes a post by ID. Unlike the other methods, this returns the raw fetch Response object rather than parsed JSON.

Limits and error handling

The create-post endpoint is rate limited to 30 requests per hour. Batch multiple channels into a single post() call instead of one call per channel.
Except for deletePost(), methods return the parsed JSON body as-is, and the SDK does not throw on HTTP error statuses. Check the response for an error payload if a call misbehaves.

Next steps

API Overview

Authentication, rate limits, and error codes

Create Post

Full request schema and per-platform settings

List channels

The endpoint behind integrations(), and the id every post needs

Upload media

The multipart endpoint behind upload(), field by field