POST
/repos/{owner}/{repo}/milestonesCreate a repository milestone
Creates a milestone in a repository. Provide a title and optionally set its state, description, and due_on date. A 201 response returns the created milestone with its generated identifier and milestone details.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
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.
The milestone to create. Provide a title and optionally specify its state, description, and due date.
titlestringrequired
The title of the milestone.
statestringoptional
The state of the milestone. Either `open` or `closed`.
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`.
201Returns the created milestone object, including its generated identifier, number, title, state, description, and due date.
urlstringrequired
html_urlstringrequired
labels_urlstringrequired
idintegerrequired
node_idstringrequired
numberintegerrequired
The number of the milestone.
statestringrequired
The state of the milestone.
titlestringrequired
The title of the milestone.
descriptionstringrequired
creatorobjectrequired
A GitHub user.
open_issuesintegerrequired
closed_issuesintegerrequired
created_atstringrequired
updated_atstringrequired
closed_atstringrequired
due_onstringrequired
404Returned when the repository is not found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
Error handling
title is required; state must be open or closed, and due_on must use ISO 8601 date-time format. A 404 is returned when the repository identified by the owner and repo path parameters is not found. A 422 is returned when validation fails or the endpoint detects spam.