---
title: "Create an issue artifact"
method: POST
path: "/repos/{owner}/{repo}/issues/{issue_number}/artifacts"
tags: ["issues"]
---

# Create an issue artifact

`POST /repos/{owner}/{repo}/issues/{issue_number}/artifacts`

## Request

- Base URL: `https://api.github.com`
- URL: `https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}/artifacts`
- Auth: none declared

Creates an artifact attached to an issue.

The artifact type defaults to `generic` when omitted. Creating an artifact
requires permission to update the issue.

The request can return `403` if the repository is read-only or locked, or a
GitHub App installation has only `issues: read` permission.

To create an HTML artifact, set `type` to `embedded_html` and provide the HTML source
in `body`. Open the returned `html_url` to inspect the source, then select
**Preview** to view the rendered artifact. Select **Show source** to return
to the HTML source.

## Path parameters

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

## Request body

- object
  - `type` 'generic' | 'link' | 'plan' | 'embedded_html': The artifact type.
  - `name` string, required: The human-readable name of the artifact.
  - `body` string, required: The artifact content. For `embedded_html` artifacts, provide the HTML source.

## Response `201`

The created artifact.

- IssueArtifact: Issue artifacts are named, typed pieces of content attached to an issue. They give people and agents a durable place to preserve context and supporting material alongside the work. Each artifact has a number unique within the issue.
  - `id` integer, required: The globally unique identifier of the artifact.
  - `html_url` string, uri: The canonical browser URL for the artifact in its issue context.
  - `number` integer, required: The artifact number within the issue.
  - `type` string, required: The artifact type. The types supported for external creation and filtering are: - `generic` is a general-purpose Markdown document. - `link` represents a named link. - `plan` is a Markdown plan. - `embedded_html` is a self-contained HTML document. Its `body` contains the HTML source.
  - `name` string, required: The human-readable name of the artifact.
  - `body` string, required: The artifact content. For `embedded_html` artifacts, this is the HTML source.
  - `body_html` string, nullable, required: The artifact content rendered as HTML, or `null` if rendering times out or is skipped to protect the response's time budget. The raw content remains available in `body`.
  - `description` string, required: A short, generated summary of the artifact.
  - `creator` object, nullable, required: The user or integration that created the artifact.
    - `login` string, required
    - `id` integer, required
  - `updated_by_actor` object, nullable, required: The user or integration that most recently updated the artifact.
    - `login` string, required
    - `id` integer, required
  - `created_at` string, date-time, nullable, required: The time the artifact was created.
  - `updated_at` string, date-time, nullable, required: The time the artifact was last updated.

## Other responses

- `403`: Forbidden
- `404`: Resource not found
- `410`: Gone
- `422`: Validation failed, or the endpoint has been spammed.
- `429`: Artifact writes are temporarily throttled. Retry after the indicated delay.
- `500`: Internal Error
- `503`: Service unavailable

## Changes

- **2026-10-28** `3b55ce443f5c`: 2 info
  - added the non-success response with the status `403`
  - the response property `description` became required for the status `201`
- **2026-10-27** `2bbf5140540d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/github/apis/enterprise-cloud/changes/repos/:owner/:repo/issues/:issue_number/artifacts/post.md)

---

[API](https://skmtc.dev/github/apis/enterprise-cloud.md) - [All operations](https://skmtc.dev/github/apis/enterprise-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/github/apis/enterprise-cloud/revisions/3b55ce443f5c?raw)
