---
title: "Upload Files"
method: POST
path: "/api/v2/uploads"
tags: ["Attachments"]
---

# Upload Files

`POST /api/v2/uploads`

Uploads a file that can be attached to a ticket comment. It doesn't attach the file to the comment. For details and examples, see [Attaching ticket comments with the API](/documentation/ticketing/using-the-zendesk-api/adding-ticket-attachments-with-the-api).

The endpoint has a required `filename` query parameter. The parameter specifies what the file will be named when attached to the ticket comment (to give the agent more context about the file). The parameter does not specify the file on the local system to be uploaded. While the two names can be different, their file extensions must be the same. If they don't match, the agent's browser or file reader could give an error when attempting to open the attachment.

The `Content-Type` header must contain a recognized MIME type that correctly describes the type of the uploaded file. Failing to send a recognized, correct type may cause undesired behavior. For example, in-browser audio playback may be interrupted by the browser's security mechanisms for MP3s uploaded with an incorrect type.

Adding multiple files to the same upload is handled by splitting requests and passing the API token received from the first request to each subsequent request. The token is valid for 60 minutes.

**Note**: Even if [private attachments](https://support.zendesk.com/hc/en-us/articles/204265396) are enabled in the Zendesk Support instance, uploaded files are visible to any authenticated user at the `content_URL` specified in the [JSON response](#json-format) until the upload token is consumed. Once a file is associated with a ticket or post, visibility is restricted to users with access to the ticket or post with the attachment.

#### Allowed For

* End users

## Response `201`

Created response

- AttachmentUploadResponse
  - `upload` object
    - `attachment` AttachmentObject — A file represented as an [Attachment](/api-reference/ticketing/tickets/ticket-attachments/) object
      - `content_type` string — The content type of the image. Example value: "image/png"
      - `content_url` string — A full URL where the attachment image file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. See [Working with url properties](/documentation/ticketing/managing-tickets/working-with-url-properties)
      - `deleted` boolean — If true, the attachment has been deleted
      - `file_name` string — The name of the image file
      - `height` integer — The height of the image file in pixels. If height is unknown, returns null
      - `id` integer — Automatically assigned when created
      - `inline` boolean — If true, the attachment is excluded from the attachment list and the attachment's URL can be referenced within the comment of a ticket. Default is false
      - `malware_access_override` boolean — If true, you can download an attachment flagged as malware. If false, you can't download such an attachment.
      - `malware_scan_result` string — The result of the malware scan. There is a delay between the time the attachment is uploaded and when the malware scan is completed. Usually the scan is done within a few seconds, but high load conditions can delay the scan results. Possible values: "malware_found", "malware_not_found", "failed_to_scan", "not_scanned"
      - `mapped_content_url` string — The URL the attachment image file has been mapped to
      - `size` integer — The size of the image file in bytes
      - `url` string — A URL to access the attachment details
      - `width` integer — The width of the image file in pixels. If width is unknown, returns null
      - `thumbnails` AttachmentBaseObject[] — An array of attachment objects. Note that photo thumbnails do not have thumbnails
        - `content_type` string — The content type of the image. Example value: "image/png"
        - `content_url` string — A full URL where the attachment image file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. See [Working with url properties](/documentation/ticketing/managing-tickets/working-with-url-properties)
        - `deleted` boolean — If true, the attachment has been deleted
        - `file_name` string — The name of the image file
        - `height` integer — The height of the image file in pixels. If height is unknown, returns null
        - `id` integer — Automatically assigned when created
        - `inline` boolean — If true, the attachment is excluded from the attachment list and the attachment's URL can be referenced within the comment of a ticket. Default is false
        - `malware_access_override` boolean — If true, you can download an attachment flagged as malware. If false, you can't download such an attachment.
        - `malware_scan_result` string — The result of the malware scan. There is a delay between the time the attachment is uploaded and when the malware scan is completed. Usually the scan is done within a few seconds, but high load conditions can delay the scan results. Possible values: "malware_found", "malware_not_found", "failed_to_scan", "not_scanned"
        - `mapped_content_url` string — The URL the attachment image file has been mapped to
        - `size` integer — The size of the image file in bytes
        - `url` string — A URL to access the attachment details
        - `width` integer — The width of the image file in pixels. If width is unknown, returns null
    - `attachments` AttachmentObject[]
      - `content_type` string — The content type of the image. Example value: "image/png"
      - `content_url` string — A full URL where the attachment image file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. See [Working with url properties](/documentation/ticketing/managing-tickets/working-with-url-properties)
      - `deleted` boolean — If true, the attachment has been deleted
      - `file_name` string — The name of the image file
      - `height` integer — The height of the image file in pixels. If height is unknown, returns null
      - `id` integer — Automatically assigned when created
      - `inline` boolean — If true, the attachment is excluded from the attachment list and the attachment's URL can be referenced within the comment of a ticket. Default is false
      - `malware_access_override` boolean — If true, you can download an attachment flagged as malware. If false, you can't download such an attachment.
      - `malware_scan_result` string — The result of the malware scan. There is a delay between the time the attachment is uploaded and when the malware scan is completed. Usually the scan is done within a few seconds, but high load conditions can delay the scan results. Possible values: "malware_found", "malware_not_found", "failed_to_scan", "not_scanned"
      - `mapped_content_url` string — The URL the attachment image file has been mapped to
      - `size` integer — The size of the image file in bytes
      - `url` string — A URL to access the attachment details
      - `width` integer — The width of the image file in pixels. If width is unknown, returns null
      - `thumbnails` AttachmentBaseObject[] — An array of attachment objects. Note that photo thumbnails do not have thumbnails
        - `content_type` string — The content type of the image. Example value: "image/png"
        - `content_url` string — A full URL where the attachment image file can be downloaded. The file may be hosted externally so take care not to inadvertently send Zendesk authentication credentials. See [Working with url properties](/documentation/ticketing/managing-tickets/working-with-url-properties)
        - `deleted` boolean — If true, the attachment has been deleted
        - `file_name` string — The name of the image file
        - `height` integer — The height of the image file in pixels. If height is unknown, returns null
        - `id` integer — Automatically assigned when created
        - `inline` boolean — If true, the attachment is excluded from the attachment list and the attachment's URL can be referenced within the comment of a ticket. Default is false
        - `malware_access_override` boolean — If true, you can download an attachment flagged as malware. If false, you can't download such an attachment.
        - `malware_scan_result` string — The result of the malware scan. There is a delay between the time the attachment is uploaded and when the malware scan is completed. Usually the scan is done within a few seconds, but high load conditions can delay the scan results. Possible values: "malware_found", "malware_not_found", "failed_to_scan", "not_scanned"
        - `mapped_content_url` string — The URL the attachment image file has been mapped to
        - `size` integer — The size of the image file in bytes
        - `url` string — A URL to access the attachment details
        - `width` integer — The width of the image file in pixels. If width is unknown, returns null
    - `token` string — Token for subsequent request

---

[API](https://skmtc.net/botbrains-io/apis/support-api.md) · [All operations](https://skmtc.net/botbrains-io/apis/support-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/botbrains-io/support-api/versions/d53eac07ba68/schema)
