---
title: "Create portal session"
method: POST
path: "/customers/{customer_id}/portal_sessions"
tags: ["Customer"]
---

# Create portal session

`POST /customers/{customer_id}/portal_sessions`

Creates a portal session for the customer, returning a short-lived URL that provides
authenticated access to the customer's billing portal. The session expires after
`expires_in_minutes` (default 60, max 180). By default, creating a new session invalidates
any other active portal sessions for the customer; pass `invalidate_existing=false` to
allow concurrent sessions.

## Path parameters

- `customer_id` string, nullable, required

## Request body

- NewPortalSession
  - `expires_in_minutes` integer — Duration in minutes until the portal session expires. Defaults to 60. Maximum 180.
  - `invalidate_existing` boolean — When true (default), creating this session soft-deletes any other active portal sessions for the customer. Set to false to allow concurrent sessions — useful when minting portal links for multiple authenticated end-users at once. The customer's permanent portal link (if any) is never invalidated by this.

## Response `201`

Created

- PortalSession
  - `id` string, required
  - `customer_id` string, required
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, nullable, required
  - `url` string, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `409` — Conflict
- `413` — Content Too Large
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/withorb/apis/api-reference.md) · [All operations](https://skmtc.net/withorb/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/withorb/api-reference/versions/816dfe734e2e/schema)
