-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathopenapi.yml
5813 lines (5813 loc) · 172 KB
/
openapi.yml
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.3
info:
title: GitBook API
description: The GitBook API
termsOfService: https://policies.gitbook.com
contact:
name: API Support
url: https://gitbook.com/support
email: [email protected]
version: 0.0.1-beta
servers:
- url: "{host}/v1"
variables:
host:
default: https://api.gitbook.com
security:
- user: []
- user-internal: []
- user-staff: []
- integration: []
components:
securitySchemes:
user:
type: http
scheme: bearer
user-internal:
type: http
scheme: bearer
user-staff:
type: http
scheme: bearer
integration:
type: http
scheme: bearer
parameters:
listLimit:
name: limit
in: query
description: The number of results per page
schema:
type: number
listPage:
name: page
in: query
description: Identifier of the page results to fetch.
schema:
type: string
pageFormat:
name: format
in: query
description: Output format for the page's content.
schema:
type: string
enum:
- document
- markdown
spaceId:
name: spaceId
in: path
required: true
description: The unique id of the space
schema:
type: string
collectionId:
name: collectionId
in: path
required: true
description: The unique id of the collection
schema:
type: string
revisionId:
name: revisionId
in: path
required: true
description: The unique id of the revision
schema:
type: string
changeRequestId:
name: changeRequestId
in: path
required: true
description: The unique ID of the change request or its number identifier in the space
schema:
oneOf:
- type: string
- type: integer
integrationName:
name: integrationName
in: path
required: true
description: Name of the integration
schema:
type: string
installationId:
name: installationId
in: path
required: true
description: Identifier of the installation
schema:
type: string
organizationId:
name: organizationId
in: path
required: true
description: The unique id of the organization
schema:
type: string
userId:
name: userId
in: path
required: true
description: The unique ID of the User
schema:
type: string
teamId:
name: teamId
in: path
required: true
description: The unique ID of the Team
schema:
type: string
pageId:
name: pageId
in: path
required: true
description: The unique id of the page
schema:
type: string
pagePath:
name: pagePath
in: path
required: true
description: The path of the page in the revision.
schema:
type: string
backofficeHostname:
name: hostname
in: path
required: true
description: The custom hostname
schema:
type: string
schemas:
Error:
type: object
required:
- error
properties:
error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
required:
- code
- message
List:
type: object
properties:
next:
type: object
properties:
page:
type: string
description: Unique identifier to query the next results page
required:
- page
count:
type: number
description: Total count of objects in the list
URL:
type: string
format: uri
Date:
type: string
format: date
RequestSpaceTrackPageView:
type: object
properties:
pageId:
type: string
description: Unique identifier of the page.
visitor:
type: object
description: Analytics info on the GitBook's content visitor.
properties:
anonymousId:
type: string
description: GitBook's unique identifier of the visitor.
cookies:
type: object
description: The visitors cookies.
additionalProperties:
type: string
userAgent:
type: string
description: User-agent of the visitor.
required:
- anonymousId
- cookies
- userAgent
url:
type: string
description: The GitBook content's URL visited (including URL params).
referrer:
type: string
description: The URL of referrer that linked to the page.
required:
- pageId
- visitor
- url
- referrer
RequestPublishIntegration:
type: object
properties:
icon:
type: string
format: byte
description: Base64 content of the icon
title:
$ref: "#/components/schemas/Integration/properties/title"
description:
$ref: "#/components/schemas/Integration/properties/description"
summary:
$ref: "#/components/schemas/Integration/properties/summary"
previewImages:
type: array
maxItems: 3
items:
type: string
format: byte
description: Base64 content of the image
visibility:
$ref: "#/components/schemas/IntegrationVisibility"
scopes:
$ref: "#/components/schemas/Integration/properties/scopes"
categories:
$ref: "#/components/schemas/Integration/properties/categories"
blocks:
$ref: "#/components/schemas/Integration/properties/blocks"
externalLinks:
$ref: "#/components/schemas/Integration/properties/externalLinks"
configurations:
$ref: "#/components/schemas/IntegrationConfigurations"
script:
type: string
description: Content of the script to use
organization:
type: string
description: The ID or subdomain of the organization under which the integration should be published
secrets:
$ref: "#/components/schemas/IntegrationSecrets"
contentSecurityPolicy:
$ref: "#/components/schemas/IntegrationContentSecurityPolicy"
required:
- title
- description
- script
- scopes
RequestUpdateIntegrationInstallation:
type: object
properties:
externalIds:
$ref: "#/components/schemas/IntegrationInstallation/properties/externalIds"
configuration:
$ref: "#/components/schemas/IntegrationInstallation/properties/configuration"
RequestUpgradeOrganizationBilling:
type: object
properties:
product:
$ref: "#/components/schemas/BillingProduct"
interval:
$ref: "#/components/schemas/BillingInterval"
reason:
type: string
description: Reason that triggered the billing upgrade
mode:
type: string
description: |
Mode to use for the upgrade (default value is `commit`): - `auto`: user is redirect to checkout if possible, other a preview of the auto-upgrade is returned. - `commit`: a checkout session is returned or an auto-upgrade is done - `preview`: a preview invoice is always returned
enum:
- auto
- commit
- preview
required:
- product
- interval
RequestInviteUsersToOrganization:
type: object
properties:
emails:
type: array
items:
oneOf:
- type: string
description: The email address of the user to invite as a member
- type: object
properties:
email:
type: string
description: The email address of the user to invite as a member
role:
$ref: "#/components/schemas/MemberRoleOrGuest"
required:
- email
- role
role:
description: Default role to set on newly invited members.
$ref: "#/components/schemas/MemberRoleOrGuest"
sso:
description: If true, invites the user as an SSO user of the organization. Defaults to false.
type: boolean
required:
- emails
RequestImportGitRepository:
type: object
properties:
url:
type: string
description: URL of the Git repository to import. It can contain basic auth credentials.
ref:
type: string
description: Git ref to import in the format "refs/heads/main"
repoCacheID:
type: string
description: Unique identifier to use to cache the Git repository across multiple operations.
repoTreeURL:
type: string
description: URL to use as a prefix for external file references.
repoCommitURL:
type: string
description: URL to use as a prefix for the commit URL.
repoProjectDirectory:
type: string
description: Path to a root directory for the project in the repository.
force:
type: boolean
standalone:
type: boolean
description: If true, the import will generate a revision without updating the space primary content.
required:
- url
- ref
RequestExportToGitRepository:
type: object
properties:
url:
type: string
description: URL of the Git repository to export to. It can contain basic auth credentials.
ref:
type: string
description: Git ref to push the commit to in the format "refs/heads/main"
commitMessage:
type: string
description: Message for the commit generated by the export
repoCacheID:
type: string
description: Unique identifier to use to cache the Git repository across multiple operations.
repoTreeURL:
type: string
description: URL to use as a prefix for external file references.
repoCommitURL:
type: string
description: URL to use as a prefix for the commit URL.
repoProjectDirectory:
type: string
description: Path to a root directory for the project in the repository.
force:
type: boolean
required:
- url
- ref
- commitMessage
RequestImportContent:
type: object
properties:
url:
type: string
description: URL of the content to import.
source:
$ref: "#/components/schemas/ImportContentSource"
required:
- url
- source
RequestCreateChangeRequest:
type: object
properties:
subject:
type: string
description: Subject of the change-request
RequestRenderIntegrationUI:
type: object
properties:
componentId:
type: string
description: ID of the component to render in the integration.
spaceId:
type: string
description: ID of the space to render.
props:
type: object
description: Current properties of the UI.
state:
type: object
description: Current local state of the UI.
context:
$ref: "#/components/schemas/ContentKitContext"
action:
$ref: "#/components/schemas/ContentKitAction"
required:
- componentId
- spaceId
- props
- context
RequestUpdateContentPublishingAuth:
type: object
properties:
fallbackURL:
type: string
format: uri
description: A fallback URL that will be used if authentication fails.
ApiInformation:
type: object
properties:
version:
type: string
description: Current release of GitBook
build:
type: string
description: Date of the latest release in ISO format
required:
- version
- build
RequestPurgeCDNCacheContext:
type: object
description: The context to send when purging the CDN Cache
properties:
type:
$ref: "#/components/schemas/PurgeCDNCacheContextType"
values:
type: array
description: The list of tags or hosts to purge
items:
type: string
required:
- type
- values
RequestBlockUserContext:
type: object
description: The context to send when blocking/unblocking a user
properties:
block:
type: boolean
required:
- block
TriggerContentIndexingContext:
type: object
description: The context to send when triggering a content indexing.
properties:
spaceId:
type: string
description: The unique identifier of the Space to index.
force:
type: boolean
description: Whether to force a complete re-indexing of the Space.
required:
- spaceId
- force
User:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "user"
enum:
- user
id:
type: string
description: Unique identifier for the user
displayName:
type: string
description: Full name for the user
email:
type: string
description: Email address of the user
photoURL:
type: string
description: URL of the user's profile picture
required:
- object
- id
- displayName
UserTarget:
type: object
properties:
user:
type: string
ContentVisibility:
type: string
description: |
* `public`: Anyone can access the content, and the content is indexed by search engines.
* `unlisted`: Anyone can access the content, and the content is not indexed by search engines
* `share-link`: Anyone with a secret token in the url can access the content.
* `visitor-auth`: Anyone authenticated through a JWT token can access the content.
* `in-collection`: Anyone who can access the parent collection can access the content.
Only available for spaces in a collection.
* `private`: Authorized members can access the content.
enum:
- public
- unlisted
- share-link
- visitor-auth
- in-collection
- private
ContentPublishingAuth:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "publishing-auth"
enum:
- publishing-auth
id:
type: string
description: Unique identifier for the content.
privateKey:
type: string
description: Private key used to sign JWT tokens.
fallbackURL:
type: string
format: uri
description: URL to redirect to when the visitor auth secret is invalid.
required:
- object
- id
- privateKey
ImportContentResult:
type: object
required:
- revision
- importedResources
- totalResources
properties:
revision:
type: string
description: ID of the newly created revision.
importedResources:
type: number
description: How many resources were imported
totalResources:
type: number
description: How many resources were processed
Space:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "space"
enum:
- space
id:
type: string
description: Unique identifier for the space
title:
type: string
description: Title of the space
minLength: 0
maxLength: 100
visibility:
$ref: "#/components/schemas/ContentVisibility"
createdAt:
$ref: "#/components/schemas/Date"
updatedAt:
$ref: "#/components/schemas/Date"
urls:
type: object
description: URLs associated with the object
properties:
app:
type: string
description: URL of the space in the application
format: uri
published:
type: string
description: URL of the published version of the space. Only defined when visibility is not "private."
format: uri
public:
type: string
description: URL of the public version of the space. Only defined when visibility is "public".
format: uri
required:
- app
required:
- object
- id
- title
- visibility
- createdAt
- updatedAt
- urls
Revision:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "revision"
enum:
- revision
id:
description: Unique identifier for the revision
type: string
parents:
description: IDs of the parent revisions
type: array
items:
type: string
pages:
type: array
items:
$ref: "#/components/schemas/RevisionPage"
files:
type: array
items:
$ref: "#/components/schemas/RevisionFile"
git:
type: object
description: Metadata about a potential associated git commit.
required:
- oid
- message
- createdByGitBook
properties:
oid:
type: string
description: SHA of the Git commit.
message:
type: string
description: Git commit message.
createdByGitBook:
type: boolean
description: Whether not this commit was created by GitBook, while exporting the revision.
url:
type: string
description: URL of the Git commit.
urls:
type: object
properties:
app:
type: string
format: uri
description: URL in the application for the revision
published:
type: string
description: URL of the published version of the revision. Only defined when the space visibility is not "private."
format: uri
public:
type: string
description: URL of the public version of the revision. Only defined when the space visibility is "public".
format: uri
required:
- app
required:
- object
- id
- parents
- pages
- files
- urls
RevisionPage:
oneOf:
- $ref: "#/components/schemas/RevisionPageSheet"
- $ref: "#/components/schemas/RevisionPageGroup"
- $ref: "#/components/schemas/RevisionPageLink"
discriminator:
propertyName: type
RevisionPageBase:
type: object
properties:
id:
description: Unique identifier for the page in the revision
type: string
title:
description: Title of the page
type: string
maxLength: 100
required:
- id
- title
RevisionPageSheet:
allOf:
- $ref: "#/components/schemas/RevisionPageBase"
- type: object
properties:
kind:
type: string
enum:
- sheet
slug:
description: Page's slug in its direct parent
type: string
path:
description: Complete path to access the page in the revision.
type: string
description:
type: string
pages:
type: array
items:
oneOf:
- $ref: "#/components/schemas/RevisionPageSheet"
- $ref: "#/components/schemas/RevisionPageLink"
required:
- kind
- slug
- path
- pages
- oneOf:
- type: object
properties:
markdown:
type: string
description: Content of the page formatted as markdown
required:
- markdown
- type: object
properties:
document:
$ref: "#/components/schemas/PageDocument"
required:
- document
- type: object
properties: {}
additionalProperties: false
RevisionPageGroup:
allOf:
- $ref: "#/components/schemas/RevisionPageBase"
- type: object
properties:
kind:
type: string
enum:
- group
slug:
description: Page's slug in its direct parent
type: string
path:
description: Complete path to access the page in the revision.
type: string
pages:
type: array
items:
oneOf:
- $ref: "#/components/schemas/RevisionPageSheet"
- $ref: "#/components/schemas/RevisionPageLink"
required:
- kind
- slug
- path
- pages
RevisionPageLink:
allOf:
- $ref: "#/components/schemas/RevisionPageBase"
- type: object
properties:
kind:
type: string
enum:
- link
href:
type: string
required:
- kind
RevisionFile:
type: object
properties:
id:
type: string
name:
type: string
contentType:
type: string
downloadURL:
type: string
required:
- id
- name
- contentType
- downloadURL
PageDocument:
type: object
properties:
nodes:
type: array
items:
type: object
properties: {}
required:
- nodes
ImportContentSource:
type: string
enum:
- website
- docx
- markdown
- html
- zip
- confluence
- github-wiki
- dropbox-paper
- notion
- quip
- google-docs
- open-api
Organization:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "organization"
enum:
- organization
id:
type: string
description: Unique identifier for the organization
title:
type: string
description: Name of the organization
minLength: 2
maxLength: 300
required:
- object
- id
- title
MemberRole:
type: string
description: |
"The role of a member in an organization.
"admin": Can administrate the content: create, delete spaces, ...
"create": Can create content.
"review": Can review content.
"edit": Can edit the content (live or change requests).
"comment": Can access the content and its discussions.
"read": Can access the content, but cannot update it in any way.
enum:
- admin
- create
- edit
- review
- comment
- read
MemberRoleOrGuest:
description: The role of a member in an organization, null for guests
oneOf:
- $ref: "#/components/schemas/MemberRole"
- type: string
nullable: true
enum:
- null
OrganizationTransferResponse:
type: object
required:
- collection
properties:
collection:
type: string
description: The unique id of the collection created in the target organization containing the content of the source organization.
newSourceHostname:
type: string
description: The new hostname if the source organization needed to change hostname.
OrganizationDirectorySyncGroup:
type: object
required:
- id
- idp_id
- directory_id
- name
properties:
id:
type: string
description: The unique identifier of this group in WorkOS. Not the unique ID from GitBook.
idp_id:
type: string
description: The identity provider's unique ID for this group, should be used to generate the team's unique ID when syncing the groups.
directory_id:
type: string
description: The unique ID of the directory this group is owned by in WorkOS. Is not a unique ID from our database.
name:
type: string
description: The name of the group from the identity provider, it should always be set according to the WorkOS documentation.
teamKey:
type: string
description: The unique ID of the GitBook team already synced to this group, if applicable.
OrganizationDirectorySyncGroupTeamStatus:
anyOf:
- type: object
required:
- success
- group_id
- team_id
properties:
success:
type: boolean
enum:
- true
group_id:
type: string
team_id:
type: string
- type: object
required:
- success
- error
properties:
success:
type: boolean
enum:
- false
error:
type: string
OrganizationTarget:
type: object
properties:
organization:
type: string
OrganizationMember:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "member"
enum:
- member
id:
type: string
description: Unique identifier for the user.
role:
$ref: "#/components/schemas/MemberRoleOrGuest"
user:
$ref: "#/components/schemas/User"
disabled:
type: boolean
description: Whatever the membership of this user is disabled and prevent them from accessing content.
joinedAt:
description: Date at which the user joined the organization.
$ref: "#/components/schemas/Date"
sso:
type: boolean
description: Whether the user can login with SSO.
required:
- object
- id
- role
- user
- disabled
- joinedAt
- sso
OrganizationTeam:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "team"
enum:
- team
id:
type: string
description: Unique identifier for the team.
title:
type: string
description: Title of the team.
members:
type: integer
description: Count of members in this team.
createdAt:
description: Date at which the team was created.
$ref: "#/components/schemas/Date"
required:
- object
- id
- title
- members
- createdAt
ChangeRequest:
type: object
properties:
object:
type: string
description: Type of Object, always equals to "change-request"
enum:
- change-request
id:
type: string
description: Unique identifier for the change request
number:
type: number
description: Incremental identifier of the change request
status: