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

# Create a portal session URL for a contact to manage their mailing list subscripitons

> Generates a new public URL for a contact with provided email to manage their mailing list subscriptions.



## OpenAPI

````yaml post /lists/portal_session
openapi: 3.0.3
info:
  title: IndiePitcher OpenAPI Spec
  description: >-
    ## Welcome


    IndiePitcher REST API allows you to send emails, manage your contacts, and
    generate portal session to manage user's contact lists.


    Please note that most destructive operations are currently not supported
    through the REST API for sesucurity reasons. Please use the [IndiePitcher
    dashboard](https://app.indiepitcher.com).


    ## Base URL

    All requests contain the following base URL:

    ```

    https://api.indiepitcher.com/v1

    ```


    ## Authentication


    - Create a free account at [IndiePitcher](https://app.indiepitcher.com) to
    get your API key. API keys are tied to a project.

    - After you've generated your API key you can use it to authenticate your
    requests by including it in the `Authorization` header.


    ```http

    Authorization: Bearer sc_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

    ```


    ## SDKs


    SDKs are available for the following languages:

    - [Node.js](https://github.com/IndiePitcher/indiepitcher-node)

    - [Swift](https://github.com/IndiePitcher/indiepitcher-swift) (server-side
    usage only)


    ## Rate Limits


    Rate limits are applied to all requests to the IndiePitcher API. The rate
    limits are as follows:

    - **10 requests per second across API keys tied to a project.**


    After reaching the rate limit, you will receive a `429 Too Many Requests`
    response. The rate limit will reset after 1 second. We recommend using
    endpoints that support batch operations to reduce the number of requests
    made.


    ## Quick Start Guide

    ### Send a simple email


    ```bash

    curl --request POST \
      --url https://api.indiepitcher.com/v1/email/transactional \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "to": "john@acme.com",
        "subject": "You have been invited to IndiePitcher",
        "body": "This is a sample body that supports **markdown**. Plain html is also supported.",
        "bodyFormat": "markdown"
      }'
    ```
  version: 1.2.0
  termsOfService: http://indiepitcher.com/terms
  contact:
    email: petr@indiepitcher.com
servers:
  - url: https://api.indiepitcher.com/v1
security: []
tags:
  - name: Email
  - name: Contacts
  - name: Mailing Lists
externalDocs:
  description: Find out more about IndiePitcher
  url: http://docs.indiepitcher.com
paths:
  /lists/portal_session:
    post:
      tags:
        - Mailing Lists
      summary: >-
        Create a portal session URL for a contact to manage their mailing list
        subscripitons
      description: >-
        Generates a new public URL for a contact with provided email to manage
        their mailing list subscriptions.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMailingListPortalSession'
        required: true
      responses:
        '200':
          description: >-
            The URL to redirect your user to, and the expiration date of the
            session.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/MailingListPortalSession'
      security:
        - apiKey: []
components:
  schemas:
    CreateMailingListPortalSession:
      type: object
      properties:
        contactEmail:
          type: string
          description: >-
            The email of a contact in your project's contact list, who to create
            the portal session for.
          example: john@acme.com
        returnURL:
          type: string
          description: >-
            URL to redirect the user to when they tap on that they're cone
            editing their lists, or when the session is expired.
          example: https://example.com/projects/123456/notification_settings
      required:
        - contactEmail
        - returnURL
    MailingListPortalSession:
      type: object
      properties:
        url:
          type: string
          description: The URL under which the user can manage their list subscriptions.
          example: https://api.indiepitcher/lists/session/jk3434kj34j43jk3k3h433g
        expiresAt:
          type: string
          description: Until when is the session valid
          example: '2024-08-28T08:39:17.887Z'
        returnURL:
          type: string
          description: >-
            URL to redirect the user to when they tap on that they're cone
            editing their lists, or when the session is expired.
          example: https://example.com/projects/123456/notification_settings
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````