---
title: "Upload a blob"
method: POST
path: "/blob"
tags: ["Blob"]
---

# Upload a blob

`POST /blob`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/blob`
- Auth: HTTP bearer

## Query parameters

- `pathname` string
- `content_type` string
- `add_random_suffix` boolean
- `project_id` integer

## Request body `application/octet-stream`

- string

## Response `201`

Blob uploaded successfully

- BlobResponse: Response after uploading a blob
  - `contentType` string, required: Content type of the blob
  - `pathname` string, required: Original pathname
  - `size` integer, required: Size in bytes
  - `uploadedAt` string, date-time, required: Upload timestamp
  - `url` string, required: URL path to access the blob

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 3 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `500` status
- **2026-10-05** `4b228ebed583`: 3 info
  - added the optional property `status` to the response with the `400` status
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `500` status
- **2026-10-05** `63a80791dc58`: 3 warning
  - removed the optional property `status` from the response with the `400` status
  - removed the optional property `status` from the response with the `401` status
  - removed the optional property `status` from the response with the `500` status
- **2026-09-23** `f4efc4d5c7b7`: 3 info
  - added the optional property `status` to the response with the `400` status
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `500` status
- **2026-09-07** `9e48d4ac62f9`: 4 info
  - added the new optional `query` request parameter `add_random_suffix`
  - added the new optional `query` request parameter `content_type`
  - added the new optional `query` request parameter `pathname`
  - added the new optional `query` request parameter `project_id`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/blob/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
