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

# Create Domain Popup Session

> Let a restaurant connect its domain in a popup inside your app

Guide: [Embedded domain connect](https://docs.minimo.it/embedded/domain-connect.md). Errors: [Errors and limits](https://docs.minimo.it/embedded/errors.md).


## OpenAPI

````yaml post /public/v1/domains/embed-sessions
openapi: 3.1.0
info:
  title: API Documentation
  description: Documentation for transactional and subscribe APIs
  version: 1.0.0
servers:
  - url: https://app.minimo.it
security:
  - bearerAuth: []
paths:
  /public/v1/domains/embed-sessions:
    servers:
      - url: https://api.minimo.it
    post:
      summary: Create domain popup session
      description: >-
        Call it from your backend. It adds the domain if needed and returns a
        one-time popup `url`. Your page opens it with
        `Minimo.openDomainConnect({ url })`: the restaurant sees the DNS
        records, the one-click setup when its provider supports it, and the live
        check, with no Minimo login. See [Embedded domain
        connect](/embedded/domain-connect).


        Set the allowed origins first with Update Domain Popup Settings.
      operationId: createDomainPopupSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain:
                  type: string
                  description: >-
                    The domain the restaurant connects. An existing domain of
                    your workspace is reused.
                  example: pizzeria-mario.example
                role:
                  type: string
                  enum:
                    - transactional
                    - marketing
                  default: transactional
                  description: Role if the domain is added now.
                tenant:
                  type: string
                  description: >-
                    Your reference for the restaurant. Sent back in every popup
                    event.
                  example: restaurant_4812
                locale:
                  type: string
                  enum:
                    - en
                    - it
                  default: en
                returnUrl:
                  type: string
                  description: >-
                    Where "Continue" goes when the popup is opened as a full
                    page. Must be on an allowed origin.
                  example: https://app.example.com/settings/email
                poweredBy:
                  type: boolean
                  default: true
                  description: Show the small Minimo line in the popup footer.
                expiresInMinutes:
                  type: integer
                  minimum: 5
                  maximum: 60
                  default: 30
                  description: Session lifetime.
              required:
                - domain
            example:
              domain: pizzeria-mario.example
              tenant: restaurant_4812
              locale: it
      responses:
        '201':
          description: The popup URL
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/DomainPopupSession'
              example:
                data:
                  sessionId: 6f1c…
                  url: https://api.minimo.it/public/v1/embed/domain#…
                  expiresAt: '2026-11-15T18:30:00.000Z'
                  domain:
                    id: 812
                    domain: pizzeria-mario.example
                    status: pending
                    created: true
        '400':
          description: >-
            `EMBED_ORIGINS_NOT_CONFIGURED`, `RETURN_URL_NOT_ALLOWED` or a domain
            that is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: >-
            `INVALID_TOKEN`: missing or wrong key, or a key without the
            **Domains** permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: The domain belongs to another workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: More than 120 sessions in an hour.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
      x-codeSamples:
        - label: cURL
          lang: bash
          source: |-
            curl --request POST \
              --url 'https://api.minimo.it/public/v1/domains/embed-sessions' \
              --header 'Authorization: Bearer YOUR_MINIMO_KEY' \
              --header 'Content-Type: application/json' \
              --data '{"domain": "pizzeria-mario.example", "tenant": "restaurant_4812", "locale": "it"}'
        - lang: JavaScript
          source: >-
            const res = await
            fetch('https://api.minimo.it/public/v1/domains/embed-sessions', {
              method: 'POST',
              headers: {
                Authorization: 'Bearer YOUR_MINIMO_KEY',
                'Content-Type': 'application/json',
              },
              body: JSON.stringify({"domain": "pizzeria-mario.example", "tenant": "restaurant_4812", "locale": "it"}),
            });

            const { data } = await res.json();

            console.log(data);
        - lang: Python
          source: |-
            import requests

            res = requests.post(
                'https://api.minimo.it/public/v1/domains/embed-sessions',
                headers={'Authorization': 'Bearer YOUR_MINIMO_KEY'},
                json={"domain": "pizzeria-mario.example", "tenant": "restaurant_4812", "locale": "it"},
            )
            print(res.status_code, res.text)
components:
  schemas:
    DomainPopupSession:
      type: object
      properties:
        sessionId:
          type: string
        url:
          type: string
          description: >-
            Open it with `Minimo.openDomainConnect({ url })`. It works once:
            create a new session to open the popup again.
        expiresAt:
          type: string
          format: date-time
        domain:
          type: object
          properties:
            id:
              type: integer
              example: 812
            domain:
              type: string
              example: pizzeria-mario.example
            status:
              type: string
              enum:
                - verified
                - pending
                - failed
            created:
              type: boolean
              description: '`true` when this call added the domain.'
          required:
            - id
            - domain
            - status
            - created
      required:
        - sessionId
        - url
        - expiresAt
        - domain
    ApiError:
      type: object
      properties:
        status:
          type: string
          example: FAIL
        message:
          type: string
          description: The error code to test in your code.
          example: INVALID_PARAMETERS
        userMessage:
          type: string
          description: >-
            When present, a sentence that says what to fix. You can show or log
            it.
          example: Set the origins allowed to embed the widgets first.
      description: >-
        Every error has this shape. See [Errors and limits](/embedded/errors)
        for every code.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: mn-API_CLIENT_ID-API_KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.