---
title: "Create an issue attachment"
method: POST
path: "/repos/{owner}/{repo}/issues/{index}/assets"
tags: ["issue"]
---

# Create an issue attachment

`POST /repos/{owner}/{repo}/issues/{index}/assets`

## Path parameters

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

## Query parameters

- `name` string

## 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

- `400` — APIError is error format response
- `404` — APIError is error format response
- `413` — APIError is error format response
- `422` — APIValidationError is error format response related to input validation
- `423` — APIRepoArchivedError is an error that is raised when an archived repo should be modified

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/revisions/350de506cefa/schema)
