Note: You can now use the REST API to add a reason when you lock an issue, and you will see lock reasons in responses that include issues or pull requests. You will also see lock reasons in locked events. This feature is currently available for developers to preview. See the blog post for full details. To access this feature, you must provide a custom media type in the Accept header:
application/vnd.github.sailor-v-preview+json
Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support or GitHub Premium Support.
Users with push access can lock an issue or pull request's conversation.
PUT /repos/:owner/:repo/issues/:issue_number/lock
Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."
You can add a publicly visible lock reason when you lock a conversation.
| Name | Type | Description |
|---|---|---|
lock_reason |
string |
The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: * off-topic* too heated * resolved * spam |
{
"locked": true,
"active_lock_reason": "too heated"
}
Status: 204 No Content