PUT/repos/{owner}/{repo}/issues/{issue_number}/lock

Lock an issue conversation

Locks the conversation on an issue or pull request in a repository. Use owner, repo, and issue_number to identify the conversation, and set lock_reason to explain the lock. Users with push access can lock conversations; if you omit the request body, send a Content-Length header with a value of zero.

3 parameters · 1 body field
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.
issue_numberintegerrequired
The number that identifies the issue.

Optional lock settings for the issue or pull request conversation.

lock_reasonstringoptional
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`
Allowed:off-topictoo heatedresolvedspam

5 status codes
204Returns no response body after locking the issue or pull request conversation.
403Returned when you do not have permission to lock the issue or pull request conversation.
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

Error handling

A 403 is returned when you do not have permission to lock the conversation. A 404 is returned when the repository or issue cannot be found. A 410 indicates that the resource is no longer available; a 422 is returned when validation fails or the endpoint has been spammed. lock_reason, if provided, must be one of: off-topic, too heated, resolved, or spam.