gitlab-org--gitlab-foss/doc/api/suggestions.md
Achilleas Pipinellis 0e078d1a8a
Replace look-alike token with '<your_access_token>'
Replace all '9koXpg98eAheJpvBs5tK' occurrences with
'<your_access_token>' in API docs.
2019-01-04 13:19:27 +01:00

909 B

Suggest Changes API

Every API call to suggestions must be authenticated.

Applying suggestions

Applies a suggested patch in a merge request. Users must be at least Developer to perform such action.

PUT /suggestions/:id/apply
Attribute Type Required Description
id integer/string yes The ID of a suggestion
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/suggestions/5/apply

Example response:

  {
    "id": 36,
    "from_original_line": 10,
    "to_original_line": 10,
    "from_line": 10,
    "to_line": 10,
    "appliable": false,
    "applied": true,
    "from_content": "        \"--talk-name=org.freedesktop.\",\n",
    "to_content": "        \"--talk-name=org.free.\",\n        \"--talk-name=org.desktop.\",\n"
  }