Skip to content

Apply a suggestion to a merge request

PUT
/api/v4/suggestions/{id}/apply

Applies a suggested patch in a merge request. You must have the Developer, Maintainer, or Owner role.

id
required
integer

The ID of the suggestion

Media type application/json
object
commit_message

A custom commit message to use instead of the default generated message or the project’s default message

string
nullable
Example generated
{
"commit_message": "example"
}

OK

Media type application/json
object
id
integer format: int64
from_line
integer
to_line
integer
appliable
boolean
applied
boolean
from_content
string
to_content
string
Example
{
"id": 1,
"from_line": 1,
"to_line": 1,
"appliable": true,
"applied": false,
"from_content": "Original content\n",
"to_content": "New content\n"
}

Bad Request

Not Found