> ## 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 Discovery



## OpenAPI

````yaml post /v2/discovery
openapi: 3.0.0
info:
  version: 1.0.0
  title: Sohar API
  license:
    name: MIT
servers:
  - url: https://api.soharhealth.com
security: []
paths:
  /v2/discovery:
    post:
      tags:
        - Discovery
      summary: Create Discovery
      operationId: createDiscovery
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscoveryRequest'
            example:
              patient:
                firstName: John
                lastName: Doe
                dateOfBirth: 09/20/2023
                state: CA
                zipCode: '90210'
              payerId: '62308'
              id: '123456'
      responses:
        '201':
          description: A discovery ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  discoveryId:
                    type: string
                    description: The Sohar ID for the discovery
                    example: fb701ac1-1246-4860-b1ec-bd916b97a990
                  id:
                    type: string
                    nullable: true
                    description: >-
                      An optional identifier for the discovery. This is a
                      user-defined value that can be used when creating the
                      discovery
                    example: '123456'
        '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: patient.firstName
        '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:
    DiscoveryRequest:
      required:
        - patient
      type: object
      properties:
        patient:
          type: object
          required:
            - firstName
            - lastName
            - dateOfBirth
            - state
          properties:
            firstName:
              type: string
              description: The patient's first name
              example: John
            lastName:
              type: string
              description: The patient's last name
              example: Doe
            dateOfBirth:
              type: string
              description: The patient's birth date in MM/DD/YYYY format
              pattern: ^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d\d$
              example: 09/20/2023
            state:
              type: string
              description: Two-letter US state code
              enum:
                - AK
                - AL
                - AR
                - AZ
                - CA
                - CO
                - CT
                - DC
                - DE
                - FL
                - GA
                - HI
                - IA
                - ID
                - IL
                - IN
                - KS
                - KY
                - LA
                - MA
                - MD
                - ME
                - MI
                - MN
                - MO
                - MS
                - MT
                - NC
                - ND
                - NE
                - NH
                - NJ
                - NM
                - NV
                - NY
                - OH
                - OK
                - OR
                - PA
                - RI
                - SC
                - SD
                - TN
                - TX
                - UT
                - VA
                - VT
                - WA
                - WI
                - WV
                - WY
              example: CA
            zipCode:
              type: string
              description: An optional parameter to improve patient matching confidence
              example: '90210'
        payerId:
          type: string
          description: >-
            An optional parameter to prioritize the specified payer. See the
            Sohar [payer
            list](https://docs.soharhealth.com/api-reference/payers/get-payers)
          example: '62308'
        id:
          type: string
          description: An optional user defined identifier for the discovery
          example: '123456'
          maxLength: 255
  securitySchemes:
    BasicAuth:
      type: http
      scheme: bearer

````