PATCH/repos/{owner}/{repo}/issues/{issue_number}

Update an issue

Updates the title, body, state, assignees, labels, milestone, type, or field values of an issue. Supply only the properties you want to change; state_reason applies only when you change state, and duplicate_issue_id applies only when state_reason is duplicate. Users with push access or the Triage role can edit issues, but milestone, label, type, and field-value changes require push access.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters · 11 body fields
ownerstringrequired
The account that owns the repository; the name is not case-sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case-sensitive.
issue_numberintegerrequired
The number that identifies the issue to update.

Issue properties to update. All fields are optional; include only the properties you want to change.

titlestringoptional
The title of the issue.
bodystringoptional
The contents of the issue.
assigneestringoptional
Username to assign to this issue. **This field is closing down.**
statestringoptional
The open or closed state of the issue.
Allowed:openclosed
state_reasonstringoptional
The reason for the state change. Ignored unless `state` is changed.
Allowed:completednot_plannedduplicatereopened
duplicate_issue_idintegeroptional
The ID of the issue to mark as the canonical duplicate when `state_reason` is `duplicate`. The issue must exist and be accessible to the authenticated user. Ignored when `state_reason` is not `duplicate`.
milestonestringoptional
The milestone name or number to associate with the issue; use `null` to remove the current milestone. Only users with push access can change the milestone.
labelsarray<string>optional
Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped.
assigneesarray<string>optional
Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped.
issue_field_valuesarray<object>optional
An array of issue field values to set on this issue. Each field value must include the field ID and the value to set. Only users with push access can set field values for issues
typestringoptional
The issue type to associate with this issue. Only users with push access can set the type for issues. Without push access to the repository, type changes are silently dropped.

7 status codes
200Returns the updated issue object, including its issue details and any applicable suggestions.
idintegerrequired
node_idstringrequired
urlstringrequired
URL for the issue
repository_urlstringrequired
labels_urlstringrequired
comments_urlstringrequired
events_urlstringrequired
html_urlstringrequired
numberintegerrequired
Number uniquely identifying the issue within its repository
statestringrequired
State of the issue; either 'open' or 'closed'
state_reasonstringoptional
The reason for the current state
Allowed:completedreopenednot_plannedduplicate
titlestringrequired
Title of the issue
bodystringoptional
Contents of the issue
userobjectrequired
A GitHub user.
labelsarray<string>required
Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository
assigneeobjectrequired
A GitHub user.
assigneesarray<SimpleUser>optional
milestoneobjectrequired
A collection of related issues and pull requests.
lockedbooleanrequired
active_lock_reasonstringoptional
commentsintegerrequired
pull_requestobjectoptional
closed_atstringrequired
created_atstringrequired
updated_atstringrequired
draftbooleanoptional
closed_byobjectoptional
A GitHub user.
body_htmlstringoptional
body_textstringoptional
timeline_urlstringoptional
typeobjectoptional
The type assigned to the issue. This is only present for issues in repositories where issue types are supported.
repositoryobjectoptional
A repository on GitHub.
performed_via_github_appobjectoptional
GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
author_associationstringoptional
How the author is associated with the repository.
Allowed:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
reactionsobjectoptional
sub_issues_summaryobjectoptional
parent_issue_urlstringoptional
URL to get the parent issue of this issue, if it is a sub-issue
pinned_commentobjectoptional
Comments provide a way for people to collaborate on an issue.
issue_dependencies_summaryobjectoptional
issue_field_valuesarray<IssueFieldValue>optional
suggestionsobjectoptional
Pending suggestions for each suggestible field (`type`, `issue_field_values`, `labels`, `assignees`, `state`) the request touched. Omitted for fields not in the request or with no pending or ignored suggestions. Items tagged `ignored` are echoes of the current request's inputs that were not persisted as pending suggestions.
301Returned when the requested resource has moved permanently.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Returned when the authenticated user is not permitted to update the issue.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the repository or issue cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
410Returned when the requested resource is no longer available.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
503Returned when the service is unavailable.
codestringoptional
messagestringoptional
documentation_urlstringoptional

Error handling

A 403 is returned when the authenticated user cannot edit the issue, and a 404 is returned when the repository or issue cannot be found. A 410 indicates the requested resource is no longer available; a 422 indicates validation failure or that the endpoint has been spammed. A 503 indicates the service is unavailable; state must be open or closed, state_reason must be one of the documented values, and each issue_field_values item must include field_id and value.