> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# supportAttachmentUploadCreate

> Start a file upload for a help desk reply, note or macro. PUT the file's raw bytes to the returned `url` before `expiresAt`, then pass its `uploadId` in a reply's or note's `attachments`, to supportMacroAttachmentAdd, or in a macro body's `inlineImages`. Needs support_messages_send or support_macros_write, the scopes of the writes that use it. Counts against the upload quota; over the quota returns THROTTLED.

**Required scopes:** [`support_messages_send`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_messages_send), [`support_macros_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-support_macros_write)

## Arguments

**byteSize** `Int!` *required*

The file's exact size in bytes, 1 to 25000000. It is signed into the URL, so a file of any other size is rejected.

## Returns

**supportAttachmentUploadCreate** `[SupportAttachmentUpload!](/docs/api-reference/v3/reference/support/support-attachment-upload)` *required*

A place to PUT one file for a help desk reply, note or macro, so its bytes never pass through the API request.

**fields**

**expiresAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When `url` stops accepting the file.

**uploadId** `String!` *required*

Once the file is uploaded, pass it in a reply's or note's `attachments`, to supportMacroAttachmentAdd, or in a macro body's `inlineImages`. Each upload can be used once.

**url** `String!` *required*

Where to PUT the file's raw bytes, e.g. `curl --fail -X PUT --upload-file ./receipt.pdf "<url>"`.

## Errors

Besides the [errors any request can return](https://developers.redo.com/docs/api-reference/v3/errors.md), this operation fails with these codes in `extensions.code`.

| Code | HTTP status | Meaning | Retry |
| - | - | - | - |
| `API_TOKEN_REQUIRED` | `403` | The credential has no API token to attribute the change to, such as a first-party token. Nothing was sent. | Call with a store API token. |
| `BAD_USER_INPUT` | `400` | An argument is invalid, or names something the store doesn't have. The message says which. Nothing was written. | Fix the input the message names, then send it again. |
| `INVALID_BYTE_SIZE` | `400` | The byteSize of an upload is outside what the file may be. The message gives the limits. No upload was started. | Pass the file's exact size, within the limits. |
| `TRY_AGAIN` | `503` | The change couldn't start for a passing reason, and nothing was written or sent. | Send the same request again after a short wait, with the same idempotencyKey if it has one. |
| `INTERNAL_SERVER_ERROR` | `500` | Something failed on Redo's side. The change may or may not have been made. | Read the record to see whether the change was made before sending it again. A send with an idempotencyKey is safe to retry with the same key. |

## Example

```graphql theme={null}
mutation {
  supportAttachmentUploadCreate(byteSize: 10) {
    expiresAt
    uploadId
    url
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.