Beta APIs

[beta] Create a tachograph file upload.

Reserve a tachograph file upload and return a presigned URL. Upload the file bytes directly to the URL with the returned headers. The driver or device the file belongs to is resolved from the file contents after upload.

Uploading the file

Once you have the uploadUrl and requiredHeaders from the response, PUT the raw file bytes directly to the URL — do not send the request through the Samsara API servers:

curl -X PUT "<uploadUrl>" \
  -H "Content-Type: <value from requiredHeaders>" \
  -H "Content-MD5: <value from requiredHeaders>" \
  -H "Content-Length: <value from requiredHeaders>" \
  --data-binary @/path/to/file.ddd

Every header listed in requiredHeaders must be sent verbatim — they are part of the URL signature, and the upload is rejected with a 403 if any header is missing or has a different value.

Retrieving uploaded files

A successful response to this request reserves the upload; it does not indicate that a file has been received or processed. Uploaded files are processed asynchronously after the PUT completes. Once a file has been processed, it can be retrieved through the standard tachograph file endpoints:

  • Driver-card files — GET /fleet/drivers/tachograph-files/history
  • Vehicle-unit files — GET /fleet/vehicles/tachograph-files/history

Files that cannot be processed — for example files that are corrupt, are not valid tachograph files, or cannot be matched to a driver or vehicle in your organization — are not retrievable through these endpoints.

<b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select Write Tachograph (EU) under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

post/fleet/tachograph/file-uploads

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

contentMd5string required

Base64-encoded MD5 digest of the file bytes (base64(md5(bytes))). Used as the Content-MD5 integrity check enforced by object storage on upload.

contentType'application/octet-stream' required

The MIME content type of the file. The upload is sent to object storage as raw bytes. Valid values: application/octet-stream

fileSizeBytesinteger required

The size of the file in bytes. Enforced as the Content-Length on upload. Maximum 10 MB (10485760 bytes).

fileType'driverCard' | 'vehicleUnit' required

The kind of tachograph file being uploaded. The driver or device the file belongs to is resolved from the file contents, not from this field. Valid values: driverCard, vehicleUnit

Example request

{
  "contentMd5": "rL0Y20zC+Fzt72VPzMSk2A==",
  "contentType": "application/octet-stream",
  "fileSizeBytes": 8192,
  "fileType": "driverCard"
}

Response

OK response.

Example response

{
  "data": {
    "expiresAtTime": "2024-01-01T13:00:00Z",
    "requiredHeaders": [
      {
        "name": "Content-MD5",
        "value": "rL0Y20zC+Fzt72VPzMSk2A=="
      }
    ],
    "uploadUrl": "https://example-bucket.s3.amazonaws.com/tachograph-uploads/v1/...?X-Amz-Signature=..."
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.