# MeshVI API

API documentation for MeshVI services. Protected routes use application authorization ([APIAuthorize]): a valid Bearer JWT is validated by the API. Calls to the hosted base URL also require an API key in the `apiKey` header, enforced at the API edge. Includes Acord certificate verification and retrieval, client, document (Document Manager v1), driver, policy, and vehicle operations for real-time insurance verification and fleet management.

Version: 1.0.0

## Servers

Staging (UAT)
```
https://uat-verified.meshvi.com
```

## Security

### BearerAuth

Type: http
Scheme: bearer
Bearer Format: JWT

### ApiKeyAuth

meshVI subscription API key. Sent as the `apiKey` HTTP header; required at the hosted API edge alongside the Bearer token.

Type: apiKey
In: header
Name: apiKey

## Download OpenAPI description

[MeshVI API](https://docs.meshvi.com/_bundle/apis/meshvi.yaml)

## meshVerified

Certificate verification and retrieval (Acord).

### Get Client Certificate

 - [GET /v1/certificates/clients](https://docs.meshvi.com/apis/meshvi/meshverified/paths/~1v1~1certificates~1clients/get.md): Retrieves the Acord certificate for a client. Provide either client id or DOT number (exactly one).

### Get Client Coverages

 - [GET /v1/coverages/clients](https://docs.meshvi.com/apis/meshvi/meshverified/paths/~1v1~1coverages~1clients/get.md): Verifies active certificates of insurance across DOT numbers. Provide exactly one of: dots (array), dot (single), or id (client ID).

### Get Vehicle Coverages

 - [GET /v1/coverages/vehicles](https://docs.meshvi.com/apis/meshvi/meshverified/paths/~1v1~1coverages~1vehicles/get.md): Verifies certificate of insurance for a vehicle. Provide either vin or licensePlate (exactly one).

### Get Vehicle Certificate

 - [GET /v1/certificates/vehicles](https://docs.meshvi.com/apis/meshvi/meshverified/paths/~1v1~1certificates~1vehicles/get.md): Retrieves the Acord certificate for a vehicle. Provide exactly one of: id, vin, or licensePlate. clientId may be used in some contexts.

### Get Vehicle Certificate

 - [GET /v1/certificates/vehicles](https://docs.meshvi.com/apis/meshvi/vehicles/paths/~1v1~1certificates~1vehicles/get.md): Retrieves the Acord certificate for a vehicle. Provide exactly one of: id, vin, or licensePlate. clientId may be used in some contexts.

## Vehicles

Vehicle CRUD, search, and certificate operations.

### Get Vehicle Certificate

 - [GET /v1/certificates/vehicles](https://docs.meshvi.com/apis/meshvi/meshverified/paths/~1v1~1certificates~1vehicles/get.md): Retrieves the Acord certificate for a vehicle. Provide exactly one of: id, vin, or licensePlate. clientId may be used in some contexts.

### Get Vehicle Certificate

 - [GET /v1/certificates/vehicles](https://docs.meshvi.com/apis/meshvi/vehicles/paths/~1v1~1certificates~1vehicles/get.md): Retrieves the Acord certificate for a vehicle. Provide exactly one of: id, vin, or licensePlate. clientId may be used in some contexts.

### Search vehicles

 - [GET /v1/vehicles](https://docs.meshvi.com/apis/meshvi/vehicles/paths/~1v1~1vehicles/get.md): Paginated search of vehicles with filtering and sorting. Supports query parameters for pagination, sorting, and filtering by VIN, unit, make, owner, garaging address, value, and status.

### Create vehicle

 - [POST /v1/vehicles](https://docs.meshvi.com/apis/meshvi/vehicles/paths/~1v1~1vehicles/post.md): Creates a new vehicle. Required: clientId, unitType/unitTypeName, unit, modelYear, makes/makeCompanyName, serialNumber (VIN, 17 characters). Name-based fields are resolved to IDs via master data lookup.

### Get vehicle detail

 - [GET /v1/vehicles/{id}](https://docs.meshvi.com/apis/meshvi/vehicles/paths/~1v1~1vehicles~1%7Bid%7D/get.md): Retrieves complete vehicle details by ID including driver assignments, coverage types, policy associations, lienholder information, billing details, and audit information.

### Update vehicle

 - [PUT /v1/vehicles/{id}](https://docs.meshvi.com/apis/meshvi/vehicles/paths/~1v1~1vehicles~1%7Bid%7D/put.md): Updates an existing vehicle. Only provided fields are updated (partial update). Name-based fields (makeCompanyName, unitTypeName, licensePlateStateName) are resolved to IDs via master data lookup.

### Get vehicles by lienholder

 - [GET /v1/vehicles/lienholders/{id}](https://docs.meshvi.com/apis/meshvi/vehicles/paths/~1v1~1vehicles~1lienholders~1%7Bid%7D/get.md): Retrieves lienholder detail with associated vehicles. Returns lienholder info (lienholderId, lienholderName, phone, address, agency, vehicleTotalCount, vehicleValueTotalCount, powerUnit, nonPowerUnit) plus vehicles array.

## Clients

Client CRUD and search.

### Search clients

 - [GET /v1/clients](https://docs.meshvi.com/apis/meshvi/clients/paths/~1v1~1clients/get.md): Paginated search of clients with filtering and sorting. Supports page, limit, sort, and filters (name, dot, agencyId, producerId, parentClientId, deleted, clientTypeId, acordEnabled).

### Create client

 - [POST /v1/clients](https://docs.meshvi.com/apis/meshvi/clients/paths/~1v1~1clients/post.md): Creates a new client. Required: clientName, agencyId. Name-based fields (state, city, mailingState, mailingCity) are resolved to IDs via master data lookup. If parentClientId is provided, the parent must belong to the same agency.

### Get client detail

 - [GET /v1/clients/{id}](https://docs.meshvi.com/apis/meshvi/clients/paths/~1v1~1clients~1%7Bid%7D/get.md): Retrieves client details by ID.

### Update client

 - [PUT /v1/clients/{id}](https://docs.meshvi.com/apis/meshvi/clients/paths/~1v1~1clients~1%7Bid%7D/put.md): Updates an existing client. All fields are optional (partial update). If agencyId is provided, the token must be authorized for it. If parentClientId is provided, it must belong to the same agency as the client being updated.

## Documents

Document Manager v1: list, upload, update, and download for clients and policies ([APIAuthorize]).

### List client documents

 - [GET /v1/documents/clients](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1clients/get.md): Returns document file names and time-limited download URLs (S3 pre-signed) for a client. Requires Document Manager View permission scoped to the client module. When dot is provided, the API validates that the DOT is set on the client and that the caller has access (same pattern as GET /v1/clients).

### Upload client document

 - [POST /v1/documents/clients](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1clients/post.md): Multipart upload of a file for a client. Requires Document Manager Create/Edit scoped to the client module. Max request size ~25 MB. Optional Idempotency-Key header: duplicate key returns HTTP 200 with the existing document. On success, response is { success, data } with documentId, fileName, and optional downloadUrl. On failure, body is { errorCode, errorText } (camelCase with CamelCaseResponse).

### List policy documents

 - [GET /v1/documents/policies](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1policies/get.md): Returns document file names and time-limited download URLs for a policy. Requires Document Manager View permission scoped to the policy module.

### Upload policy document

 - [POST /v1/documents/policies](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1policies/post.md): Multipart upload for a policy. Requires Document Manager Create/Edit scoped to the policy module. Same limits and idempotency behavior as POST /v1/documents/clients.

### Update client document

 - [PUT /v1/documents/{id}/client](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1%7Bid%7D~1client/put.md): Replaces/updates an existing document that belongs to a client (multipart). Requires Document Manager Create/Edit for the client module. Path id is the document ID.

### Download client document

 - [GET /v1/documents/{id}/client/download](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1%7Bid%7D~1client~1download/get.md): Returns a wrapped payload with documentId, downloadUrl, and expiresAtUtc. Requires Document Manager View for the client module.

### Update policy document

 - [PUT /v1/documents/{id}/policy](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1%7Bid%7D~1policy/put.md): Updates an existing document tied to a policy. Requires Document Manager Create/Edit for the policy module.

### Download policy document

 - [GET /v1/documents/{id}/policy/download](https://docs.meshvi.com/apis/meshvi/documents/paths/~1v1~1documents~1%7Bid%7D~1policy~1download/get.md): Same as GET /v1/documents/{id}/client/download but authorization is scoped to the policy module.

## Drivers

Driver CRUD and search.

### Search drivers

 - [GET /v1/drivers](https://docs.meshvi.com/apis/meshvi/drivers/paths/~1v1~1drivers/get.md): Paginated search of drivers with filtering and sorting. Supports query parameters for pagination, sorting, and filtering by client, status, license, and search text.

### Create driver

 - [POST /v1/drivers](https://docs.meshvi.com/apis/meshvi/drivers/paths/~1v1~1drivers/post.md): Creates a new driver. Required: clientId, firstName, lastName, driverType. Date fields use MM-dd-yyyy format. Name-based fields (state, city, driverType, dlType) are resolved to IDs via master data lookup.

### Get driver detail

 - [GET /v1/drivers/{id}](https://docs.meshvi.com/apis/meshvi/drivers/paths/~1v1~1drivers~1%7Bid%7D/get.md): Retrieves driver details by ID.

### Update driver

 - [PUT /v1/drivers/{id}](https://docs.meshvi.com/apis/meshvi/drivers/paths/~1v1~1drivers~1%7Bid%7D/put.md): Updates an existing driver. Uses the same request body as create. Only provided fields are updated.

### Associate driver to vehicle

 - [POST /v1/drivers/vehicles](https://docs.meshvi.com/apis/meshvi/drivers/associatedrivertovehicle.md): Associates an existing driver with the specified vehicle, or creates a new driver and associates them. If driverId is provided (>0), the driver must exist. If driverId is 0, firstName and lastName are required to create a new driver.

## Policies

Policy CRUD, search, and related vehicles.

### Search policies

 - [GET /v1/policies](https://docs.meshvi.com/apis/meshvi/policies/paths/~1v1~1policies/get.md): Paginated search of policies. Query params: page, limit, sort, q, policy, clientId, deleted, status, coverageType.

### Create policy

 - [POST /v1/policies](https://docs.meshvi.com/apis/meshvi/policies/paths/~1v1~1policies/post.md): Creates a new policy. Required: clientId, effectiveDate, expirationDate, and either coverageType or fullCoverageTypeName. Name-based fields (insurerName, stateName, producerName, etc.) are resolved to IDs via master data lookup. The token must be authorized for the specified clientId.

### Get policy detail

 - [GET /v1/policies/{id}](https://docs.meshvi.com/apis/meshvi/policies/paths/~1v1~1policies~1%7Bid%7D/get.md): Retrieves policy details by ID.

### Update policy

 - [PUT /v1/policies/{id}](https://docs.meshvi.com/apis/meshvi/policies/paths/~1v1~1policies~1%7Bid%7D/put.md): Updates an existing policy. Only properties present in the request body are updated (partial update). Supports the same fields as create. Name-based fields are resolved via master data lookup.

### Get policy vehicles

 - [GET /v1/policies/{id}/vehicles](https://docs.meshvi.com/apis/meshvi/policies/paths/~1v1~1policies~1%7Bid%7D~1vehicles/get.md): Retrieves a paginated list of vehicles associated with a policy. Supports optional filters for make, value, and status.

