---
title: "Create a release attachment"
method: POST
path: "/repos/{owner}/{repo}/releases/{id}/assets"
tags: ["repository"]
---

# Create a release attachment

`POST /repos/{owner}/{repo}/releases/{id}/assets`

## Request

- Base URL: `https://demo.gitea.com/api/v1`
- URL: `https://demo.gitea.com/api/v1/repos/{owner}/{repo}/releases/{id}/assets`
- Auth: one of:
  - HTTP basic
  - API key in query parameter `token`
  - API key in query parameter `access_token`
  - API key in header `Authorization`
  - API key in query parameter `sudo`
  - API key in header `Sudo`
  - API key in header `X-GITEA-OTP`
- TypeScript: <https://skmtc.dev/gitea/apis/gitea-api/docs/repos/:owner/:repo/releases/:id/assets/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `owner` string, required
- `repo` string, required
- `id` integer, required

## Query parameters

- `name` string

## Request body `multipart/form-data`

- object
  - `attachment` string, binary: attachment to upload

## Response `201`

Attachment

- Attachment: Attachment a generic attachment
  - `browser_download_url` string: DownloadURL is the URL to download the attachment
  - `created_at` string, date-time: Created is the time when the attachment was uploaded
  - `download_count` integer: DownloadCount is the number of times the attachment has been downloaded
  - `id` integer: ID is the unique identifier for the attachment
  - `name` string: Name is the filename of the attachment
  - `size` integer: Size is the file size in bytes
  - `uuid` string: UUID is the unique identifier for the attachment file

## Other responses

- `default`: APIError is error format response

## Changes

- **2026-10-28** `7ef50c4c527f`: 3 info
  - removed the non-success response with the status `400`
  - removed the non-success response with the status `404`
  - removed the non-success response with the status `413`
- **2026-07-13** `4df6be504c96`: 1 info
  - added the non-success response with the status `413`

[Operation history](https://skmtc.dev/gitea/apis/gitea-api/changes/repos/:owner/:repo/releases/:id/assets/post.md)

---

[API](https://skmtc.dev/gitea/apis/gitea-api.md) - [All operations](https://skmtc.dev/gitea/apis/gitea-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitea/apis/gitea-api/revisions/7ef50c4c527f?raw)
