Forgejo and Gitea: why the comment was refused
A comment on a pull request's conversation (POST /api/v1/repos/OWNER/REPO/issues/NUMBER/comments with body), a comment on lines of the diff (sent in a review: POST …/pulls/NUMBER/reviews with comments), a reply and resolving a conversation can be refused with 403, 422 or 400. All of this is from the source of both (CreateIssueComment in routers/api/v1/repo/issue_comment.go, Forgejo's ReqIssueUnlockedOrCanWrite, CreatePullReview and the reply and resolve calls in routers/api/v1/repo/pull_review.go, and services/pull/review.go), read on October 24, 2026, with Forgejo's release branches up to v17.0 and Gitea's up to 1.27.
The answers
- 403
You cannot change a locked issue.(Forgejo 17 and later) orYou cannot comment on a locked issue.(Gitea, and Forgejo before 17): the pull request's conversation is locked, and you cannot write to the repository's pull requests. People who can write still can comment; on Gitea and older Forgejo, so can site administrators. - 403
user is blocked by the poster or repository owner(Forgejo) oruser is blocked(Gitea): the pull request's author or the repository's owner has blocked your account. On Gitea, a block does not stop the repository's administrators. - 422
[Body]: Required: the comment'sbodyis empty or missing. - 422
a code comment may span at most 50 lines(Forgejo 16 and later): a comment on lines covers more lines than the server allows. 50 is the default; the server's administrator sets it withMAX_CODE_COMMENT_LINES, and 0 means no limit.extra_lines_count must be >= 0means the range was given as negative. - 400
comment is not a review comment(Gitea 1.27 and later, replying withPOST …/pulls/NUMBER/comments/ID/replies; Gitea 1.26 and later, resolving withPOST …/pulls/comments/ID/resolveorunresolve):IDis a comment on the conversation, not a comment on lines, so there is no thread to reply in or to resolve. A reply to a comment of another pull request answers 404. - 403
user should have permission to resolve comment(Gitea): only the pull request's author, people who can write to the repository's pull requests, and official reviewers may resolve a conversation.
Forgejo's releases (up to v17.0) have no call to reply to a comment on lines or to resolve a conversation. A token without permission to write to issues is refused with 403 too, but that answer says token does not have at least one of required scope(s); see which permission to add. A pull request that does not exist, or that you cannot see, answers 404; see missing, private or renamed.
Where it stands
curl -H "Authorization: token your-token" https://codeberg.org/api/v1/repos/OWNER/REPO/issues/7
"is_locked": true means the conversation is locked. The same call works for a pull request, by its number. Use your own server's address instead of codeberg.org.
What to do
- Locked: ask someone who can write to the repository to unlock the conversation, or to comment for you.
- Blocked: only the account that blocked you can lift it.
- 422 "[Body]: Required": send the text in
body. - 422 "may span at most … lines": comment on fewer lines, or split the comment.
- 400 "comment is not a review comment": answer a conversation comment with a new conversation comment.
- 403 "permission to resolve": ask the pull request's author, or someone who can write to the repository, to resolve it.
Forgejo and Gitea pull requests in IntelliJ IDEA
Pull Request Inbox for Forgejo and Gitea, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, comments on the conversation and on lines of the diff, and replies in a thread: with Gitea's reply call where the server has it, otherwise in the same conversation, the way the server's own page does. It resolves conversations with Gitea's call; on Forgejo, it says that the server has no such call and to resolve it on the pull request's page. Refusals are shown with the server's words; from version 1.0.16, a comment refused because the conversation is locked, or because your account is blocked, says so instead of pointing at your permissions. Reading is free; commenting, approving and merging are Pro (US$1.50 a month, with a 30-day trial).
Forgejo, Gitea and Codeberg are names of their respective owners; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by the Forgejo project, Codeberg e.V., the Gitea project or JetBrains.
More: Forgejo and Gitea merge refused (405, 409) · Forgejo and Gitea review refused (422) · Forgejo and Gitea branch update refused (403, 409, 422) · Forgejo and Gitea pull request not created (409, 422, 403) · "token does not have at least one of required scope(s)" · 401 "token is required" and unknown tokens · 404 "The target couldn't be found." and "not found" · Forgejo and Gitea search refused (400, 422) · Forgejo and Gitea pull request files (pages of 50, changed_files) · Forgejo and Gitea pull request plugins for IntelliJ IDEA, compared · 日本語