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

# Executes a session

> Executes a session was created with deferred execution



## OpenAPI

````yaml /api_v1.json post /api/v1/local/session/{namespace}/{sessionId}
openapi: 3.1.0
info:
  title: Coral Server API
  version: '1.0'
servers: []
security: []
tags: []
externalDocs:
  url: /
paths:
  /api/v1/local/session/{namespace}/{sessionId}:
    post:
      tags:
        - local
      summary: Executes a session
      description: Executes a session was created with deferred execution
      operationId: executeDeferredSession
      parameters:
        - name: namespace
          in: path
          description: The namespace of the session
          required: true
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
        - name: sessionId
          in: path
          description: The sessionId of the session
          required: true
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
      requestBody:
        description: Settings for the execution of the session
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionRuntimeSettings'
        required: false
      responses:
        '200':
          description: Success
          headers: {}
        '400':
          description: The session exists but is not pending execution
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteException'
        '404':
          description: Either namespace or session ID is invalid
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteException'
      deprecated: false
      security:
        - token: []
components:
  schemas:
    SessionRuntimeSettings:
      type: object
      properties:
        ttl:
          type: integer
          format: int64
          description: >-
            If specified, the session will never live longer than this many
            milliseconds.
          title: Long
        extendedEndReport:
          type: boolean
          description: >-
            If specified, the end report generated for this session will be
            extended, including threads and messages
          title: Boolean
        persistenceMode:
          anyOf:
            - type: object
              description: >-
                Session will exist for at least the specified time (in
                milliseconds) after the session exits.  This time does not
                include the run time of the session.
              properties:
                mode:
                  type: string
                  enum:
                    - hold_after_exit
                  title: String
                duration:
                  type: integer
                  format: int64
                  title: Long
              required:
                - duration
                - mode
              title: hold_after_exit
            - type: object
              description: >-
                Session will exist for at least the specified time (in
                milliseconds).  This time includes the run time of the session.
              properties:
                mode:
                  type: string
                  enum:
                    - minimum_time
                  title: String
                time:
                  type: integer
                  format: int64
                  title: Long
              required:
                - mode
                - time
              title: minimum_time
            - type: object
              description: No persistence
              properties:
                mode:
                  type: string
                  enum:
                    - none
                  title: String
              required:
                - mode
              title: none
          description: >-
            Persistence mode for the session. Default is "none" meaning the
            session will be deleted as soon as it exits
          discriminator:
            propertyName: mode
          title: SessionPersistenceMode
        webhooks:
          $ref: '#/components/schemas/SessionWebhooks'
          description: Webhooks executed for this session
      required:
        - extendedEndReport
      title: SessionRuntimeSettings
    RouteException:
      type: object
      properties:
        message:
          type: string
          title: String
      required:
        - message
      title: RouteException
    SessionWebhooks:
      type: object
      properties:
        sessionEnd:
          $ref: '#/components/schemas/SessionEndWebhook'
          description: >-
            The webhook that is called when this session ends.  The model sent
            is a SessionEndState
      title: SessionWebhooks
    SessionEndWebhook:
      type: object
      description: >-
        The webhook that is called when this session ends.  The model sent is a
        SessionEndState
      properties:
        url:
          type: string
          title: String
      required:
        - url
      title: SessionEndWebhook
  securitySchemes:
    token:
      type: http
      scheme: bearer
      bearerFormat: Configured token

````