/documents (v2)

Creates a document which needs to be used.

Send a document to the dispatch

To send a document to a dispatch please do the following steps:

Step 1: Make a POST call to https://api.keeptruckin.com/v1/documents and pass the category parameter as dispatch and also pass in the dispatch_id of the relevant dispatch as a parameter.

{
     "doc_name": "bill of lading",
     "doc_date": "2022-06-08",
     "category": "dispatch",
     "doc_type": "pdf",
     "doc_size": 5,
     "driver_id": 123,
     "dispatch_id": 40,
     "doc_time": "2022-06-08T21:54:56.601Z"
}

Step 2: Upload the document using the upload_url from the response of the POST call.

Step 3: After uploading the document, make a PUT call to https://api.keeptruckin.com/v1/documents/:id and pass the upload_status parameter as completed.

{
  "id":15310,
  "upload_status":"completed"
}

Update: Upload vehicle as well as driver qualification documents

❗️

IMPORTANT

This update is only available for POST v2/documents endpoint.

The /documents API also allows you to upload vehicle and driver qualification documents. You can follow the steps mentioned-above to upload the documents, but ensure to provide the following JSON fields for the documents.

Vehicle Documents

"doc_json_fields": {
           "expiration_date":"2026-12-24T05:00:00.000Z",
           "vehicle_doc_members": {
            "vehicle_ids": [34337,34323],
            "group_ids": []
           }
        }
  • expiration_date: Specify the expiration date for the document. For example, if you are uploading the vehicle registration certificate, mention its expiry date.
  • vehicle_ids: Mention the IDs of all the vehicles for which you are uploading this document. For example, if you are uploading a vehicle insurance document, and it covers multiple vehicles, then you must mention all the vehicles for which the documents is pertaining to.
  • group_ids: Specify the ID of the group for which you are uploading this document.

Qualification Documents

 "doc_json_fields": {
           "expiration_date":"2026-12-24T05:00:00.000Z",
           "driver_id": "1193969"
        }
  • expiration_date: Specify the expiration date for the driver's qualification document. For example, if you are uploading the driver's license, mention its expiry date.
  • driver_id: Specify the ID of the driver for whom you are uploading this document.

📘

NOTE

When specifying the driver_id, ensure to use the "Internal Motive Driver ID".


Language
Credentials
Header
Click Try It! to start a request and see the response here!