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

# Submit the declarations

> Every employee's own health declaration in one call, under one consent. Each entry names an employee by `employee_id` and carries their answers to the questions. `consent` must be `true`: by sending it, you confirm the employees have stated that their answers are true and complete and agreed to share them with the insurance provider. The declarations are kept by employee id, apart from the employee list, so editing the list leaves them alone; each call replaces them. Every employee on the list has to have declared before the company can be priced.



## OpenAPI

````yaml /medical-api-reference/openapi.json put /companies/{companyId}/declarations
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}/declarations:
    put:
      tags:
        - Medical Forms
      summary: Submit the declarations
      description: >-
        Every employee's own health declaration in one call, under one consent.
        Each entry names an employee by `employee_id` and carries their answers
        to the questions. `consent` must be `true`: by sending it, you confirm
        the employees have stated that their answers are true and complete and
        agreed to share them with the insurance provider. The declarations are
        kept by employee id, apart from the employee list, so editing the list
        leaves them alone; each call replaces them. Every employee on the list
        has to have declared before the company can be priced.
      parameters:
        - required: true
          name: companyId
          in: path
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - consent
                - employees
              properties:
                consent:
                  type: boolean
                  enum:
                    - true
                  description: Consent for the whole submission. Must be true.
                employees:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    required:
                      - employee_id
                      - answers
                    properties:
                      employee_id:
                        type: string
                        description: >-
                          The employee's nationality_id, iqama_id or
                          border_number. Each employee once.
                        example: '1111111111'
                      answers:
                        $ref: '#/components/schemas/DeclarationAnswers'
      responses:
        '200':
          description: >-
            The company's declarations, keyed by employee id, and who is still
            to declare
          content:
            application/json:
              schema:
                type: object
                properties:
                  health_declarations:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        answers:
                          $ref: '#/components/schemas/DeclarationAnswers'
                        consent:
                          type: boolean
                          enum:
                            - true
                        filled_at:
                          type: string
                          format: date-time
                  pending_declarations:
                    type: array
                    items:
                      type: string
                    description: >-
                      Employees who still have to declare. Empty once everyone
                      has, and the company can be priced.
        '400':
          description: An employee_id is not in the company. Nothing is stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: '40022'
                message: 'No employee of this company matches: 9999999999.'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    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
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  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
    UnprocessableEntity:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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