---
title: "bird amb attachments upload"
description: "Upload an attachment"
canonical: "https://bird.com/docs/cli/reference/amb-attachments-upload"
---

# `bird amb attachments upload`

## Usage

```bash
bird amb attachments upload [flags]
```

## Description

Upload an attachment

Uploads a file to Apple for one business account and returns an `aat_` attachment ID to send in `text.attachments[].attachment_id`, so the same file can be sent many times without uploading it again. Upload a local file, or supply `source_url` and Bird downloads the file. Each call uploads a new attachment. Apple keeps an attachment for about 30 days after its last use.

Pass the file with --file ("-" reads stdin); any other fields are
flags. Run --dry-run to print the parts that would be sent, including the
file's path and size, without uploading it.

## Examples

```bash
# check what would be sent, without sending it
bird amb attachments upload --from <from> --file ./document.pdf --dry-run

# upload it
bird amb attachments upload --from <from> --file ./document.pdf
```

## Options

#### Request

| Name                | Description                                                  |
| ------------------- | ------------------------------------------------------------ |
| `--dry-run`         | Print the resolved request without sending it, then exit     |
| `--idempotency-key` | Deduplication key; a retry with the same key won't act twice |

#### Options

| Name                | Description                                                                                                                                                                                          |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--from`            | Apple business identifier of the business account that sends the attachment. Read it from the business account's apple\_business\_id. Only this business account can send the attachment. (required) |
| `--file`            | The file, at most 25,000,000 bytes. Its filename becomes the attachment's name unless name is given. Supply this or source\_url.                                                                     |
| `--source-url`      | HTTPS URL of a file of at most 99,999,999 bytes, which Bird downloads instead of an uploaded file. Supply this or file. A non-HTTPS URL is refused with a 422 AMBEndpointNotHTTPS.                   |
| `--name`            | Display filename. Defaults to the uploaded filename, else the last segment of the source\_url path.                                                                                                  |
| `--mime-type`       | Media type of the file. Defaults to the uploaded part's declared type, else the type Bird detects from the contents.                                                                                 |
| `--response-schema` | Print the fields this command returns, then exit                                                                                                                                                     |

## Related

| Name                                                                            | Description            |
| ------------------------------------------------------------------------------- | ---------------------- |
| [`bird amb attachments download`](/docs/cli/reference/amb-attachments-download) | Download an attachment |
| [`bird amb attachments get`](/docs/cli/reference/amb-attachments-get)           | Get an attachment      |

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
