Creates a branch in the specified repository.
The authenticated user must have an effective REPO_WRITE permission to call this resource. If branch permissions are set up in the repository, the authenticated user must also have access to the branch name that is to be created.
string
Requiredstring
Requiredboolean
string
string
object
JSON representation of the newly created branch
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"empty": true,
"name": "<string>",
"startPoint": "<string>"
}'
Deletes a branch in the specified repository.
If the branch does not exist, this operation will not raise an error. In other words after calling this resource and receiving a 204 response the branch provided in the request is guaranteed to not exist in the specified repository any more, regardless of its existence beforehand.
The optional 'endPoint' parameter of the request may contain a commit ID that the provided ref name is expected to point to. Should the ref point to a different commit ID, a 400 response will be returned with appropriate error details.
The authenticated user must have an effective REPO_WRITE permission to call this resource. If branch permissions are set up in the repository, the authenticated user must also have access to the branch name that is to be deleted.
string
Requiredstring
Requiredboolean
boolean
string
string
object
An empty response indicating that the branch no longer exists in the repository
1
2
3
4
5
6
7
8
9
curl --request DELETE \
--url 'http://{baseurl}/rest/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Content-Type: application/json' \
--data '{
"dryRun": true,
"empty": true,
"endPoint": "<string>",
"name": "<string>"
}'
Gets the branch information associated with a single commit from a given repository.
string
Requiredstring
Requiredstring
Requiredinteger
integer
a page of branch refs associated with the commit
Page of refs
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches/info/{commitId}' \
--header 'Accept: application/json;charset=UTF-8'
Creates a tag in the specified repository.
The authenticated user must have an effective REPO_WRITE permission to call this resource.
'LIGHTWEIGHT' and 'ANNOTATED' are the two type of tags that can be created. The 'startPoint' can either be a ref or a 'commit'.
string
Requiredstring
RequiredThe create git tag request.
boolean
string
string
string
string
A JSON representation of the newly created tag.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"force": true,
"message": "A new release tag",
"name": "release-tag",
"startPoint": "refs/heads/master",
"type": "ANNOTATED"
}'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Deletes a tag in the specified repository.
The authenticated user must have an effective REPO_WRITE permission to call this resource.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the tag no longer exists in the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}'
Retrieves the synchronization status for the specified repository. In addition to listing refs which cannot be synchronized, if any, the status also provides the timestamp for the most recent synchronization and indicates whether synchronization is available and enabled. If "?at" is specified in the URL, the synchronization status for the specified ref is returned, rather than the complete repository status.
The authenticated user must have REPO_READ permission for the repository, or it must be public if the request is anonymous. Additionally, after synchronization is enabled for a repository, meaning synchronization was available at that time, permission changes and other actions can cause it to become unavailable. Even when synchronization is enabled, if it is no longer available for the repository it will not be performed.
string
Requiredstring
Requiredstring
Synchronization status for the specified repository, or specific ref within that repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"orphanedRefs": {
"state": "AHEAD",
"tag": true,
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"divergedRefs": {
"state": "AHEAD",
"tag": true,
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"lastSync": 1331038800000,
"aheadRefs": {
"state": "AHEAD",
"tag": true,
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"available": true,
"enabled": true
}
Enables or disables synchronization for the specified repository. When synchronization is enabled, branches within the repository are immediately synchronized and the status is updated with the outcome. That initial synchronization is performed before the REST request returns, allowing it to return the updated status.
The authenticated user must have REPO_ADMIN permission for the specified repository. Anonymous users cannot manage synchronization, even on public repositories. Additionally, synchronization must be available for the specified repository. Synchronization is only available if:
string
Requiredstring
Requiredboolean
The updated synchronization status for the repository, after enabling synchronization. 204 NO CONTENT is returned instead after disabling synchronization.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"orphanedRefs": {
"state": "AHEAD",
"tag": true,
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"divergedRefs": {
"state": "AHEAD",
"tag": true,
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"lastSync": 1331038800000,
"aheadRefs": {
"state": "AHEAD",
"tag": true,
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"available": true,
"enabled": true
}
Allows developers to apply a manual operation to bring a ref back in sync with upstream when it becomes out of sync due to conflicting changes. The following actions are supported:
The authenticated user must have REPO_WRITE permission for the specified repository. Anonymous users cannot synchronize refs, even on public repositories. Additionally, synchronization must be enabled and available for the specified repository.
string
Requiredstring
Requiredstring
Context
string
The requested action was successfully performed, and has updated the ref's state, but the ref if is still not in sync with upstream. For example, after applying the MERGE action, the ref will still be AHEAD of upstream. If the action brings the ref in sync with upstream, 204 NO CONTENT is returned instead.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}/synchronize' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"action": "MERGE",
"context": {
"commitMessage": "Merging in latest from upstream."
},
"refId": "refs/heads/master"
}'
1
2
3
4
5
6
7
{
"state": "AHEAD",
"tag": true,
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Add an emoticon reaction to a comment
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe added reaction
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/reactions/{emoticon}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
{
"emoticon": {
"shortcut": "<string>",
"url": "<string>",
"value": "<string>"
},
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"comment": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [
{
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
}
Remove an emoticon reaction from a comment
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe added reaction
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/reactions/{emoticon}'
Search for restrictions using the supplied parameters.
The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
Requiredstring
Requiredstring
string
string
number
number
A response containing a page of restrictions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
"values": [
{
"accessKeys": [
{
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"users": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"groups": [
"group_a",
"group_b"
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
}
},
"id": 1,
"type": "pull-request-only"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a restriction for the supplied branch or set of branches to be applied on all repositories in the given project.
A restriction means preventing writes on the specified branch(es) by all except a set of users and/or groups, or preventing specific operations such as branch deletion.
For example, you can restrict write access on 'master' to just the 'senior-developer' group, or prevent anyone from deleting that branch.
The request matcher and type must conform to the following.
See the Branch REST API for more information.
See the Branch REST API for more information.
The authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
Requiredstring
RequiredThe request containing the details of the restriction to create.
array<integer>
array<RestSshAccessKey>
array<string>
array<string>
object
string
array<string>
array<RestApplicationUser>
Response contains the ref restriction that was just created.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
curl --request POST \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"accessKeyIds": [
1,
2,
3
],
"accessKeys": [
{
"repository": {
"scmId": "git",
"slug": "my-repo",
"project": {
"avatarUrl": "<string>",
"avatar": "<string>",
"key": "PRJ",
"links": {}
},
"name": "My repo",
"links": {}
},
"project": {
"avatarUrl": "<string>",
"avatar": "<string>",
"key": "PRJ",
"links": {}
},
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"text": "sh-rsa AAAAB3... me@127.0.0.1"
},
"permission": "USER_ADMIN"
}
],
"groupNames": [
"bitbucket-developers"
],
"groups": [
"group_a",
"group_b"
],
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"type": "pull-request-only",
"userSlugs": [
"bman",
"tstark",
"hulk"
],
"users": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"links": {},
"name": "jcitizen",
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen",
"avatarUrl": "<string>"
}
]
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"accessKeys": [
{
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"users": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"groups": [
"group_a",
"group_b"
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
}
},
"id": 1,
"type": "pull-request-only"
}
Returns a restriction as specified by a restriction id.
The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
Requiredstring
Requiredstring
RequiredA response containing the restriction.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"accessKeys": [
{
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"users": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"groups": [
"group_a",
"group_b"
],
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
}
},
"id": 1,
"type": "pull-request-only"
}
Deletes a restriction as specified by a restriction id.
The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}'
Retrieve a page of recently accessed repositories for the currently authenticated user.
Repositories are ordered from most recently to least recently accessed.
Only authenticated users may call this resource.
string
number
number
A page of recently accessed repositories.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/profile/recent/repos' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"values": [
{
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Streams an archive of the repository's contents at the requested commit. If no at=
commit is requested, an archive of the default branch is streamed.
The filename=
query parameter may be used to specify the exact filename to include in the "Content-Disposition" header. If an explicit filename is not provided, one will be automatically generated based on what is being archived. Its format depends on the at= value:
No at=
commit: <slug>-<default-branch-name>@<commit>.<format>; e.g. example-master@43c2f8a0fe8.zip
at=
sha: <slug>-<at>.<format>; e.g. example-09bcbb00100cfbb5310fb6834a1d5ce6cac253e9.tar.gz
at=
branchOrTag: <slug>-<branchOrTag>@<commit>.<format>; e.g. example-feature@bbb225f16e1.tar
Archives may be requested in the following formats by adding the format=
query parameter:
The contents of the archive may be filtered by using the path=
query parameter to specify paths to include. path=
may be specified multiple times to include multiple paths.
The prefix=
query parameter may be used to define a directory (or multiple directories) where the archive's contents should be placed. If the prefix does not end with /, one will be added automatically. The prefix is always treated as a directory; it is not possible to use it to prepend characters to the entries in the archive.
Archives of public repositories may be streamed by any authenticated or anonymous user. Streaming archives for non-public repositories requires an authenticated user with at least REPO_READ permission.
string
Requiredstring
Requiredstring
string
string
string
string
An archive or the requested commit, in zip, tar or gzipped-tar format.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/archive' \
--header 'Accept: application/json'
Retrieve the attachment.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment.
string
Requiredstring
Requiredstring
Requiredstring
the attachment
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}' \
--header 'Accept: application/json'
Delete an attachment.
The user must be authenticated and have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredThis status code has no content.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}'
Retrieve the attachment metadata.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment that has the attachment metadata.
string
Requiredstring
Requiredstring
RequiredThe attachment metadata
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata' \
--header 'Accept: application/json'
1
2
3
4
5
{
"metadata": "{\\\"A\\\":\\\"B\\\"}",
"url": "test.com/test",
"id": 1
}
Save attachment metadata.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment that has the attachment metadata.
string
Requiredstring
Requiredstring
RequiredThe attachment metadata can be any valid JSON content
string
The attachment metadata
any
1
2
3
4
5
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '"<string>"'
Delete attachment metadata.
The user must be authenticated and have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredThis status code has no content.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata'
Retrieve the branches matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredboolean
string
boolean
string
string
number
number
The branches matching the supplied filterText.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"displayId": "<string>",
"default": true,
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"id": "refs/heads/master"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates a branch using the information provided in the RestCreateBranchRequest request
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
string
Requiredstring
RequiredThe request to create a branch containing a name, startPoint, and optionally a message
string
string
string
The created branch.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
1
2
3
4
5
6
7
{
"displayId": "<string>",
"default": true,
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"id": "refs/heads/master"
}
Retrieve a page of content for a file path at a specified revision.
Responses from this endpoint vary widely depending on the query parameters. The example JSON is for a request that does not use size, type, blame or noContent.
The various parameters are "processed" in the above order. That means ?size=true&type=truewill return a size response, not a type one; the type parameter will be ignored.
The blame and noContent query parameters are handled differently from size and type. For blame and noContent, the presence of the parameter implies "true" if no value is specified; size and and type both require an explicit=true or they're treated as "false".
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
A page of contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse' \
--header 'Accept: application/json'
Retrieve a page of content for a file path at a specified revision.
Responses from this endpoint vary widely depending on the query parameters. The example JSON is for a request that does not use size, type, blame or noContent.
The various parameters are "processed" in the above order. That means ?size=true&type=truewill return a size response, not a type one; the type parameter will be ignored.
The blame and noContent query parameters are handled differently from size and type. For blame and noContent, the presence of the parameter implies "true" if no value is specified; size and and type both require an explicit=true or they're treated as "false".
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A page of contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \
--header 'Accept: application/json'
Update the content of path, on the given repository and branch.
This resource accepts PUT multipart form data, containing the file in a form-field named content.
An example curl request to update 'README.md' would be:
curl -X PUT -u username:password -F content=@README.md -F 'message=Updated using file-edit REST API' -F branch=master -F sourceCommitId=5636641a50b http://example.com/rest/api/latest/projects/PROJECT_1/repos/repo_1/browse/README.md
The file can be updated or created on a new branch. In this case, the sourceBranch parameter should be provided to identify the starting point for the new branch and the branch parameter identifies the branch to create the new commit on.
string
Requiredstring
Requiredstring
RequiredThe multipart form data containing the file
string
string
string
string
string
The newly created commit.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
Retrieve a page of changes made in a specified commit.
Note: The implementation will apply a hard cap ({@code page.max.changes}) and it is not possible to request subsequent content when that cap is exceeded.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
number
number
A page of changes
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/changes' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
"values": [
{
"conflict": {
"ourChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"theirChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"executable": true,
"nodeType": "DIRECTORY",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of commits from a given starting commit or "between" two commits. If no explicit commit is specified, the tip of the repository's default branch is assumed. commits may be identified by branch or tag name or by ID. A path may be supplied to restrict the returned commits to only those which affect that path.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
string
string
string
string
number
A page of commits
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
"values": [
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a single commit identified by its ID. In general, that ID is a SHA1. From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A commit
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
Retrieve a page of changes made in a specified commit.
Note: The implementation will apply a hard cap (page.max.changes
) and it is not possible to request subsequent content when that cap is exceeded.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of changes
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
"values": [
{
"conflict": {
"ourChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"theirChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"executable": true,
"nodeType": "DIRECTORY",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves the commit discussion comments that match the specified search criteria.
It is possible to retrieve commit discussion comments that are anchored to a range of commits by providing the sinceId that the comments anchored from.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of comments that match the search criteria
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
{
"values": [
{
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add a new comment.
Comments can be added in a few places by setting different attributes:
General commit comment:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
"text": "An insightful general comment on a commit." } </pre> Reply to a comment: <pre>{ "text": "A measured reply.", "parent": { "id": 1 } } </pre> General file comment: <pre>{ "text": "An insightful general comment on a file.", "anchor": { "diffType": "COMMIT", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } } </pre> File line comment: <pre>{ "text": "A pithy comment on a particular line within a file.", "anchor": { "diffType": "COMMIT", "line": 1, "lineType": "CONTEXT", "fileType": "FROM", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
Note: general file comments are an experimental feature and may change in the near future!
For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves). Also, fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added. Finally diffType refers to the type of diff the comment was added on.
For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be:- 'ADDED' - for an added line;- 'REMOVED' - for a removed line; or- 'CONTEXT' - for a line that was unmodified but is in the vicinity of the diff.'fileType' refers to the file of the diff to which the anchor should be attached - which is of relevance when displaying the diff in a side-by-side way. Currently the supported values are:- 'FROM' - the source file of the diff- 'TO' - the destination file of the diffIf the current user is not a participant the user is added as one and updated to watch the commit.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
the comment
string
integer
string
integer
string
object
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
{
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
Retrieves a commit discussion comment.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe requested comment.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
{
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
Update a comment, with the following restrictions:
Note: the supplied supplied JSON object must contain a version
that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe comment to update
string
integer
string
integer
string
object
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
{
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
Delete a commit comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users. Comments which have replies may not be deleted, regardless of the user's granted permissions.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}'
string
Requiredstring
Requiredstring
Requiredinteger
string
boolean
string
boolean
string
default response
any
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff'
Retrieve the diff between two provided revisions.
Note: This resource is currently not paged. The server will internally apply a hard cap to the streamed lines, and it is not possible to request subsequent pages if that cap is exceeded. In the event that the cap is reached, the diff will be cut short and one or more {@code truncated} flags will be set to true on the "segments", "hunks" and "diffs" properties, as well as the top-level object, in the returned JSON response.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
string
string
string
string
string
A diff between two revisions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
{
"lineComments": [
{
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"approved": true,
"role": "AUTHOR",
"status": "UNAPPROVED"
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
],
"truncated": true,
"destination": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"hunks": [
{
"truncated": true,
"sourceLine": 2154,
"destinationSpan": 2154,
"destinationLine": 2154,
"segments": [
{
"truncated": true,
"lines": [
{}
],
"type": "ADDED"
}
],
"sourceSpan": 2154,
"context": "<string>"
}
],
"source": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"binary": true,
"properties": {}
}
Add the authenticated user as a watcher for the specified commit.
The authenticated user must have REPO_READ permission for the repository containing the commit to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is now watching the commit.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
Remove the authenticated user as a watcher for the specified commit.
The authenticated user must have REPO_READ permission for the repository containing the commit to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is no longer watching the commit.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
Gets the file changes available in the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
string
string
number
number
A page of changes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/changes' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
"values": [
{
"conflict": {
"ourChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"theirChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"executable": true,
"nodeType": "DIRECTORY",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets the commits accessible from the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
string
string
number
number
A page of commits.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/commits' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
"values": [
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets a diff of the changes available in the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
string
number
number
The diff of the changes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
{
"values": [
{
"lineComments": [
{
"createdDate": 1359075920,
"updatedDate": 1449075920,
"comments": [],
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{}
],
"reviewers": [
{}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"parent": {
"createdDate": 1359075920,
"updatedDate": 1449075920,
"anchor": {
"diffType": "COMMIT",
"fileType": "FROM",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"lineType": "ADDED",
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"participants": [
{}
],
"reviewers": [
{}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"title": "Talking Nerdy",
"closed": true,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"version": 2154
},
"lineComment": true,
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"html": "<string>",
"anchored": true,
"pending": true,
"reply": true,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"text": "An insightful comment.",
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
},
"id": 1,
"state": "OPEN",
"version": 1,
"severity": "NORMAL",
"properties": {}
}
],
"truncated": true,
"destination": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"hunks": [
{
"truncated": true,
"sourceLine": 2154,
"destinationSpan": 2154,
"destinationLine": 2154,
"segments": [
{}
],
"sourceSpan": 2154,
"context": "<string>"
}
],
"source": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"binary": true,
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Stream the raw diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff' \
--header 'Accept: application/json'
Stream the raw diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff/{path}' \
--header 'Accept: application/json'
Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of files.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"values": [],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
number
number
A page of files.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files/{path}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"values": [],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Return a page of hook scripts configured for the specified repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requirednumber
number
A page of hook scripts.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
"values": [
{
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"script": {
"createdDate": "<string>",
"description": "<string>",
"updatedDate": "<string>",
"pluginKey": "<string>",
"name": "<string>",
"id": 2154,
"type": "POST",
"version": 2154
},
"triggerIds": [
"<string>"
]
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates/updates the hook script configuration for the provided hook script and repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requiredstring
RequiredThe hook triggers for which the hook script should be run
array<string>
The updated hook script.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"triggerIds": [
"<string>"
]
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"script": {
"createdDate": "<string>",
"description": "<string>",
"updatedDate": "<string>",
"pluginKey": "<string>",
"name": "<string>",
"id": 2154,
"type": "POST",
"version": 2154
},
"triggerIds": [
"<string>"
]
}
Removes the hook script from the set of hook scripts configured to run in the repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requiredstring
RequiredThe hook script was successfully deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}'
Get all labels applied to the given repository.
The authenticated user must have REPO_READ permission for the specified repository.
string
Requiredstring
RequiredThe applied label.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels' \
--header 'Accept: application/json'
1
2
3
{
"name": "labelName"
}
Applies a label to the repository.
The authenticated user must have REPO_ADMIN permission for the specified repository.
string
Requiredstring
RequiredThe label to apply
string
The applied label.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "labelName"
}'
1
2
3
{
"name": "labelName"
}
Remove label that is applied to the given repository.
The authenticated user must have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the label is no longer associated to the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels/{labelName}'
Streams files from the repository's root with the last commit to modify each file. Commit modifications are traversed starting from the at
commit or, if not specified, from the tip of the default branch.
Unless the repository is public, the authenticated user must have REPO_READ access to call this resource.
string
Requiredstring
Requiredstring
A map of files to the last commit that modified them, and the latest commit to the repository (by nature, any commit to a repository modifies its root).
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
"files": {
"latestCommit": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"readmeMd": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"pomXml": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
}
}
Streams files in the requested path
with the last commit to modify each file. Commit modifications are traversed starting from the at
commit or, if not specified, from the tip of the default branch.
Unless the repository is public, the authenticated user must have REPO_READ access to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A map of files to the last commit that modified them, and the latest commit to update the requested path.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
"files": {
"latestCommit": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"readmeMd": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"pomXml": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
}
}
Retrieve the patch content for a repository at a specified revision.
Cache headers are added to the response (only if full commit hashes are used, not in the case of short hashes).
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
The patch contents from a repository.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/patch' \
--header 'Accept: application/json'
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
The raw contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw/{path}' \
--header 'Accept: application/json'
Retrieve a page of repository ref change activity.
The authenticated user must have REPO_ADMIN permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of ref change activity.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
"values": [
{
"refChange": {
"updatedType": "UNKNOWN",
"fromHash": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad",
"toHash": "d6edcbf924697ab811a867421dab60d954ccad99",
"refId": "refs/heads/master",
"type": "ADD",
"ref": {
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
},
"repository": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"trigger": "push",
"createdDate": 19990759200,
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"id": 1
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of branches with ref change activities for a specific repository.
The authenticated user must have REPO_ADMIN permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of branches with ref change activities.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities/branches' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"values": [
{
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves the auto decline settings for the supplied repository. Project settings will be returned if no explicit settings have been set for the repository. In the case that there are no project settings, the default settings will be returned.
The authenticated user must have REPO_READ permission for this repository to call the resource.
string
Requiredstring
RequiredThe auto decline settings
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"inactivityWeeks": 4,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
Creates or updates the auto decline settings for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource
string
Requiredstring
RequiredThe settings to create or update
boolean
integer
The auto decline settings
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"inactivityWeeks": 4
}'
1
2
3
4
5
6
7
8
{
"inactivityWeeks": 4,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
Delete auto decline settings for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
RequiredThe auto decline settings have been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline'
Retrieve a page of repository hooks for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of repository hooks with their associated enabled state.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
"values": [
{
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>"
},
"configured": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a repository hook for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>"
},
"configured": true
}
Delete repository hook configuration for the supplied hookKey and repositorySlug
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe hook configuration matching the supplied hookKey and repositorySlug was deleted
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}'
Enable a repository hook for this repository and optionally apply new configuration.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
A JSON document may be provided to use as the settings for the hook. These structure and validity of the document is decided by the plugin providing the hook.
string
Requiredstring
Requiredstring
Requiredstring
The repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>"
},
"configured": true
}
Disable a repository hook for this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>"
},
"configured": true
}
Retrieve the settings for a repository hook for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe settings for the hook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
{
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648,
"stringValue": "This is an arbitrary string"
}
Modify the settings for a repository hook for this repository.
The service will reject any settings which are too large, the current limit is 32KB once serialized.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
A JSON document can be provided to use as the settings for the hook. These structure and validity of the document is decided by the plugin providing the hook.
string
Requiredstring
Requiredstring
RequiredThe raw settings.
boolean
number
integer
integer
string
The settings for the hook.
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648,
"stringValue": "This is an arbitrary string"
}'
1
2
3
4
5
6
7
{
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648,
"stringValue": "This is an arbitrary string"
}
Retrieve the pull request settings for the context repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
This resource will call all RestFragments that are registered with the key bitbucket.repository.settings.pullRequests. If any fragment fails validations by returning a non-empty Map of errors, then no fragments will execute.
The property keys for the settings that are bundled with the application are
string
Requiredstring
RequiredThe repository pull request settings for the context repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"requiredAllTasksComplete": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"enabled": true,
"count": "3"
},
"requiredSuccessfulBuildsDeprecated": 2154,
"requiredAllApprovers": true,
"requiredApprovers": {
"enabled": true,
"count": "3"
},
"mergeConfig": {
"defaultStrategy": {
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
},
"strategies": [
{
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
}
],
"commitSummaries": 2154,
"type": "repository"
}
}
Update the pull request settings for the context repository.
The authenticated user must have REPO_ADMIN permission for the context repository to call this resource.
This resource will call all RestFragments that are registered with the key bitbucket.repository.settings.pullRequests. If any fragment fails validations by returning a non-empty Map of errors, then no fragments will execute.
Only the settings that should be updated need to be included in the request.
The property keys for the settings that are bundled with the application are
Merge strategy configuration deletion:
An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:
1 2 3
"mergeConfig": { } }
Upon completion of this request, the effective configuration will be:
string
Requiredstring
RequiredThe updated settings.
boolean
integer
object
integer
boolean
object
object
The repository pull request settings for the context repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"requiredAllTasksComplete": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"enabled": true,
"count": "3"
},
"requiredSuccessfulBuildsDeprecated": 2154,
"requiredAllApprovers": true,
"requiredApprovers": {
"enabled": true,
"count": "3"
},
"mergeConfig": {
"defaultStrategy": {
"id": "no-ff",
"links": {}
},
"strategies": [
{
"id": "no-ff",
"links": {}
}
],
"commitSummaries": 2154
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"requiredAllTasksComplete": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"enabled": true,
"count": "3"
},
"requiredSuccessfulBuildsDeprecated": 2154,
"requiredAllApprovers": true,
"requiredApprovers": {
"enabled": true,
"count": "3"
},
"mergeConfig": {
"defaultStrategy": {
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
},
"strategies": [
{
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
}
],
"commitSummaries": 2154,
"type": "repository"
}
}
Retrieve the tags matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
string
Requiredstring
Requiredstring
string
number
number
The tags matching the supplied filterText.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"values": [
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates a tag using the information provided in the RestCreateTagRequest request
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
string
Requiredstring
RequiredThe request to create a tag containing a name, startPoint, and optionally a message
string
string
string
The created tag.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Retrieve a tag in the specified repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe tag which matches the supplied name.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Add the authenticated user as a watcher for the specified repository.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
RequiredThe repository to watch.
string
string
object
string
object
The user is now watching the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch' \
--header 'Content-Type: application/json' \
--data '{
"scmId": "git",
"slug": "my-repo",
"project": {
"avatarUrl": "<string>",
"avatar": "<string>",
"key": "PRJ",
"links": {}
},
"name": "My repo",
"links": {}
}'
Remove the authenticated user as a watcher for the specified repository.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
RequiredThe user is no longer watching the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
boolean
A page of webhooks.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \
--header 'Accept: application/json'
Create a webhook for the repository specified via the URL.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe webhook to be created for this repository.
object
object
array<string>
boolean
string
string
A created webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"statistics": {},
"configuration": {},
"events": [
"<string>"
],
"active": true,
"url": "<string>",
"name": "<string>"
}'
1
2
3
4
5
6
7
8
9
{
"configuration": {},
"events": [
"<string>"
],
"active": true,
"url": "<string>",
"name": "<string>"
}
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
A webhook.
RestWebhookRequestResponse
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/test' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A webhook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"configuration": {},
"events": [
"<string>"
],
"active": true,
"url": "<string>",
"name": "<string>"
}
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe representation of the updated values for the webhook
object
object
array<string>
boolean
string
string
A webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"statistics": {},
"configuration": {},
"events": [
"<string>"
],
"active": true,
"url": "<string>",
"name": "<string>"
}'
1
2
3
4
5
6
7
8
9
{
"configuration": {},
"events": [
"<string>"
],
"active": true,
"url": "<string>",
"name": "<string>"
}
Delete a webhook for the repository specified via the URL.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe webhook for the repository has been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
A webhook invocation dataset.
RestDetailedInvocation
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredA webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summary' \
--header 'Accept: application/json'
Retrieve a page of repositories based on query parameters that control the search. See the documentation of the parameters for more details.
This resource is anonymously accessible.
Note on permissions. In absence of the permission
query parameter the implicit 'read' permission is assumed. Please note that this permission is lower than the REPO_READ permission rather than being equal to it. The implicit 'read' permission for a given repository is assigned to any user that has any of the higher permissions, such as REPO_READ, as well as to anonymous users if the repository is marked as public. The important implication of the above is that an anonymous request to this resource with a permission level REPO_READ is guaranteed to receive an empty list of repositories as a result. For anonymous requests it is therefore recommended to not specify the permission parameter at all.
string
string
string
string
string
string
string
number
number
A page of repositories.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/repos' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"values": [
{
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"origin": {
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"relatedLinks": {},
"partition": 2154,
"defaultBranch": "main",
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"archived": true,
"forkable": true,
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL"
},
"scope": "REPOSITORY",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
},
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Rate this page: