---
title: "Prepare a direct agent or server media upload"
method: POST
path: "/v1/workspaces/{workspaceId}/feedback/attachments/prepare"
---

# Prepare a direct agent or server media upload

`POST /v1/workspaces/{workspaceId}/feedback/attachments/prepare`

## Request

- Base URL: `https://api.bangermail.com`
- URL: `https://api.bangermail.com/v1/workspaces/{workspaceId}/feedback/attachments/prepare`
- Auth: HTTP bearer

Returns a temporary signed PUT URL and required upload headers. Send file bytes with those headers, without Banger credentials, then complete the upload. Do not upload directly from browsers; use the authenticated binary proxy. Up to 30 uploads and 250 MiB per reporter per day.

## Path parameters

- `workspaceId` string, uuid, required

## Request body

- object
  - `attachment_id` string, uuid, required
  - `filename` string, required
  - `mime_type` 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'video/mp4' | 'video/webm' | 'video/quicktime', required
  - `size_bytes` integer, required

## Response `201`

data contains attachment_id, status, and upload with signed url, method PUT, and headers when uploading. If ready, no upload is needed.

- object
  - `data` object, required
    - `attachment_id` string, uuid, required
    - `filename` string, required
    - `mime_type` string, required
    - `size_bytes` integer, required
    - `status` 'ready' | 'uploading', required
    - `upload` object
      - `url` string, required
      - `method` 'PUT', required
      - `headers` object, required

## Other responses

- `409`: Attachment conflicts or is already being prepared.
- `429`: Upload limit reached.
- `502`: Linear upload preparation failed.

---

[API](https://skmtc.dev/bangermail/apis/banger-api.md) · [All operations](https://skmtc.dev/bangermail/apis/banger-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bangermail/apis/banger-api/revisions/a149909267f9?raw)
