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

# Create Session

> Create a new conversation session for a user.

Sessions track conversation history and are used for memory extraction. Messages added to a session
will be processed to extract and store long-term memories when the session is finalized.

**Path Parameters:**
- `custom_user_id` (str): Unique identifier for the user

**Body Parameters:**
- `auto_process_after_seconds` (int): Seconds of inactivity before session auto-processes. Must be >= 600. Default: 600
- `metadata` (Dict[str, Any]): Optional JSON metadata to attach to the session
- `custom_created_at_utc` (datetime): Optional custom timestamp for when the session was created. Must be UTC timezone-aware. Useful for benchmarking or importing historical data. Default: current time

**Returns:**
- `session` (SessionInfo): Created session with ID, status, creation timestamp, and metadata



## OpenAPI

````yaml https://api.recallrai.com/api/openapi.json post /api/v1/users/{custom_user_id}/sessions
openapi: 3.1.0
info:
  title: api-backend
  description: This powers the Recallr AI API Backend
  version: 0.1.0
servers:
  - url: https://api.recallrai.com
    description: Production server
security: []
paths:
  /api/v1/users/{custom_user_id}/sessions:
    post:
      tags:
        - Sessions
      summary: Create Session
      description: >-
        Create a new conversation session for a user.


        Sessions track conversation history and are used for memory extraction.
        Messages added to a session

        will be processed to extract and store long-term memories when the
        session is finalized.


        **Path Parameters:**

        - `custom_user_id` (str): Unique identifier for the user


        **Body Parameters:**

        - `auto_process_after_seconds` (int): Seconds of inactivity before
        session auto-processes. Must be >= 600. Default: 600

        - `metadata` (Dict[str, Any]): Optional JSON metadata to attach to the
        session

        - `custom_created_at_utc` (datetime): Optional custom timestamp for when
        the session was created. Must be UTC timezone-aware. Useful for
        benchmarking or importing historical data. Default: current time


        **Returns:**

        - `session` (SessionInfo): Created session with ID, status, creation
        timestamp, and metadata
      operationId: create_session_api_v1_users__custom_user_id__sessions_post
      parameters:
        - name: custom_user_id
          in: path
          required: true
          schema:
            type: string
            title: The custom user ID to create the session for
        - name: X-Recallr-Project-Id
          in: header
          required: true
          schema:
            type: string
            format: uuid
            title: X-Recallr-Project-Id
        - name: X-Recallr-Api-Key
          in: header
          required: true
          schema:
            type: string
            title: X-Recallr-Api-Key
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Body_create_session_api_v1_users__custom_user_id__sessions_post
      responses:
        '201':
          description: Session created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSessionResponse'
        '401':
          description: Authentication required
        '404':
          description: User not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
components:
  schemas:
    Body_create_session_api_v1_users__custom_user_id__sessions_post:
      properties:
        auto_process_after_seconds:
          type: integer
          minimum: 600
          title: >-
            Seconds to wait before automaticly processing the session. Defaults
            to 600.
          default: 600
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Optional metadata for the session
        custom_created_at_utc:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: >-
            Optional custom timestamp for when the session was created (must be
            UTC timezone-aware).
      type: object
      title: Body_create_session_api_v1_users__custom_user_id__sessions_post
    CreateSessionResponse:
      properties:
        session:
          $ref: '#/components/schemas/SessionInfo'
      type: object
      required:
        - session
      title: CreateSessionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SessionInfo:
      properties:
        session_id:
          type: string
          format: uuid
          title: Session Id
        status:
          $ref: '#/components/schemas/ProjectUserSessionStatus'
        created_at:
          type: string
          format: date-time
          title: Created At
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        session_summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Summary
        memories:
          anyOf:
            - items:
                $ref: '#/components/schemas/SessionMemoryInfo'
              type: array
            - type: 'null'
          title: Memories
      type: object
      required:
        - session_id
        - status
        - created_at
      title: SessionInfo
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ProjectUserSessionStatus:
      type: string
      enum:
        - pending
        - processing
        - processed
        - failed
        - insufficient_balance
      title: ProjectUserSessionStatus
    SessionMemoryInfo:
      properties:
        memory_id:
          type: string
          format: uuid
          title: Memory Id
        content:
          type: string
          title: Content
      type: object
      required:
        - memory_id
        - content
      title: SessionMemoryInfo

````