---
title: "[beta] Attach a file to an estimate"
method: POST
path: "/maintenance/estimates/attachments"
tags: ["Beta APIs"]
---

# \[beta\] Attach a file to an estimate

`POST /maintenance/estimates/attachments`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/maintenance/estimates/attachments`
- Auth: HTTP bearer

Attach a PDF, JPEG or PNG to an editable estimate and its work order. Supply exactly one of file (up to 7.5 MB decoded) or upload (up to 40 MB). For upload, PUT the declared file with matching Content-Type, Content-MD5 and Content-Length before uploadPut expires, then read the estimate for availability. Up to 50 work-order attachments are supported.

 <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 Work Orders** under the Work Orders 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.

## Request body

- MaintenanceEstimateAttachmentsCreateMaintenanceEstimateAttachmentRequestBody: Supply exactly one of file or upload. Upload creates a temporary PUT session; read the estimate after uploading to see availability.
  - `estimateId` string, required: Estimate UUID or external ID. The estimate must be editable.
  - `file` MaintenanceEstimateInlineFileRequestBody: Inline file; at most 7.5 MB decoded or 10 MB base64 encoded.
    - `base64Content` string, required: Base64-encoded document bytes; at most 10 MB encoded and 7.5 MB decoded.
    - `contentType` 'application/pdf' | 'image/jpeg' | 'image/png', required: Media MIME type. Supported formats are PDF, JPEG and PNG. Valid values: `application/pdf`, `image/jpeg`, `image/png`
  - `name` string: Filename, at most 255 Unicode characters; generated when omitted.
  - `upload` MaintenanceAttachmentUploadRequestBody: Create a presigned PUT upload session. Send the declared Content-Type, Content-MD5 and Content-Length with the PUT before expiry.
    - `contentMd5` string, required: Standard base64 encoding of the file's 16-byte MD5 digest.
    - `contentType` 'application/pdf' | 'image/jpeg' | 'image/png', required: File MIME type. Valid values: `application/pdf`, `image/jpeg`, `image/png`
    - `fileSizeBytes` integer, required: Exact file length in bytes; at most 40 MB.

## Response `200`

OK response.

- MaintenanceEstimateAttachmentsCreateMaintenanceEstimateAttachmentResponseBody
  - `data` MaintenanceEstimateAttachmentCreateResultResponseBody, required: Created attachment and optional upload session.
    - `createdAtTime` string, date-time, required: Time the attachment was created.
    - `id` string, required: Stable attachment ID.
    - `name` string, required: Original or generated filename.
    - `processingStatus` 'unknown' | 'processing' | 'finished', required: Attachment availability. Defaults to processing until a validated download is available; unknown when availability cannot be determined. Valid values: `unknown`, `processing`, `finished`
    - `updatedAtTime` string, date-time, required: Latest attachment change; initially equal to creation time.
    - `uploadPut` FunctionsStorageSignedUrlOfTypeResponseBody: A presigned URL for a file in Functions storage.
      - `expiresAtTime` string, date-time, required: RFC 3339 timestamp when the presigned URL expires.
      - `url` string, required: The presigned URL.
    - `url` string, uri: Temporary download URL; present only when processingStatus is finished.
    - `urlExpiresAt` string, date-time: Expiration of the temporary download URL; present only with url.

## Other responses

- `401`: Unauthorized response.
- `404`: Not Found response.
- `405`: Method Not Allowed response.
- `409`: Conflict response.
- `413`: Content Too Large response.
- `429`: Too Many Requests response.
- `500`: Internal Server Error response.
- `501`: Not Implemented response.
- `502`: Bad Gateway response.
- `503`: Service Unavailable response.
- `504`: Gateway Timeout response.
- `default`: Bad Request response.

---

[API](https://skmtc.dev/samsara/apis/samsara-api.md) - [All operations](https://skmtc.dev/samsara/apis/samsara-api/llms.txt) - [OpenAPI document](https://skmtc.dev/samsara/apis/samsara-api/revisions/a9e35d4999be?raw)
