---
title: "Initiate GCS async upload"
method: POST
path: "/api/users/files/upload/initiate"
tags: ["users/files"]
---

# Initiate GCS async upload

`POST /api/users/files/upload/initiate`

## Request

- Base URL: `https://localhost:8080`
- URL: `https://localhost:8080/api/users/files/upload/initiate`
- Auth: `bearer` (a scheme the document does not define)

Creates a pending document record and returns a signed PUT URL for direct client upload to GCS

## Request body

- InitiateFileUploadDto
  - `fileName` string, required: Original file name
  - `mimeType` string, required: File MIME type
  - `fileSize` number, required: File size in bytes
  - `folderId` string: Target folder ID — defaults to My Files when omitted

## Response `200`

documentId, signedUploadUrl, expiresAt

## Other responses

- `400`: Validation error or file too large
- `401`: Unauthorized

---

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