PostEverywhere Auth API
Device-grant login and browser OAuth handoff: connect social accounts from CLIs, servers, and AI agents without a dashboard session.
Device-grant login and browser OAuth handoff: connect social accounts from CLIs, servers, and AI agents without a dashboard session.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/posteverywhere-ai:posteverywhere-ai-auth-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: PostEverywhere API Reference Auth API
version: 1.0.1
description: 'Public v1 API for PostEverywhere: schedule and publish content across
13 platforms: X (Twitter), Google Business Profile, Instagram, Facebook, LinkedIn, YouTube,
TikTok, Threads, Pinterest, Bluesky, Telegram, Discord and WordPress.
New here? Start with the Quick Start (first post in 5
minutes) and Authentication. Platform-specific
behavior lives in the Platform Guides, and
media constraints in Media Requirements.
## Authentication
All endpoints (except the device-login pair under `/auth/device`) accept an
API key in the `Authorization` header:
```
Authorization: Bearer pe_live_...
```
Keys are created in the dashboard (Developers) or minted by the CLI device
flow (`POST /auth/device` → `POST /auth/device/token`). Keys carry scopes
(`read`, `write`, `ai`); each operation''s required scope is noted via
`x-scope`. A missing scope returns `403 insufficient_scope`. A browser
session cookie also works as a fallback for interactive testing; scopes are
then implicitly `read, write, ai` and API-key rate limits are skipped.
Auth failures return `401` with codes `invalid_api_key`, `api_key_revoked`,
or `api_key_expired`. Organizations without an active subscription receive
`402 subscription_required` (the error object additionally carries
`subscription_status`).
## Response envelope
Every endpoint responds with the same JSON envelope: a `data` object, an
`error` object and a `meta` object (`meta.request_id`, an 8-character
correlation id, and `meta.timestamp`, ISO 8601). On success `error` is
`null`. On failure `data` is `null` and `error` carries `message`, `code`
(for example `validation_error`), `retryable` and an optional `details`
object.
`error.retryable` is `true` for transient failures (HTTP 5xx and 429) and
`false` for permanent ones; clients should not blindly retry 4xx.
Exception: the auth layer''s own 401/402 responses omit `retryable` and
`meta.request_id` (they carry only `meta.timestamp`).
## Rate limiting
API keys are limited to 60 requests/minute and 1,000 requests/hour.
When the API-key limit is hit the `429` response includes
`X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`
(unix seconds) headers. Every `429` (including posting-budget and
AI-budget limits, which are separate from the API-key limit) includes a
`Retry-After` header (seconds, default 30).
Posting budgets (per user): immediate publishes 60/min, 200/hour,
1,000/day; scheduled posts 100/min, 1,000/hour with no daily cap.
Media uploads: 500/hour, 2,500/day, counted when an upload finishes
(`/media/ID/complete`, a direct upload, or `/media/upload-from-url`),
not at presign.
X: scheduled posts are limited to 100 a day per organisation. A post over
the limit is held and sent when the window reopens; it is not failed.
During a free trial each X account can post 15 times a day.
## Timestamps
All timestamps are ISO 8601. `scheduled_for` request values without an
explicit offset are interpreted as UTC. The `timezone` field is display
metadata only. It never changes when a post fires.'
contact:
name: PostEverywhere Developers
url: https://posteverywhere.ai/docs
servers:
- url: https://app.posteverywhere.ai/api/v1
description: Production
security:
- apiKey: []
tags:
- name: Auth
description: 'Device-grant login and browser OAuth handoff: connect social accounts from CLIs, servers, and AI agents without a dashboard session.'
paths:
/auth/device:
post:
operationId: startDeviceAuth
x-scope: none
security: []
tags:
- Auth
summary: Start a device-grant login (RFC 8628 style)
description: 'UNAUTHENTICATED. Show the returned `user_code` and
`verification_uri` to the user; they approve in a logged-in browser.
Then poll `POST /auth/device/token` every `interval` seconds. Codes
expire after `expires_in` seconds (15 min). Per-IP rate limited.'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
client_name:
type: string
maxLength: 100
description: Shown as the API key name, e.g. "CLI on jamie-macbook"
responses:
'200':
description: Device code allocated
content:
application/json:
schema:
type: object
required:
- data
- error
- meta
properties:
data:
type: object
required:
- device_code
- user_code
- verification_uri
- expires_in
- interval
properties:
device_code:
type: string
user_code:
type: string
description: Human-typable code, format XXXX-XXXX
verification_uri:
type: string
format: uri
verification_uri_complete:
type: string
format: uri
expires_in:
type: integer
const: 900
interval:
type: integer
const: 5
error:
type: 'null'
meta:
$ref: '#/components/schemas/Meta'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
/auth/device/token:
post:
operationId: pollDeviceToken
x-scope: none
security: []
tags:
- Auth
summary: Poll a device login and mint the API key on approval
description: 'UNAUTHENTICATED. Poll every 5 s with the `device_code`. Non-terminal
states return 200 with `status` of `pending` or `slow_down`
(includes `interval`). Terminal: `expired`, `denied`, or
`authorized`. On the first poll after browser approval the response
carries the plaintext `api_key` (scopes read/write/ai, no expiry)
EXACTLY ONCE. Persist it immediately; subsequent polls return
`expired`.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- device_code
properties:
device_code:
type: string
minLength: 32
responses:
'200':
description: Poll result
content:
application/json:
schema:
type: object
required:
- data
- error
- meta
properties:
data:
type: object
required:
- status
properties:
status:
type: string
enum:
- pending
- slow_down
- expired
- denied
- authorized
interval:
type: integer
description: Present with slow_down
api_key:
type: string
description: pe_live_... plaintext key, returned once, only with status=authorized
api_key_id:
type: string
format: uuid
scopes:
type: array
items:
type: string
organization_id:
type: string
format: uuid
user:
type: object
properties:
id:
type: integer
email:
type: string
name:
type:
- string
- 'null'
error:
type: 'null'
meta:
$ref: '#/components/schemas/Meta'
'400':
$ref: '#/components/responses/BadRequest'
'500':
$ref: '#/components/responses/ServerError'
/auth/social-connect/start:
post:
operationId: startSocialConnect
x-scope: write
tags:
- Auth
summary: Start a browser OAuth connect session
description: 'Requires an API key (session fallback rejected with
`401 api_key_required`). For the browser-OAuth platforms (instagram,
facebook, threads, x, linkedin, tiktok, youtube, pinterest) this
returns the dashboard''s OAuth-start `authorize_url` to open in a
logged-in browser, plus a `session_id` to poll. Headless platforms
(bluesky, telegram, discord) are rejected with
`400 use_headless_endpoint`; POST credentials to their dedicated
endpoints instead. `mode: reconnect` requires `account_id`.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- platform
properties:
platform:
type: string
enum:
- instagram
- facebook
- threads
- x
- linkedin
- tiktok
- youtube
- pinterest
- google_business
mode:
type: string
enum:
- connect
- reconnect
default: connect
account_id:
type: integer
description: Required for mode=reconnect
responses:
'200':
description: Session started
content:
application/json:
schema:
type: object
required:
- data
- error
- meta
properties:
data:
type: object
required:
- session_id
- authorize_url
- expires_in
- interval
properties:
session_id:
type: string
format: uuid
authorize_url:
type: string
format: uri
expires_in:
type: integer
const: 900
interval:
type: integer
const: 3
error:
type: 'null'
meta:
$ref: '#/components/schemas/Meta'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/PaymentRequired'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
/auth/social-connect/poll/{session_id}:
get:
operationId: pollSocialConnect
x-scope: read
tags:
- Auth
summary: Poll a connect session until the browser OAuth completes
description: 'Requires the SAME API key that started the session. Resolves to
`completed` (with the connected `account`) once an account for the
session''s platform appears (or, for reconnect, the target account''s
token refreshes) after the session started. Other statuses:
`pending`, `expired`, `cancelled`.'
parameters:
- name: session_id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Session status
content:
application/json:
schema:
type: object
required:
- data
- error
- meta
properties:
data:
type: object
required:
- status
properties:
status:
type: string
enum:
- pending
- completed
- expired
- cancelled
account:
type:
- object
- 'null'
properties:
id:
type: integer
platform:
type: string
account_name:
type: string
avatar_url:
type:
- string
- 'null'
error:
type: 'null'
meta:
$ref: '#/components/schemas/Meta'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/PaymentRequired'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
/auth/social-connect/bluesky:
post:
operationId: connectBluesky
x-scope: write
tags:
- Auth
summary: Connect a Bluesky account (headless, app password)
description: 'Requires an API key. Use an App Password (Bluesky Settings → App
Passwords), not the login password (`401 auth_failed` otherwise).
Errors: `validation_error`, `account_limit_reached` (403),
`already_connected` (409: account belongs to another organization).'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- handle
- app_password
properties:
handle:
type: string
description: e.g. alice.bsky.social (leading @ tolerated)
app_password:
type: string
responses:
'200':
description: Connected
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectCompletedEnvelope'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/PaymentRequired'
'403':
$ref: '#/components/responses/Forbidden'
'409':
description: Account already connected to another organization
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
/auth/social-connect/telegram:
post:
operationId: connectTelegram
x-scope: write
tags:
- Auth
summary: Connect a Telegram channel (headless, bot token)
description: 'Requires an API key. The bot (from @BotFather) must be an
administrator of the channel with Post Messages enabled
(`400 bot_not_admin` otherwise, with setup instructions). `channel`
accepts "@name" or a numeric chat ID. Provider errors are mapped to
specific codes; upstream Telegram failures return 502.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- bot_token
- channel
properties:
bot_token:
type: string
channel:
type: string
description: '@mychannel or numeric chat id'
responses:
'200':
description: Connected
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectCompletedEnvelope'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/PaymentRequired'
'403':
$ref: '#/components/responses/Forbidden'
'409':
description: Channel already connected to another organization
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
'502':
description: Telegram API unreachable
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
/auth/social-connect/discord:
post:
operationId: connectDiscord
x-scope: write
tags:
- Auth
summary: Connect a Discord channel (headless, webhook URL)
description: 'Requires an API key. Create the webhook in Discord under Server
Settings → Integrations → Webhooks and paste its URL. Invalid URLs
return `401 auth_failed`.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- webhook_url
properties:
webhook_url:
type: string
format: uri
responses:
'200':
description: Connected
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectCompletedEnvelope'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/PaymentRequired'
'403':
$ref: '#/components/responses/Forbidden'
'409':
description: Channel already connected to another organization
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
components:
schemas:
Meta:
type: object
description: Response metadata. request_id is an 8-char correlation id (absent on auth-layer 401/402).
properties:
request_id:
type: string
timestamp:
type: string
format: date-time
required:
- timestamp
ErrorBody:
type: object
required:
- message
properties:
message:
type: string
code:
type: string
description: Machine-readable error code (e.g. validation_error, not_found, rate_limit_exceeded)
retryable:
type: boolean
description: true for transient failures (5xx, 429). Absent on auth-layer 401/402 errors.
details:
description: Optional structured context specific to the error code
subscription_status:
type: string
description: Present only on 402 subscription_required
additionalProperties: true
ConnectCompletedEnvelope:
type: object
required:
- data
- error
- meta
properties:
data:
$ref: '#/components/schemas/ConnectedAccountResult'
error:
type: 'null'
meta:
$ref: '#/components/schemas/Meta'
ConnectedAccountResult:
type: object
required:
- status
- account
properties:
status:
type: string
const: completed
account:
type: object
properties:
id:
type: integer
platform:
type: string
account_name:
type: string
avatar_url:
type:
- string
- 'null'
is_update:
type: boolean
description: true when an existing connection was refreshed rather than newly created
ErrorEnvelope:
type: object
required:
- data
- error
- meta
properties:
data:
type: 'null'
error:
$ref: '#/components/schemas/ErrorBody'
meta:
$ref: '#/components/schemas/Meta'
responses:
BadRequest:
description: Validation error; see error.code and error.details
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
data: null
error:
message: account_ids is required and must be a non-empty array. Use GET /accounts to find your account IDs.
code: account_ids_required
retryable: false
meta:
request_id: 1a2b3c4d
timestamp: '2026-07-08T09:00:00.000Z'
NotFound:
description: Resource not found in your organization/workspace (not_found)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
data: null
error:
message: Post not found. Verify the post ID belongs to your organization.
code: not_found
retryable: false
meta:
request_id: 1a2b3c4d
timestamp: '2026-07-08T09:00:00.000Z'
RateLimited:
description: 'Rate limit exceeded (rate_limit_exceeded, or plan budgets
post_limit_reached / daily_limit_reached on schedulePost). All 429s
carry Retry-After. The API-key limiter additionally sets the
X-RateLimit-* headers and error.details (limit, remaining, reset_at).
'
headers:
Retry-After:
description: Seconds to wait before retrying
schema:
type: integer
X-RateLimit-Limit:
description: Requests allowed in the window (API-key limiter only)
schema:
type: integer
X-RateLimit-Remaining:
description: Requests remaining (API-key limiter only)
schema:
type: integer
X-RateLimit-Reset:
description: Unix seconds when the window resets (API-key limiter only)
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
data: null
error:
message: API rate limit exceeded (60 requests/min). Please slow down.
code: rate_limit_exceeded
retryable: true
details:
limit: 60
remaining: 0
reset_at: '2026-07-08T09:01:00.000Z'
meta:
request_id: 1a2b3c4d
timestamp: '2026-07-08T09:00:00.000Z'
PaymentRequired:
description: 'No active subscription (code subscription_required; the error object
also carries subscription_status), or insufficient AI credits
(insufficient_credits) / paid plan required (upgrade_required).
'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
data: null
error:
message: Your free trial has ended. Please upgrade to a paid plan to continue using the API.
code: subscription_required
subscription_status: expired
meta:
timestamp: '2026-07-08T09:00:00.000Z'
Forbidden:
description: API key missing the required scope (insufficient_scope), storage quota exceeded (storage_quota_exceeded), or account limit reached (account_limit_reached)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
data: null
error:
message: 'API key missing required scope: ''write''. Your key has scopes: [read]'
code: insufficient_scope
retryable: false
details:
required_scope: write
current_scopes:
- read
meta:
request_id: 1a2b3c4d
timestamp: '2026-07-08T09:00:00.000Z'
ServerError:
description: Internal error (internal_error and endpoint-specific 5xx codes). Retryable.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
data: null
error:
message: Failed to create post. Verify content, account_ids, and optional media_ids/scheduled_for are valid, then retry.
code: internal_error
retryable: true
meta:
request_id: 1a2b3c4d
timestamp: '2026-07-08T09:00:00.000Z'
Unauthorized:
description: 'Missing/invalid/revoked/expired API key (codes invalid_api_key,
api_key_revoked, api_key_expired, api_key_required, auth_failed).
Auth-layer 401s omit error.retryable and meta.request_id.
'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
data: null
error:
message: 'Invalid API key format. Expected: Bearer pe_live_...'
code: invalid_api_key
meta:
timestamp: '2026-07-08T09:00:00.000Z'
securitySchemes:
apiKey:
type: http
scheme: bearer
bearerFormat: pe_live_...
description: 'API key created in the dashboard (Developers) or via the device-login
flow. Keys start with `pe_live_` and carry scopes (read, write, ai);
only a SHA-256 hash is stored server-side. See each operation''s
`x-scope` for the scope it requires.
'