---
title: "Create portal session"
method: POST
path: "/api/v1/projects/{projectId}/consumers/{consumerId}/portal-sessions"
tags: ["Consumers"]
---

# Create portal session

`POST /api/v1/projects/{projectId}/consumers/{consumerId}/portal-sessions`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/projects/{projectId}/consumers/{consumerId}/portal-sessions`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Opens the customer portal for this consumer. The response carries the token once; only its hash is stored.

## Path parameters

- `projectId` string, uuid, required
- `consumerId` string, uuid, required

## Request body

- PortalSessionRequest
  - `ttlMinutes` integer: How long the session lasts, in minutes. Defaults to 60.
  - `allowedOrigin` string: The origin of the page that embeds the portal, e.g. https://app.example.com. When set, the portal refuses to render inside any other page.

## Response `201`

Session created

---

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