Billing

Upgrade plan (Pro or Scale)

Upgrade or switch to a paid plan. Behavior depends on principal type:

  • HUMAN (session cookie): one-call execution. The Settings UI click is itself the consent signal.
  • AGENT (DK key): a plan switch, or a same-plan call while a downgrade is scheduled, returns { status: "approval_required", approval_url, polling_url, expires_at }. The agent prints the approval URL in chat; only the org owner can approve it, and the agent polls /api/web-approve/status. confirm_token and mode are ignored.

Fast paths (both principal types): no existing subscription returns a Checkout URL; same-plan + scheduled-cancel resumes; design-partner orgs no-op at Scale.

post/api/billing/upgrade

Request

  • Base URL
    https://trydock.ai
  • Auth
    HTTP bearer

Request body

plan'pro' | 'scale'

Target plan. Defaults to pro.

confirm_tokenstring

Ignored. Agents always get a web approval; people execute directly.

mode'chat' | 'web'

Ignored. Agents always get a web approval; people execute directly.

Response

Discriminated by status: switched | resumed | checkout-required | approval_required | design-partner.

plan'free' | 'pro' | 'scale'

Plan tier. Caps live in src/lib/plan.ts.

statusstring required
checkoutUrlstring uri
targetPlan'pro' | 'scale'
messagestring
approval_urlstring uri

Agents only: the page the org owner opens to approve.

polling_urlstring uri
expires_atstring

Changes

No recorded changes to this operation across all 2 revisions of this API.