GET /api/v1/billing

The workspace's plan: trial, seats used and allowed, whether publishing is paused, and billing_url where a person pays. Read-only: paying is done by a workspace owner or admin in the dashboard

GET
/api/v1/billing

Authorization

BearerAuth
headerAuthorizationBearer <token>

API key sk_...

Response Body

{billing}

application/json
  1. response
billing?
Example Request
curl -X GET 'https://example.com/api/v1/billing'
Example Response
{  "billing": {    "enabled": true,    "state": "disabled",    "outbound": true,    "billing_url": "string",    "cardTrial": true,    "trial": {      "endsAt": "2019-08-24T14:15:22Z",      "daysLeft": 0,      "seats": 0,      "card": true,      "cancelAtPeriodEnd": true,      "maxSeats": 0    },    "seats": {      "used": 0,      "limit": 0,      "free": 0    },    "nextSeatMonthlyCents": 0,    "nextInvoice": {      "amountCents": 0,      "at": "2019-08-24T14:15:22Z"    },    "graceEndsAt": "2019-08-24T14:15:22Z",    "currentPeriodEnd": "2019-08-24T14:15:22Z",    "cancelAtPeriodEnd": true  }}

GET /api/v1/credits GET

Prepaid X credit: balance, the X API price list (X's price × markup, 1 by default) and the latest ledger entries. With X credit on, X calls are debited before they are sent, refunded when X refuses them (4xx), and refused with 402 insufficient_x_credit when the balance does not cover them

GET /api/v1/connect/{platform} GET

OAuth authorization URL for the account owner (valid 10 minutes, single use). Facebook: the owner picks Pages; the result may be a pending connection. WhatsApp: a Postgale page that runs Meta's Embedded Signup (several numbers → pending connection). Telegram has no OAuth: the answer is a one-time code (15 minutes) and instructions: a chat admin adds Postgale's bot as an admin with the right to post and sends /connect <code> in the channel or group (or forwards that channel post to the bot); the chat then appears in GET /api/v1/accounts and account.connected is emitted. Discord: a server admin installs Postgale's bot (scope bot) and picks channels, one account per channel (platformAccountId = channel id); POST /api/v1/connect/discord binds more channels of that server (without DISCORD_BOT_TOKEN the link creates a channel webhook instead, platformAccountId = webhook id). Mastodon needs instance (the server's domain; public DNS names only): Postgale registers itself on that server if needed and the link opens its authorization page (platformAccountId = <id>@<server>). Bluesky has no OAuth: POST {handle, appPassword} (a Bluesky app password, never the account password) connects the account right away and answers {platform, account}; a refused handle or password is a 400. Gated platforms (coming soon) that are not live on this instance answer 400; in production any other platform that is not live answers 503 provider_not_configured. LinkedIn: personal profiles by default; variant=pages (LinkedIn Company Pages) is coming soon and answers 400 while not enabled.