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

# attachments

> Upload a file so a ticket or comment can carry it.

Most of the time you do not need this command: `--attach` on
[`tickets create`](/cli-reference/tickets) and
[`tickets comments create`](/cli-reference/tickets) uploads and attaches a file in one step.

Use `attachments upload` when the file has to be attached by a later call than the one that
uploads it — a script that uploads once and reuses the id, or a request you build yourself
against the [API](/api/attachments/create-upload).

<Note>
  Sample output on this page is shown as the `--json` envelope, which is reproducible. Pretty
  tables depend on your terminal width. See [Output formats](/cli/output-formats).
</Note>

## attachments upload

Uploads one file and prints the `signed_id` that attaches it. The file is sent straight to
storage rather than through the API.

```bash theme={"system"}
neetodesk attachments upload ~/Downloads/report.pdf
```

This command takes no flags beyond the [global ones](/cli-reference/overview#global-flags).

```json theme={"system"}
{
  "data": {
    "signed_id": "eyJfcmFpbHMiOnsiZGF0YSI6IjEyMyJ9fQ==",
    "filename": "report.pdf",
    "content_type": "application/pdf",
    "byte_size": 20481,
    "checksum": "Y2hlY2tzdW1leGFtcGxl",
    "upload_url": "https://neeto-desk.s3.amazonaws.com/3ieihu6erxcialumauhj1pqs07hr?X-Amz-Signature=...",
    "upload_headers": { "Content-Type": "application/pdf" }
  }
}
```

Capture just the id with `--quiet`, then attach it through the API:

```bash theme={"system"}
SIGNED_ID=$(neetodesk attachments upload ~/Downloads/report.pdf --quiet --json \
  | python3 -c 'import json,sys; print(json.load(sys.stdin)["signed_id"])')
```

A `signed_id` is only accepted in the workspace that uploaded it, and a file that is never
attached to anything is cleaned up automatically.
