@templmf/temp-solf-lmf 0.0.108 → 0.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/gitlab-foss-8-17-stable/doc/api/README.md +391 -0
  2. package/gitlab-foss-8-17-stable/doc/api/access_requests.md +139 -0
  3. package/gitlab-foss-8-17-stable/doc/api/award_emoji.md +374 -0
  4. package/gitlab-foss-8-17-stable/doc/api/boards.md +241 -0
  5. package/gitlab-foss-8-17-stable/doc/api/branches.md +260 -0
  6. package/gitlab-foss-8-17-stable/doc/api/broadcast_messages.md +154 -0
  7. package/gitlab-foss-8-17-stable/doc/api/build_triggers.md +118 -0
  8. package/gitlab-foss-8-17-stable/doc/api/build_variables.md +128 -0
  9. package/gitlab-foss-8-17-stable/doc/api/builds.md +610 -0
  10. package/gitlab-foss-8-17-stable/doc/api/ci/README.md +24 -0
  11. package/gitlab-foss-8-17-stable/doc/api/ci/builds.md +147 -0
  12. package/gitlab-foss-8-17-stable/doc/api/ci/lint.md +49 -0
  13. package/gitlab-foss-8-17-stable/doc/api/ci/runners.md +59 -0
  14. package/gitlab-foss-8-17-stable/doc/api/commits.md +479 -0
  15. package/gitlab-foss-8-17-stable/doc/api/deploy_key_multiple_projects.md +29 -0
  16. package/gitlab-foss-8-17-stable/doc/api/deploy_keys.md +216 -0
  17. package/gitlab-foss-8-17-stable/doc/api/deployments.md +218 -0
  18. package/gitlab-foss-8-17-stable/doc/api/enviroments.md +121 -0
  19. package/gitlab-foss-8-17-stable/doc/api/groups.md +484 -0
  20. package/gitlab-foss-8-17-stable/doc/api/issues.md +856 -0
  21. package/gitlab-foss-8-17-stable/doc/api/keys.md +46 -0
  22. package/gitlab-foss-8-17-stable/doc/api/labels.md +257 -0
  23. package/gitlab-foss-8-17-stable/doc/api/members.md +175 -0
  24. package/gitlab-foss-8-17-stable/doc/api/merge_requests.md +1158 -0
  25. package/gitlab-foss-8-17-stable/doc/api/milestones.md +105 -0
  26. package/gitlab-foss-8-17-stable/doc/api/namespaces.md +70 -0
  27. package/gitlab-foss-8-17-stable/doc/api/notes.md +407 -0
  28. package/gitlab-foss-8-17-stable/doc/api/notification_settings.md +177 -0
  29. package/gitlab-foss-8-17-stable/doc/api/oauth2.md +137 -0
  30. package/gitlab-foss-8-17-stable/doc/api/pipelines.md +259 -0
  31. package/gitlab-foss-8-17-stable/doc/api/project_snippets.md +118 -0
  32. package/gitlab-foss-8-17-stable/doc/api/projects.md +1402 -0
  33. package/gitlab-foss-8-17-stable/doc/api/repositories.md +200 -0
  34. package/gitlab-foss-8-17-stable/doc/api/repository_files.md +134 -0
  35. package/gitlab-foss-8-17-stable/doc/api/runners.md +322 -0
  36. package/gitlab-foss-8-17-stable/doc/api/services.md +812 -0
  37. package/gitlab-foss-8-17-stable/doc/api/session.md +56 -0
  38. package/gitlab-foss-8-17-stable/doc/api/settings.md +126 -0
  39. package/gitlab-foss-8-17-stable/doc/api/sidekiq_metrics.md +152 -0
  40. package/gitlab-foss-8-17-stable/doc/api/snippets.md +232 -0
  41. package/gitlab-foss-8-17-stable/doc/api/system_hooks.md +146 -0
  42. package/gitlab-foss-8-17-stable/doc/api/tags.md +191 -0
  43. package/gitlab-foss-8-17-stable/doc/api/templates/gitignores.md +579 -0
  44. package/gitlab-foss-8-17-stable/doc/api/templates/gitlab_ci_ymls.md +120 -0
  45. package/gitlab-foss-8-17-stable/doc/api/templates/licenses.md +147 -0
  46. package/gitlab-foss-8-17-stable/doc/api/todos.md +296 -0
  47. package/gitlab-foss-8-17-stable/doc/api/users.md +835 -0
  48. package/gitlab-foss-8-17-stable/doc/api/v3_to_v4.md +14 -0
  49. package/gitlab-foss-8-17-stable/doc/api/version.md +23 -0
  50. package/package.json +1 -1
  51. package//347/224/237/344/272/247/347/216/257/345/242/203CK/346/211/251/345/256/271/346/255/245/351/252/244.docx +0 -0
@@ -0,0 +1,1158 @@
1
+ # Merge requests
2
+
3
+ ## List merge requests
4
+
5
+ Get all merge requests for this project.
6
+ The `state` parameter can be used to get only merge requests with a given state (`opened`, `closed`, or `merged`) or all of them (`all`).
7
+ The pagination parameters `page` and `per_page` can be used to restrict the list of merge requests.
8
+
9
+ ```
10
+ GET /projects/:id/merge_requests
11
+ GET /projects/:id/merge_requests?state=opened
12
+ GET /projects/:id/merge_requests?state=all
13
+ GET /projects/:id/merge_requests?iids[]=42&iids[]=43
14
+ ```
15
+
16
+ Parameters:
17
+
18
+ - `id` (required) - The ID of a project
19
+ - `iid` (optional) - Return the request having the given `iid`
20
+ - `state` (optional) - Return `all` requests or just those that are `merged`, `opened` or `closed`
21
+ - `order_by` (optional) - Return requests ordered by `created_at` or `updated_at` fields. Default is `created_at`
22
+ - `sort` (optional) - Return requests sorted in `asc` or `desc` order. Default is `desc`
23
+
24
+ ```json
25
+ [
26
+ {
27
+ "id": 1,
28
+ "iid": 1,
29
+ "target_branch": "master",
30
+ "source_branch": "test1",
31
+ "project_id": 3,
32
+ "title": "test1",
33
+ "state": "opened",
34
+ "upvotes": 0,
35
+ "downvotes": 0,
36
+ "author": {
37
+ "id": 1,
38
+ "username": "admin",
39
+ "email": "admin@example.com",
40
+ "name": "Administrator",
41
+ "state": "active",
42
+ "created_at": "2012-04-29T08:46:00Z"
43
+ },
44
+ "assignee": {
45
+ "id": 1,
46
+ "username": "admin",
47
+ "email": "admin@example.com",
48
+ "name": "Administrator",
49
+ "state": "active",
50
+ "created_at": "2012-04-29T08:46:00Z"
51
+ },
52
+ "source_project_id": 2,
53
+ "target_project_id": 3,
54
+ "labels": [ ],
55
+ "description": "fixed login page css paddings",
56
+ "work_in_progress": false,
57
+ "milestone": {
58
+ "id": 5,
59
+ "iid": 1,
60
+ "project_id": 3,
61
+ "title": "v2.0",
62
+ "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
63
+ "state": "closed",
64
+ "created_at": "2015-02-02T19:49:26.013Z",
65
+ "updated_at": "2015-02-02T19:49:26.013Z",
66
+ "due_date": null
67
+ },
68
+ "merge_when_build_succeeds": true,
69
+ "merge_status": "can_be_merged",
70
+ "subscribed" : false,
71
+ "sha": "8888888888888888888888888888888888888888",
72
+ "merge_commit_sha": null,
73
+ "user_notes_count": 1,
74
+ "should_remove_source_branch": true,
75
+ "force_remove_source_branch": false,
76
+ "web_url": "http://example.com/example/example/merge_requests/1"
77
+ }
78
+ ]
79
+ ```
80
+
81
+ ## Get single MR
82
+
83
+ Shows information about a single merge request.
84
+
85
+ ```
86
+ GET /projects/:id/merge_requests/:merge_request_id
87
+ ```
88
+
89
+ Parameters:
90
+
91
+ - `id` (required) - The ID of a project
92
+ - `merge_request_id` (required) - The ID of MR
93
+
94
+ ```json
95
+ {
96
+ "id": 1,
97
+ "iid": 1,
98
+ "target_branch": "master",
99
+ "source_branch": "test1",
100
+ "project_id": 3,
101
+ "title": "test1",
102
+ "state": "merged",
103
+ "upvotes": 0,
104
+ "downvotes": 0,
105
+ "author": {
106
+ "id": 1,
107
+ "username": "admin",
108
+ "email": "admin@example.com",
109
+ "name": "Administrator",
110
+ "state": "active",
111
+ "created_at": "2012-04-29T08:46:00Z"
112
+ },
113
+ "assignee": {
114
+ "id": 1,
115
+ "username": "admin",
116
+ "email": "admin@example.com",
117
+ "name": "Administrator",
118
+ "state": "active",
119
+ "created_at": "2012-04-29T08:46:00Z"
120
+ },
121
+ "source_project_id": 2,
122
+ "target_project_id": 3,
123
+ "labels": [ ],
124
+ "description": "fixed login page css paddings",
125
+ "work_in_progress": false,
126
+ "milestone": {
127
+ "id": 5,
128
+ "iid": 1,
129
+ "project_id": 3,
130
+ "title": "v2.0",
131
+ "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
132
+ "state": "closed",
133
+ "created_at": "2015-02-02T19:49:26.013Z",
134
+ "updated_at": "2015-02-02T19:49:26.013Z",
135
+ "due_date": null
136
+ },
137
+ "merge_when_build_succeeds": true,
138
+ "merge_status": "can_be_merged",
139
+ "subscribed" : true,
140
+ "sha": "8888888888888888888888888888888888888888",
141
+ "merge_commit_sha": "9999999999999999999999999999999999999999",
142
+ "user_notes_count": 1,
143
+ "should_remove_source_branch": true,
144
+ "force_remove_source_branch": false,
145
+ "web_url": "http://example.com/example/example/merge_requests/1"
146
+ }
147
+ ```
148
+
149
+ ## Get single MR commits
150
+
151
+ Get a list of merge request commits.
152
+
153
+ ```
154
+ GET /projects/:id/merge_requests/:merge_request_id/commits
155
+ ```
156
+
157
+ Parameters:
158
+
159
+ - `id` (required) - The ID of a project
160
+ - `merge_request_id` (required) - The ID of MR
161
+
162
+
163
+ ```json
164
+ [
165
+ {
166
+ "id": "ed899a2f4b50b4370feeea94676502b42383c746",
167
+ "short_id": "ed899a2f4b5",
168
+ "title": "Replace sanitize with escape once",
169
+ "author_name": "Dmitriy Zaporozhets",
170
+ "author_email": "dzaporozhets@sphereconsultinginc.com",
171
+ "created_at": "2012-09-20T11:50:22+03:00",
172
+ "message": "Replace sanitize with escape once"
173
+ },
174
+ {
175
+ "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
176
+ "short_id": "6104942438c",
177
+ "title": "Sanitize for network graph",
178
+ "author_name": "randx",
179
+ "author_email": "dmitriy.zaporozhets@gmail.com",
180
+ "created_at": "2012-09-20T09:06:12+03:00",
181
+ "message": "Sanitize for network graph"
182
+ }
183
+ ]
184
+ ```
185
+
186
+ ## Get single MR changes
187
+
188
+ Shows information about the merge request including its files and changes.
189
+
190
+ ```
191
+ GET /projects/:id/merge_requests/:merge_request_id/changes
192
+ ```
193
+
194
+ Parameters:
195
+
196
+ - `id` (required) - The ID of a project
197
+ - `merge_request_id` (required) - The ID of MR
198
+
199
+ ```json
200
+ {
201
+ "id": 21,
202
+ "iid": 1,
203
+ "project_id": 4,
204
+ "title": "Blanditiis beatae suscipit hic assumenda et molestias nisi asperiores repellat et.",
205
+ "state": "reopened",
206
+ "created_at": "2015-02-02T19:49:39.159Z",
207
+ "updated_at": "2015-02-02T20:08:49.959Z",
208
+ "target_branch": "secret_token",
209
+ "source_branch": "version-1-9",
210
+ "upvotes": 0,
211
+ "downvotes": 0,
212
+ "author": {
213
+ "name": "Chad Hamill",
214
+ "username": "jarrett",
215
+ "id": 5,
216
+ "state": "active",
217
+ "avatar_url": "http://www.gravatar.com/avatar/b95567800f828948baf5f4160ebb2473?s=40&d=identicon"
218
+ },
219
+ "assignee": {
220
+ "name": "Administrator",
221
+ "username": "root",
222
+ "id": 1,
223
+ "state": "active",
224
+ "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40&d=identicon"
225
+ },
226
+ "source_project_id": 4,
227
+ "target_project_id": 4,
228
+ "labels": [ ],
229
+ "description": "Qui voluptatibus placeat ipsa alias quasi. Deleniti rem ut sint. Optio velit qui distinctio.",
230
+ "work_in_progress": false,
231
+ "milestone": {
232
+ "id": 5,
233
+ "iid": 1,
234
+ "project_id": 4,
235
+ "title": "v2.0",
236
+ "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
237
+ "state": "closed",
238
+ "created_at": "2015-02-02T19:49:26.013Z",
239
+ "updated_at": "2015-02-02T19:49:26.013Z",
240
+ "due_date": null
241
+ },
242
+ "merge_when_build_succeeds": true,
243
+ "merge_status": "can_be_merged",
244
+ "subscribed" : true,
245
+ "sha": "8888888888888888888888888888888888888888",
246
+ "merge_commit_sha": null,
247
+ "user_notes_count": 1,
248
+ "should_remove_source_branch": true,
249
+ "force_remove_source_branch": false,
250
+ "web_url": "http://example.com/example/example/merge_requests/1",
251
+ "changes": [
252
+ {
253
+ "old_path": "VERSION",
254
+ "new_path": "VERSION",
255
+ "a_mode": "100644",
256
+ "b_mode": "100644",
257
+ "diff": "--- a/VERSION\ +++ b/VERSION\ @@ -1 +1 @@\ -1.9.7\ +1.9.8",
258
+ "new_file": false,
259
+ "renamed_file": false,
260
+ "deleted_file": false
261
+ }
262
+ ]
263
+ }
264
+ ```
265
+
266
+ ## Create MR
267
+
268
+ Creates a new merge request.
269
+ ```
270
+ POST /projects/:id/merge_requests
271
+ ```
272
+
273
+ | Attribute | Type | Required | Description |
274
+ | --------- | ---- | -------- | ----------- |
275
+ | `id` | string | yes | The ID of a project |
276
+ | `source_branch` | string | yes | The source branch |
277
+ | `target_branch` | string | yes | The target branch |
278
+ | `title` | string | yes | Title of MR |
279
+ | `assignee_id` | integer | no | Assignee user ID |
280
+ | `description` | string | no | Description of MR |
281
+ | `target_project_id` | integer | no | The target project (numeric id) |
282
+ | `labels` | string | no | Labels for MR as a comma-separated list |
283
+ | `milestone_id` | integer | no | The ID of a milestone |
284
+ | `remove_source_branch` | boolean | no | Flag indicating if a merge request should remove the source branch when merging |
285
+
286
+ ```json
287
+ {
288
+ "id": 1,
289
+ "iid": 1,
290
+ "target_branch": "master",
291
+ "source_branch": "test1",
292
+ "project_id": 3,
293
+ "title": "test1",
294
+ "state": "opened",
295
+ "upvotes": 0,
296
+ "downvotes": 0,
297
+ "author": {
298
+ "id": 1,
299
+ "username": "admin",
300
+ "email": "admin@example.com",
301
+ "name": "Administrator",
302
+ "state": "active",
303
+ "created_at": "2012-04-29T08:46:00Z"
304
+ },
305
+ "assignee": {
306
+ "id": 1,
307
+ "username": "admin",
308
+ "email": "admin@example.com",
309
+ "name": "Administrator",
310
+ "state": "active",
311
+ "created_at": "2012-04-29T08:46:00Z"
312
+ },
313
+ "source_project_id": 4,
314
+ "target_project_id": 4,
315
+ "labels": [ ],
316
+ "description": "fixed login page css paddings",
317
+ "work_in_progress": false,
318
+ "milestone": {
319
+ "id": 5,
320
+ "iid": 1,
321
+ "project_id": 4,
322
+ "title": "v2.0",
323
+ "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
324
+ "state": "closed",
325
+ "created_at": "2015-02-02T19:49:26.013Z",
326
+ "updated_at": "2015-02-02T19:49:26.013Z",
327
+ "due_date": null
328
+ },
329
+ "merge_when_build_succeeds": true,
330
+ "merge_status": "can_be_merged",
331
+ "subscribed" : true,
332
+ "sha": "8888888888888888888888888888888888888888",
333
+ "merge_commit_sha": null,
334
+ "user_notes_count": 0,
335
+ "should_remove_source_branch": true,
336
+ "force_remove_source_branch": false,
337
+ "web_url": "http://example.com/example/example/merge_requests/1"
338
+ }
339
+ ```
340
+
341
+ ## Update MR
342
+
343
+ Updates an existing merge request. You can change the target branch, title, or even close the MR.
344
+
345
+ ```
346
+ PUT /projects/:id/merge_requests/:merge_request_id
347
+ ```
348
+
349
+ | Attribute | Type | Required | Description |
350
+ | --------- | ---- | -------- | ----------- |
351
+ | `id` | string | yes | The ID of a project |
352
+ | `merge_request_id` | integer | yes | The ID of a merge request |
353
+ | `source_branch` | string | yes | The source branch |
354
+ | `target_branch` | string | yes | The target branch |
355
+ | `title` | string | yes | Title of MR |
356
+ | `assignee_id` | integer | no | Assignee user ID |
357
+ | `description` | string | no | Description of MR |
358
+ | `target_project_id` | integer | no | The target project (numeric id) |
359
+ | `labels` | string | no | Labels for MR as a comma-separated list |
360
+ | `milestone_id` | integer | no | The ID of a milestone |
361
+ | `remove_source_branch` | boolean | no | Flag indicating if a merge request should remove the source branch when merging |
362
+
363
+ ```json
364
+ {
365
+ "id": 1,
366
+ "iid": 1,
367
+ "target_branch": "master",
368
+ "project_id": 3,
369
+ "title": "test1",
370
+ "state": "opened",
371
+ "upvotes": 0,
372
+ "downvotes": 0,
373
+ "author": {
374
+ "id": 1,
375
+ "username": "admin",
376
+ "email": "admin@example.com",
377
+ "name": "Administrator",
378
+ "state": "active",
379
+ "created_at": "2012-04-29T08:46:00Z"
380
+ },
381
+ "assignee": {
382
+ "id": 1,
383
+ "username": "admin",
384
+ "email": "admin@example.com",
385
+ "name": "Administrator",
386
+ "state": "active",
387
+ "created_at": "2012-04-29T08:46:00Z"
388
+ },
389
+ "source_project_id": 4,
390
+ "target_project_id": 4,
391
+ "labels": [ ],
392
+ "description": "description1",
393
+ "work_in_progress": false,
394
+ "milestone": {
395
+ "id": 5,
396
+ "iid": 1,
397
+ "project_id": 4,
398
+ "title": "v2.0",
399
+ "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
400
+ "state": "closed",
401
+ "created_at": "2015-02-02T19:49:26.013Z",
402
+ "updated_at": "2015-02-02T19:49:26.013Z",
403
+ "due_date": null
404
+ },
405
+ "merge_when_build_succeeds": true,
406
+ "merge_status": "can_be_merged",
407
+ "subscribed" : true,
408
+ "sha": "8888888888888888888888888888888888888888",
409
+ "merge_commit_sha": null,
410
+ "user_notes_count": 1,
411
+ "should_remove_source_branch": true,
412
+ "force_remove_source_branch": false,
413
+ "web_url": "http://example.com/example/example/merge_requests/1"
414
+ }
415
+ ```
416
+
417
+ ## Delete a merge request
418
+
419
+ Only for admins and project owners. Soft deletes the merge request in question.
420
+
421
+ ```
422
+ DELETE /projects/:id/merge_requests/:merge_request_id
423
+ ```
424
+
425
+ | Attribute | Type | Required | Description |
426
+ | --------- | ---- | -------- | ----------- |
427
+ | `id` | integer | yes | The ID of a project |
428
+ | `merge_request_id` | integer | yes | The ID of a project's merge request |
429
+
430
+ ```bash
431
+ curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/4/merge_requests/85
432
+ ```
433
+
434
+ ## Accept MR
435
+
436
+ Merge changes submitted with MR using this API.
437
+
438
+
439
+ If it has some conflicts and can not be merged - you'll get a `405` and the error message 'Branch cannot be merged'
440
+
441
+ If merge request is already merged or closed - you'll get a `406` and the error message 'Method Not Allowed'
442
+
443
+ If the `sha` parameter is passed and does not match the HEAD of the source - you'll get a `409` and the error message 'SHA does not match HEAD of source branch'
444
+
445
+ If you don't have permissions to accept this merge request - you'll get a `401`
446
+
447
+ ```
448
+ PUT /projects/:id/merge_requests/:merge_request_id/merge
449
+ ```
450
+
451
+ Parameters:
452
+
453
+ - `id` (required) - The ID of a project
454
+ - `merge_request_id` (required) - ID of MR
455
+ - `merge_commit_message` (optional) - Custom merge commit message
456
+ - `should_remove_source_branch` (optional) - if `true` removes the source branch
457
+ - `merge_when_build_succeeds` (optional) - if `true` the MR is merged when the build succeeds
458
+ - `sha` (optional) - if present, then this SHA must match the HEAD of the source branch, otherwise the merge will fail
459
+
460
+ ```json
461
+ {
462
+ "id": 1,
463
+ "iid": 1,
464
+ "target_branch": "master",
465
+ "source_branch": "test1",
466
+ "project_id": 3,
467
+ "title": "test1",
468
+ "state": "merged",
469
+ "upvotes": 0,
470
+ "downvotes": 0,
471
+ "author": {
472
+ "id": 1,
473
+ "username": "admin",
474
+ "email": "admin@example.com",
475
+ "name": "Administrator",
476
+ "state": "active",
477
+ "created_at": "2012-04-29T08:46:00Z"
478
+ },
479
+ "assignee": {
480
+ "id": 1,
481
+ "username": "admin",
482
+ "email": "admin@example.com",
483
+ "name": "Administrator",
484
+ "state": "active",
485
+ "created_at": "2012-04-29T08:46:00Z"
486
+ },
487
+ "source_project_id": 4,
488
+ "target_project_id": 4,
489
+ "labels": [ ],
490
+ "description": "fixed login page css paddings",
491
+ "work_in_progress": false,
492
+ "milestone": {
493
+ "id": 5,
494
+ "iid": 1,
495
+ "project_id": 4,
496
+ "title": "v2.0",
497
+ "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
498
+ "state": "closed",
499
+ "created_at": "2015-02-02T19:49:26.013Z",
500
+ "updated_at": "2015-02-02T19:49:26.013Z",
501
+ "due_date": null
502
+ },
503
+ "merge_when_build_succeeds": true,
504
+ "merge_status": "can_be_merged",
505
+ "subscribed" : true,
506
+ "sha": "8888888888888888888888888888888888888888",
507
+ "merge_commit_sha": "9999999999999999999999999999999999999999",
508
+ "user_notes_count": 1,
509
+ "should_remove_source_branch": true,
510
+ "force_remove_source_branch": false,
511
+ "web_url": "http://example.com/example/example/merge_requests/1"
512
+ }
513
+ ```
514
+
515
+ ## Cancel Merge When Pipeline Succeeds
516
+
517
+ If you don't have permissions to accept this merge request - you'll get a `401`
518
+
519
+ If the merge request is already merged or closed - you get `405` and error message 'Method Not Allowed'
520
+
521
+ In case the merge request is not set to be merged when the build succeeds, you'll also get a `406` error.
522
+ ```
523
+ PUT /projects/:id/merge_requests/:merge_request_id/cancel_merge_when_build_succeeds
524
+ ```
525
+ Parameters:
526
+
527
+ - `id` (required) - The ID of a project
528
+ - `merge_request_id` (required) - ID of MR
529
+
530
+ ```json
531
+ {
532
+ "id": 1,
533
+ "iid": 1,
534
+ "target_branch": "master",
535
+ "source_branch": "test1",
536
+ "project_id": 3,
537
+ "title": "test1",
538
+ "state": "opened",
539
+ "upvotes": 0,
540
+ "downvotes": 0,
541
+ "author": {
542
+ "id": 1,
543
+ "username": "admin",
544
+ "email": "admin@example.com",
545
+ "name": "Administrator",
546
+ "state": "active",
547
+ "created_at": "2012-04-29T08:46:00Z"
548
+ },
549
+ "assignee": {
550
+ "id": 1,
551
+ "username": "admin",
552
+ "email": "admin@example.com",
553
+ "name": "Administrator",
554
+ "state": "active",
555
+ "created_at": "2012-04-29T08:46:00Z"
556
+ },
557
+ "source_project_id": 4,
558
+ "target_project_id": 4,
559
+ "labels": [ ],
560
+ "description": "fixed login page css paddings",
561
+ "work_in_progress": false,
562
+ "milestone": {
563
+ "id": 5,
564
+ "iid": 1,
565
+ "project_id": 4,
566
+ "title": "v2.0",
567
+ "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.",
568
+ "state": "closed",
569
+ "created_at": "2015-02-02T19:49:26.013Z",
570
+ "updated_at": "2015-02-02T19:49:26.013Z",
571
+ "due_date": null
572
+ },
573
+ "merge_when_build_succeeds": true,
574
+ "merge_status": "can_be_merged",
575
+ "subscribed" : true,
576
+ "sha": "8888888888888888888888888888888888888888",
577
+ "merge_commit_sha": null,
578
+ "user_notes_count": 1,
579
+ "should_remove_source_branch": true,
580
+ "force_remove_source_branch": false,
581
+ "web_url": "http://example.com/example/example/merge_requests/1"
582
+ }
583
+ ```
584
+
585
+ ## Comments on merge requests
586
+
587
+ Comments are done via the [notes](notes.md) resource.
588
+
589
+ ## List issues that will close on merge
590
+
591
+ Get all the issues that would be closed by merging the provided merge request.
592
+
593
+ ```
594
+ GET /projects/:id/merge_requests/:merge_request_id/closes_issues
595
+ ```
596
+
597
+ | Attribute | Type | Required | Description |
598
+ | --------- | ---- | -------- | ----------- |
599
+ | `id` | integer | yes | The ID of a project |
600
+ | `merge_request_id` | integer | yes | The ID of the merge request |
601
+
602
+ ```bash
603
+ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/76/merge_requests/1/closes_issues
604
+ ```
605
+
606
+ Example response when the GitLab issue tracker is used:
607
+
608
+ ```json
609
+ [
610
+ {
611
+ "state" : "opened",
612
+ "description" : "Ratione dolores corrupti mollitia soluta quia.",
613
+ "author" : {
614
+ "state" : "active",
615
+ "id" : 18,
616
+ "web_url" : "https://gitlab.example.com/eileen.lowe",
617
+ "name" : "Alexandra Bashirian",
618
+ "avatar_url" : null,
619
+ "username" : "eileen.lowe"
620
+ },
621
+ "milestone" : {
622
+ "project_id" : 1,
623
+ "description" : "Ducimus nam enim ex consequatur cumque ratione.",
624
+ "state" : "closed",
625
+ "due_date" : null,
626
+ "iid" : 2,
627
+ "created_at" : "2016-01-04T15:31:39.996Z",
628
+ "title" : "v4.0",
629
+ "id" : 17,
630
+ "updated_at" : "2016-01-04T15:31:39.996Z"
631
+ },
632
+ "project_id" : 1,
633
+ "assignee" : {
634
+ "state" : "active",
635
+ "id" : 1,
636
+ "name" : "Administrator",
637
+ "web_url" : "https://gitlab.example.com/root",
638
+ "avatar_url" : null,
639
+ "username" : "root"
640
+ },
641
+ "updated_at" : "2016-01-04T15:31:51.081Z",
642
+ "id" : 76,
643
+ "title" : "Consequatur vero maxime deserunt laboriosam est voluptas dolorem.",
644
+ "created_at" : "2016-01-04T15:31:51.081Z",
645
+ "iid" : 6,
646
+ "labels" : [],
647
+ "user_notes_count": 1
648
+ },
649
+ ]
650
+ ```
651
+
652
+ Example response when an external issue tracker (e.g. JIRA) is used:
653
+
654
+ ```json
655
+ [
656
+ {
657
+ "id" : "PROJECT-123",
658
+ "title" : "Title of this issue"
659
+ }
660
+ ]
661
+ ```
662
+
663
+ ## Subscribe to a merge request
664
+
665
+ Subscribes the authenticated user to a merge request to receive notification. If the user is already subscribed to the merge request, the
666
+ status code `304` is returned.
667
+
668
+ ```
669
+ POST /projects/:id/merge_requests/:merge_request_id/subscription
670
+ ```
671
+
672
+ | Attribute | Type | Required | Description |
673
+ | --------- | ---- | -------- | ----------- |
674
+ | `id` | integer | yes | The ID of a project |
675
+ | `merge_request_id` | integer | yes | The ID of the merge request |
676
+
677
+ ```bash
678
+ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/17/subscription
679
+ ```
680
+
681
+ Example response:
682
+
683
+ ```json
684
+ {
685
+ "id": 17,
686
+ "iid": 1,
687
+ "project_id": 5,
688
+ "title": "Et et sequi est impedit nulla ut rem et voluptatem.",
689
+ "description": "Consequatur velit eos rerum optio autem. Quia id officia quaerat dolorum optio. Illo laudantium aut ipsum dolorem.",
690
+ "state": "opened",
691
+ "created_at": "2016-04-05T21:42:23.233Z",
692
+ "updated_at": "2016-04-05T22:11:52.900Z",
693
+ "target_branch": "ui-dev-kit",
694
+ "source_branch": "version-1-9",
695
+ "upvotes": 0,
696
+ "downvotes": 0,
697
+ "author": {
698
+ "name": "Eileen Skiles",
699
+ "username": "leila",
700
+ "id": 19,
701
+ "state": "active",
702
+ "avatar_url": "http://www.gravatar.com/avatar/39ce4a2822cc896933ffbd68c1470e55?s=80&d=identicon",
703
+ "web_url": "https://gitlab.example.com/leila"
704
+ },
705
+ "assignee": {
706
+ "name": "Celine Wehner",
707
+ "username": "carli",
708
+ "id": 16,
709
+ "state": "active",
710
+ "avatar_url": "http://www.gravatar.com/avatar/f4cd5605b769dd2ce405a27c6e6f2684?s=80&d=identicon",
711
+ "web_url": "https://gitlab.example.com/carli"
712
+ },
713
+ "source_project_id": 5,
714
+ "target_project_id": 5,
715
+ "labels": [],
716
+ "work_in_progress": false,
717
+ "milestone": {
718
+ "id": 7,
719
+ "iid": 1,
720
+ "project_id": 5,
721
+ "title": "v2.0",
722
+ "description": "Corrupti eveniet et velit occaecati dolorem est rerum aut.",
723
+ "state": "closed",
724
+ "created_at": "2016-04-05T21:41:40.905Z",
725
+ "updated_at": "2016-04-05T21:41:40.905Z",
726
+ "due_date": null
727
+ },
728
+ "merge_when_build_succeeds": false,
729
+ "merge_status": "cannot_be_merged",
730
+ "subscribed": true,
731
+ "sha": "8888888888888888888888888888888888888888",
732
+ "merge_commit_sha": null
733
+ }
734
+ ```
735
+
736
+ ## Unsubscribe from a merge request
737
+
738
+ Unsubscribes the authenticated user from a merge request to not receive
739
+ notifications from that merge request. If the user is
740
+ not subscribed to the merge request, the status code `304` is returned.
741
+
742
+ ```
743
+ DELETE /projects/:id/merge_requests/:merge_request_id/subscription
744
+ ```
745
+
746
+ | Attribute | Type | Required | Description |
747
+ | --------- | ---- | -------- | ----------- |
748
+ | `id` | integer | yes | The ID of a project |
749
+ | `merge_request_id` | integer | yes | The ID of the merge request |
750
+
751
+ ```bash
752
+ curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/17/subscription
753
+ ```
754
+
755
+ Example response:
756
+
757
+ ```json
758
+ {
759
+ "id": 17,
760
+ "iid": 1,
761
+ "project_id": 5,
762
+ "title": "Et et sequi est impedit nulla ut rem et voluptatem.",
763
+ "description": "Consequatur velit eos rerum optio autem. Quia id officia quaerat dolorum optio. Illo laudantium aut ipsum dolorem.",
764
+ "state": "opened",
765
+ "created_at": "2016-04-05T21:42:23.233Z",
766
+ "updated_at": "2016-04-05T22:11:52.900Z",
767
+ "target_branch": "ui-dev-kit",
768
+ "source_branch": "version-1-9",
769
+ "upvotes": 0,
770
+ "downvotes": 0,
771
+ "author": {
772
+ "name": "Eileen Skiles",
773
+ "username": "leila",
774
+ "id": 19,
775
+ "state": "active",
776
+ "avatar_url": "http://www.gravatar.com/avatar/39ce4a2822cc896933ffbd68c1470e55?s=80&d=identicon",
777
+ "web_url": "https://gitlab.example.com/leila"
778
+ },
779
+ "assignee": {
780
+ "name": "Celine Wehner",
781
+ "username": "carli",
782
+ "id": 16,
783
+ "state": "active",
784
+ "avatar_url": "http://www.gravatar.com/avatar/f4cd5605b769dd2ce405a27c6e6f2684?s=80&d=identicon",
785
+ "web_url": "https://gitlab.example.com/carli"
786
+ },
787
+ "source_project_id": 5,
788
+ "target_project_id": 5,
789
+ "labels": [],
790
+ "work_in_progress": false,
791
+ "milestone": {
792
+ "id": 7,
793
+ "iid": 1,
794
+ "project_id": 5,
795
+ "title": "v2.0",
796
+ "description": "Corrupti eveniet et velit occaecati dolorem est rerum aut.",
797
+ "state": "closed",
798
+ "created_at": "2016-04-05T21:41:40.905Z",
799
+ "updated_at": "2016-04-05T21:41:40.905Z",
800
+ "due_date": null
801
+ },
802
+ "merge_when_build_succeeds": false,
803
+ "merge_status": "cannot_be_merged",
804
+ "subscribed": false,
805
+ "sha": "8888888888888888888888888888888888888888",
806
+ "merge_commit_sha": null
807
+ }
808
+ ```
809
+
810
+ ## Create a todo
811
+
812
+ Manually creates a todo for the current user on a merge request.
813
+ If there already exists a todo for the user on that merge request,
814
+ status code `304` is returned.
815
+
816
+ ```
817
+ POST /projects/:id/merge_requests/:merge_request_id/todo
818
+ ```
819
+
820
+ | Attribute | Type | Required | Description |
821
+ | --------- | ---- | -------- | ----------- |
822
+ | `id` | integer | yes | The ID of a project |
823
+ | `merge_request_id` | integer | yes | The ID of the merge request |
824
+
825
+ ```bash
826
+ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/27/todo
827
+ ```
828
+
829
+ Example response:
830
+
831
+ ```json
832
+ {
833
+ "id": 113,
834
+ "project": {
835
+ "id": 3,
836
+ "name": "Gitlab Ci",
837
+ "name_with_namespace": "Gitlab Org / Gitlab Ci",
838
+ "path": "gitlab-ci",
839
+ "path_with_namespace": "gitlab-org/gitlab-ci"
840
+ },
841
+ "author": {
842
+ "name": "Administrator",
843
+ "username": "root",
844
+ "id": 1,
845
+ "state": "active",
846
+ "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
847
+ "web_url": "https://gitlab.example.com/root"
848
+ },
849
+ "action_name": "marked",
850
+ "target_type": "MergeRequest",
851
+ "target": {
852
+ "id": 27,
853
+ "iid": 7,
854
+ "project_id": 3,
855
+ "title": "Et voluptas laudantium minus nihil recusandae ut accusamus earum aut non.",
856
+ "description": "Veniam sunt nihil modi earum cumque illum delectus. Nihil ad quis distinctio quia. Autem eligendi at quibusdam repellendus.",
857
+ "state": "opened",
858
+ "created_at": "2016-06-17T07:48:04.330Z",
859
+ "updated_at": "2016-07-01T11:14:15.537Z",
860
+ "target_branch": "allow_regex_for_project_skip_ref",
861
+ "source_branch": "backup",
862
+ "upvotes": 0,
863
+ "downvotes": 0,
864
+ "author": {
865
+ "name": "Jarret O'Keefe",
866
+ "username": "francisca",
867
+ "id": 14,
868
+ "state": "active",
869
+ "avatar_url": "http://www.gravatar.com/avatar/a7fa515d53450023c83d62986d0658a8?s=80&d=identicon",
870
+ "web_url": "https://gitlab.example.com/francisca"
871
+ },
872
+ "assignee": {
873
+ "name": "Dr. Gabrielle Strosin",
874
+ "username": "barrett.krajcik",
875
+ "id": 4,
876
+ "state": "active",
877
+ "avatar_url": "http://www.gravatar.com/avatar/733005fcd7e6df12d2d8580171ccb966?s=80&d=identicon",
878
+ "web_url": "https://gitlab.example.com/barrett.krajcik"
879
+ },
880
+ "source_project_id": 3,
881
+ "target_project_id": 3,
882
+ "labels": [],
883
+ "work_in_progress": false,
884
+ "milestone": {
885
+ "id": 27,
886
+ "iid": 2,
887
+ "project_id": 3,
888
+ "title": "v1.0",
889
+ "description": "Quis ea accusantium animi hic fuga assumenda.",
890
+ "state": "active",
891
+ "created_at": "2016-06-17T07:47:33.840Z",
892
+ "updated_at": "2016-06-17T07:47:33.840Z",
893
+ "due_date": null
894
+ },
895
+ "merge_when_build_succeeds": false,
896
+ "merge_status": "unchecked",
897
+ "subscribed": true,
898
+ "sha": "8888888888888888888888888888888888888888",
899
+ "merge_commit_sha": null,
900
+ "user_notes_count": 7,
901
+ "should_remove_source_branch": true,
902
+ "force_remove_source_branch": false,
903
+ "web_url": "http://example.com/example/example/merge_requests/1"
904
+ },
905
+ "target_url": "https://gitlab.example.com/gitlab-org/gitlab-ci/merge_requests/7",
906
+ "body": "Et voluptas laudantium minus nihil recusandae ut accusamus earum aut non.",
907
+ "state": "pending",
908
+ "created_at": "2016-07-01T11:14:15.530Z"
909
+ }
910
+ ```
911
+
912
+ ## Get MR diff versions
913
+
914
+ Get a list of merge request diff versions.
915
+
916
+ ```
917
+ GET /projects/:id/merge_requests/:merge_request_id/versions
918
+ ```
919
+
920
+ | Attribute | Type | Required | Description |
921
+ | --------- | ------- | -------- | --------------------- |
922
+ | `id` | String | yes | The ID of the project |
923
+ | `merge_request_id` | integer | yes | The ID of the merge request |
924
+
925
+ ```bash
926
+ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/1/merge_requests/1/versions
927
+ ```
928
+
929
+ Example response:
930
+
931
+ ```json
932
+ [{
933
+ "id": 110,
934
+ "head_commit_sha": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
935
+ "base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
936
+ "start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
937
+ "created_at": "2016-07-26T14:44:48.926Z",
938
+ "merge_request_id": 105,
939
+ "state": "collected",
940
+ "real_size": "1"
941
+ }, {
942
+ "id": 108,
943
+ "head_commit_sha": "3eed087b29835c48015768f839d76e5ea8f07a24",
944
+ "base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
945
+ "start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
946
+ "created_at": "2016-07-25T14:21:33.028Z",
947
+ "merge_request_id": 105,
948
+ "state": "collected",
949
+ "real_size": "1"
950
+ }]
951
+ ```
952
+
953
+ ## Get a single MR diff version
954
+
955
+ Get a single merge request diff version.
956
+
957
+ ```
958
+ GET /projects/:id/merge_requests/:merge_request_id/versions/:version_id
959
+ ```
960
+
961
+ | Attribute | Type | Required | Description |
962
+ | --------- | ------- | -------- | --------------------- |
963
+ | `id` | String | yes | The ID of the project |
964
+ | `merge_request_id` | integer | yes | The ID of the merge request |
965
+ | `version_id` | integer | yes | The ID of the merge request diff version |
966
+
967
+ ```bash
968
+ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/1/merge_requests/1/versions/1
969
+ ```
970
+
971
+ Example response:
972
+
973
+ ```json
974
+ {
975
+ "id": 110,
976
+ "head_commit_sha": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
977
+ "base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
978
+ "start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
979
+ "created_at": "2016-07-26T14:44:48.926Z",
980
+ "merge_request_id": 105,
981
+ "state": "collected",
982
+ "real_size": "1",
983
+ "commits": [{
984
+ "id": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
985
+ "short_id": "33e2ee85",
986
+ "title": "Change year to 2018",
987
+ "author_name": "Administrator",
988
+ "author_email": "admin@example.com",
989
+ "created_at": "2016-07-26T17:44:29.000+03:00",
990
+ "message": "Change year to 2018"
991
+ }, {
992
+ "id": "aa24655de48b36335556ac8a3cd8bb521f977cbd",
993
+ "short_id": "aa24655d",
994
+ "title": "Update LICENSE",
995
+ "author_name": "Administrator",
996
+ "author_email": "admin@example.com",
997
+ "created_at": "2016-07-25T17:21:53.000+03:00",
998
+ "message": "Update LICENSE"
999
+ }, {
1000
+ "id": "3eed087b29835c48015768f839d76e5ea8f07a24",
1001
+ "short_id": "3eed087b",
1002
+ "title": "Add license",
1003
+ "author_name": "Administrator",
1004
+ "author_email": "admin@example.com",
1005
+ "created_at": "2016-07-25T17:21:20.000+03:00",
1006
+ "message": "Add license"
1007
+ }],
1008
+ "diffs": [{
1009
+ "old_path": "LICENSE",
1010
+ "new_path": "LICENSE",
1011
+ "a_mode": "0",
1012
+ "b_mode": "100644",
1013
+ "diff": "--- /dev/null\n+++ b/LICENSE\n@@ -0,0 +1,21 @@\n+The MIT License (MIT)\n+\n+Copyright (c) 2018 Administrator\n+\n+Permission is hereby granted, free of charge, to any person obtaining a copy\n+of this software and associated documentation files (the \"Software\"), to deal\n+in the Software without restriction, including without limitation the rights\n+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+copies of the Software, and to permit persons to whom the Software is\n+furnished to do so, subject to the following conditions:\n+\n+The above copyright notice and this permission notice shall be included in all\n+copies or substantial portions of the Software.\n+\n+THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+SOFTWARE.\n",
1014
+ "new_file": true,
1015
+ "renamed_file": false,
1016
+ "deleted_file": false
1017
+ }]
1018
+ }
1019
+ ```
1020
+ ## Set a time estimate for a merge request
1021
+
1022
+ Sets an estimated time of work for this merge request.
1023
+
1024
+ ```
1025
+ POST /projects/:id/merge_requests/:merge_request_id/time_estimate
1026
+ ```
1027
+
1028
+ | Attribute | Type | Required | Description |
1029
+ | --------- | ---- | -------- | ----------- |
1030
+ | `id` | integer | yes | The ID of a project |
1031
+ | `merge_request_id` | integer | yes | The ID of a project's merge request |
1032
+ | `duration` | string | yes | The duration in human format. e.g: 3h30m |
1033
+
1034
+ ```bash
1035
+ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/93/time_estimate?duration=3h30m
1036
+ ```
1037
+
1038
+ Example response:
1039
+
1040
+ ```json
1041
+ {
1042
+ "human_time_estimate": "3h 30m",
1043
+ "human_total_time_spent": null,
1044
+ "time_estimate": 12600,
1045
+ "total_time_spent": 0
1046
+ }
1047
+ ```
1048
+
1049
+ ## Reset the time estimate for a merge request
1050
+
1051
+ Resets the estimated time for this merge request to 0 seconds.
1052
+
1053
+ ```
1054
+ POST /projects/:id/merge_requests/:merge_request_id/reset_time_estimate
1055
+ ```
1056
+
1057
+ | Attribute | Type | Required | Description |
1058
+ | --------- | ---- | -------- | ----------- |
1059
+ | `id` | integer | yes | The ID of a project |
1060
+ | `merge_request_id` | integer | yes | The ID of a project's merge_request |
1061
+
1062
+ ```bash
1063
+ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/93/reset_time_estimate
1064
+ ```
1065
+
1066
+ Example response:
1067
+
1068
+ ```json
1069
+ {
1070
+ "human_time_estimate": null,
1071
+ "human_total_time_spent": null,
1072
+ "time_estimate": 0,
1073
+ "total_time_spent": 0
1074
+ }
1075
+ ```
1076
+
1077
+ ## Add spent time for a merge request
1078
+
1079
+ Adds spent time for this merge request
1080
+
1081
+ ```
1082
+ POST /projects/:id/merge_requests/:merge_request_id/add_spent_time
1083
+ ```
1084
+
1085
+ | Attribute | Type | Required | Description |
1086
+ | --------- | ---- | -------- | ----------- |
1087
+ | `id` | integer | yes | The ID of a project |
1088
+ | `merge_request_id` | integer | yes | The ID of a project's merge request |
1089
+ | `duration` | string | yes | The duration in human format. e.g: 3h30m |
1090
+
1091
+ ```bash
1092
+ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/93/add_spent_time?duration=1h
1093
+ ```
1094
+
1095
+ Example response:
1096
+
1097
+ ```json
1098
+ {
1099
+ "human_time_estimate": null,
1100
+ "human_total_time_spent": "1h",
1101
+ "time_estimate": 0,
1102
+ "total_time_spent": 3600
1103
+ }
1104
+ ```
1105
+
1106
+ ## Reset spent time for a merge request
1107
+
1108
+ Resets the total spent time for this merge request to 0 seconds.
1109
+
1110
+ ```
1111
+ POST /projects/:id/merge_requests/:merge_request_id/reset_spent_time
1112
+ ```
1113
+
1114
+ | Attribute | Type | Required | Description |
1115
+ | --------- | ---- | -------- | ----------- |
1116
+ | `id` | integer | yes | The ID of a project |
1117
+ | `merge_request_id` | integer | yes | The ID of a project's merge_request |
1118
+
1119
+ ```bash
1120
+ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/93/reset_spent_time
1121
+ ```
1122
+
1123
+ Example response:
1124
+
1125
+ ```json
1126
+ {
1127
+ "human_time_estimate": null,
1128
+ "human_total_time_spent": null,
1129
+ "time_estimate": 0,
1130
+ "total_time_spent": 0
1131
+ }
1132
+ ```
1133
+
1134
+ ## Get time tracking stats
1135
+
1136
+ ```
1137
+ GET /projects/:id/merge_requests/:merge_request_id/time_stats
1138
+ ```
1139
+
1140
+ | Attribute | Type | Required | Description |
1141
+ | --------- | ---- | -------- | ----------- |
1142
+ | `id` | integer | yes | The ID of a project |
1143
+ | `merge_request_id` | integer | yes | The ID of a project's merge request |
1144
+
1145
+ ```bash
1146
+ curl --request GET --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/merge_requests/93/time_stats
1147
+ ```
1148
+
1149
+ Example response:
1150
+
1151
+ ```json
1152
+ {
1153
+ "human_time_estimate": "2h",
1154
+ "human_total_time_spent": "1h",
1155
+ "time_estimate": 7200,
1156
+ "total_time_spent": 3600
1157
+ }
1158
+ ```