---
title: "Upload Attachment"
source_url: https://docs.rapyd.net/en/upload-attachment.html
lang: en
---

# Upload Attachment

Uploads one file and returns a batch token. Pass the token in the `attachments` array of [Create Ticket](https://docs.rapyd.net/en/create-ticket.md "Create Ticket") or [Add Comment](https://docs.rapyd.net/en/add-comment.md "Add Comment")to attach the file.

The Rapyd file service handles this endpoint, not the host that handles the ticket calls. Sign the request like any other API call. Sign the file upload without a body.

Each call accepts one file. The file must be a `.jpg`, `.jpeg`, `.png`, `.pdf`, or `.csv` file and up to 10 MiB. The token belongs to the organization that uploaded the file.

### Parameters

### Request Header Parameters

- - access_key (string, required)
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type (string, required)
  - Indicates that the data appears as a file. Set to **multipart/form-data**.
- - idempotency (string)
  - A unique key that prevents the platform from creating the same object twice.

    See [Idempotency](https://docs.rapyd.net/en/idempotency.md "Idempotency").
- - salt (string, required)
  - Random string. Recommended length: 8-16 characters.
- - signature (string, required)
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp (string, required)
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).
- - api_timestamp (string, required)
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Request Body Parameters

- - file (string)
  - The file to upload. Send exactly one file part. The name of the form field does not matter.

### 200 OK Response

- - created_at (number)
  - The time of the upload, in Unix seconds.
- - id (string)
  - The batch token. Pass it in the `attachments` array of [Create Ticket](https://docs.rapyd.net/en/create-ticket.md "Create Ticket") or [Add Comment](https://docs.rapyd.net/en/add-comment.md "Add Comment").
- - original_name (string)
  - The original name of the file.
- - status (string)
  - The status of the upload, for example `NEW`.
- - type (string)
  - The upload type. Always `support_ticket_attachment`.

- /v1/support/tickets/attachments

- Upload Attachment
- ```curl
  curl -X post 'https://<files-host>/v1/support/tickets/attachments' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: multipart/form-data' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --form 'file=@"invoice.pdf"'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "6f1c1d0e-2b7a-4f0e-9d0a-3c1d8e2b7a11"
      },
      "data": {
          "id": "batch_9f1c2d7e4a6b",
          "original_name": "invoice.pdf",
          "type": "support_ticket_attachment",
          "status": "NEW",
          "created_at": 1791448100
      }
  }
  ```
