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

# Fetch the employees

> Fills the company's employee list with the employees registered under its commercial registration number, so you start from the company's current headcount instead of typing it in. It replaces the list; edit it afterwards with Save the employees. Every fetched employee starts on the `basic` tier with no dependents.



## OpenAPI

````yaml /medical-api-reference/openapi.json post /companies/{companyId}/employees/fetch
openapi: 3.0.1
info:
  title: OpenAPI For SME Medical Insurance
  description: API's that you need to use to request insurance(s) for your clients
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://production.yasmina.ai/api/v1/medical
  - url: https://sandbox.yasmina.ai/api/v1/medical
security:
  - bearerAuth: []
paths:
  /companies/{companyId}/employees/fetch:
    post:
      tags:
        - Employees
      summary: Fetch the employees
      description: >-
        Fills the company's employee list with the employees registered under
        its commercial registration number, so you start from the company's
        current headcount instead of typing it in. It replaces the list; edit it
        afterwards with Save the employees. Every fetched employee starts on the
        `basic` tier with no dependents.
      parameters:
        - required: true
          name: companyId
          in: path
          schema:
            type: integer
      responses:
        '200':
          description: The company's employee list
          content:
            application/json:
              schema:
                type: object
                properties:
                  employees:
                    type: array
                    items:
                      $ref: '#/components/schemas/Insured'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Insured:
      type: object
      properties:
        name:
          type: string
        nationality_iso:
          type: string
        category:
          type: string
          enum:
            - basic
            - standard
            - premium
            - executive
          description: >-
            The tier this employee picked. Every provider sells all four, so the
            quote request can price it with each of them.
        nationality_id:
          type: string
          description: For Saudis only. Exactly 10 digits.
          pattern: ^[0-9]{10}$
          example: '1111111111'
        iqama_id:
          type: string
          description: >-
            For non-Saudis. Exactly 10 digits. A non-Saudi whose iqama is not
            issued yet sends border_number instead.
          pattern: ^[0-9]{10}$
          example: '2222222222'
        border_number:
          type: string
          description: >-
            For non-Saudis without an iqama yet, in place of iqama_id. Exactly
            10 digits.
          pattern: ^[0-9]{10}$
          example: '3000000001'
        sponsor_id:
          type: string
          description: The employee's sponsor id. Optional. Exactly 10 digits.
          pattern: ^[0-9]{10}$
          example: '1000000001'
        is_married:
          type: boolean
          description: Whether the employee is married. Optional.
          example: true
        mobile_number:
          type: string
          description: The employee's mobile number.
          example: '0500000001'
        dependents:
          type: array
          description: >-
            Family members covered under this employee's policy. They get the
            same provider and category as the employee. Optional; omit or send
            an empty array for an employee without dependents.
          items:
            $ref: '#/components/schemas/Dependent'
        date_of_birth:
          type: string
          description: >-
            Format YYYY-MM-DD. Saudi nationals whose national id starts with 1
            give the Hijri (Umm al-Qura) date printed on their id, for example
            1409-09-14; everyone else gives a Gregorian date. Employees must be
            between 18 and 110 years old.
        health_declaration:
          type: object
          readOnly: true
          description: >-
            The employee's answers, on the employees of a quote request and a
            policy. Set through Fill the company declarations; ignored when sent
            in.
          properties:
            answers:
              $ref: '#/components/schemas/DeclarationAnswers'
            source:
              type: string
              enum:
                - all_employees
                - employee
            filled_at:
              type: string
              format: date-time
      required:
        - name
        - nationality_iso
        - category
        - mobile_number
        - date_of_birth
    Dependent:
      type: object
      required:
        - name
        - relationship
        - nationality_iso
        - date_of_birth
      properties:
        name:
          type: string
        relationship:
          type: string
          enum:
            - spouse
            - child
            - parent
          description: How the dependent is related to the employee
        nationality_iso:
          type: string
          description: ISO 3166-1 alpha-2 country code
        nationality_id:
          type: string
          description: Required when nationality_iso is SA. Exactly 10 digits.
          pattern: ^[0-9]{10}$
          example: '1111111112'
        iqama_id:
          type: string
          description: Required when nationality_iso is not SA. Exactly 10 digits.
          pattern: ^[0-9]{10}$
          example: '2222222222'
        date_of_birth:
          type: string
          description: >-
            Format YYYY-MM-DD. Saudi nationals whose national id starts with 1
            give the Hijri (Umm al-Qura) date printed on their id, for example
            1409-09-14; everyone else gives a Gregorian date. A dependent can be
            any age up to 110.
    DeclarationAnswers:
      type: object
      description: Yes or No for each question, and the list of chronic diseases.
      properties:
        allergies:
          type: string
          enum:
            - 'Yes'
            - 'No'
        current_medications:
          type: string
          enum:
            - 'Yes'
            - 'No'
        hospitalizations:
          type: string
          enum:
            - 'Yes'
            - 'No'
        pre_existing_conditions:
          type: string
          enum:
            - 'Yes'
            - 'No'
        past_surgeries:
          type: string
          enum:
            - 'Yes'
            - 'No'
        surgery_complications:
          type: string
          enum:
            - 'Yes'
            - 'No'
        chest_pain_or_breathlessness:
          type: string
          enum:
            - 'Yes'
            - 'No'
        heart_procedures:
          type: string
          enum:
            - 'Yes'
            - 'No'
        smoking:
          type: string
          enum:
            - 'Yes'
            - 'No'
        alcohol_consumption:
          type: string
          enum:
            - 'Yes'
            - 'No'
        physical_activity:
          type: string
          enum:
            - 'Yes'
            - 'No'
        family_history:
          type: string
          enum:
            - 'Yes'
            - 'No'
        chronic_disease:
          type: array
          items:
            type: string
            enum:
              - Diabetes
              - Asthma
              - Chronic Kidney Disease
              - Liver Disease
              - Cancer
              - None of the above
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: '40101'
              message:
                type: string
                example: Unauthenticated
    NotFound:
      description: Record not found
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: '40401'
              message:
                type: string
                example: Not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.