Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Create a document endpoint allows you to perform two main actions:- Create a document for a driver to fill out in the Driver App
- Submit a document on a driver’s behalf
Document State
A document’s state determines if it is created for a driver to fill out in the Driver App or if the document is submitted on behalf of the driver.- Setting a document’s state to
Requiredcreates a document for the driver to fill out in the Driver App. The most common use case for this is Creating Stop Tasks in Routes. The document will be marked as “Required” in the Driver App. - Setting a document’s state to
Submittedwill submit the document on behalf of the driver. A fleet admin will then be able to view the document in the Samsara Dashboard. It will appear as if the driver submitted the document from the Driver App.
Required.
Create Document Request
The Create a document endpoint allows you to create or submit a document for a given driver. For example:| Field | Description |
|---|---|
documentTypeUuid | The UUID of the Document Type that describes the template for this document. |
name | An optional name for this document. |
fields | The fields for this document. This will either define default values or provide values that are submitted on behalf of the driver. |
state | Valid values: Required or Submitted. Defaults to Required. |
dispatchJobId | The ID of a route stop if you want to associate this document with a particular route stop. |
notes | Optional notes for the document. |
Defining Fields
Thefields array of the document creation request should list fields and values in the same order they appear in the Document Type for the given document.
For example, list the Load # field first, then the Did you drop the trailer? field, and so on. The field order must match the order returned by the Document Types API.
Required state, the driver can fill out the values through the driver app. If a document is in the Submitted state, the document will contain default values for any fields left blank.
Field Values
All fields have:label— same as the label defined by the document typetype— one ofphoto,string,number,multipleChoice,signature,dateTime,scannedDocument,barcode- The actual value for the field. This property can be omitted if you wish for the field to assume a default value.
String Fields
stringValue is omitted: ""
Multiple Choice Fields
selected. If an option is not selected, it may be omitted.
Default if multipleChoiceValue is omitted: [] (none of the options were selected).
Number Fields
numberValue is omitted: 0.
Datetime Fields
dateTime is measured in RFC 3339 format.
Default if dateTimeMs is omitted: 0 (appears as if the field was left blank).
Photo Fields
Photos cannot be submitted via the API. The value for a photo field must be left blank.Required state, the driver will be able to submit photos through the Driver App.
Signature Fields
Signatures cannot be submitted via the API. The value for a signature field must be left blank.Required state, the driver will be able to capture a signature through the Driver App.