> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alvys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload driver document

> Upload multipart/form-data. One file per request. Max file size 10 MB.
Allowed document types: License, Medical, Driver License, Driver Sheet, Drug Test, Operating Authority, Completed W9 Tax Form (W9 Form), Other Documents.
Allowed MIME types: application/pdf, image/jpeg, image/png.

Upload multipart/form-data. One file per request. Max file size 10 MB.
Allowed document types: License, Medical, Driver License, Driver Sheet, Drug Test, Operating Authority, Completed W9 Tax Form (W9 Form), Other Documents.
Allowed MIME types: application/pdf, image/jpeg, image/png.

Upload a document to a specific driver record. Supports `multipart/form-data`. Each request must contain exactly one file.

* **Max file size:** 25 MB
* **Allowed MIME types:** `application/pdf`, `image/jpeg`, `image/png`, `image/gif`
* **Allowed Document Types:** License, DriverLicense, DriverSheet, Drug Test, Medical *(suggested rename: Medical Card)*, Operating Authority, Completed W9 Tax Form (W9 Form), Other Documents

***

### Parameters

| Parameter  | In   | Type   | Required | Description                     |
| ---------- | ---- | ------ | -------- | ------------------------------- |
| `driverId` | path | string | Yes      | Unique identifier of the driver |
| `version`  | path | string | Yes      | API version (e.g., `1.0`)       |

***

### Request Body

`multipart/form-data`

| Parameter      | Type   | Required | Description                                                                  |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------- |
| `File`         | binary | Yes      | The file to upload (PDF, JPEG, PNG). Max size 25 MB.                         |
| `FileName`     | string | No       | Optional custom filename (if omitted, filename is taken from multipart part) |
| `DocumentType` | string | Yes      | The type of document. Must match one of the allowed document types.          |

***

#### Example Request (cURL)

```bash theme={null}
curl -X POST "{{host}}/api/p/v1/drivers/{driverId}/document" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: multipart/form-data" \
  -F "File=@Driver_License.pdf" \
  -F "DocumentType=License"
```

***

### Response Body

| Name             | Type    | Description                                                                 |
| ---------------- | ------- | --------------------------------------------------------------------------- |
| `id`             | string  | Unique identifier of the uploaded document                                  |
| `AttachmentPath` | string  | File name/path assigned on upload + timestamp suffix (1757343192)           |
| `AttachmentType` | string  | Type of document (matches `DocumentType`)                                   |
| `AttachmentSize` | integer | Size of the file in bytes                                                   |
| `UploadedAt`     | string  | UTC timestamp when the file was uploaded                                    |
| `ParentId`       | string  | Identifier of the parent entity (e.g., driverId, loadNumber, tripId)        |
| `ParentType`     | string  | Entity type the document is attached to (e.g., Driver, Load, Trip, Trailer) |

#### Example Response

**200 OK**

```json theme={null}
{
  "id": "4b5c38bd-005e-4903-a4ee-45ca5e86411a",
  "AttachmentPath": "DriverLicense-1757343192.pdf",
  "AttachmentType": "License",
  "AttachmentSize": 5245329,
  "UploadedAt": "2025-09-09T08:26:03.194Z",
  "ParentId": "DR12345",
  "ParentType": "Driver"
}
```

<br />

On the right side, you can see examples of different error codes by clicking **Example** and selecting the response code.

***

### Rate Limits

All endpoints are subject to rate limits to protect the API from traffic spikes.
For detailed information, see the [Rate Limits](/docs/rate-limits) section.

***

### Try It Out

This page is interactive, allowing you to try a request by specifying the **API version** and **driverId** in the URL path.

As you fill out the parameters, the cURL command on the right side of the page will be automatically updated. Alternatively, you can directly edit the cURL command.

⚠️ Don’t forget: make sure to **authorize yourself** before trying a request.


## OpenAPI

````yaml POST /api/p/v{version}/drivers/{driverId}/document
openapi: 3.0.1
info:
  title: Alvys
  description: >-
    Alvys provides a robust set of REST APIs to allow you to integrate Alvys
    into virtually any platform. These APIs cover most of Alvys' major product
    areas with additional endpoints being added regularly based on customer
    requests.
  contact:
    name: Alvys Support
    url: https://www.alvys.com/resources/contact/
  version: v1
servers:
  - url: https://integrations.alvys.com
    description: Public API Server
  - url: https://api.alvys.com/
    description: Public API Server
security:
  - Public: []
tags:
  - name: Authentication
    description: Obtain an OAuth 2.0 access token for the Alvys Public API.
  - name: Carrier Settlement Statements
    description: >-
      Search carrier settlement statements and retrieve a single statement by
      number.
  - name: Carriers
    description: Read carrier records, search carriers, and manage carrier documents.
  - name: Customers
    description: Create, read, update, delete, and search customer records.
  - name: Deductions
    description: >-
      Create one-time deductions and search or delete existing deduction
      records.
  - name: DispatchPreferences
    description: Dispatch preferences endpoints for reading dispatch rules and preferences.
  - name: Driver Settlement Statements
    description: >-
      Search driver settlement statements and retrieve a single statement by
      number.
  - name: Drivers
    description: >-
      Read driver records, search drivers and driver events, and manage driver
      documents.
  - name: Fuel
    description: Read and search fuel transactions.
  - name: Invoices
    description: >-
      Read invoices, create carrier invoices, and record carrier and customer
      payments.
  - name: Loads
    description: Read, update, search loads, and manage load documents and notes.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read, search trips, manage trip documents, and record stop appointments,
      arrivals, and departures.
  - name: Trucks
    description: Read trucks, search truck events, and manage truck documents.
  - name: Users
    description: List and search users.
  - name: Visibility
    description: >-
      Read inbound and outbound visibility history and search outbound
      visibility errors.
  - name: Webhooks
    description: >-
      Create, read, update, delete, enable, disable, verify, test, and rotate
      secrets for webhook subscriptions; read event types, delivery logs, and
      health metrics.
paths:
  /api/p/v{version}/drivers/{driverId}/document:
    post:
      tags:
        - Drivers
      summary: Upload driver document
      description: >-
        Upload multipart/form-data. One file per request. Max file size 10 MB.

        Allowed document types: License, Medical, Driver License, Driver Sheet,
        Drug Test, Operating Authority, Completed W9 Tax Form (W9 Form), Other
        Documents.

        Allowed MIME types: application/pdf, image/jpeg, image/png.
      parameters:
        - name: driverId
          in: path
          required: true
          schema:
            type: string
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Alvys.Models.Documents.SingleDocumentUploadRequest
            encoding:
              File:
                allowReserved: true
              FileName:
                allowReserved: true
              DocumentType:
                allowReserved: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alvys.Models.PublicAPI.AttachmentResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '413':
          description: Content Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '415':
          description: Unsupported Media Type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.Documents.SingleDocumentUploadRequest:
      required:
        - DocumentType
        - File
      type: object
      properties:
        File:
          type: string
          format: binary
        FileName:
          type: string
          nullable: true
        DocumentType:
          minLength: 1
          type: string
      additionalProperties: false
    Alvys.Models.PublicAPI.AttachmentResponse:
      required:
        - AttachmentPath
        - AttachmentType
        - id
        - ParentId
        - ParentType
      type: object
      properties:
        id:
          type: string
        AttachmentPath:
          type: string
        AttachmentType:
          type: string
        AttachmentSize:
          type: integer
          format: int64
          nullable: true
        UploadedAt:
          type: string
          format: date-time
          nullable: true
        ParentId:
          type: string
        ParentType:
          type: string
        UploadedBy:
          type: string
          nullable: true
        DownloadUrl:
          type: string
          nullable: true
        ExpiresAt:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ValidationProblemDetails:
      required:
        - Errors
      type: object
      properties:
        Errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    Public:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        OAuth 2.0 client-credentials access token. Obtain one from
        https://auth.alvys.com/oauth/token (grant_type=client_credentials,
        audience=https://api.alvys.com/public/), then paste it here. The
        playground sends it as `Authorization: Bearer <token>`.

````