---
title: "Create a Stripe Customer Portal session"
method: POST
path: "/api/billing/portal"
tags: ["Billing"]
---

# Create a Stripe Customer Portal session

`POST /api/billing/portal`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/billing/portal`
- Auth: HTTP bearer

Returns a short-lived URL for the Stripe Customer Portal — card changes, invoice history, manual cancellation. People only: an agent key gets 401 `session_required`, because the portal can cancel or switch the plan.

## Response `200`

Portal URL.

- object
  - `url` string, uri, required

## Other responses

- `400`: Stripe not configured.

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
