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

# Create Run

> Creates a new Run from a Flow template.



## OpenAPI

````yaml post /v1/runs
openapi: 3.0.0
info:
  version: 1.0.0
  title: Sohar API
  license:
    name: MIT
servers:
  - url: https://api.soharhealth.com
security: []
paths:
  /v1/runs:
    post:
      tags:
        - Runs
      summary: Create Run
      description: Creates a new Run from a Flow template.
      operationId: createRun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRunRequest'
            example:
              flowId: 33093874-1e3d-4ea9-b988-8cc64e5a4079
              input:
                patient:
                  firstName: John
                  lastName: Doe
      responses:
        '201':
          description: A Run ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRunResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_request_error
                    default: invalid_request_error
                  param:
                    type: string
                    example: flowId
        '403':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_request_error
                    default: invalid_request_error
        '500':
          description: Internal error
      security:
        - BasicAuth: []
components:
  schemas:
    CreateRunRequest:
      type: object
      required:
        - flowId
      properties:
        flowId:
          type: string
          description: The Flow ID.
          example: 33093874-1e3d-4ea9-b988-8cc64e5a4079
        version:
          type: integer
          description: >-
            The Flow template version. Defaults to the latest version when
            omitted.
          example: 1
        input:
          type: object
          description: >-
            Initial input for the Run. Refer to the Flow template for specific
            `input` requirements.
          additionalProperties: true
          default: {}
    CreateRunResponse:
      type: object
      required:
        - flowRunId
      properties:
        flowRunId:
          type: string
          description: The Sohar ID for the Run.
          example: fb701ac1-1246-4860-b1ec-bd916b97a990
  securitySchemes:
    BasicAuth:
      type: http
      scheme: bearer

````