---
title: "Create Customer Session"
method: POST
path: "/v1/customer-sessions/"
tags: ["customer-sessions", "public"]
---

# Create Customer Session

`POST /v1/customer-sessions/`

Create a customer session.

For organizations with `member_model_enabled`, this will automatically
create a member session for the owner member of the customer.

**Scopes**: `customer_sessions:write`

## Request body

- union
  - CustomerSessionCustomerIDCreate — Schema for creating a customer session using a customer ID.
    - `member_id` string, uuid4, nullable — ID of the member to create a session for. When not provided and the organization has `member_model_enabled`, the owner member of the customer will be used for individual customers.
    - `external_member_id` string, nullable — External ID of the member to create a session for. Alternative to `member_id`.
    - `return_url` string, uri, nullable — When set, a back button will be shown in the customer portal to return to this URL.
    - `customer_id` string, uuid4, required — ID of the customer to create a session for.
  - CustomerSessionCustomerExternalIDCreate — Schema for creating a customer session using an external customer ID.
    - `member_id` string, uuid4, nullable — ID of the member to create a session for. When not provided and the organization has `member_model_enabled`, the owner member of the customer will be used for individual customers.
    - `external_member_id` string, nullable — External ID of the member to create a session for. Alternative to `member_id`.
    - `return_url` string, uri, nullable — When set, a back button will be shown in the customer portal to return to this URL.
    - `external_customer_id` string, required — External ID of the customer to create a session for.

## Response `201`

Customer session created.

- CustomerSession — A customer session that can be used to authenticate as a customer.
  - `created_at` string, date-time, required — Creation timestamp of the object.
  - `modified_at` string, date-time, nullable, required — Last modification timestamp of the object.
  - `id` string, uuid4, required — The ID of the object.
  - `token` string, required
  - `expires_at` string, date-time, required
  - `return_url` string, nullable, required
  - `customer_portal_url` string, required
  - `customer_id` string, uuid4, required
  - `customer` Customer, required — unresolved $ref

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/polar/apis/polar-api.md) · [All operations](https://skmtc.net/polar/apis/polar-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/polar/polar-api/revisions/f9688fd328d6/schema)
