apicheats.dev github/llms.txt Raw .md
POST

POST /repos/{owner}/{repo}/issues — GitHub API

GitHub token (required); https://api.github.com

GitHub API

Create an issue

POST to /repos/{owner}/{repo}/issues with owner, repo and a required title; body, labels and assignees are optional. You need a bearer token with write access to the repository. The response includes the created issue's number, state and html_url. See the GitHub create-an-issue docs.

Base URL
https://api.github.com
Auth
Authorization: Bearer <GITHUB_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 445 tokens · Vary: Accept

Critical gotchas

GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.

Fine-grained tokens only authorize repositories and permissions selected when the token is created.

cURL

curl -X POST 'https://api.github.com/repos/example-owner/example-repo/issues' \  -H "Authorization: Bearer $GITHUB_TOKEN" \  -H 'Accept: application/vnd.github+json' \  -H 'X-GitHub-Api-Version: 2026-03-10' \  -H 'Content-Type: application/json' \  -d '{  "title": "Bug: login page returns 500 on submit"}'

Parameters

Name In Type Required Description
owner path string Yes The account owner of the repository. The name is not case sensitive.
repo path string Yes The name of the repository without the `.git` extension. The name is not case sensitive.
title body string Yes The title of the issue.
body body string No The contents of the issue.
milestone body string No Request body field milestone.
labels body string[] No Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._
assignees body string[] No Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._
issue_field_values body object[] No An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Issue fields are only available for organization-owned repositories with the feature enabled. Field values are silently dropped otherwise.
type body string No The name of the issue type to associate with this issue. _NOTE: Only users with push access can set the type for new issues. The type is silently dropped otherwise._
parent_issue_id body integer No The id of the parent issue to add this issue to as a sub-issue. _NOTE: Only users with triage access to both the parent issue's repository and this repository can set the parent issue._

Response 200 OK

{
  "id": 0,
  "node_id": "string",
  "number": 42,
  "state": "open",
  "title": "Widget creation fails in Safari on OS X 10.8",
  "html_url": "https://example.com"
}
Get a free GitHub API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.