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

# Create Interaction

> Creates a new interaction.



## OpenAPI

````yaml /api-reference/auto-generated-openapi.yml post /interactions/
openapi: 3.0.0
info:
  title: Corti API
  version: 2.0.0
servers:
  - url: https://api.{environment}.corti.app/v2/
    variables:
      environment:
        default: eu
        enum:
          - us
          - eu
security:
  - AuthorizationHeader:
      - bearer
tags:
  - name: Interactions
  - name: Facts
  - name: Documents
  - name: Codes
  - name: Recordings
  - name: Transcripts
paths:
  /interactions/:
    post:
      tags:
        - Interactions
      summary: Create Interaction
      description: Creates a new interaction.
      operationId: interactions_create
      parameters:
        - $ref: '#/components/parameters/Tenant-Name'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InteractionsCreateRequest'
        required: true
      responses:
        '201':
          description: >-
            Returns the newly created interaction with its assigned ID and
            WebSocket URL for real-time data streaming.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InteractionsCreateResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: RFC9457
      x-codeSamples:
        - lang: csharp
          label: C# .NET SDK
          source: |
            using Corti;

            var client = new CortiClient(
                "TENANT_NAME",
                CortiClientEnvironment.Eu,
                new CortiClientAuth.ClientCredentials("client_id", "client_secret")
            );
            await client.Interactions.CreateAsync(
                new InteractionsCreateRequest
                {
                    Encounter = new InteractionsEncounterCreateRequest
                    {
                        Identifier = "identifier",
                        Status = InteractionsEncounterStatusEnum.Planned,
                        Type = InteractionsEncounterTypeEnum.FirstConsultation,
                    },
                }
            );
        - lang: javascript
          label: JavaScript SDK
          source: |
            import { CortiClient, CortiEnvironment } from "@corti/sdk";

            const client = new CortiClient({
                environment: CortiEnvironment.Eu,
                auth: {
                    clientId: "YOUR_CLIENT_ID",
                    clientSecret: "YOUR_CLIENT_SECRET"
                },
                tenantName: "YOUR_TENANT_NAME"
            });
            await client.interactions.create({
                encounter: {
                    identifier: "identifier",
                    status: "planned",
                    type: "first_consultation"
                }
            });
components:
  parameters:
    Tenant-Name:
      name: Tenant-Name
      in: header
      description: >-
        Identifies a distinct entity within Corti's multi-tenant system. Ensures
        correct routing and authentication of the request.
      required: true
      example: base
      schema:
        type: string
        description: >-
          Identifies a distinct entity within Corti's multi-tenant system.
          Ensures correct routing and authentication of the request.
        example: base
  schemas:
    InteractionsCreateRequest:
      type: object
      required:
        - encounter
      properties:
        assignedUserId:
          $ref: '#/components/schemas/UUID'
          type: string
          format: uuid
          description: >-
            A unique identifier for the medical professional responsible for
            this interaction. If nulled, automatically set to a uuid.
          items: {}
        encounter:
          $ref: '#/components/schemas/InteractionsEncounterCreateRequest'
          type: object
          description: Details about the encounter.
        patient:
          $ref: '#/components/schemas/InteractionsPatient'
          type: object
          description: Optional patient details.
    InteractionsCreateResponse:
      type: object
      required:
        - interactionId
        - websocketUrl
      properties:
        interactionId:
          $ref: '#/components/schemas/UUID'
          type: string
          format: uuid
          description: Unique identifier for the interaction.
          items: {}
        websocketUrl:
          type: string
          description: >-
            WebSocket URL for streaming real-time interactions. Append a token
            in the format: /interactions/{interactionID}/streams?token=Bearer
            token-value-here
    ErrorResponse:
      type: object
      required:
        - requestid
        - status
        - type
        - detail
      properties:
        requestid:
          type: string
        status:
          type: integer
        type:
          type: string
        detail:
          type: string
        validationErrors:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
    UUID:
      type: string
      items: {}
      format: uuid
      example: f47ac10b-58cc-4372-a567-0e02b2c3d479
    InteractionsEncounterCreateRequest:
      type: object
      required:
        - identifier
        - status
        - type
      properties:
        identifier:
          type: string
          description: >-
            A unique identifier for the encounter, essential for tracking and
            referencing specific patient interactions.
        status:
          $ref: '#/components/schemas/InteractionsEncounterStatusEnum'
          description: >-
            Indicates the current state of the encounter, crucial for
            understanding the progression and current state of care.
        type:
          $ref: '#/components/schemas/InteractionsEncounterTypeEnum'
          description: >-
            The specific type of encounter, providing context about the nature
            and setting of the patient interaction.
        period:
          $ref: '#/components/schemas/InteractionsEncounterPeriod'
          type: object
          description: The time period during which the encounter takes place.
        title:
          type: string
          description: A readable name for the interaction
          nullable: true
    InteractionsPatient:
      type: object
      required:
        - identifier
      properties:
        identifier:
          type: string
          description: FHIR reference to patient identifier.
        name:
          type: string
          description: FHIR reference to Text representation of the full name.
          nullable: true
        gender:
          $ref: '#/components/schemas/InteractionsGenderEnum'
          description: FHIR reference to patient gender.
          nullable: true
        birthDate:
          type: string
          format: date-time
          description: FHIR reference to patient birth date.
          nullable: true
        pronouns:
          type: string
          description: FHIR reference to patient extension Individual Pronouns.
          nullable: true
    InteractionsEncounterStatusEnum:
      type: string
      enum:
        - planned
        - in-progress
        - on-hold
        - completed
        - cancelled
        - deleted
    InteractionsEncounterTypeEnum:
      type: string
      enum:
        - first_consultation
        - consultation
        - emergency
        - inpatient
        - outpatient
    InteractionsEncounterPeriod:
      type: object
      required:
        - startedAt
      properties:
        startedAt:
          type: string
          format: date-time
          description: The start date/time of the encounter. (UTC)
        endedAt:
          type: string
          format: date-time
          description: The end date/time of the encounter. (UTC)
          nullable: true
    InteractionsGenderEnum:
      type: string
      enum:
        - male
        - female
        - unknown
        - other
  securitySchemes:
    AuthorizationHeader:
      type: http
      description: Input your token
      scheme: bearer

````