openapi: 3.0.0
servers:
- url: https://api.sandbox.autoinsure.curacel.co/api
  description: Sandbox
- url: https://api.autoinsure.curacel.co/api
  description: Production
info:
  version: 1.0.0
  title: Curacel Auto API Docs
  description: |
    # Introduction
    Curacel auto is an insurance platform that aims to drive insurance literacy and inclusion in Africa. This API allows developers, product owners, and business owners to tap into auto insurance by interacting with insurance on their already existing solutions, thereby offering customers tailored insurance to fit their needs.

    This API gives you access to:

      - **Auto Claims**

    In this API reference, you'll find all the information you need about each endpoint and resource.
    - Tip: Make sure to also visit our Developer Portal for guides on Getting started with Auto https://docs.curacel.co/docs/get-started-with-grow , and Setting up your environment https://docs.curacel.co/docs/environment

    ## Environments

    We have two environments, sandbox and production.

    | Environment | Purpose | Access |
    | ----------- | ------- | ------ |
    | `Sandbox` | We've created a [sandbox environment](https://api.sandbox.autoinsure.curacel.co/api) where you can test your API client code without incurring any costs. In this environment, you can create links without real credentials. No data is tampered with and you are able to thoroughly test API endpoints in test mode before going live. | Base URL (cURL): api.sandbox.autoinsure.curacel.co/api |
    | `Production` | The Production environment is recommended for live applications that have direct connections to institutions. You will need real credentials to create links in this environment, and you will be pulling real data from the institutions. | Base URL (cURL): api.autoinsure.curacel.co/api |


    ## Note

    You can't create an application for live mode and sandbox using the same API key. We use the same endpoint structure, the only difference is the base URL.
    Therefore, for each environment, you'll need to [generate separate API keys](https://docs.curacel.co/docs/guides/curacel-auto/authentication).

    ## HTTP Response status codes

    | Status Code | Description |
    | ----------- | ------- |
    | `1xx` | Informational. |
    | `2xx` | Successful - Everything worked as expected.|
    | `3xx` | Redirection messages. |
    | `4xx` | Client Error responses. |
    | `5xx` | Server error responses. |

    ## HTTP Response Status Codes Summary


    Curacel Grow uses the standard HTTP response codes to indicate if an API request was successful or not.


    | Status Code | Description |
    | ----------- | ----------- |
    | `200` - **OK** |  ✅ Everything worked perfectly.|
    | `201` - **Created** |  ✅ As a result of the request's success, a new resource was created. Most common use-case is in a POST request.|
    | `204` - **Success** |  ✅ Although, the request was successful, no content to return by the server.|
    | `400` - **Bad Request** | ❌ The request was denied, usually because a required parameter was missing. |
    | `401` - **Unauthorized** | ❌ Unauthenticated because no valid API key was provided. |
    | `402` - **Request Failed**| ❌ The parameters were correct, however, the request did not succeed.|
    | `403` | ❌ The client does not have access rights to the content. |
    | `404` - **Not Found** | ❌ The server can not find the requested resource. The link may be correct, but the resource does not exist.|
    | `409` - **Conflict** | ❌ This response is sent when a request conflicts with the current state of the server.|
    | `422` - **Unprocessable Entity** | ❌ The request was well-formed, however, it couldn't be carried out because of semantic flaws. |
    | `429` - **Too Many Requests** | ❌ The user has issued an excessive number of requests in a short period of time ("rate limiting"). |
    | `500`, `502`, `503`, `504` - **Server Errors** | ❌ Something went wrong on Curacels' end. (These are rare.) . **Note** that together with this response, a user-friendly page explaining the problem should be sent.|

    ## Error handling

      ### Error messages


      We don't yet have any custom error codes, but errors would always contain one of the standard HTTP codes with a message in the payload.

      Curacel Auto API errors are returned in JSON format. For example, an error might look like this:

        ```json

        [
          {
            "message": "The given data was invalid.",
            "errors": {
              "chassis_number": [
                "The chassis number field is required."
              ]
            }
          }
        ]

        ```
    An error response will typically include the following parameters:

       - `request_id`:

       -  `message`:

       - `code`:

       - `field` *(optional)*:

      ### Request identifier

      When you encounter any issues with a specific error, include the request identifier ('request id') in your message for the support team.
      This will ease the process of investigation and get you back up and running in no time.


    ### Error codes and troubleshooting

      Please see our dedicated error handling articles on our Developer Portal for a complete list of errors and how to troubleshoot them.
  contact:
    name: Curacel Auto API Support
    email: auto@curacel.ai
    url: https://docs.curacel.co/
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
tags:
- name: assessments
  description: Assess a vehicle for damages
- name: policies
  description: Everything about managing policies
- name: uploads
  description: Everything about managing uploads
- name: claims
  description: Everything about managing your claims
- name: products
  description: Everything about managing products
- name: vehicles
  description: Everything about vehicle
- name: fleets
  description: Create and manage fleet inspections and their vehicles
paths:
  "/v1/claims":
    get:
      tags:
      - claims
      summary: Get all claims
      description: Get all claims
      operationId: getClaims
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      "$ref": "#/components/schemas/Claim"
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
    post:
      tags:
      - claims
      summary: Create a new claim
      description: ''
      operationId: createClaim
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - policy_number
              - date
              - time
              - location
              - landmark
              - accident_type
              - description
              - bank_details
              - images
              properties:
                policy_number:
                  type: string
                  description: Policy number of the user
                date:
                  type: string
                  description: Date of the accident
                time:
                  type: string
                  description: Time of the accident
                damages:
                  type: array
                  nullable: true
                  description: Damages recorded in the vehicle
                  items:
                    type: string
                location:
                  type: string
                  description: Location of the accident
                landmark:
                  type: string
                  description: Landmark of the accident
                accident_type:
                  type: string
                  description: Type of the accident
                  enum:
                  - a-head-on-collision
                  - rear-end-collisions
                  - side-impact-accidents
                  - chain-reactions
                  - rollovers
                  - other
                description:
                  type: string
                  description: Description of the accident
                bank_details:
                  type: object
                  description: Bank details of the user for payment
                  required:
                  - bank_name
                  - account_name
                  - account_no
                  properties:
                    bank_name:
                      type: string
                      description: Name of the bank
                    sort_code:
                      type: string
                      description: Name of the account
                    account_no:
                      type: string
                      description: Number of the account
                    account_name:
                      type: string
                      description: Name of the account
                images:
                  type: array
                  description: Images of the accident
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: URL of the file
                      part:
                        type: string
                        description: Side of the vehicle
                        enum:
                        - left
                        - right
                        - rear
                        - front
                        - dashboard
                        - vin-plate
                        - license-plate
                police_report:
                  type: integer
                  description: Police report of the accident. Use the ID of the uploaded
                    file
                repair_estimate:
                  type: integer
                  description: Repair estimate of the damages. Use the ID of the uploaded
                    file
                session_id:
                  type: string
                  description: Session ID for claim files uploaded before claim creation
        required: true
      responses:
        201:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  id:
                    type: integer
                    description: ID of the claim
                  pre_evaluation_id:
                    type: integer
                    description: ID of the post-loss evaluation
                  purchased_policy_id:
                    type: integer
                    description: ID of the purchased policy
                  accident_id:
                    type: integer
                    description: ID of the accident type
                  policy_number:
                    type: string
                    description: Policy number of the user
                  date:
                    type: string
                    description: Date of the accident
                  time:
                    type: string
                    description: Time of the accident
                  location:
                    type: string
                    description: Location of the accident
                  landmark:
                    type: string
                    description: Landmark of the accident
                  accident_type:
                    type: string
                    description: Type of the accident
                  description:
                    type: string
                    description: Description of the accident
                  channel:
                    type: string
                    description: Channel that created the claim
                  pre_purchase_evaluation_id:
                    type: integer
                    nullable: true
                    description: ID of the pre-purchase evaluation
                  bank_details:
                    type: object
                    description: Bank details of the user for payment
                    properties:
                      bank_name:
                        type: string
                        description: Name of the bank
                      sort_code:
                        type: string
                        description: Name of the account
                      account_no:
                        type: string
                        description: Number of the account
                      account_name:
                        type: string
                        description: Name of the account
                  status:
                    type: string
                    description: Status of the claim
                  plate_number_mismatch:
                    type: boolean
                    description: Whether the claim plate number mismatches the policy
                      vehicle
                  vin_mismatch:
                    type: boolean
                    description: Whether the claim VIN mismatches the policy vehicle
                  form_tat:
                    type: string
                    nullable: true
                    description: Claim form turnaround time
                  evaluation:
                    "$ref": "#/components/schemas/PreEvaluationResponse"
                  created_at:
                    type: string
                    description: Date of creation of the claim
                  updated_at:
                    type: string
                    description: Date of update of the claim
        422:
          description: Unprocessable Content
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/claims/{id}":
    get:
      tags:
      - claims
      summary: Get a claim
      description: Get details of a claim by id
      operationId: getClaim
      parameters:
      - name: id
        in: path
        description: ID of the claim
        required: true
        schema:
          type: integer
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  data:
                    "$ref": "#/components/schemas/Claim"
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
        404:
          description: Not found.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/fleets":
    get:
      tags:
      - fleets
      summary: List fleet inspections
      description: Returns only fleet inspections owned by the authenticated insurer.
        The API allows 60 requests per minute for each authenticated account.
      operationId: listFleetInspections
      parameters:
      - name: search
        in: query
        description: Search the fleet name. Ignored when filter is all.
        schema:
          type: string
      - name: per_page
        in: query
        description: Number of fleets per page. Ignored when filter is all.
        schema:
          type: integer
          default: 10
          minimum: 1
      - name: filter
        in: query
        description: Set to all to return an unpaginated minimal collection.
        schema:
          type: string
          enum:
          - all
      responses:
        200:
          description: Fleet inspections returned successfully. Paginated requests
            also include links and meta.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/FleetInspectionCollection"
        401:
          "$ref": "#/components/responses/Unauthorized"
        429:
          description: Too many requests.
    post:
      tags:
      - fleets
      summary: Create a fleet inspection
      description: Creates an active fleet inspection for the authenticated insurer.
        Personal fleets require proof of address and director identity documents.
        Corporate fleets require CAC, MEMART, and director identity documents.
      operationId: createFleetInspection
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              "$ref": "#/components/schemas/CreateFleetInspectionRequest"
      responses:
        201:
          description: Fleet inspection created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/FleetInspection"
        401:
          "$ref": "#/components/responses/Unauthorized"
        422:
          "$ref": "#/components/responses/ValidationError"
        429:
          description: Too many requests.
  "/fleets/{id}":
    get:
      tags:
      - fleets
      summary: Get a fleet inspection
      description: Returns a fleet inspection owned by the authenticated insurer.
        Use the ULID returned as uid or id.
      operationId: getFleetInspection
      parameters:
      - name: id
        in: path
        required: true
        description: Fleet inspection ULID.
        schema:
          type: string
      responses:
        200:
          description: Fleet inspection returned successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    "$ref": "#/components/schemas/FleetInspection"
        401:
          "$ref": "#/components/responses/Unauthorized"
        403:
          description: The authenticated insurer does not own this fleet.
        404:
          description: Fleet inspection not found.
        429:
          description: Too many requests.
  "/fleets/{id}/vehicles":
    post:
      tags:
      - fleets
      summary: Add fleet vehicles
      description: Creates or updates vehicles by VIN within the fleet. Send one vehicle
        object or a root array containing 1 to 500 vehicles. Do not wrap a batch in
        a vehicles property. Response order follows request order.
      operationId: createFleetVehicles
      parameters:
      - name: id
        in: path
        required: true
        description: Fleet inspection ULID.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
              - "$ref": "#/components/schemas/FleetVehicleRequest"
              - type: array
                minItems: 1
                maxItems: 500
                items:
                  "$ref": "#/components/schemas/FleetVehicleRequest"
      responses:
        201:
          description: Vehicle or vehicles saved successfully. A single request returns
            one object, while a batch returns an array.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    oneOf:
                    - "$ref": "#/components/schemas/FleetVehicle"
                    - type: array
                      items:
                        "$ref": "#/components/schemas/FleetVehicle"
        401:
          "$ref": "#/components/responses/Unauthorized"
        403:
          description: The authenticated insurer does not own this fleet.
        404:
          description: Fleet inspection not found.
        422:
          "$ref": "#/components/responses/ValidationError"
        429:
          description: Too many requests.
  "/v1/vehicle-assessments":
    post:
      summary: Create a new vehicle assessment
      description: Upload the images of the vehicle and get the assessment via webhooks
      operationId: createVehicleAssessment
      tags:
      - assessments
      requestBody:
        content:
          application/json:
            schema:
              "$ref": "#/components/schemas/VehicleAssessmentRequestData"
        required: true
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  id:
                    type: integer
                    description: ID of the pre-policy assessment
                  fleet_vehicle_id:
                    type: integer
                    description: Fleet vehicle ID. Returned only when the assessment
                      is for a fleet vehicle.
                  fleet_id:
                    type: string
                    description: Public fleet ULID. Returned only when the assessment
                      is for a fleet vehicle.
                  assessment_id:
                    type: integer
                    description: ID of the post-loss assessment
                  claim_id:
                    type: integer
                    description: ID of the claim created for a post-loss assessment
                  info:
                    type: string
                    description: Information about the assessment
        422:
          description: Unprocessable Content
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/policies":
    post:
      tags:
      - policies
      summary: Create a new policy
      description: ''
      operationId: createPolicy
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
              - "$ref": "#/components/schemas/ThirdPartyPurchaseData"
              - "$ref": "#/components/schemas/ComprehensivePurchaseData"
        required: true
      responses:
        201:
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Policy"
        422:
          description: Unprocessable Content
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/policies/{id}":
    put:
      tags:
      - policies
      summary: Update a policy
      description: Update the details of a policy with information neccessary for
        claims
      operationId: updatePolicy
      parameters:
      - name: id
        in: path
        description: ID of the policy
        required: true
        schema:
          type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - policy_number
              - expiry_date
              - policy_doc
              properties:
                policy_number:
                  type: string
                  description: Policy number of the policy
                expiry_date:
                  type: string
                  description: Expiry date of the policy. Must be a future date (cannot
                    be in the past).
                  format: date
                policy_doc:
                  type: string
                  description: URL of the policy document
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Policy"
        422:
          description: Unprocessable Content
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/uploads":
    post:
      tags:
      - uploads
      summary: Upload a file
      description: ''
      operationId: uploadFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: File to upload
                uploaded_file:
                  type: object
                  description: Uploaded file metadata from a direct upload flow. Alternative
                    to multipart file.
                  properties:
                    key:
                      type: string
                      description: Temporary uploaded file key
                    ext:
                      type: string
                      description: Uploaded file extension
                    name:
                      type: string
                      description: Uploaded file name
                description:
                  type: string
                  description: Description of the file
                session_id:
                  type: string
                  description: Session ID to associate with the uploaded file
        required: true
      responses:
        201:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID of the file
                      size:
                        type: integer
                        description: Size of the file
                      mime:
                        type: string
                        description: Mime type of the file
                      ext:
                        type: string
                        description: Extension of the file
                      path:
                        type: string
                        description: URL of the uploaded file
                      description:
                        type: string
                        description: Description of the file
                      src_filename:
                        type: string
                        description: Name of the file
                      created_at:
                        type: string
                        description: Date of creation of the file
                      license_details:
                        type: object
                        description: Extracted license details. Returned when description
                          is drivers license.
        422:
          description: Unprocessable Content
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/products":
    get:
      tags:
      - products
      summary: Get all products
      description: Get all products
      operationId: getProducts
      parameters:
      - name: type
        in: query
        description: Type of the product
        required: false
        schema:
          type: string
          enum:
          - 3rd_party
          - comprehensive
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: ID of the product
                        name:
                          type: string
                          description: Name of the product
                        description:
                          type: string
                          description: Description of the product
                        type:
                          type: string
                          description: Type of the product
                          enum:
                          - 3rd_party
                          - comprehensive
                        premium_rate:
                          type: number
                          description: Premium of the product
                        payment_duration:
                          type: string
                          description: Duration of the policy
                        vehicle_value_label:
                          type: string
                          nullable: true
                          description: Label for the vehicle value band, if any
                        extra_cover_benefits:
                          type: array
                          description: Additional cover benefits for the product
                          items:
                            "$ref": "#/components/schemas/ExtraCoverBenefit"
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/products/{id}":
    get:
      tags:
      - products
      summary: Get a product
      description: Get details of a product by id
      operationId: getProduct
      parameters:
      - name: id
        in: path
        description: ID of the product
        required: true
        schema:
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID of the product
                      name:
                        type: string
                        description: Name of the product
                      description:
                        type: string
                        description: Description of the product
                      type:
                        type: string
                        description: Type of the product
                        enum:
                        - 3rd_party
                        - comprehensive
                      premium_rate:
                        type: number
                        description: Premium of the product
                      vehicle_value_label:
                        type: string
                        nullable: true
                        description: Label for the vehicle value band, if any
                      extra_cover_benefits:
                        type: array
                        description: Additional cover benefits for the product
                        items:
                          "$ref": "#/components/schemas/ExtraCoverBenefit"
                      payment_duration:
                        type: string
                        description: Duration of the policy
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
        404:
          description: Not found.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/vehicles/brands":
    get:
      tags:
      - vehicles
      summary: Get all vehicle brands
      description: Get all vehicle brands
      operationId: getVehicleBrands
      parameters:
      - name: paginate
        in: query
        description: Paginate the results
        required: false
        schema:
          type: integer
          enum:
          - 1
          - 0
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: ID of the brand
                        name:
                          type: string
                          description: Name of the brand
                        countries:
                          type: array
                          description: ISO country codes where the brand is available
                          items:
                            type: string
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/vehicles/brands/{brandId}/models":
    get:
      tags:
      - vehicles
      summary: Get all models of a brand
      description: Get all the models of a brand
      operationId: getVehicleBrandModels
      parameters:
      - name: brandId
        in: path
        description: ID of the brand
        required: true
        schema:
          type: integer
      - name: paginate
        in: query
        description: Paginate the results
        required: false
        schema:
          type: integer
          enum:
          - 1
          - 0
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: ID of the model
                        name:
                          type: string
                          description: Name of the model
        401:
          "$ref": "#/components/responses/Unauthorized"
        400:
          description: Bad request.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
        404:
          description: Not found.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
  "/v1/vehicles/estimate":
    get:
      tags:
      - vehicles
      summary: Get the average value of a vehicle
      description: Get the average value of a vehicle
      operationId: getVehicleAverageValue
      parameters:
      - name: model
        in: query
        description: ID of the Model of the vehicle
        required: true
        schema:
          type: integer
      - name: year
        in: query
        description: Year of manufacture of the vehicle
        required: true
        schema:
          type: integer
      - name: currency
        in: query
        description: Currency code for the valuation
        required: true
        schema:
          type: string
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  brand:
                    type: string
                    description: Brand of the vehicle
                  model:
                    type: string
                    description: Model of the vehicle
                  year:
                    type: integer
                    description: Year of manufacture of the vehicle
                  locallyUsedAverage:
                    type: number
                    description: Average value of the vehicle in locally used condition
                  locallyUsedMin:
                    type: number
                    description: Minimum value of the vehicle in locally used condition
                  locallyUsedMax:
                    type: number
                    description: Maximum value of the vehicle in locally used condition
                  foreignUsedAverage:
                    type: number
                    description: Average value of the vehicle in foreign used condition
                  foreignUsedMin:
                    type: number
                    description: Minimum value of the vehicle in foreign used condition
                  foreignUsedMax:
                    type: number
                    description: Maximum value of the vehicle in foreign used condition
                  yearDiscontinued:
                    type: integer
                    nullable: true
                    description: Year the model was discontinued. Null if still produced.
        401:
          "$ref": "#/components/responses/Unauthorized"
        404:
          description: Not found.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API KEY from your account dashboard
  responses:
    Unauthorized:
      description: Unauthenticated - no valid API key was provided.
      content:
        application/json:
          schema:
            properties:
              data:
                type: string
    ValidationError:
      description: The request failed validation. Batch vehicle errors include the
        zero based request index, for example vehicles.1.chassis_number.
      content:
        application/json:
          schema:
            "$ref": "#/components/schemas/ValidationError"
  schemas:
    ValidationError:
      type: object
      required:
      - message
      - error
      properties:
        message:
          type: string
        error:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    FleetInspectionCollection:
      type: object
      required:
      - data
      properties:
        data:
          type: array
          items:
            "$ref": "#/components/schemas/FleetInspection"
        links:
          type: object
          nullable: true
          properties:
            first:
              type: string
            last:
              type: string
            prev:
              type: string
              nullable: true
            next:
              type: string
              nullable: true
        meta:
          type: object
          nullable: true
          properties:
            current_page:
              type: integer
            from:
              type: integer
              nullable: true
            last_page:
              type: integer
            per_page:
              type: integer
            to:
              type: integer
              nullable: true
            total:
              type: integer
    CreateFleetInspectionRequest:
      type: object
      required:
      - name
      - inspection_type
      - company_name
      - company_email
      - company_phone_no
      - director_identity_card
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 150
          description: Fleet name. Must be unique for the authenticated insurer.
        inspection_type:
          type: string
          enum:
          - personal
          - corporate
        company_name:
          type: string
          minLength: 3
        company_email:
          type: string
          format: email
          maxLength: 100
        company_phone_no:
          type: string
        proof_of_address:
          type: string
          format: binary
          description: Required for personal fleets. PNG, JPEG, or PDF with a maximum
            size of 1500 KB.
        director_identity_card:
          type: string
          format: binary
          description: Required for all fleets. PNG, JPEG, or PDF with a maximum size
            of 1500 KB.
        cac_document:
          type: string
          format: binary
          description: Required for corporate fleets. PNG, JPEG, or PDF with a maximum
            size of 1500 KB.
        memart:
          type: string
          format: binary
          description: Required for corporate fleets. PNG, JPEG, or PDF with a maximum
            size of 1500 KB.
    FleetInspection:
      type: object
      properties:
        uid:
          type: string
          description: Fleet ULID used in fleet API URLs.
        id:
          type: string
          description: Alias of uid.
        inspection_type:
          type: string
          enum:
          - personal
          - corporate
        name:
          type: string
        company_name:
          type: string
        company_phone_no:
          type: string
        company_email:
          type: string
          format: email
        status:
          type: string
        payment_status:
          type: string
        policy_start_date:
          type: string
          format: date
          nullable: true
        policy_end_date:
          type: string
          format: date
          nullable: true
        meta:
          type: array
          description: Uploaded fleet documents. Returned by the get operation.
          items:
            type: object
            properties:
              type:
                type: string
              url:
                type: string
                format: uri
              file:
                type: string
        insurer:
          type: object
          description: Returned by the get operation.
          properties:
            id:
              type: integer
            code:
              type: string
        has_policies:
          type: integer
          description: Number of policies attached to the fleet.
        vehicles_count:
          type: integer
        created_at:
          type: string
          format: date-time
        inspection_link:
          type: string
          format: uri
    FleetVehicleRequest:
      type: object
      required:
      - chassis_number
      - vehicle_regno
      - vehicle_type
      - manufacturer
      - model
      - year
      - color
      properties:
        chassis_number:
          type: string
          pattern: "^[A-HJ-NPR-Z0-9]{12}$|^[A-HJ-NPR-Z0-9]{17}$"
          description: A 12 or 17 character uppercase VIN. I, O, and Q are not allowed.
        vehicle_regno:
          type: string
          maxLength: 60
        engine_no:
          type: string
          nullable: true
          maxLength: 60
        vehicle_type:
          type: string
          maxLength: 100
        manufacturer:
          type: string
          maxLength: 255
        model:
          type: string
          maxLength: 150
        year:
          type: integer
          minimum: 1901
          maximum: 2155
        color:
          type: string
          maxLength: 50
    FleetVehicle:
      type: object
      properties:
        id:
          type: integer
          description: Use this value as fleet_vehicle_id when creating an assessment.
        vin:
          type: string
        registration_no:
          type: string
        engine_no:
          type: string
          nullable: true
        body_type:
          type: string
        maker:
          type: string
        model:
          type: string
        year:
          type: integer
        color:
          type: string
        created_at:
          type: string
          format: date-time
    PreEvaluationRequestData:
      type: object
      required:
      - source
      - chassis_number
      - manufacturer
      - model
      - year
      - color
      - engine_no
      - usage
      - license_number
      - license_expiry
      - vehicle_value
      - vehicle_type
      - assessment_type
      - vehicle_details
      properties:
        source:
          type: string
          description: Originating source of the pre-evaluation request
        chassis_number:
          type: string
          description: Chassis number of the vehicle
        manufacturer:
          type: string
          description: Manufacturer of the vehicle
        model:
          type: string
          description: Model of the vehicle
        year:
          type: string
          description: Year of manufacture of the vehicle
        color:
          type: string
          description: Color of the vehicle
        engine_no:
          type: string
          description: Engine number of the vehicle
        usage:
          type: string
          description: Usage of the vehicle
        license_number:
          type: string
          description: License number of the vehicle
        license_expiry:
          type: string
          description: License expiry date of the vehicle
        vehicle_value:
          type: string
          description: Value of the vehicle
        vehicle_type:
          type: string
          description: Type of the vehicle
        vehicle_details:
          type: array
          minItems: 4
          description: 'Details of the vehicle. Must contain at least 4 items and
            must include the rear, front, left and right sides. Each image URL must
            be publicly accessible.

'
          items:
            type: object
            properties:
              url:
                type: string
                description: Publicly accessible URL of the vehicle image
              side:
                type: string
                enum:
                - left
                - right
                - rear
                - front
                - dashboard
                - vin-plate
                - license-plate
                - video
                description: Side of the vehicle
        vehicle_regno:
          type: string
          description: Registration number of the vehicle
        assessment_type:
          type: string
          description: Type of assessment
          enum:
          - pre_purchase
          - claims
    PreEvaluationResponse:
      type: object
      properties:
        id:
          type: integer
          description: ID of the pre-evaluation
        user_id:
          type: integer
          nullable: true
          description: ID of the user associated with the pre-evaluation
        name:
          type: string
          nullable: true
          description: Name of the customer
        phone:
          type: string
          nullable: true
          description: Phone number of the customer
        email:
          type: string
          nullable: true
          description: Email of the customer
        incidence_type:
          type: string
          nullable: true
          description: Incidence type
        third_party_damage_type:
          type: string
          nullable: true
          description: Third-party damage type
        third_party_damage_type_other:
          type: string
          nullable: true
          description: Other third-party damage type
        third_party_description:
          type: string
          nullable: true
          description: Third-party damage description
        gender:
          type: string
          nullable: true
          description: Gender of the customer
        chassis_number:
          type: string
          description: Chassis number of the vehicle
        manufacturer:
          type: string
          description: Manufacturer of the vehicle
        model:
          type: string
          description: Model of the vehicle
        year:
          type: string
          description: Year of manufacture of the vehicle
        color:
          type: string
          description: Color of the vehicle
        engine_no:
          type: string
          description: Engine number of the vehicle
        address:
          type: string
          nullable: true
          description: Address of the customer
        usage:
          type: string
          description: Usage of the vehicle
        license_number:
          type: string
          description: License number of the vehicle
        license_expiry:
          type: string
          description: License expiry date of the vehicle
        confirmation_number:
          type: string
          nullable: true
          description: Confirmation number of the pre-evaluation
        vehicle_value:
          type: string
          description: Value of the vehicle
        vehicle_value_currency:
          type: string
          description: Currency of the vehicle value
        vehicle_type:
          type: string
          description: Type of the vehicle
        vehicle_details:
          type: array
          description: Details of the vehicle
          items:
            type: object
            properties:
              url:
                type: string
                description: URL of the vehicle
              side:
                type: string
                description: Side of the vehicle
        vehicle_regno:
          type: string
          description: Registration number of the vehicle
        assessment_type:
          type: string
          description: Type of assessment
        created_at:
          type: string
          description: Date of creation of the pre-evaluation
        ref:
          type: string
          description: Reference of the pre-evaluation
        files:
          type: array
          description: Files of the pre-evaluation
          items:
            "$ref": "#/components/schemas/PreEvaluationFile"
    PreEvaluationFile:
      type: object
      properties:
        id:
          type: integer
          description: ID of the pre-evaluation file
        pre_evaluation_id:
          type: integer
          description: ID of the pre-evaluation
        third_party_item_id:
          type: integer
          nullable: true
          description: ID of the third-party item
        vehicle_part:
          type: object
          description: Vehicle part metadata
        vehicle_side:
          type: object
          description: Vehicle side metadata
        type:
          type: string
          description: File type
        path:
          type: string
          description: File path or URL
        processing_status:
          type: string
          description: Processing status of the file
        result:
          type: string
          nullable: true
          description: Processing result
        url:
          type: string
          description: URL of the file
        pre_processed_url:
          type: string
          nullable: true
          description: Pre-processed file URL
        created_at:
          type: string
          description: Date of creation of the file
        updated_at:
          type: string
          description: Date of last update of the file
        location:
          type: object
          nullable: true
          description: Capture location metadata
        annotations:
          type: array
          description: Annotations for the file
          items:
            type: object
        internal_damages:
          type: array
          nullable: true
          description: Internal damages detected for the file
          items:
            type: object
    Claim:
      type: object
      properties:
        id:
          type: integer
          description: ID of the claim
        pre_evaluation_id:
          type: integer
          description: ID of the post-loss evaluation
        purchased_policy_id:
          type: integer
          description: ID of the purchased policy
        accident_id:
          type: integer
          description: ID of the accident type
        channel:
          type: string
          description: Channel that created the claim
        date:
          type: string
          description: Date of the accident
        time:
          type: string
          description: Time of the accident
        location:
          type: string
          description: Location of the accident
        landmark:
          type: string
          nullable: true
          description: Landmark of the accident
        description:
          type: string
          description: Description of the accident
        status:
          type: string
          description: Status of the claim
        vehicles_match:
          type: boolean
          description: Whether the claim vehicle matches the policy vehicle
        pre_purchase_evaluation_id:
          type: integer
          nullable: true
          description: ID of the related pre-purchase evaluation, if any
        damages:
          type: array
          description: Damages recorded in the vehicle
          items:
            type: string
        plate_number_mismatch:
          type: boolean
          description: Whether the claim plate number mismatches the policy vehicle
        vin_mismatch:
          type: boolean
          description: Whether the claim VIN mismatches the policy vehicle
        form_tat:
          type: string
          nullable: true
          description: Claim form turnaround time
        created_at:
          type: string
          description: Date of creation of the claim
        bank_details:
          type: object
          description: Bank details of the user for payment
          properties:
            bank_name:
              type: string
              description: Name of the bank
            account_name:
              type: string
              description: Name of the account
            account_number:
              type: string
              description: Number of the account
        pre_evaluation:
          "$ref": "#/components/schemas/PreEvaluationResponse"
    VehicleAssessmentRequestData:
      type: object
      required:
      - assessment_type
      - images
      description: Provide registration_number for a standard assessment or fleet_vehicle_id
        for a fleet assessment.
      properties:
        registration_number:
          type: string
          nullable: true
          description: Registration number of the vehicle. Not required when fleet_vehicle_id
            is present. The stored fleet vehicle registration takes precedence.
        fleet_vehicle_id:
          type: integer
          nullable: true
          description: Integer fleet vehicle ID returned by the add vehicles endpoint.
            The vehicle must belong to the authenticated insurer and can only be used
            for a pre-policy assessment.
        assessment_type:
          type: string
          description: Type of assessment
          enum:
          - pre-policy
          - post-loss
        pre_policy_assessment_id:
          type: string
          description: Required when assessment_type is post-loss. ID of the pre-policy
            assessment.
        images:
          type: array
          description: Image URLs of the vehicle. Invalid front, rear, left, and right
            images return the standard validation response with the image reason appended
            to each part message.
          minItems: 1
          items:
            type: object
            required:
            - url
            - part
            properties:
              url:
                type: string
                description: URL of the file
              part:
                type: string
                description: Side of the vehicle
                enum:
                - left
                - right
                - rear
                - front
                - dashboard
                - vin-plate
                - license-plate
                - video
    ThirdPartyPurchaseData:
      type: object
      required:
      - product_id
      - chassis_number
      - manufacturer
      - model
      - year
      - vehicle_regno
      - engine_no
      - color
      - vehicle_type
      - email
      - name
      - phone
      - gender
      - address
      - license_number
      - license_expiry
      properties:
        product_id:
          type: integer
          description: Product ID of the policy to be created
        chassis_number:
          type: string
          description: Chassis number of the vehicle
        manufacturer:
          type: string
          description: Manufacturer of the vehicle
        model:
          type: string
          description: Model of the vehicle
        year:
          type: string
          description: Year of manufacture of the vehicle
        vehicle_regno:
          type: string
          description: Registration number of the vehicle
        engine_no:
          type: string
          description: Engine number of the vehicle
        color:
          type: string
          description: Color of the vehicle
        vehicle_type:
          type: string
          description: Type of the vehicle
          enum:
          - Van
          - Cargo/Truck
          - Pick Up
          - SUV/Crossover
          - Saloon Car
          - Bus
          - Minivan
          - Trailer
        email:
          type: string
          description: Email of the user
        name:
          type: string
          description: Name of the user
        phone:
          type: string
          description: Phone number of the user
        gender:
          type: string
          description: gender of the user
          enum:
          - male
          - female
        address:
          type: string
          description: Address of the user
        license_number:
          type: string
          description: License number of the user
        license_expiry:
          type: string
          description: License expiry date of the user
          format: date
    ComprehensivePurchaseData:
      type: object
      required:
      - product_id
      - chassis_number
      - manufacturer
      - model
      - year
      - vehicle_regno
      - engine_no
      - color
      - vehicle_type
      - email
      - name
      - phone
      - gender
      - address
      - license_number
      - license_expiry
      - vehicle_value
      - vehicle_value_currency
      - usage
      - address_proof_file_id
      - license_file_id
      - images
      properties:
        product_id:
          type: integer
          description: Product ID of the policy to be created
        chassis_number:
          type: string
          description: Chassis number of the vehicle
        manufacturer:
          type: string
          description: Manufacturer of the vehicle
        model:
          type: string
          description: Model of the vehicle
        year:
          type: string
          description: Year of manufacture of the vehicle
        vehicle_regno:
          type: string
          description: Registration number of the vehicle
        engine_no:
          type: string
          description: Engine number of the vehicle
        color:
          type: string
          description: Color of the vehicle
        vehicle_type:
          type: string
          description: Type of the vehicle
          enum:
          - Van
          - Cargo/Truck
          - Pick Up
          - SUV/Crossover
          - Saloon Car
          - Bus
          - Minivan
          - Trailer
        email:
          type: string
          description: Email of the user
        name:
          type: string
          description: Name of the user
        phone:
          type: string
          description: Phone number of the user
        gender:
          type: string
          description: gender of the user
          enum:
          - male
          - female
        address:
          type: string
          description: Address of the user
        license_number:
          type: string
          description: License number of the user
        license_expiry:
          type: string
          description: License expiry date of the user
          format: date
        vehicle_value:
          type: number
          description: Value of the vehicle. Required for comprehensive products.
        vehicle_value_currency:
          type: string
          description: Currency of the vehicle value
        usage:
          type: string
          description: Usage of the vehicle
          enum:
          - private
          - commercial
        address_proof_file_id:
          type: integer
          description: ID of the address proof file. Use the ID of the uploaded file
        license_file_id:
          type: integer
          description: ID of the license file. Use the ID of the uploaded file
        images:
          type: array
          description: Images of the vehicle
          items:
            type: object
            properties:
              url:
                type: string
                description: URL of the file
              part:
                type: string
                description: Side of the vehicle
                enum:
                - left
                - right
                - rear
                - front
                - dashboard
                - vin-plate
                - license-plate
                - video
    Policy:
      type: object
      properties:
        id:
          type: integer
          description: ID of the policy
        full_name:
          type: string
          description: Full name of the user
        start_date:
          type: string
          description: Start date of the policy
        policy_type:
          type: string
          description: Type of the policy
          enum:
          - third_party
          - comprehensive
        purchase_date:
          type: string
          description: Date of purchase of the policy
        payment_status:
          type: string
          description: Payment status of the policy
        end_date:
          type: string
          description: End date of the policy
        status:
          type: string
          description: Status of the policy
        policy_status:
          type: string
          description: Policy status
        issued_status:
          type: string
          description: Issued status of the policy
          enum:
          - Issued
          - Pending
        product:
          type: string
          description: Name of the product
        premium:
          type: string
          description: Premium of the policy
        policy_document:
          type: string
          description: URL of the policy document
        policy_number:
          type: string
          description: Number of the policy
        created_at:
          type: string
          description: Date of creation of the policy
        payment_link:
          type: string
          nullable: true
          description: Payment link for unpaid policies
    ExtraCoverBenefit:
      type: object
      properties:
        id:
          type: integer
          description: ID of the extra cover benefit
        cover:
          type: string
          description: Cover name
        benefit:
          type: string
          description: Benefit description
        amount:
          type: number
          description: Benefit amount
security:
- bearerAuth: []
