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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Upload file

> Upload a file and optionally share it to Slack.

`uploadFile` uses Slack's external upload flow. Leave `conversationId` unset to
keep the file private to the installed app, or share it in a conversation or
thread.

## Example

```ts automations/upload-slack-report.automation.ts theme={null}
import { automation } from "automate.ax"
import { uploadFile } from "automate.ax/slack"

export default automation("Upload Slack report", () => {
  uploadFile({
    conversationId: "C01234567",
    file: new File(["Revenue: 42"], "report.txt", { type: "text/plain" }),
    initialComment: "The latest report is ready.",
    title: "Daily report",
  })
})
```

## Inputs

| Input             | Type                                             | Required | Default         | Description                                           |
| ----------------- | ------------------------------------------------ | -------- | --------------- | ----------------------------------------------------- |
| `file`            | `File`                                           | Yes      | —               | File bytes, media type, size, and default name.       |
| `filename`        | `string`                                         | No       | `file.name`     | Filename shown by Slack.                              |
| `title`           | `string`                                         | No       | None            | Human-readable title.                                 |
| `altText`         | `string`                                         | No       | None            | Accessible image description, up to 1,000 characters. |
| `snippetType`     | `string`                                         | No       | None            | Syntax-highlighting type for text snippets.           |
| `conversationId`  | `string`                                         | No       | Private upload  | Conversation in which to share the file.              |
| `threadTimestamp` | `string`                                         | No       | None            | Parent timestamp when sharing into a thread.          |
| `initialComment`  | `string`                                         | No       | None            | Message posted with a shared file.                    |
| `account`         | `string \| IntegrationAccountReference<"slack">` | No       | Project default | Slack binding.                                        |

## Output

Returns a normalized Slack file with `id` and optional `name`, `title`,
`mimeType`, `fileType`, `size`, `permalink`, authenticated `urlPrivate`, uploader
`userId`, creation time, and sharing `channelIds`.

The action fails if Slack cannot issue an upload ticket, the file transfer
returns a non-success HTTP status, or Slack completes the flow without a file.
