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

# HubSpot: Upload File

> Upload and host an image, picture, or other file in the HubSpot File Manager and get a public URL to use in an email body.

Upload and host an image, picture, or other file in the HubSpot File Manager and get a public URL to use in an email body.

> [!NOTE]
>
> Tool ID: `hubspot_upload_file`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'hubspot_upload_file',
  {
    "file_name": "Example",
    "content": "Example message"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute hubspot_upload_file --input '{
  "file_name": "Example",
  "content": "Example message"
}' --json
```

## Example response

The static output schema lacks the details for a reliable example. Use `deepline describe hubspot_upload_file --json` for the complete live contract.

## Input reference

Upload a file to the HubSpot File Manager and get its hosted URL, for example an image to embed in an email body. Requires the `files` scope.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.file_name` | `string` | Yes | — | File name to store in HubSpot, including its extension, for example `launch-hero.png`. Minimum length: 1. |
| `payload.content` | `string` | Yes | — | File content: plain text, or base64 when `is_base64` is true. The whole request must stay under 4.5 MB, so base64 content is limited to about 3 MB of file data. Use hubspot\_import\_file\_from\_url for larger files. Minimum length: 1. |
| `payload.is_base64` | `boolean` | No | — | Whether `content` is base64. Set true for images and other binary files. |
| `payload.mime_type` | `string` | No | — | MIME type such as `image/png`. Defaults to `application/octet-stream`. Minimum length: 1. |
| `payload.folder_path` | `string` | No | — | File Manager folder path, for example `/email-images`. HubSpot creates it when missing. Provide exactly one of `folder_path` or `folder_id`. Minimum length: 1. |
| `payload.folder_id` | `string` | No | — | File Manager folder ID. Provide exactly one of `folder_path` or `folder_id`. Minimum length: 1. |
| `payload.access` | `"PUBLIC_NOT_INDEXABLE" \| "PUBLIC_INDEXABLE" \| "PRIVATE"` | No | `"PUBLIC_NOT_INDEXABLE"` | Who can open the file URL. `PUBLIC_NOT_INDEXABLE` (default) is public but hidden from search engines, which suits email images. `PRIVATE` files need a signed URL. Allowed: `PUBLIC_NOT_INDEXABLE`, `PUBLIC_INDEXABLE`, `PRIVATE`. |
| `payload.overwrite` | `boolean` | No | — | Replace a file with the same name in the same folder instead of renaming the new one. |
| `payload.duplicate_validation_strategy` | `"NONE" \| "REJECT" \| "RETURN_EXISTING"` | No | — | What HubSpot does when an identical file already exists: upload anyway (`NONE`), fail (`REJECT`), or return the existing file (`RETURN_EXISTING`). Allowed: `NONE`, `REJECT`, `RETURN_EXISTING`. |
| `payload.duplicate_validation_scope` | `"ENTIRE_PORTAL" \| "EXACT_FOLDER"` | No | — | Where HubSpot looks for a duplicate file. Allowed: `ENTIRE_PORTAL`, `EXACT_FOLDER`. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Upload a file to the HubSpot File Manager and get its hosted URL, for example an image to embed in an email body. Requires the `files` scope.",
    "properties": {
      "file_name": {
        "type": "string",
        "description": "File name to store in HubSpot, including its extension, for example `launch-hero.png`.",
        "minLength": 1
      },
      "content": {
        "type": "string",
        "description": "File content: plain text, or base64 when `is_base64` is true. The whole request must stay under 4.5 MB, so base64 content is limited to about 3 MB of file data; use hubspot_import_file_from_url for larger files.",
        "minLength": 1
      },
      "is_base64": {
        "type": "boolean",
        "description": "Whether `content` is base64. Set true for images and other binary files."
      },
      "mime_type": {
        "type": "string",
        "description": "MIME type such as `image/png`. Defaults to `application/octet-stream`.",
        "minLength": 1
      },
      "folder_path": {
        "type": "string",
        "description": "File Manager folder path, for example `/email-images`. HubSpot creates it when missing. Provide exactly one of `folder_path` or `folder_id`.",
        "minLength": 1
      },
      "folder_id": {
        "type": "string",
        "description": "File Manager folder ID. Provide exactly one of `folder_path` or `folder_id`.",
        "minLength": 1
      },
      "access": {
        "type": "string",
        "description": "Who can open the file URL. `PUBLIC_NOT_INDEXABLE` (default) is public but hidden from search engines, which suits email images; `PRIVATE` files need a signed URL.",
        "default": "PUBLIC_NOT_INDEXABLE",
        "enum": [
          "PUBLIC_NOT_INDEXABLE",
          "PUBLIC_INDEXABLE",
          "PRIVATE"
        ]
      },
      "overwrite": {
        "type": "boolean",
        "description": "Replace a file with the same name in the same folder instead of renaming the new one."
      },
      "duplicate_validation_strategy": {
        "type": "string",
        "description": "What HubSpot does when an identical file already exists: upload anyway (`NONE`), fail (`REJECT`), or return the existing file (`RETURN_EXISTING`).",
        "enum": [
          "NONE",
          "REJECT",
          "RETURN_EXISTING"
        ]
      },
      "duplicate_validation_scope": {
        "type": "string",
        "description": "Where HubSpot looks for a duplicate file.",
        "enum": [
          "ENTIRE_PORTAL",
          "EXACT_FOLDER"
        ]
      }
    },
    "required": [
      "file_name",
      "content"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `record` | Yes | — | Provider response payload. |
| `result.meta` | `record` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "additionalProperties": {}
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Connect integrations](https://deepline.com/docs/integrations.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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