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

# Update company

> Changes a company you registered. Send only the fields to change; each follows the same rule as on Create company, and the employees and declarations are not touched. A policy that is already paid keeps its dates. On production, a unified national number that belongs to another of your companies answers 400 with code 40025 and that company_id.



## OpenAPI

````yaml /medical-api-reference/openapi.json put /companies/{companyId}
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}:
    put:
      tags:
        - Company
      summary: Update company
      description: >-
        Changes a company you registered. Send only the fields to change; each
        follows the same rule as on Create company, and the employees and
        declarations are not touched. A policy that is already paid keeps its
        dates. On production, a unified national number that belongs to another
        of your companies answers 400 with code 40025 and that company_id.
      parameters:
        - name: companyId
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the company
                name_ar:
                  type: string
                  description: Arabic name of the company
                sponsor_number:
                  type: string
                  description: Sponsor number (exactly 10 digits)
                  pattern: ^[0-9]{10}$
                  example: '1000000001'
                unified_national_number:
                  type: string
                  description: Unified national number of the company
                  example: '7000000001'
                email_address:
                  type: string
                  description: Email address
                phone_number:
                  type: string
                  description: Phone number
                start_date:
                  type: string
                  format: date
                  nullable: true
                  description: >-
                    The day the company wants its cover to start, YYYY-MM-DD,
                    today or later. Send null to clear it, so the policy starts
                    the day it is issued. An unpaid policy takes the new day
                    when it is issued again.
                  example: '2026-12-01'
            example:
              start_date: '2026-12-01'
      responses:
        '200':
          description: The company as it is now
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Company'
        '400':
          description: >-
            Production only: that unified national number belongs to another of
            your companies
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: '40025'
                  message:
                    type: string
                    example: >-
                      That unified national number is already registered as
                      company 123.
                  company_id:
                    type: integer
                    example: 123
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    Company:
      type: object
      properties:
        name:
          type: string
        name_ar:
          type: string
        sponsor_number:
          type: string
        unified_national_number:
          type: string
        email_address:
          type: string
        phone_number:
          type: string
        client_id:
          type: string
        updated_at:
          type: string
        created_at:
          type: string
        id:
          type: integer
        start_date:
          type: string
          format: date
          nullable: true
      example:
        name: Example company name
        name_ar: مثال اسم شركة
        sponsor_number: '1000000001'
        unified_national_number: '7000000001'
        email_address: example@example.com
        phone_number: '+966512345678'
        start_date: '2026-12-01'
        client_id: a1b2c3d4-5678-90ab-cdef-1234567890ab
        updated_at: '2025-08-01T14:22:30.000000Z'
        created_at: '2025-08-01T14:22:30.000000Z'
        id: 42
    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.