Creates a single document. The legacy version of this endpoint can be found at samsara.com/api-legacy.
Rate limit: 100 requests/min (learn more about rate limits here).
To use this endpoint, select Write Documents under the Driver Workflow category when creating or editing an API token. Learn More.
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
curl --request POST \
--url https://api.samsara.com/fleet/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"documentTypeId": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"driverId": "45646",
"fields": [
{
"label": "Load weight",
"type": "photo",
"value": {
"barcodeValue": [
{
"barcodeType": "org.gs1.EAN-13",
"barcodeValue": "0853883003114"
}
],
"dateTimeValue": {
"dateTime": "1982-06-16T15:19:13Z"
},
"multipleChoiceValue": [
{
"selected": false,
"value": "Yes"
}
],
"numberValue": 123.456,
"photoValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"scannedDocumentValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"signatureValue": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"name": "John Smith",
"signedAtTime": "2008-01-05T01:56:51Z",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
},
"stringValue": "Red Truck"
}
}
],
"name": "Dropoff Slip 123",
"notes": "Missing a crate",
"routeStopId": "45646",
"state": "submitted",
"vehicleId": "45646"
}
'{
"data": {
"createdAtTime": "2009-03-03T07:48:13Z",
"documentType": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"name": "Fleet Truck List"
},
"driver": {
"id": "45646",
"externalIds": {},
"name": "Driver Bob"
},
"fields": [
{
"label": "Load weight",
"type": "photo",
"value": {
"barcodeValue": [
{
"barcodeType": "org.gs1.EAN-13",
"barcodeValue": "0853883003114"
}
],
"dateTimeValue": {
"dateTime": "2002-02-18T15:38:47Z"
},
"multipleChoiceValue": [
{
"selected": false,
"value": "Yes"
}
],
"numberValue": 123.456,
"photoValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"scannedDocumentValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"signatureValue": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"name": "John Smith",
"signedAtTime": "1985-01-18T04:30:49Z",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
},
"stringValue": "Red Truck"
}
}
],
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"state": "submitted",
"conditionalFieldSections": [
{
"conditionalFieldFirstIndex": 7614788251245023000,
"conditionalFieldLastIndex": 4183211541072084000,
"triggeringFieldIndex": 4033010555242500600,
"triggeringFieldValue": "Optiona 1"
}
],
"name": "Dropoff Slip 123",
"notes": "Missing a crate",
"route": {
"id": "131313",
"externalIds": {},
"name": "Pineapple delivery"
},
"routeStop": {
"externalIds": {},
"id": "494123",
"name": "Company Warehouse #1"
},
"updatedAtTime": "1992-02-28T12:42:58Z",
"vehicle": {
"externalIds": {},
"id": "494123",
"name": "Fleet Truck #1"
}
}
}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.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ID for the document type.
"9814a1fa-f0c6-408b-bf85-51dc3bc71ac7"
ID of the driver. Can be either unique Samsara ID or an external ID for the driver.
"45646"
The fields associated with this document.
Show child attributes
Name of the document.
"Dropoff Slip 123"
Notes on the document.
2000"Missing a crate"
ID of the route stop. Can be either unique Samsara ID or an external ID for the route stop.
"45646"
The condition of the document created for the driver. Can be either required or submitted, if no value is specified, state defaults to required. required documents are pre-populated documents for the Driver to fill out in the Driver App. Valid values: submitted, required
submitted, required "submitted"
ID of the vehicle. Can be either unique Samsara ID or an external ID for the vehicle.
"45646"
OK response.
A single document.
Show child attributes
curl --request POST \
--url https://api.samsara.com/fleet/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"documentTypeId": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"driverId": "45646",
"fields": [
{
"label": "Load weight",
"type": "photo",
"value": {
"barcodeValue": [
{
"barcodeType": "org.gs1.EAN-13",
"barcodeValue": "0853883003114"
}
],
"dateTimeValue": {
"dateTime": "1982-06-16T15:19:13Z"
},
"multipleChoiceValue": [
{
"selected": false,
"value": "Yes"
}
],
"numberValue": 123.456,
"photoValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"scannedDocumentValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"signatureValue": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"name": "John Smith",
"signedAtTime": "2008-01-05T01:56:51Z",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
},
"stringValue": "Red Truck"
}
}
],
"name": "Dropoff Slip 123",
"notes": "Missing a crate",
"routeStopId": "45646",
"state": "submitted",
"vehicleId": "45646"
}
'{
"data": {
"createdAtTime": "2009-03-03T07:48:13Z",
"documentType": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"name": "Fleet Truck List"
},
"driver": {
"id": "45646",
"externalIds": {},
"name": "Driver Bob"
},
"fields": [
{
"label": "Load weight",
"type": "photo",
"value": {
"barcodeValue": [
{
"barcodeType": "org.gs1.EAN-13",
"barcodeValue": "0853883003114"
}
],
"dateTimeValue": {
"dateTime": "2002-02-18T15:38:47Z"
},
"multipleChoiceValue": [
{
"selected": false,
"value": "Yes"
}
],
"numberValue": 123.456,
"photoValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"scannedDocumentValue": [
{
"id": "f5271458-21f9-4a9f-a290-780c6d8840ff",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
}
],
"signatureValue": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"name": "John Smith",
"signedAtTime": "1985-01-18T04:30:49Z",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
},
"stringValue": "Red Truck"
}
}
],
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"state": "submitted",
"conditionalFieldSections": [
{
"conditionalFieldFirstIndex": 7614788251245023000,
"conditionalFieldLastIndex": 4183211541072084000,
"triggeringFieldIndex": 4033010555242500600,
"triggeringFieldValue": "Optiona 1"
}
],
"name": "Dropoff Slip 123",
"notes": "Missing a crate",
"route": {
"id": "131313",
"externalIds": {},
"name": "Pineapple delivery"
},
"routeStop": {
"externalIds": {},
"id": "494123",
"name": "Company Warehouse #1"
},
"updatedAtTime": "1992-02-28T12:42:58Z",
"vehicle": {
"externalIds": {},
"id": "494123",
"name": "Fleet Truck #1"
}
}
}