@gitbook/api 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -1011,6 +1011,7 @@ export interface Space {
1011
1011
  organization: string;
1012
1012
  /** ID of the parent collection. */
1013
1013
  parent?: string;
1014
+ gitSync?: GitSyncState;
1014
1015
  }
1015
1016
  export interface RevisionBase {
1016
1017
  /** Type of Object, always equals to "revision" */
@@ -1867,7 +1868,9 @@ export interface SearchAIQuery {
1867
1868
  }
1868
1869
  /** Answer from AI for a question asked on a content. */
1869
1870
  export interface SearchAIAnswer {
1871
+ /** @deprecated */
1870
1872
  text: string;
1873
+ answer: Document;
1871
1874
  followupQuestions: string[];
1872
1875
  /** The sources used to generate the answer. */
1873
1876
  sources: SearchAIAnswerSource[];
@@ -1980,12 +1983,10 @@ export interface Collection {
1980
1983
  object: 'collection';
1981
1984
  /** Unique identifier for the collection */
1982
1985
  id: string;
1983
- /**
1984
- * Title of the collection
1985
- * @minLength 0
1986
- * @maxLength 50
1987
- */
1988
- title: string;
1986
+ /** Title of the collection */
1987
+ title: CollectionTitle;
1988
+ /** Description of the collection */
1989
+ description?: CollectionDescription;
1989
1990
  /** Path in the published URL */
1990
1991
  path?: string;
1991
1992
  /**
@@ -2022,6 +2023,18 @@ export interface Collection {
2022
2023
  app: string;
2023
2024
  };
2024
2025
  }
2026
+ /**
2027
+ * Title of the collection
2028
+ * @minLength 0
2029
+ * @maxLength 50
2030
+ */
2031
+ export declare type CollectionTitle = string;
2032
+ /**
2033
+ * Description of the collection
2034
+ * @minLength 0
2035
+ * @maxLength 100
2036
+ */
2037
+ export declare type CollectionDescription = string;
2025
2038
  export interface Integration {
2026
2039
  object: 'integration';
2027
2040
  /** Unique named identifier for the integration */
@@ -3221,7 +3234,7 @@ export interface ContentKitURL {
3221
3234
  query?: Record<string, string | ContentKitDynamicBinding>;
3222
3235
  }
3223
3236
  /** Channel to subscribe to for API updates. */
3224
- export declare type SubscriptionChannel = SpaceInfoChannel | SpaceGitInfoChannel | SpacePublishingAuthChannel | SpacePublishingCustomizationChannel | SpaceEntitiesChannel | SpaceCustomFieldsChannel | BackofficeUserInfoChannel | SpaceIntegrationsChannel | OrganizationCustomFieldsChannel | UserAPITokensChannel | UserOrganizationsChannel | UserProfileChannel | ChangeRequestReviewsChannel | CollectionPublishingCustomizationChannel | {
3237
+ export declare type SubscriptionChannel = SpaceInfoChannel | SpaceGitInfoChannel | SpacePublishingAuthChannel | SpacePublishingCustomizationChannel | SpaceEntitiesChannel | SpaceCustomFieldsChannel | BackofficeUserInfoChannel | SpaceIntegrationsChannel | OrganizationCustomFieldsChannel | UserAPITokensChannel | UserOrganizationsChannel | UserProfileChannel | ChangeRequestReviewsChannel | CollectionChannel | CollectionPublishingCustomizationChannel | {
3225
3238
  channel: 'organization';
3226
3239
  organization: string;
3227
3240
  } | OrganizationMembersChannel | OrganizationMemberChannel | OrganizationTeamsChannel | OrganizationTeamChannel | OrganizationTeamMembersChannel | OrganizationTeamMemberChannel | OrganizationSpacesChannel | OrganizationCollectionsChannel | OrganizationEntitiesChannel | OrganizationSchemasChannel | OrganizationCapturesChannel | OrganizationContentAuditsChannel | OrganizationIntegrationsChannel | OrganizationInstallationsChannel | {
@@ -3292,6 +3305,10 @@ export interface UserProfileChannel {
3292
3305
  channel: 'user-profile';
3293
3306
  user: string;
3294
3307
  }
3308
+ export interface CollectionChannel {
3309
+ channel: 'collection';
3310
+ collection: string;
3311
+ }
3295
3312
  export interface CollectionPublishingCustomizationChannel {
3296
3313
  channel: 'collection-publishing-customization';
3297
3314
  collection: string;
@@ -3713,6 +3730,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3713
3730
  */
3714
3731
  askQueryWithGet: (query: {
3715
3732
  query: string;
3733
+ /** Output format for the content. */
3734
+ format?: 'document' | 'markdown';
3716
3735
  }, params?: RequestParams) => Promise<HttpResponse<{
3717
3736
  /** Answer from AI for a question asked on a content. */
3718
3737
  answer?: SearchAIAnswer;
@@ -3725,7 +3744,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3725
3744
  * @request POST:/search/ask
3726
3745
  * @secure
3727
3746
  */
3728
- askQuery: (data: SearchAIQuery, params?: RequestParams) => Promise<HttpResponse<{
3747
+ askQuery: (data: SearchAIQuery, query?: {
3748
+ /** Output format for the content. */
3749
+ format?: 'document' | 'markdown';
3750
+ }, params?: RequestParams) => Promise<HttpResponse<{
3729
3751
  /** Answer from AI for a question asked on a content. */
3730
3752
  answer?: SearchAIAnswer;
3731
3753
  }, Error>>;
@@ -3802,6 +3824,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3802
3824
  */
3803
3825
  visibility?: ContentVisibility;
3804
3826
  }, params?: RequestParams) => Promise<HttpResponse<Space, Error>>;
3827
+ /**
3828
+ * No description
3829
+ *
3830
+ * @tags spaces
3831
+ * @name DeleteSpaceById
3832
+ * @summary Soft-deletes a space. Soft-deleted spaces will be permanently removed after 7 days.
3833
+ * @request DELETE:/spaces/{spaceId}
3834
+ * @secure
3835
+ */
3836
+ deleteSpaceById: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
3805
3837
  /**
3806
3838
  * No description
3807
3839
  *
@@ -3822,6 +3854,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3822
3854
  * @secure
3823
3855
  */
3824
3856
  duplicateSpace: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<Space, Error>>;
3857
+ /**
3858
+ * No description
3859
+ *
3860
+ * @tags spaces
3861
+ * @name RestoreSpace
3862
+ * @summary Restore a recently soft-deleted space.
3863
+ * @request POST:/spaces/{spaceId}/restore
3864
+ * @secure
3865
+ */
3866
+ restoreSpace: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<Space, Error>>;
3825
3867
  /**
3826
3868
  * No description
3827
3869
  *
@@ -3850,6 +3892,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3850
3892
  */
3851
3893
  askQueryInSpaceWithGet: (spaceId: string, query: {
3852
3894
  query: string;
3895
+ /** Output format for the content. */
3896
+ format?: 'document' | 'markdown';
3853
3897
  }, params?: RequestParams) => Promise<HttpResponse<{
3854
3898
  /** Answer from AI for a question asked on a content. */
3855
3899
  answer?: SearchAIAnswer;
@@ -3862,7 +3906,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3862
3906
  * @request POST:/spaces/{spaceId}/search/ask
3863
3907
  * @secure
3864
3908
  */
3865
- askQueryInSpace: (spaceId: string, data: SearchAIQuery, params?: RequestParams) => Promise<HttpResponse<{
3909
+ askQueryInSpace: (spaceId: string, data: SearchAIQuery, query?: {
3910
+ /** Output format for the content. */
3911
+ format?: 'document' | 'markdown';
3912
+ }, params?: RequestParams) => Promise<HttpResponse<{
3866
3913
  /** Answer from AI for a question asked on a content. */
3867
3914
  answer?: SearchAIAnswer;
3868
3915
  }, Error>>;
@@ -4866,7 +4913,21 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4866
4913
  * * `private`: Authorized members can access the content.
4867
4914
  */
4868
4915
  visibility?: ContentVisibility;
4916
+ /** Title of the collection */
4917
+ title?: CollectionTitle;
4918
+ /** Description of the collection */
4919
+ description?: CollectionDescription;
4869
4920
  }, params?: RequestParams) => Promise<HttpResponse<Collection, Error>>;
4921
+ /**
4922
+ * No description
4923
+ *
4924
+ * @tags collections
4925
+ * @name DeleteCollectionById
4926
+ * @summary Deletes a collection
4927
+ * @request DELETE:/collections/{collectionId}
4928
+ * @secure
4929
+ */
4930
+ deleteCollectionById: (collectionId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
4870
4931
  /**
4871
4932
  * No description
4872
4933
  *
@@ -5785,6 +5846,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5785
5846
  }, params?: RequestParams) => Promise<HttpResponse<List & {
5786
5847
  items: {
5787
5848
  space: Space;
5849
+ /** @deprecated */
5788
5850
  gitSync?: GitSyncState;
5789
5851
  }[];
5790
5852
  }, Error>>;
@@ -6264,6 +6326,33 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6264
6326
  page: RevisionPageDocument;
6265
6327
  changeRequest?: ChangeRequest;
6266
6328
  }, Error>>;
6329
+ /**
6330
+ * No description
6331
+ *
6332
+ * @tags organizations
6333
+ * @name GetSnippetSuggestedLocations
6334
+ * @summary Return possible snippet locations in an organization based on the current user.
6335
+ * @request GET:/orgs/{organizationId}/snippets/{snippetId}/move
6336
+ * @secure
6337
+ */
6338
+ getSnippetSuggestedLocations: (organizationId: string, snippetId: string, query?: {
6339
+ /** Identifier of the page results to fetch. */
6340
+ page?: string;
6341
+ /** The number of results per page */
6342
+ limit?: number;
6343
+ /** If specified, only locations in the given space will be returned. If not specified, GitBook will suggest spaces. */
6344
+ spaceId?: string;
6345
+ /** If specified, only locations under the given pageId will be returned. You must specify a spaceId too. If pageId is not specified, GitBook will suggest pages at the top level. */
6346
+ pageId?: string;
6347
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
6348
+ items: {
6349
+ /** If defined and true, this location was suggested by GitBook AI. */
6350
+ aiPowered?: boolean;
6351
+ space: Space;
6352
+ /** The parent page of the suggested location. */
6353
+ parentPage?: RevisionPageDocument | RevisionPageGroup;
6354
+ }[];
6355
+ }, Error>>;
6267
6356
  /**
6268
6357
  * No description
6269
6358
  *
@@ -6272,7 +6361,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6272
6361
  * @request POST:/orgs/{organizationId}/ask
6273
6362
  * @secure
6274
6363
  */
6275
- askInOrganization: (organizationId: string, data: SearchAIQuery, params?: RequestParams) => Promise<HttpResponse<{
6364
+ askInOrganization: (organizationId: string, data: SearchAIQuery, query?: {
6365
+ /** Output format for the content. */
6366
+ format?: 'document' | 'markdown';
6367
+ }, params?: RequestParams) => Promise<HttpResponse<{
6276
6368
  /** Answer from AI for a question asked on a content. */
6277
6369
  answer?: SearchAIAnswer;
6278
6370
  }, Error>>;
package/dist/index.cjs CHANGED
@@ -537,9 +537,10 @@ var Api = class extends HttpClient {
537
537
  format: "json",
538
538
  ...params
539
539
  }),
540
- askQuery: (data, params = {}) => this.request({
540
+ askQuery: (data, query, params = {}) => this.request({
541
541
  path: `/search/ask`,
542
542
  method: "POST",
543
+ query,
543
544
  body: data,
544
545
  secure: true,
545
546
  type: "application/json" /* Json */,
@@ -591,6 +592,12 @@ var Api = class extends HttpClient {
591
592
  format: "json",
592
593
  ...params
593
594
  }),
595
+ deleteSpaceById: (spaceId, params = {}) => this.request({
596
+ path: `/spaces/${spaceId}`,
597
+ method: "DELETE",
598
+ secure: true,
599
+ ...params
600
+ }),
594
601
  generateSpaceHiveReadAccessToken: (spaceId, params = {}) => this.request({
595
602
  path: `/spaces/${spaceId}/hive/token`,
596
603
  method: "POST",
@@ -605,6 +612,13 @@ var Api = class extends HttpClient {
605
612
  format: "json",
606
613
  ...params
607
614
  }),
615
+ restoreSpace: (spaceId, params = {}) => this.request({
616
+ path: `/spaces/${spaceId}/restore`,
617
+ method: "POST",
618
+ secure: true,
619
+ format: "json",
620
+ ...params
621
+ }),
608
622
  searchSpaceContent: (spaceId, query, params = {}) => this.request({
609
623
  path: `/spaces/${spaceId}/search`,
610
624
  method: "GET",
@@ -621,9 +635,10 @@ var Api = class extends HttpClient {
621
635
  format: "json",
622
636
  ...params
623
637
  }),
624
- askQueryInSpace: (spaceId, data, params = {}) => this.request({
638
+ askQueryInSpace: (spaceId, data, query, params = {}) => this.request({
625
639
  path: `/spaces/${spaceId}/search/ask`,
626
640
  method: "POST",
641
+ query,
627
642
  body: data,
628
643
  secure: true,
629
644
  type: "application/json" /* Json */,
@@ -1220,6 +1235,12 @@ var Api = class extends HttpClient {
1220
1235
  format: "json",
1221
1236
  ...params
1222
1237
  }),
1238
+ deleteCollectionById: (collectionId, params = {}) => this.request({
1239
+ path: `/collections/${collectionId}`,
1240
+ method: "DELETE",
1241
+ secure: true,
1242
+ ...params
1243
+ }),
1223
1244
  listSpacesInCollectionById: (collectionId, query, params = {}) => this.request({
1224
1245
  path: `/collections/${collectionId}/spaces`,
1225
1246
  method: "GET",
@@ -1941,9 +1962,18 @@ var Api = class extends HttpClient {
1941
1962
  format: "json",
1942
1963
  ...params
1943
1964
  }),
1944
- askInOrganization: (organizationId, data, params = {}) => this.request({
1965
+ getSnippetSuggestedLocations: (organizationId, snippetId, query, params = {}) => this.request({
1966
+ path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
1967
+ method: "GET",
1968
+ query,
1969
+ secure: true,
1970
+ format: "json",
1971
+ ...params
1972
+ }),
1973
+ askInOrganization: (organizationId, data, query, params = {}) => this.request({
1945
1974
  path: `/orgs/${organizationId}/ask`,
1946
1975
  method: "POST",
1976
+ query,
1947
1977
  body: data,
1948
1978
  secure: true,
1949
1979
  type: "application/json" /* Json */,
package/dist/index.js CHANGED
@@ -468,9 +468,10 @@ var Api = class extends HttpClient {
468
468
  format: "json",
469
469
  ...params
470
470
  }),
471
- askQuery: (data, params = {}) => this.request({
471
+ askQuery: (data, query, params = {}) => this.request({
472
472
  path: `/search/ask`,
473
473
  method: "POST",
474
+ query,
474
475
  body: data,
475
476
  secure: true,
476
477
  type: "application/json" /* Json */,
@@ -522,6 +523,12 @@ var Api = class extends HttpClient {
522
523
  format: "json",
523
524
  ...params
524
525
  }),
526
+ deleteSpaceById: (spaceId, params = {}) => this.request({
527
+ path: `/spaces/${spaceId}`,
528
+ method: "DELETE",
529
+ secure: true,
530
+ ...params
531
+ }),
525
532
  generateSpaceHiveReadAccessToken: (spaceId, params = {}) => this.request({
526
533
  path: `/spaces/${spaceId}/hive/token`,
527
534
  method: "POST",
@@ -536,6 +543,13 @@ var Api = class extends HttpClient {
536
543
  format: "json",
537
544
  ...params
538
545
  }),
546
+ restoreSpace: (spaceId, params = {}) => this.request({
547
+ path: `/spaces/${spaceId}/restore`,
548
+ method: "POST",
549
+ secure: true,
550
+ format: "json",
551
+ ...params
552
+ }),
539
553
  searchSpaceContent: (spaceId, query, params = {}) => this.request({
540
554
  path: `/spaces/${spaceId}/search`,
541
555
  method: "GET",
@@ -552,9 +566,10 @@ var Api = class extends HttpClient {
552
566
  format: "json",
553
567
  ...params
554
568
  }),
555
- askQueryInSpace: (spaceId, data, params = {}) => this.request({
569
+ askQueryInSpace: (spaceId, data, query, params = {}) => this.request({
556
570
  path: `/spaces/${spaceId}/search/ask`,
557
571
  method: "POST",
572
+ query,
558
573
  body: data,
559
574
  secure: true,
560
575
  type: "application/json" /* Json */,
@@ -1151,6 +1166,12 @@ var Api = class extends HttpClient {
1151
1166
  format: "json",
1152
1167
  ...params
1153
1168
  }),
1169
+ deleteCollectionById: (collectionId, params = {}) => this.request({
1170
+ path: `/collections/${collectionId}`,
1171
+ method: "DELETE",
1172
+ secure: true,
1173
+ ...params
1174
+ }),
1154
1175
  listSpacesInCollectionById: (collectionId, query, params = {}) => this.request({
1155
1176
  path: `/collections/${collectionId}/spaces`,
1156
1177
  method: "GET",
@@ -1872,9 +1893,18 @@ var Api = class extends HttpClient {
1872
1893
  format: "json",
1873
1894
  ...params
1874
1895
  }),
1875
- askInOrganization: (organizationId, data, params = {}) => this.request({
1896
+ getSnippetSuggestedLocations: (organizationId, snippetId, query, params = {}) => this.request({
1897
+ path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
1898
+ method: "GET",
1899
+ query,
1900
+ secure: true,
1901
+ format: "json",
1902
+ ...params
1903
+ }),
1904
+ askInOrganization: (organizationId, data, query, params = {}) => this.request({
1876
1905
  path: `/orgs/${organizationId}/ask`,
1877
1906
  method: "POST",
1907
+ query,
1878
1908
  body: data,
1879
1909
  secure: true,
1880
1910
  type: "application/json" /* Json */,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.21.0",
7
+ "version": "0.23.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -4342,6 +4342,9 @@
4342
4342
  "parent": {
4343
4343
  "type": "string",
4344
4344
  "description": "ID of the parent collection."
4345
+ },
4346
+ "gitSync": {
4347
+ "$ref": "#/components/schemas/GitSyncState"
4345
4348
  }
4346
4349
  },
4347
4350
  "required": [
@@ -6818,8 +6821,12 @@
6818
6821
  "description": "Answer from AI for a question asked on a content.",
6819
6822
  "properties": {
6820
6823
  "text": {
6824
+ "deprecated": true,
6821
6825
  "type": "string"
6822
6826
  },
6827
+ "answer": {
6828
+ "$ref": "#/components/schemas/Document"
6829
+ },
6823
6830
  "followupQuestions": {
6824
6831
  "type": "array",
6825
6832
  "items": {
@@ -6867,6 +6874,7 @@
6867
6874
  },
6868
6875
  "required": [
6869
6876
  "text",
6877
+ "answer",
6870
6878
  "pages",
6871
6879
  "sources",
6872
6880
  "followupQuestions"
@@ -7188,10 +7196,10 @@
7188
7196
  "description": "Unique identifier for the collection"
7189
7197
  },
7190
7198
  "title": {
7191
- "type": "string",
7192
- "description": "Title of the collection",
7193
- "minLength": 0,
7194
- "maxLength": 50
7199
+ "$ref": "#/components/schemas/CollectionTitle"
7200
+ },
7201
+ "description": {
7202
+ "$ref": "#/components/schemas/CollectionDescription"
7195
7203
  },
7196
7204
  "path": {
7197
7205
  "type": "string",
@@ -7249,6 +7257,18 @@
7249
7257
  "urls"
7250
7258
  ]
7251
7259
  },
7260
+ "CollectionTitle": {
7261
+ "type": "string",
7262
+ "description": "Title of the collection",
7263
+ "minLength": 0,
7264
+ "maxLength": 50
7265
+ },
7266
+ "CollectionDescription": {
7267
+ "type": "string",
7268
+ "description": "Description of the collection",
7269
+ "minLength": 0,
7270
+ "maxLength": 100
7271
+ },
7252
7272
  "Integration": {
7253
7273
  "type": "object",
7254
7274
  "properties": {
@@ -11173,6 +11193,9 @@
11173
11193
  {
11174
11194
  "$ref": "#/components/schemas/ChangeRequestReviewsChannel"
11175
11195
  },
11196
+ {
11197
+ "$ref": "#/components/schemas/CollectionChannel"
11198
+ },
11176
11199
  {
11177
11200
  "$ref": "#/components/schemas/CollectionPublishingCustomizationChannel"
11178
11201
  },
@@ -11569,6 +11592,24 @@
11569
11592
  "user"
11570
11593
  ]
11571
11594
  },
11595
+ "CollectionChannel": {
11596
+ "type": "object",
11597
+ "properties": {
11598
+ "channel": {
11599
+ "type": "string",
11600
+ "enum": [
11601
+ "collection"
11602
+ ]
11603
+ },
11604
+ "collection": {
11605
+ "type": "string"
11606
+ }
11607
+ },
11608
+ "required": [
11609
+ "channel",
11610
+ "collection"
11611
+ ]
11612
+ },
11572
11613
  "CollectionPublishingCustomizationChannel": {
11573
11614
  "type": "object",
11574
11615
  "properties": {
@@ -12805,6 +12846,9 @@
12805
12846
  "schema": {
12806
12847
  "type": "string"
12807
12848
  }
12849
+ },
12850
+ {
12851
+ "$ref": "#/components/parameters/pageFormat"
12808
12852
  }
12809
12853
  ],
12810
12854
  "responses": {
@@ -12836,6 +12880,11 @@
12836
12880
  "user": []
12837
12881
  }
12838
12882
  ],
12883
+ "parameters": [
12884
+ {
12885
+ "$ref": "#/components/parameters/pageFormat"
12886
+ }
12887
+ ],
12839
12888
  "requestBody": {
12840
12889
  "required": true,
12841
12890
  "content": {
@@ -13064,6 +13113,31 @@
13064
13113
  "$ref": "#/components/responses/UnexpectedError"
13065
13114
  }
13066
13115
  }
13116
+ },
13117
+ "delete": {
13118
+ "operationId": "deleteSpaceById",
13119
+ "summary": "Soft-deletes a space. Soft-deleted spaces will be permanently removed after 7 days.",
13120
+ "tags": [
13121
+ "spaces"
13122
+ ],
13123
+ "security": [
13124
+ {
13125
+ "user": []
13126
+ }
13127
+ ],
13128
+ "parameters": [
13129
+ {
13130
+ "$ref": "#/components/parameters/spaceId"
13131
+ }
13132
+ ],
13133
+ "responses": {
13134
+ "205": {
13135
+ "description": "Space has been deleted"
13136
+ },
13137
+ "default": {
13138
+ "$ref": "#/components/responses/UnexpectedError"
13139
+ }
13140
+ }
13067
13141
  }
13068
13142
  },
13069
13143
  "/spaces/{spaceId}/hive/token": {
@@ -13137,6 +13211,40 @@
13137
13211
  }
13138
13212
  }
13139
13213
  },
13214
+ "/spaces/{spaceId}/restore": {
13215
+ "post": {
13216
+ "operationId": "restoreSpace",
13217
+ "summary": "Restore a recently soft-deleted space.",
13218
+ "tags": [
13219
+ "spaces"
13220
+ ],
13221
+ "security": [
13222
+ {
13223
+ "user": []
13224
+ }
13225
+ ],
13226
+ "parameters": [
13227
+ {
13228
+ "$ref": "#/components/parameters/spaceId"
13229
+ }
13230
+ ],
13231
+ "responses": {
13232
+ "200": {
13233
+ "description": "Space restored",
13234
+ "content": {
13235
+ "application/json": {
13236
+ "schema": {
13237
+ "$ref": "#/components/schemas/Space"
13238
+ }
13239
+ }
13240
+ }
13241
+ },
13242
+ "default": {
13243
+ "$ref": "#/components/responses/UnexpectedError"
13244
+ }
13245
+ }
13246
+ }
13247
+ },
13140
13248
  "/spaces/{spaceId}/search": {
13141
13249
  "get": {
13142
13250
  "operationId": "searchSpaceContent",
@@ -13216,6 +13324,9 @@
13216
13324
  },
13217
13325
  {
13218
13326
  "$ref": "#/components/parameters/spaceId"
13327
+ },
13328
+ {
13329
+ "$ref": "#/components/parameters/pageFormat"
13219
13330
  }
13220
13331
  ],
13221
13332
  "responses": {
@@ -13245,6 +13356,9 @@
13245
13356
  "parameters": [
13246
13357
  {
13247
13358
  "$ref": "#/components/parameters/spaceId"
13359
+ },
13360
+ {
13361
+ "$ref": "#/components/parameters/pageFormat"
13248
13362
  }
13249
13363
  ],
13250
13364
  "requestBody": {
@@ -16745,6 +16859,12 @@
16745
16859
  "properties": {
16746
16860
  "visibility": {
16747
16861
  "$ref": "#/components/schemas/ContentVisibility"
16862
+ },
16863
+ "title": {
16864
+ "$ref": "#/components/schemas/CollectionTitle"
16865
+ },
16866
+ "description": {
16867
+ "$ref": "#/components/schemas/CollectionDescription"
16748
16868
  }
16749
16869
  }
16750
16870
  }
@@ -16766,6 +16886,31 @@
16766
16886
  "$ref": "#/components/responses/UnexpectedError"
16767
16887
  }
16768
16888
  }
16889
+ },
16890
+ "delete": {
16891
+ "operationId": "deleteCollectionById",
16892
+ "summary": "Deletes a collection",
16893
+ "tags": [
16894
+ "collections"
16895
+ ],
16896
+ "security": [
16897
+ {
16898
+ "user": []
16899
+ }
16900
+ ],
16901
+ "parameters": [
16902
+ {
16903
+ "$ref": "#/components/parameters/collectionId"
16904
+ }
16905
+ ],
16906
+ "responses": {
16907
+ "205": {
16908
+ "description": "Collection has been deleted"
16909
+ },
16910
+ "default": {
16911
+ "$ref": "#/components/responses/UnexpectedError"
16912
+ }
16913
+ }
16769
16914
  }
16770
16915
  },
16771
16916
  "/collections/{collectionId}/spaces": {
@@ -19694,6 +19839,7 @@
19694
19839
  "$ref": "#/components/schemas/Space"
19695
19840
  },
19696
19841
  "gitSync": {
19842
+ "deprecated": true,
19697
19843
  "$ref": "#/components/schemas/GitSyncState"
19698
19844
  }
19699
19845
  },
@@ -21392,6 +21538,104 @@
21392
21538
  "$ref": "#/components/responses/UnexpectedError"
21393
21539
  }
21394
21540
  }
21541
+ },
21542
+ "get": {
21543
+ "operationId": "getSnippetSuggestedLocations",
21544
+ "summary": "Return possible snippet locations in an organization based on the current user.",
21545
+ "tags": [
21546
+ "organizations"
21547
+ ],
21548
+ "security": [
21549
+ {
21550
+ "user": []
21551
+ }
21552
+ ],
21553
+ "parameters": [
21554
+ {
21555
+ "$ref": "#/components/parameters/organizationId"
21556
+ },
21557
+ {
21558
+ "$ref": "#/components/parameters/snippetId"
21559
+ },
21560
+ {
21561
+ "$ref": "#/components/parameters/listPage"
21562
+ },
21563
+ {
21564
+ "$ref": "#/components/parameters/listLimit"
21565
+ },
21566
+ {
21567
+ "name": "spaceId",
21568
+ "in": "query",
21569
+ "description": "If specified, only locations in the given space will be returned. If not specified, GitBook will suggest spaces.",
21570
+ "schema": {
21571
+ "type": "string"
21572
+ }
21573
+ },
21574
+ {
21575
+ "name": "pageId",
21576
+ "in": "query",
21577
+ "description": "If specified, only locations under the given pageId will be returned. You must specify a spaceId too. If pageId is not specified, GitBook will suggest pages at the top level.",
21578
+ "schema": {
21579
+ "type": "string"
21580
+ }
21581
+ }
21582
+ ],
21583
+ "responses": {
21584
+ "200": {
21585
+ "description": "A paginated list of suggested snippet locations.",
21586
+ "content": {
21587
+ "application/json": {
21588
+ "schema": {
21589
+ "allOf": [
21590
+ {
21591
+ "$ref": "#/components/schemas/List"
21592
+ },
21593
+ {
21594
+ "type": "object",
21595
+ "required": [
21596
+ "items"
21597
+ ],
21598
+ "properties": {
21599
+ "items": {
21600
+ "type": "array",
21601
+ "items": {
21602
+ "type": "object",
21603
+ "required": [
21604
+ "space"
21605
+ ],
21606
+ "properties": {
21607
+ "aiPowered": {
21608
+ "type": "boolean",
21609
+ "description": "If defined and true, this location was suggested by GitBook AI."
21610
+ },
21611
+ "space": {
21612
+ "$ref": "#/components/schemas/Space"
21613
+ },
21614
+ "parentPage": {
21615
+ "description": "The parent page of the suggested location.",
21616
+ "oneOf": [
21617
+ {
21618
+ "$ref": "#/components/schemas/RevisionPageDocument"
21619
+ },
21620
+ {
21621
+ "$ref": "#/components/schemas/RevisionPageGroup"
21622
+ }
21623
+ ]
21624
+ }
21625
+ }
21626
+ }
21627
+ }
21628
+ }
21629
+ }
21630
+ ]
21631
+ }
21632
+ }
21633
+ }
21634
+ },
21635
+ "default": {
21636
+ "$ref": "#/components/responses/UnexpectedError"
21637
+ }
21638
+ }
21395
21639
  }
21396
21640
  },
21397
21641
  "/orgs/{organizationId}/ask": {
@@ -21406,6 +21650,9 @@
21406
21650
  "parameters": [
21407
21651
  {
21408
21652
  "$ref": "#/components/parameters/organizationId"
21653
+ },
21654
+ {
21655
+ "$ref": "#/components/parameters/pageFormat"
21409
21656
  }
21410
21657
  ],
21411
21658
  "requestBody": {
package/spec/openapi.yaml CHANGED
@@ -2837,6 +2837,8 @@ components:
2837
2837
  parent:
2838
2838
  type: string
2839
2839
  description: ID of the parent collection.
2840
+ gitSync:
2841
+ $ref: "#/components/schemas/GitSyncState"
2840
2842
  required:
2841
2843
  - object
2842
2844
  - id
@@ -4501,7 +4503,10 @@ components:
4501
4503
  description: Answer from AI for a question asked on a content.
4502
4504
  properties:
4503
4505
  text:
4506
+ deprecated: true
4504
4507
  type: string
4508
+ answer:
4509
+ $ref: "#/components/schemas/Document"
4505
4510
  followupQuestions:
4506
4511
  type: array
4507
4512
  items:
@@ -4535,6 +4540,7 @@ components:
4535
4540
  - sections
4536
4541
  required:
4537
4542
  - text
4543
+ - answer
4538
4544
  - pages
4539
4545
  - sources
4540
4546
  - followupQuestions
@@ -4758,10 +4764,9 @@ components:
4758
4764
  type: string
4759
4765
  description: Unique identifier for the collection
4760
4766
  title:
4761
- type: string
4762
- description: Title of the collection
4763
- minLength: 0
4764
- maxLength: 50
4767
+ $ref: "#/components/schemas/CollectionTitle"
4768
+ description:
4769
+ $ref: "#/components/schemas/CollectionDescription"
4765
4770
  path:
4766
4771
  type: string
4767
4772
  description: Path in the published URL
@@ -4803,6 +4808,16 @@ components:
4803
4808
  - organization
4804
4809
  - visibility
4805
4810
  - urls
4811
+ CollectionTitle:
4812
+ type: string
4813
+ description: Title of the collection
4814
+ minLength: 0
4815
+ maxLength: 50
4816
+ CollectionDescription:
4817
+ type: string
4818
+ description: Description of the collection
4819
+ minLength: 0
4820
+ maxLength: 100
4806
4821
  Integration:
4807
4822
  type: object
4808
4823
  properties:
@@ -7345,6 +7360,7 @@ components:
7345
7360
  - $ref: "#/components/schemas/UserOrganizationsChannel"
7346
7361
  - $ref: "#/components/schemas/UserProfileChannel"
7347
7362
  - $ref: "#/components/schemas/ChangeRequestReviewsChannel"
7363
+ - $ref: "#/components/schemas/CollectionChannel"
7348
7364
  - $ref: "#/components/schemas/CollectionPublishingCustomizationChannel"
7349
7365
  - type: object
7350
7366
  properties:
@@ -7584,6 +7600,18 @@ components:
7584
7600
  required:
7585
7601
  - channel
7586
7602
  - user
7603
+ CollectionChannel:
7604
+ type: object
7605
+ properties:
7606
+ channel:
7607
+ type: string
7608
+ enum:
7609
+ - collection
7610
+ collection:
7611
+ type: string
7612
+ required:
7613
+ - channel
7614
+ - collection
7587
7615
  CollectionPublishingCustomizationChannel:
7588
7616
  type: object
7589
7617
  properties:
@@ -8413,6 +8441,7 @@ paths:
8413
8441
  required: true
8414
8442
  schema:
8415
8443
  type: string
8444
+ - $ref: "#/components/parameters/pageFormat"
8416
8445
  responses:
8417
8446
  "200":
8418
8447
  description: OK
@@ -8430,6 +8459,8 @@ paths:
8430
8459
  summary: Ask a question to an AI across spaces that is accessible by the currently authenticated target.
8431
8460
  security:
8432
8461
  - user: []
8462
+ parameters:
8463
+ - $ref: "#/components/parameters/pageFormat"
8433
8464
  requestBody:
8434
8465
  required: true
8435
8466
  content:
@@ -8567,6 +8598,20 @@ paths:
8567
8598
  $ref: "#/components/schemas/Space"
8568
8599
  default:
8569
8600
  $ref: "#/components/responses/UnexpectedError"
8601
+ delete:
8602
+ operationId: deleteSpaceById
8603
+ summary: Soft-deletes a space. Soft-deleted spaces will be permanently removed after 7 days.
8604
+ tags:
8605
+ - spaces
8606
+ security:
8607
+ - user: []
8608
+ parameters:
8609
+ - $ref: "#/components/parameters/spaceId"
8610
+ responses:
8611
+ "205":
8612
+ description: Space has been deleted
8613
+ default:
8614
+ $ref: "#/components/responses/UnexpectedError"
8570
8615
  "/spaces/{spaceId}/hive/token":
8571
8616
  post:
8572
8617
  operationId: generateSpaceHiveReadAccessToken
@@ -8608,6 +8653,25 @@ paths:
8608
8653
  $ref: "#/components/schemas/Space"
8609
8654
  default:
8610
8655
  $ref: "#/components/responses/UnexpectedError"
8656
+ "/spaces/{spaceId}/restore":
8657
+ post:
8658
+ operationId: restoreSpace
8659
+ summary: Restore a recently soft-deleted space.
8660
+ tags:
8661
+ - spaces
8662
+ security:
8663
+ - user: []
8664
+ parameters:
8665
+ - $ref: "#/components/parameters/spaceId"
8666
+ responses:
8667
+ "200":
8668
+ description: Space restored
8669
+ content:
8670
+ application/json:
8671
+ schema:
8672
+ $ref: "#/components/schemas/Space"
8673
+ default:
8674
+ $ref: "#/components/responses/UnexpectedError"
8611
8675
  "/spaces/{spaceId}/search":
8612
8676
  get:
8613
8677
  operationId: searchSpaceContent
@@ -8653,6 +8717,7 @@ paths:
8653
8717
  schema:
8654
8718
  type: string
8655
8719
  - $ref: "#/components/parameters/spaceId"
8720
+ - $ref: "#/components/parameters/pageFormat"
8656
8721
  responses:
8657
8722
  "200":
8658
8723
  description: OK
@@ -8670,6 +8735,7 @@ paths:
8670
8735
  summary: Ask a question to an AI within the context of the space.
8671
8736
  parameters:
8672
8737
  - $ref: "#/components/parameters/spaceId"
8738
+ - $ref: "#/components/parameters/pageFormat"
8673
8739
  requestBody:
8674
8740
  required: true
8675
8741
  content:
@@ -10571,6 +10637,10 @@ paths:
10571
10637
  properties:
10572
10638
  visibility:
10573
10639
  $ref: "#/components/schemas/ContentVisibility"
10640
+ title:
10641
+ $ref: "#/components/schemas/CollectionTitle"
10642
+ description:
10643
+ $ref: "#/components/schemas/CollectionDescription"
10574
10644
  responses:
10575
10645
  "200":
10576
10646
  description: The collection has been updated
@@ -10580,6 +10650,20 @@ paths:
10580
10650
  $ref: "#/components/schemas/Collection"
10581
10651
  default:
10582
10652
  $ref: "#/components/responses/UnexpectedError"
10653
+ delete:
10654
+ operationId: deleteCollectionById
10655
+ summary: Deletes a collection
10656
+ tags:
10657
+ - collections
10658
+ security:
10659
+ - user: []
10660
+ parameters:
10661
+ - $ref: "#/components/parameters/collectionId"
10662
+ responses:
10663
+ "205":
10664
+ description: Collection has been deleted
10665
+ default:
10666
+ $ref: "#/components/responses/UnexpectedError"
10583
10667
  "/collections/{collectionId}/spaces":
10584
10668
  get:
10585
10669
  operationId: listSpacesInCollectionById
@@ -12247,6 +12331,7 @@ paths:
12247
12331
  space:
12248
12332
  $ref: "#/components/schemas/Space"
12249
12333
  gitSync:
12334
+ deprecated: true
12250
12335
  $ref: "#/components/schemas/GitSyncState"
12251
12336
  required:
12252
12337
  - space
@@ -13194,6 +13279,59 @@ paths:
13194
13279
  $ref: "#/components/schemas/ChangeRequest"
13195
13280
  default:
13196
13281
  $ref: "#/components/responses/UnexpectedError"
13282
+ get:
13283
+ operationId: getSnippetSuggestedLocations
13284
+ summary: Return possible snippet locations in an organization based on the current user.
13285
+ tags:
13286
+ - organizations
13287
+ security:
13288
+ - user: []
13289
+ parameters:
13290
+ - $ref: "#/components/parameters/organizationId"
13291
+ - $ref: "#/components/parameters/snippetId"
13292
+ - $ref: "#/components/parameters/listPage"
13293
+ - $ref: "#/components/parameters/listLimit"
13294
+ - name: spaceId
13295
+ in: query
13296
+ description: If specified, only locations in the given space will be returned. If not specified, GitBook will suggest spaces.
13297
+ schema:
13298
+ type: string
13299
+ - name: pageId
13300
+ in: query
13301
+ description: If specified, only locations under the given pageId will be returned. You must specify a spaceId too. If pageId is not specified, GitBook will suggest pages at the top level.
13302
+ schema:
13303
+ type: string
13304
+ responses:
13305
+ "200":
13306
+ description: A paginated list of suggested snippet locations.
13307
+ content:
13308
+ application/json:
13309
+ schema:
13310
+ allOf:
13311
+ - $ref: "#/components/schemas/List"
13312
+ - type: object
13313
+ required:
13314
+ - items
13315
+ properties:
13316
+ items:
13317
+ type: array
13318
+ items:
13319
+ type: object
13320
+ required:
13321
+ - space
13322
+ properties:
13323
+ aiPowered:
13324
+ type: boolean
13325
+ description: If defined and true, this location was suggested by GitBook AI.
13326
+ space:
13327
+ $ref: "#/components/schemas/Space"
13328
+ parentPage:
13329
+ description: The parent page of the suggested location.
13330
+ oneOf:
13331
+ - $ref: "#/components/schemas/RevisionPageDocument"
13332
+ - $ref: "#/components/schemas/RevisionPageGroup"
13333
+ default:
13334
+ $ref: "#/components/responses/UnexpectedError"
13197
13335
  "/orgs/{organizationId}/ask":
13198
13336
  post:
13199
13337
  operationId: askInOrganization
@@ -13202,6 +13340,7 @@ paths:
13202
13340
  - user: []
13203
13341
  parameters:
13204
13342
  - $ref: "#/components/parameters/organizationId"
13343
+ - $ref: "#/components/parameters/pageFormat"
13205
13344
  requestBody:
13206
13345
  required: true
13207
13346
  content: