Create a release attachment
POST
/repos/{owner}/{repo}/releases/{id}/assets
const url = 'https://gitea.example.com/api/v1/repos/example/example/releases/1/assets';const options = {method: 'POST', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://gitea.example.com/api/v1/repos/example/example/releases/1/assets \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”owner
required
string
Owner of the repo
repo
required
string
Name of the repo
id
required
integer format: int64
Id of the release
Query Parameters
Section titled “Query Parameters”name
string
Name of the attachment
FormData Parameters
Section titled “FormData Parameters”attachment
file
Attachment to upload
Responses
Section titled “Responses”Attachment
Media typeapplication/json
Attachment a generic attachment
object
browser_download_url
string
created_at
string format: date-time
download_count
integer format: int64
id
integer format: int64
name
string
size
integer format: int64
uuid
string
Examplegenerated
{ "browser_download_url": "example", "created_at": "2026-04-15T12:00:00Z", "download_count": 1, "id": 1, "name": "example", "size": 1, "uuid": "example"}APIError is error format response
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string
APINotFound is a not found empty response
Media typeapplication/json