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

# Fill the company declarations

> A company admin answers the health declaration on the employees' behalf, before the company is priced. `all_employees` is the default set of answers; `ids_or_emails` overrides them for the employees whose history differs. Each call replaces the company's declarations. They are kept by employee id, apart from the employee list, so editing the list leaves them alone; 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: Fill the company declarations
      description: >-
        A company admin answers the health declaration on the employees' behalf,
        before the company is priced. `all_employees` is the default set of
        answers; `ids_or_emails` overrides them for the employees whose history
        differs. Each call replaces the company's declarations. They are kept by
        employee id, apart from the employee list, so editing the list leaves
        them alone; 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:
                - all_employees
              properties:
                all_employees:
                  $ref: '#/components/schemas/DeclarationAnswers'
                ids_or_emails:
                  type: array
                  description: >-
                    Employees whose answers differ from all_employees, named by
                    nationality_id, iqama_id or border_number.
                  items:
                    type: object
                    required:
                      - id_or_email
                      - answers
                    properties:
                      id_or_email:
                        type: string
                        example: '1111111111'
                      answers:
                        $ref: '#/components/schemas/DeclarationAnswers'
      responses:
        '200':
          description: The company's declarations, keyed by employee id
          content:
            application/json:
              schema:
                type: object
                properties:
                  health_declarations:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        answers:
                          $ref: '#/components/schemas/DeclarationAnswers'
                        source:
                          type: string
                          enum:
                            - all_employees
                            - employee
                        filled_at:
                          type: string
                          format: date-time
        '400':
          description: >-
            An `ids_or_emails` entry names nobody 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.