跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 22.6.1, which is no longer the latest release. See the latest release.

Create an issue attachment

POST
/repos/{owner}/{repo}/issues/{index}/assets
curl --request POST \
--url https://gitea.example.com/api/v1/repos/example/example/issues/1/assets \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: multipart/form-data' \
--form attachment=@file
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

index
required
integer format: int64

Index of the issue

name
string

Name of the attachment

attachment
required
file

Attachment to upload

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
message
string
url
string

APIError is error format response

Media typeapplication/json
message
string
url
string

APIValidationError is error format response related to input validation

Media typeapplication/json
message
string
url
string

APIRepoArchivedError is an error that is raised when an archived repo should be modified

Media typeapplication/json
message
string
url
string