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

# Create Hosted Session

> Create a new hosted session for the organization associated with the API key.



## OpenAPI

````yaml POST /api/v1/hosted/sessions
openapi: 3.1.0
info:
  title: Dotlet API
  description: >-
    The Dotlet API lets you search, register, and manage domains, configure DNS
    records, and embed domain purchasing flows in your own product.


    All endpoints are authenticated with an API key or bearer token, and all
    request and response bodies are JSON.
  version: 0.1.1
  contact:
    name: Dotlet Support
    url: https://dotlet.net/support
    email: support@dotlet.net
servers:
  - url: https://api.dotlet.net
    description: Production
security: []
tags:
  - name: Domains
    description: Search, price, register, renew, and manage domains.
  - name: Orders
    description: Create and track domain orders separately from immediate purchases.
  - name: DNS
    description: Manage DNS records for domains hosted with Dotlet.
  - name: Hosted Sessions
    description: Create embeddable, scoped sessions for end users in your own product.
paths:
  /api/v1/hosted/sessions:
    post:
      tags:
        - Hosted Sessions
      summary: Create Hosted Session
      description: >-
        Create a new hosted session for the organization associated with the API
        key.
      operationId: create_hosted_session_api_v1_hosted_sessions_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HostedSessionCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostedSessionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    HostedSessionCreate:
      properties:
        allowed_actions:
          items:
            $ref: '#/components/schemas/HostedAction'
          type: array
          minItems: 1
          title: Allowed Actions
        external_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External User Id
        external_account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Account Id
        theme_config:
          anyOf:
            - $ref: '#/components/schemas/ThemeConfig'
            - type: 'null'
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        expires_in_minutes:
          type: integer
          maximum: 1440
          minimum: 5
          title: Expires In Minutes
          default: 60
      type: object
      required:
        - allowed_actions
      title: HostedSessionCreate
    HostedSessionResponse:
      properties:
        session_id:
          type: string
          format: uuid
          title: Session Id
        hosted_url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Hosted Url
        embed_url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Embed Url
        client_token:
          type: string
          title: Client Token
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - session_id
        - hosted_url
        - embed_url
        - client_token
        - expires_at
      title: HostedSessionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HostedAction:
      type: string
      enum:
        - domain_search
        - domain_purchase
        - dns_manage
        - renew
      title: HostedAction
    ThemeConfig:
      properties:
        primary_color:
          anyOf:
            - type: string
            - type: 'null'
          title: Primary Color
        logo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Logo Url
        brand_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand Name
      type: object
      title: ThemeConfig
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer

````