-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.yaml
24330 lines (23312 loc) · 931 KB
/
schema.yaml
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
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: Bitbucket API
description: Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
version: "2.0"
termsOfService: https://www.atlassian.com/legal/customer-agreement
contact:
name: Bitbucket Support
url: https://support.atlassian.com/bitbucket-cloud/
email: support@bitbucket.org
paths:
/addon:
delete:
tags:
- Addon
description: |-
Deletes the application for the user.
This endpoint is intended to be used by Bitbucket Connect apps
and only supports JWT authentication -- that is how Bitbucket
identifies the particular installation of the app. Developers
with applications registered in the "Develop Apps" section
of Bitbucket Marketplace need not use this endpoint as
updates for those applications can be sent out via the
UI of that section.
```
$ curl -X DELETE https://api.bitbucket.org/2.0/addon \
-H "Authorization: JWT <JWT Token>"
```
summary: Delete an app
responses:
"204":
description: Request has succeeded. The application has been deleted for the user.
"401":
description: No authorization.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"403":
description: Improper authentication.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
put:
tags:
- Addon
description: |-
Updates the application installation for the user.
This endpoint is intended to be used by Bitbucket Connect apps
and only supports JWT authentication -- that is how Bitbucket
identifies the particular installation of the app. Developers
with applications registered in the "Develop Apps" section
of Bitbucket need not use this endpoint as updates for those
applications can be sent out via the UI of that section.
Passing an empty body will update the installation using the
existing descriptor URL.
```
$ curl -X PUT https://api.bitbucket.org/2.0/addon \
-H "Authorization: JWT <JWT Token>" \
--header "Content-Type: application/json" \
--data '{}'
```
The new `descriptor` for the installation can be also provided
in the body directly.
```
$ curl -X PUT https://api.bitbucket.org/2.0/addon \
-H "Authorization: JWT <JWT Token>" \
--header "Content-Type: application/json" \
--data '{"descriptor": $NEW_DESCRIPTOR}'
```
In both these modes the URL of the descriptor cannot be changed. To
change the descriptor location and upgrade an installation
the request must be made exclusively with a `descriptor_url`.
```
$ curl -X PUT https://api.bitbucket.org/2.0/addon \
-H "Authorization: JWT <JWT Token>" \
--header "Content-Type: application/json" \
--data '{"descriptor_url": $NEW_URL}'
```
The `descriptor_url` must exactly match the marketplace registration
that Atlassian has for the application. Contact your Atlassian
developer advocate to update this registration. Once the registration
has been updated you may call this resource for each installation.
Note that the scopes of the application cannot be increased
in the new descriptor nor reduced to none.
summary: Update an installed app
responses:
"204":
description: Request has succeeded. The installation has been updated to the new descriptor.
"400":
description: Scopes have increased or decreased to none.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"401":
description: No authorization.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"403":
description: Improper authentication.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
parameters: []
/addon/linkers:
get:
tags:
- Addon
description: |-
Gets a list of all [linkers](/cloud/bitbucket/modules/linker/)
for the authenticated application.
summary: List linkers for an app
responses:
"200":
description: Successful.
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
parameters: []
/addon/linkers/{linker_key}:
get:
tags:
- Addon
description: |-
Gets a [linker](/cloud/bitbucket/modules/linker/) specified by `linker_key`
for the authenticated application.
summary: Get a linker for an app
responses:
"200":
description: Successful.
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: The linker does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
parameters:
- name: linker_key
in: path
description: |-
The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
as defined in an application descriptor.
required: true
schema:
type: string
/addon/linkers/{linker_key}/values:
delete:
tags:
- Addon
description: |-
Delete all [linker](/cloud/bitbucket/modules/linker/) values for the
specified linker of the authenticated application.
summary: Delete all linker values
responses:
"204":
description: Successfully deleted the linker values.
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: The linker does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
get:
tags:
- Addon
description: |-
Gets a list of all [linker](/cloud/bitbucket/modules/linker/) values for the
specified linker of the authenticated application.
A linker value lets applications supply values to modify its regular expression.
The base regular expression must use a Bitbucket-specific match group `(?K)`
which will be translated to `([\w\-]+)`. A value must match this pattern.
[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)
summary: List linker values for a linker
responses:
"200":
description: Successful.
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: The linker does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
post:
tags:
- Addon
description: |-
Creates a [linker](/cloud/bitbucket/modules/linker/) value for the specified
linker of authenticated application.
A linker value lets applications supply values to modify its regular expression.
The base regular expression must use a Bitbucket-specific match group `(?K)`
which will be translated to `([\w\-]+)`. A value must match this pattern.
[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)
summary: Create a linker value
responses:
"201":
description: Successfully created the linker value.
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: The linker does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"409":
description: The linker already has the value being added.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
put:
tags:
- Addon
description: |-
Bulk update [linker](/cloud/bitbucket/modules/linker/) values for the specified
linker of the authenticated application.
A linker value lets applications supply values to modify its regular expression.
The base regular expression must use a Bitbucket-specific match group `(?K)`
which will be translated to `([\w\-]+)`. A value must match this pattern.
[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)
summary: Update a linker value
responses:
"204":
description: Successfully updated the linker values.
"400":
description: Invalid input.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: The linker does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
parameters:
- name: linker_key
in: path
description: |-
The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
as defined in an application descriptor.
required: true
schema:
type: string
/addon/linkers/{linker_key}/values/{value_id}:
delete:
tags:
- Addon
description: |-
Delete a single [linker](/cloud/bitbucket/modules/linker/) value
of the authenticated application.
summary: Delete a linker value
responses:
"204":
description: Successfully deleted the linker value.
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: The linker value does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
get:
tags:
- Addon
description: |-
Get a single [linker](/cloud/bitbucket/modules/linker/) value
of the authenticated application.
summary: Get a linker value
responses:
"200":
description: Successful.
"401":
description: Authentication must use app JWT
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: The linker value does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
parameters:
- name: linker_key
in: path
description: |-
The unique key of a [linker module](/cloud/bitbucket/modules/linker/)
as defined in an application descriptor.
required: true
schema:
type: string
- name: value_id
in: path
description: The numeric ID of the linker value.
required: true
schema:
type: integer
/hook_events:
get:
tags:
- Webhooks
description: |-
Returns the webhook resource or subject types on which webhooks can
be registered.
Each resource/subject type contains an `events` link that returns the
paginated list of specific events each individual subject type can
emit.
This endpoint is publicly accessible and does not require
authentication or scopes.
Example:
```
$ curl https://api.bitbucket.org/2.0/hook_events
{
"repository": {
"links": {
"events": {
"href": "https://api.bitbucket.org/2.0/hook_events/repository"
}
}
},
"workspace": {
"links": {
"events": {
"href": "https://api.bitbucket.org/2.0/hook_events/workspace"
}
}
}
}
```
summary: Get a webhook resource
responses:
"200":
description: A mapping of resource/subject types pointing to their individual event types.
content:
application/json:
schema:
$ref: '#/components/schemas/subject_types'
security:
- oauth2: []
- basic: []
- api_key: []
parameters: []
/hook_events/{subject_type}:
get:
tags:
- Webhooks
description: |-
Returns a paginated list of all valid webhook events for the
specified entity.
**The team and user webhooks are deprecated, and you should use workspace instead.
For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).**
This is public data that does not require any scopes or authentication.
Example:
NOTE: The following example is a truncated response object for the `workspace` `subject_type`.
We return the same structure for the other `subject_type` objects.
```
$ curl https://api.bitbucket.org/2.0/hook_events/workspace
{
"page": 1,
"pagelen": 30,
"size": 21,
"values": [
{
"category": "Repository",
"description": "Whenever a repository push occurs",
"event": "repo:push",
"label": "Push"
},
{
"category": "Repository",
"description": "Whenever a repository fork occurs",
"event": "repo:fork",
"label": "Fork"
},
{
"category": "Repository",
"description": "Whenever a repository import occurs",
"event": "repo:imported",
"label": "Import"
},
...
{
"category":"Pull Request",
"label":"Approved",
"description":"When someone has approved a pull request",
"event":"pullrequest:approved"
},
]
}
```
summary: List subscribable webhook types
responses:
"200":
description: A paginated list of webhook types available to subscribe on.
content:
application/json:
schema:
$ref: '#/components/schemas/paginated_hook_events'
"404":
description: If an invalid `{subject_type}` value was specified.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2: []
- basic: []
- api_key: []
parameters:
- name: subject_type
in: path
description: A resource or subject type.
required: true
schema:
type: string
enum:
- repository
- workspace
/pullrequests/{selected_user}:
get:
tags:
- Pullrequests
description: |-
Returns all pull requests authored by the specified user.
By default only open pull requests are returned. This can be controlled
using the `state` query parameter. To retrieve pull requests that are
in one of multiple states, repeat the `state` parameter for each
individual state.
This endpoint also supports filtering and sorting of the results. See
[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.
summary: List pull requests for a user
responses:
"200":
description: All pull requests authored by the specified user.
content:
application/json:
schema:
$ref: '#/components/schemas/paginated_pullrequests'
"404":
description: If the specified user does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
parameters:
- name: state
in: query
description: Only return pull requests that are in this state. This parameter can be repeated.
schema:
type: string
enum:
- OPEN
- MERGED
- DECLINED
- SUPERSEDED
security:
- oauth2:
- pullrequest
- basic: []
- api_key: []
parameters:
- name: selected_user
in: path
description: |
This can either be the username of the pull request author, the author's UUID
surrounded by curly-braces, for example: `{account UUID}`, or the author's Atlassian ID.
required: true
schema:
type: string
/repositories:
get:
tags:
- Repositories
description: |-
Returns a paginated list of all public repositories.
This endpoint also supports filtering and sorting of the results. See
[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.
summary: List public repositories
responses:
"200":
description: All public repositories.
content:
application/json:
schema:
$ref: '#/components/schemas/paginated_repositories'
parameters:
- name: after
in: query
description: |-
Filter the results to include only repositories created on or
after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)
timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ`
required: false
schema:
type: string
- name: role
in: query
description: |
Filters the result based on the authenticated user's role on each repository.
* **member**: returns repositories to which the user has explicit read access
* **contributor**: returns repositories to which the user has explicit write access
* **admin**: returns repositories to which the user has explicit administrator access
* **owner**: returns all repositories owned by the current user
required: false
schema:
type: string
enum:
- admin
- contributor
- member
- owner
- name: q
in: query
description: |
Query string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
`role` parameter must also be specified.
required: false
schema:
type: string
- name: sort
in: query
description: |
Field by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
required: false
schema:
type: string
security:
- oauth2:
- repository
- basic: []
- api_key: []
parameters: []
/repositories/{workspace}:
get:
tags:
- Repositories
description: |-
Returns a paginated list of all repositories owned by the specified
workspace.
The result can be narrowed down based on the authenticated user's role.
E.g. with `?role=contributor`, only those repositories that the
authenticated user has write access to are returned (this includes any
repo the user is an admin on, as that implies write access).
This endpoint also supports filtering and sorting of the results. See
[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details.
summary: List repositories in a workspace
responses:
"200":
description: The repositories owned by the specified account.
content:
application/json:
schema:
$ref: '#/components/schemas/paginated_repositories'
"404":
description: If the specified account does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"410":
description: If the specified account marked as spam.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
parameters:
- name: role
in: query
description: |2
Filters the result based on the authenticated user's role on each repository.
* **member**: returns repositories to which the user has explicit read access
* **contributor**: returns repositories to which the user has explicit write access
* **admin**: returns repositories to which the user has explicit administrator access
* **owner**: returns all repositories owned by the current user
required: false
schema:
type: string
enum:
- admin
- contributor
- member
- owner
- name: q
in: query
description: |2
Query string to narrow down the response as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).
required: false
schema:
type: string
- name: sort
in: query
description: "\nField by which the results should be sorted as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering).\n "
required: false
schema:
type: string
security:
- oauth2:
- repository
- basic: []
- api_key: []
parameters:
- name: workspace
in: path
description: |
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: `{workspace UUID}`.
required: true
schema:
type: string
/repositories/{workspace}/{repo_slug}:
delete:
tags:
- Repositories
description: |-
Deletes the repository. This is an irreversible operation.
This does not affect its forks.
summary: Delete a repository
responses:
"204":
description: Indicates successful deletion.
"403":
description: If the caller either does not have admin access to the repository, or the repository is set to read-only.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: If the repository does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
parameters:
- name: redirect_to
in: query
description: |
If a repository has been moved to a new location, use this parameter to
show users a friendly message in the Bitbucket UI that the repository
has moved to a new location. However, a GET to this endpoint will still
return a 404.
required: false
schema:
type: string
security:
- oauth2:
- repository:delete
- basic: []
- api_key: []
get:
tags:
- Repositories
description: Returns the object describing this repository.
summary: Get a repository
responses:
"200":
description: The repository object.
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
"403":
description: If the repository is private and the authenticated user does not have access to it.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: If no repository exists at this location.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- oauth2:
- repository
- basic: []
- api_key: []
post:
tags:
- Repositories
description: |-
Creates a new repository.
Note: In order to set the project for the newly created repository,
pass in either the project key or the project UUID as part of the
request body as shown in the examples below:
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "MARS"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
```
or
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "{ba516952-992a-4c2d-acbd-17d502922f96}"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
```
The project must be assigned for all repositories. If the project is not provided,
the repository is automatically assigned to the oldest project in the workspace.
Note: In the examples above, the workspace ID `teamsinspace`,
and/or the repository name `hablanding` can be replaced by UUIDs.
summary: Create a repository
responses:
"200":
description: The newly created repository.
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
"400":
description: If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"401":
description: If the request was not authenticated.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
description: The repository that is to be created. Note that most object elements are optional. Elements "owner" and "full_name" are ignored as the URL implies them.
security:
- oauth2:
- repository:admin
- basic: []
- api_key: []
put:
tags:
- Repositories
description: |-
Since this endpoint can be used to both update and to create a
repository, the request body depends on the intent.
#### Creation
See the POST documentation for the repository endpoint for an example
of the request body.
#### Update
Note: Changing the `name` of the repository will cause the location to
be changed. This is because the URL of the repo is derived from the
name (a process called slugification). In such a scenario, it is
possible for the request to fail if the newly created slug conflicts
with an existing repository's slug. But if there is no conflict,
the new location will be returned in the `Location` header of the
response.
summary: Update a repository
responses:
"200":
description: The existing repository has been updated
headers:
Location:
description: |-
The location of the repository. This header is only
provided when the repository's name is changed.
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
"201":
description: A new repository has been created
headers:
Location:
description: The location of the newly created repository
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
"400":
description: If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"401":
description: If the request was not authenticated.
content:
application/json:
schema:
$ref: '#/components/schemas/error'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
description: |
The repository that is to be updated.
Note that the elements "owner" and "full_name" are ignored since the
URL implies them.
security:
- oauth2:
- repository:admin
- basic: []
- api_key: []
parameters:
- name: repo_slug
in: path
description: |
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: `{repository UUID}`.
required: true
schema:
type: string
- name: workspace
in: path
description: |
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: `{workspace UUID}`.
required: true
schema:
type: string
/repositories/{workspace}/{repo_slug}/branch-restrictions:
get:
tags:
- Branch restrictions
description: |-
Returns a paginated list of all branch restrictions on the
repository.
summary: List branch restrictions
responses:
"200":
description: A paginated list of branch restrictions
content:
application/json:
schema:
$ref: '#/components/schemas/paginated_branchrestrictions'
"401":
description: If the request was not authenticated
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"403":
description: If the authenticated user does not have admin access to the repository
content:
application/json:
schema:
$ref: '#/components/schemas/error'
"404":
description: If the repository does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/error'
parameters:
- name: kind
in: query
description: Branch restrictions of this type
required: false
schema:
type: string
- name: pattern
in: query
description: Branch restrictions applied to branches of this pattern
required: false