---
title: "Upload the specified file"
method: POST
path: "/file/{fileId}/upload"
tags: ["File"]
---

# Upload the specified file

`POST /file/{fileId}/upload`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/file/{fileId}/upload`
- Auth: HTTP bearer

Upload the specified file to the file storage service. The file can be
specified either as a HTTP URL, a data URL, a multipart/form-data, or
as a raw file stream. There is currently a limit of 4.5MB for files
uploaded via all available methods except for direct-to-source uploads
when using application/json request body with a file object.

## Path parameters

- `fileId` string, required

## Request body

- union
  - object
    - `file` string, required: The file to upload either as http: or data: URL
  - object
    - `file` object, required: The file definition to upload
      - `type` string, required: The file type
      - `size` number, required: The file size
      - `name` string: The file name

## Response `200`

The file was upload successfully

- object
  - `id` string, required: The ID of the upload file
  - `uploadRequest` object: The request required to upload the file
    - `method` string, required: The HTTP method to use
    - `url` string, required: The HTTP url to use
    - `headers` object, required: The HTTP headers to use

## Other responses

- `default`: An error response

---

[API](https://skmtc.dev/chatbotkit/apis/cbk-api.md) · [All operations](https://skmtc.dev/chatbotkit/apis/cbk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatbotkit/apis/cbk-api/revisions/13d250576136?raw)
