Skip to content

Approve merge request

POST
/api/v4/projects/{id}/merge_requests/{merge_request_iid}/approve

Approves a specified merge request. The currently authenticated user must be an eligible approver. The sha parameter ensures you are approving the current version of the merge request. If defined, the value must match the merge request’s HEAD commit SHA. A mismatch returns a 409 Conflict response.

id
required
One of:
string

The ID or URL-encoded path of the project

merge_request_iid
required
integer

The IID of a merge request

Media type application/json
object
sha

When present, must have the HEAD SHA of the source branch

string
nullable
publish_review

When true submits pending review comments

boolean
nullable
approval_password

Current user’s password if project is set to require explicit auth on approval

string
nullable
Example
secret

Created

Media type application/json
object
user_has_approved
boolean
user_can_approve
boolean
approved
boolean
approved_by
object
user
object
id
integer format: int64
username
string
public_email
string
name
string
state
string
locked
boolean
avatar_url
string
avatar_path
string
custom_attributes
Array<object>
object
key
string
value
string
web_url
string
approved_at
string format: date-time
Example
{
"approved_by": {
"user": {
"id": 1,
"username": "admin",
"public_email": "john@example.com",
"name": "Administrator",
"state": "active",
"avatar_url": "https://gravatar.com/avatar/1",
"avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
"custom_attributes": [
{
"key": "foo",
"value": "bar"
}
],
"web_url": "https://gitlab.example.com/root"
},
"approved_at": "2025-01-01T10:00:00Z"
}
}

Bad Request

Unauthorized

Not found