---
title: "Attach a file to a widget integration"
method: POST
path: "/integration/widget/{widgetIntegrationId}/file/{fileId}/attach"
tags: ["Widget Integration"]
---

# Attach a file to a widget integration

`POST /integration/widget/{widgetIntegrationId}/file/{fileId}/attach`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/integration/widget/{widgetIntegrationId}/file/{fileId}/attach`
- Auth: HTTP bearer

## Path parameters

- `widgetIntegrationId` string, required: The ID of the widget integration
- `fileId` string, required: The ID of the file to attach

## Request body

- object
  - `type` 'bar' | 'user' | 'bot' | 'button', required: The attachment slot type for the file

## Response `200`

The file was attached to the widget integration successfully

- object
  - `id` string, required: The ID of the attached file
  - `type` string, required: The attachment slot type
  - `widgetIntegrationId` string, required: The ID of the widget integration

## 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)
