---
title: "Get Upload Strategy (Direct or Presigned URL)"
method: POST
path: "/api/storage/buckets/{bucketName}/upload-strategy"
tags: ["Client"]
---

# Get Upload Strategy (Direct or Presigned URL)

`POST /api/storage/buckets/{bucketName}/upload-strategy`

Returns upload strategy based on storage backend (S3 returns presigned URLs, local returns direct upload endpoints).

The filename is used verbatim as the object key. Uploading to an existing key replaces the current object in place. To upload with a server-generated unique key instead, use `POST /api/storage/buckets/{bucketName}/objects`. End-user creates and replacements are gated by the `storage.objects` row-level-security policies.

## Path parameters

- `bucketName` string, required

## Request body

- object
  - `filename` string, required — Object key to upload to (used verbatim)
  - `contentType` string — MIME type of the file
  - `size` integer — File size in bytes

## Response `200`

Upload strategy details

- UploadStrategy
  - `method` 'presigned' | 'direct', required — Upload method - presigned for S3, direct for local storage
  - `uploadUrl` string, required — URL to upload the file to
  - `fields` object — Form fields for presigned POST (S3 only)
  - `key` string, required — Final logical object key (the filename, used verbatim).
  - `confirmRequired` boolean, required — Whether upload confirmation is required
  - `confirmUrl` string — URL to confirm the upload (if confirmRequired is true)
  - `expiresAt` string, date-time — Expiration time for presigned URL (S3 only)

## Other responses

- `403` — The caller is not permitted to create or replace this object
- `404` — Bucket not found

---

[API](https://skmtc.dev/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.dev/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/revisions/a935bb49f932/schema)
