---
title: "Initiate media upload"
method: POST
path: "/upload_media"
tags: ["Media Upload"]
---

# Initiate media upload

`POST /upload_media`

## Request

- Base URL: `https://socialbu.com/api/v1`
- URL: `https://socialbu.com/api/v1/upload_media`
- Auth: HTTP bearer

Generate a pre-signed URL to upload a media file.

## Request body

- object
  - `name` string, required: File name e.g, ("document.pdf" ,"image.png")
  - `mime_type` string, required: File type e.g, ("application/pdf" ,"image/png")

## Response `200`

file uploaded

- object
  - `name` string: File name e.g, ("document.pdf" ,"image.png")
  - `mime_type` string: File type e.g, ("application/pdf" ,"image/png")
  - `signed_url` string: This parameter provides a pre-signed URL to which you should upload your media file using the HTTP PUT method. To ensure a successful upload, you must set the following headers in your request: - `Content-Type`: Set this header to the MIME type of the file you are uploading (e.g., `image/jpeg`, `video/mp4`). This header informs the server about the type of the media content being uploaded. - `Content-Length`: Set this header to be the size of the file being uploaded (bytes). - `x-amz-acl`: Set this to `private`.
  - `key` string: A unique identifier used to check the upload status.
  - `secure_key` string: File secure key.
  - `url` string: File public URL.

## Other responses

- `422`: The given data was invalid.

---

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