---
title: "Creates a billing portal session."
method: POST
path: "/api/billing/portal"
tags: ["billing"]
---

# Creates a billing portal session.

`POST /api/billing/portal`

## Request

- Base URL: `https://api.pricklymails.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pricklymails.com/api/billing/portal`
- Auth: HTTP bearer

## Request body

- CreatePortalRequest: Request body for `POST /api/billing/portal`.
  - `return_url` string, required: URL the user is redirected to when they leave the billing portal.

## Response `200`

Hosted billing portal redirect URL.

- PortalSessionResponse: JSON response body for `POST /api/billing/portal`.
  - `url` string, required: Hosted billing portal URL to redirect the user to.

## Other responses

- `401`: Missing or invalid JWT.
- `404`: Caller has no billing account.
- `503`: Billing is not available.

---

[API](https://skmtc.dev/pricklymails/apis/pricklymails-api.md) · [All operations](https://skmtc.dev/pricklymails/apis/pricklymails-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pricklymails/apis/pricklymails-api/revisions/b4225a92d8fb?raw)
