Sample - GitHub REST API
PATCH/repos/{owner}/{repo}/milestones/{milestone_number}

Update a repository milestone

Updates an existing milestone in a repository. Supply only the milestone properties you want to change, including title, state, description, or due_on; state defaults to open when omitted. The authenticated user must have permission to update milestones in the repository.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters · 4 body fields
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
milestone_numberintegerrequired
The integer that identifies the milestone to update.

Optional milestone fields to update; omitted fields retain their current values.

titlestringoptional
The title of the milestone.
statestringoptional
The state of the milestone. Either `open` or `closed`.
Allowed:openclosedDefault:open
descriptionstringoptional
A description of the milestone.
due_onstringoptional
The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.

1 status code
200Returns the updated milestone object, including its identifiers, state, title, description, due date, issue counts, and timestamps.
urlstringrequired
html_urlstringrequired
labels_urlstringrequired
idintegerrequired
node_idstringrequired
numberintegerrequired
The number of the milestone.
statestringrequired
The state of the milestone.
Allowed:openclosedDefault:open
titlestringrequired
The title of the milestone.
descriptionstringrequired
creatorobjectrequired
A GitHub user.
open_issuesintegerrequired
closed_issuesintegerrequired
created_atstringrequired
updated_atstringrequired
closed_atstringrequired
due_onstringrequired

Error handling

owner, repo, and milestone_number identify the repository milestone to update. state must be either open or closed, and due_on must be an ISO 8601 date-time when provided.