> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quentli.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create customer portal session

> Generates a one-time authenticated URL that signs the customer into the portal at a supported destination.



## OpenAPI

````yaml /openapi.yaml post /v1/customer-portal-session
openapi: 3.0.3
info:
  title: Quentli REST API
  version: 1.0.0
  description: OpenAPI spec for Quentli REST endpoints.
servers:
  - url: https://api.quentli.com
    description: Production API
  - url: https://api.staging.quentli.com
    description: Staging API for production-like validation
  - url: https://api.demo.quentli.com
    description: Demo API hostname served by staging
security:
  - organizationApiKey: []
tags:
  - name: Auth
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
paths:
  /v1/customer-portal-session:
    post:
      tags:
        - Auth
      summary: Create customer portal session
      description: >-
        Generates a one-time authenticated URL that signs the customer into the
        portal at a supported destination.
      operationId: customer_portal_session_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerPortalSessionArgs'
      responses:
        '200':
          description: Customer portal session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomerPortalSessionPayload'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    CreateCustomerPortalSessionArgs:
      type: object
      properties:
        input:
          oneOf:
            - type: object
              properties:
                destination:
                  type: string
                  enum:
                    - home
                  description: Sends the customer to the customer portal home page.
                  example: home
                customerId:
                  type: string
                  description: Identifier of the customer to create a portal session for.
                  example: cus_1234567890abcdefghij
              required:
                - destination
                - customerId
              description: Home
            - type: object
              properties:
                destination:
                  type: string
                  enum:
                    - preferences
                  description: Sends the customer to the customer portal preferences page.
                  example: preferences
                customerId:
                  type: string
                  description: Identifier of the customer to create a portal session for.
                  example: cus_1234567890abcdefghij
              required:
                - destination
                - customerId
              description: Preferences
            - type: object
              properties:
                destination:
                  type: string
                  enum:
                    - invoice-checkout
                  description: >-
                    Sends the customer to the checkout page for a specific
                    invoice.
                  example: invoice-checkout
                customerId:
                  type: string
                  description: Identifier of the customer to create a portal session for.
                  example: cus_1234567890abcdefghij
                invoiceId:
                  type: string
                  description: Identifier of the invoice to send the customer to.
                  example: inv_1234567890abcdefghij
              required:
                - destination
                - customerId
                - invoiceId
              description: Invoice checkout
            - type: object
              properties:
                destination:
                  type: string
                  enum:
                    - subscription-home
                  description: >-
                    Sends the customer to the detail page for a specific
                    subscription.
                  example: subscription-home
                customerId:
                  type: string
                  description: Identifier of the customer to create a portal session for.
                  example: cus_1234567890abcdefghij
                subscriptionId:
                  type: string
                  description: Identifier of the subscription to send the customer to.
                  example: sub_1234567890abcdefghij
              required:
                - destination
                - customerId
                - subscriptionId
              description: Subscription home
      required:
        - input
      description: Request body for creating an authenticated customer portal session.
    CreateCustomerPortalSessionPayload:
      type: object
      properties:
        url:
          type: string
          description: Authenticated URL the customer can use to access the portal session.
          example: https://portal.example.com/l/abc123
      required:
        - url
      description: Response containing an authenticated customer portal session link.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'

````