v1

latestOpenAPI 3.0.32026-07-264469137.7 KB
Customer sessions

Create a customer portal session

Creates a pre-authenticated customer portal session and returns the URL that opens it. The URL carries the session credential, so redirect the customer to it and do not log or share it. Sessions are short-lived; create a fresh one each time a customer asks to manage their billing. Requires the customers:write scope.

post/v1/customers/{customer_id}/portal-sessions

Path parameters

customer_idstring required

Response

Success

idstring required

The session identifier, prefixed with psn_. Use it to correlate a session with your own logs; it is not a credential and cannot be exchanged for access.

urlstring uri required

The URL that opens the portal as this customer. It carries the session credential, so it works on any device and must not be logged or shared.

Example response

{
  "id": "psn_9f2c4a7b1d3e",
  "url": "https://portal.bachs.io/s/6Yc0nQpR2vX1sK7fLbA9tE"
}