@gitbook/api 0.209.1 → 0.210.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
@@ -201,51 +201,6 @@ export declare enum SiteInsightsQueryOperator {
201
201
  export declare enum SiteInsightsPageNotFoundType {
202
202
  Conditional = "conditional"
203
203
  }
204
- export declare enum SiteInsightsVisitorBot {
205
- Unknown = "unknown",
206
- Googlebot = "googlebot",
207
- Bingbot = "bingbot",
208
- Duckduckbot = "duckduckbot",
209
- Facebookbot = "facebookbot",
210
- Applebot = "applebot",
211
- Chatgpt = "chatgpt",
212
- Openai = "openai",
213
- Claude = "claude",
214
- Anthropic = "anthropic",
215
- Gemini = "gemini",
216
- Perplexity = "perplexity",
217
- Cohere = "cohere",
218
- Mistral = "mistral",
219
- Deepseek = "deepseek",
220
- Meta = "meta",
221
- Bytespider = "bytespider",
222
- Ccbot = "ccbot",
223
- Amazonbot = "amazonbot",
224
- Youbot = "youbot",
225
- Cursor = "cursor",
226
- Vscode = "vscode",
227
- ClaudeCode = "claude-code",
228
- Codex = "codex",
229
- Opencode = "opencode",
230
- Gptbot = "gptbot",
231
- Claudebot = "claudebot",
232
- MetaFetcher = "meta-fetcher",
233
- Grok = "grok",
234
- GithubCopilot = "github-copilot",
235
- MetaWebindexer = "meta-webindexer",
236
- MetaAds = "meta-ads",
237
- Duckassist = "duckassist",
238
- AmznSearchbot = "amzn-searchbot",
239
- AmznUser = "amzn-user",
240
- OtherBot = "other-bot",
241
- Parallel = "parallel",
242
- Exa = "exa",
243
- Linkup = "linkup",
244
- VertexAi = "vertex-ai",
245
- Atlassian = "atlassian",
246
- Kapa = "kapa",
247
- Bedrock = "bedrock"
248
- }
249
204
  export declare enum SiteInsightsVisitorOS {
250
205
  Windows = "windows",
251
206
  Macos = "macos",
@@ -393,6 +348,71 @@ export declare enum SiteQuestionAnswerResolution {
393
348
  Partially = "partially",
394
349
  Yes = "yes"
395
350
  }
351
+ /** Whether the visitor who asked was signed in to the site: `authenticated` on a site behind authenticated access, or when they asked with a verified visitor token, and `anonymous` otherwise. Questions asked through the API or a connected channel, and those asked before this was recorded, are neither. */
352
+ export declare enum SiteQuestionVisitorAuthentication {
353
+ Authenticated = "authenticated",
354
+ Anonymous = "anonymous"
355
+ }
356
+ /** Who should act on an answer, derived from what was asked and what the site said. `docs` the site had no answer, or only a weak one, to a question a page could answer for everyone, so the content should be written or fixed; `team` the question needs a decision or clarification from a team beyond the docs, such as product, sales or marketing, for example when the site said something is not supported or only available on another plan; `support` only a person can resolve it, because it concerns the asker's own account, order, data or contract; `none` the site answered it. */
357
+ export declare enum SiteQuestionEscalation {
358
+ Docs = "docs",
359
+ Team = "team",
360
+ Support = "support",
361
+ None = "none"
362
+ }
363
+ /** What the site's content said about the main thing asked, judged from the answer. Unlike `answered`, which measures the assistant, it tells a product limit from a content gap: `covered` the site confirms it is possible or explains how it works; `limited` possible only under a named condition such as a plan, version, role or quota; `unsupported` the site says it cannot be done; `no-answer` the site gave no answer to a question a page could answer for everyone; `needs-support` only a person can resolve it, because it concerns the asker's own account, order, data or contract. */
364
+ export declare enum SiteQuestionAnswerSiteSaid {
365
+ Covered = "covered",
366
+ Limited = "limited",
367
+ Unsupported = "unsupported",
368
+ NoAnswer = "no-answer",
369
+ NeedsSupport = "needs-support"
370
+ }
371
+ export declare enum SiteInsightsVisitorBot {
372
+ Unknown = "unknown",
373
+ Googlebot = "googlebot",
374
+ Bingbot = "bingbot",
375
+ Duckduckbot = "duckduckbot",
376
+ Facebookbot = "facebookbot",
377
+ Applebot = "applebot",
378
+ Chatgpt = "chatgpt",
379
+ Openai = "openai",
380
+ Claude = "claude",
381
+ Anthropic = "anthropic",
382
+ Gemini = "gemini",
383
+ Perplexity = "perplexity",
384
+ Cohere = "cohere",
385
+ Mistral = "mistral",
386
+ Deepseek = "deepseek",
387
+ Meta = "meta",
388
+ Bytespider = "bytespider",
389
+ Ccbot = "ccbot",
390
+ Amazonbot = "amazonbot",
391
+ Youbot = "youbot",
392
+ Cursor = "cursor",
393
+ Vscode = "vscode",
394
+ ClaudeCode = "claude-code",
395
+ Codex = "codex",
396
+ Opencode = "opencode",
397
+ Gptbot = "gptbot",
398
+ Claudebot = "claudebot",
399
+ MetaFetcher = "meta-fetcher",
400
+ Grok = "grok",
401
+ GithubCopilot = "github-copilot",
402
+ MetaWebindexer = "meta-webindexer",
403
+ MetaAds = "meta-ads",
404
+ Duckassist = "duckassist",
405
+ AmznSearchbot = "amzn-searchbot",
406
+ AmznUser = "amzn-user",
407
+ OtherBot = "other-bot",
408
+ Parallel = "parallel",
409
+ Exa = "exa",
410
+ Linkup = "linkup",
411
+ VertexAi = "vertex-ai",
412
+ Atlassian = "atlassian",
413
+ Kapa = "kapa",
414
+ Bedrock = "bedrock"
415
+ }
396
416
  /** Who asked the question: `human` for a person using a web browser, `agent` for an AI agent, `bot` for another automated client that names itself, such as a search engine crawler, and `unknown` when it can't be told, such as for a script calling the API. */
397
417
  export declare enum SiteQuestionVisitorType {
398
418
  Human = "human",
@@ -458,6 +478,18 @@ export declare enum ContextConnectionStatus {
458
478
  Failed = "failed",
459
479
  Skipped = "skipped"
460
480
  }
481
+ /** What the person was asking for, independent of the type of site: `can-it` whether it does, supports or integrates with something; `how-to` the steps to get something done; `how-it-works` rules, defaults and what happens when; `details` exact values, syntax, limits or lists; `troubleshoot` errors and why something fails; `pricing` price, plans and licensing; `trust` security, compliance and data handling; `fit` use-case fit, alternatives and switching from another tool; `other` anything else. */
482
+ export declare enum SiteQuestionIntent {
483
+ CanIt = "can-it",
484
+ HowTo = "how-to",
485
+ HowItWorks = "how-it-works",
486
+ Details = "details",
487
+ Troubleshoot = "troubleshoot",
488
+ Pricing = "pricing",
489
+ Trust = "trust",
490
+ Fit = "fit",
491
+ Other = "other"
492
+ }
461
493
  /** Type classification of the user question. */
462
494
  export declare enum SiteQuestionType {
463
495
  Exploring = "exploring",
@@ -877,6 +909,19 @@ export declare enum OrganizationDomainStatus {
877
909
  Verified = "verified",
878
910
  Error = "error"
879
911
  }
912
+ /**
913
+ * State of a SAML provider's email domain in the organization.
914
+ * - `verified`: People with an email on this domain can sign in through the provider.
915
+ * - `pending`, `error`, `legacy`: The domain isn't verified yet, so it doesn't let anyone sign in.
916
+ * - `removed`: The organization no longer has this domain.
917
+ */
918
+ export declare enum SAMLProviderDomainStatus {
919
+ Verified = "verified",
920
+ Pending = "pending",
921
+ Error = "error",
922
+ Legacy = "legacy",
923
+ Removed = "removed"
924
+ }
880
925
  /**
881
926
  * Status of the provider.
882
927
  * - `active`: The provider is active and can be used to authenticate users.
@@ -1617,6 +1662,8 @@ export interface UserAPIToken {
1617
1662
  revoked: boolean;
1618
1663
  /** When the API token stops authenticating. Absent for a token that never expires. */
1619
1664
  expiresAt?: Timestamp;
1665
+ /** When the API token last authenticated a request, accurate to within an hour. Absent for a token that has never been used. */
1666
+ lastUsedAt?: Timestamp;
1620
1667
  }
1621
1668
  /** The API token details, including the token itself. */
1622
1669
  export type UserAPITokenExtended = UserAPIToken & {
@@ -2359,6 +2406,12 @@ export interface DocumentInlineLink {
2359
2406
  data: {
2360
2407
  /** A relative reference to content in GitBook. */
2361
2408
  ref: ContentRef;
2409
+ /**
2410
+ * Where the link opens when clicked. When absent, the link follows the site's default behavior.
2411
+ * - `self`: The link opens in the current tab.
2412
+ * - `blank`: The link opens in a new browser tab.
2413
+ */
2414
+ target?: "self" | "blank";
2362
2415
  };
2363
2416
  isVoid?: false;
2364
2417
  }
@@ -2559,7 +2612,7 @@ export interface DocumentTableViewGrid {
2559
2612
  export interface DocumentTableViewCards {
2560
2613
  type: "cards";
2561
2614
  /** Size of the cards. It indicates how many columns will be used */
2562
- cardSize: "medium" | "large";
2615
+ cardSize: "small" | "medium" | "large";
2563
2616
  /** Ordered list of the definition IDs to display */
2564
2617
  columns: string[];
2565
2618
  /** Definition ID to use as a target link for the card */
@@ -2769,29 +2822,6 @@ export interface DocumentBlockPrompt {
2769
2822
  isVoid?: false;
2770
2823
  }
2771
2824
  export type DocumentBlocksTopLevels = DocumentBlocksEssentials | DocumentBlockQuote | DocumentBlockHint | DocumentBlockPrompt | DocumentBlockImages | DocumentBlockFile | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockCode | DocumentBlockMath | DocumentBlockExpandable | DocumentBlockTabs | DocumentBlockTable | DocumentBlockOpenAPI | DocumentBlockOpenAPIOperation | DocumentBlockOpenAPISchemas | DocumentBlockOpenAPIWebhook | DocumentBlockContentRef | DocumentBlockIntegration | DocumentBlockReusableContent | DocumentBlockStepper | DocumentBlockIf | DocumentBlockColumns | DocumentBlockUpdates;
2772
- export interface DocumentBlockIf {
2773
- object: "block";
2774
- type: "if";
2775
- key?: string;
2776
- nodes: DocumentBlocksTopLevels[];
2777
- isVoid?: false;
2778
- data: {
2779
- expression: string;
2780
- };
2781
- }
2782
- export interface DocumentBlockReusableContent {
2783
- object: "block";
2784
- type: "reusable-content";
2785
- key?: string;
2786
- data: {
2787
- ref: ContentRefReusableContent;
2788
- };
2789
- isVoid: true;
2790
- meta?: {
2791
- /** A content token that can be used to fetch the reusable content from the API. */
2792
- token?: string;
2793
- };
2794
- }
2795
2825
  export interface DocumentBlockContentRef {
2796
2826
  object: "block";
2797
2827
  type: "content-ref";
@@ -2838,13 +2868,29 @@ export interface DocumentBlockExpandable {
2838
2868
  id: string;
2839
2869
  };
2840
2870
  }
2841
- export interface DocumentBlockStepper {
2871
+ export interface DocumentBlockIf {
2842
2872
  object: "block";
2843
- type: "stepper";
2873
+ type: "if";
2844
2874
  key?: string;
2845
- nodes: DocumentBlockStepperStep[];
2875
+ /** Blocks shown when the expression is true. Directly inside an `updates` block, these are `update` blocks, and only there. */
2876
+ nodes: (DocumentBlocksTopLevels | DocumentBlockUpdate)[];
2846
2877
  isVoid?: false;
2847
- data?: object;
2878
+ data: {
2879
+ expression: string;
2880
+ };
2881
+ }
2882
+ export interface DocumentBlockReusableContent {
2883
+ object: "block";
2884
+ type: "reusable-content";
2885
+ key?: string;
2886
+ data: {
2887
+ ref: ContentRefReusableContent;
2888
+ };
2889
+ isVoid: true;
2890
+ meta?: {
2891
+ /** A content token that can be used to fetch the reusable content from the API. */
2892
+ token?: string;
2893
+ };
2848
2894
  }
2849
2895
  export interface DocumentBlockTabs {
2850
2896
  object: "block";
@@ -2856,6 +2902,24 @@ export interface DocumentBlockTabs {
2856
2902
  fullWidth?: boolean;
2857
2903
  };
2858
2904
  }
2905
+ export interface DocumentBlockStepper {
2906
+ object: "block";
2907
+ type: "stepper";
2908
+ key?: string;
2909
+ nodes: DocumentBlockStepperStep[];
2910
+ isVoid?: false;
2911
+ data?: object;
2912
+ }
2913
+ export interface DocumentBlockStepperStep {
2914
+ object: "block";
2915
+ type: "stepper-step";
2916
+ key?: string;
2917
+ nodes: (DocumentBlocksEssentials | DocumentBlockContentRef | DocumentBlockCode | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockImages | DocumentBlockDrawing | DocumentBlockHint | DocumentBlockPrompt | DocumentBlockQuote | DocumentBlockMath | DocumentBlockIntegration | DocumentBlockExpandable | DocumentBlockTable | DocumentBlockTabs | DocumentBlockIf | DocumentBlockReusableContent | DocumentBlockStepper)[];
2918
+ data: {
2919
+ icon?: string;
2920
+ };
2921
+ isVoid?: false;
2922
+ }
2859
2923
  export interface DocumentBlockTabsItem {
2860
2924
  object: "block";
2861
2925
  type: "tabs-item";
@@ -2874,13 +2938,16 @@ export interface DocumentBlockTabsItem {
2874
2938
  };
2875
2939
  isVoid?: false;
2876
2940
  }
2877
- export interface DocumentBlockStepperStep {
2941
+ export interface DocumentBlockUpdate {
2878
2942
  object: "block";
2879
- type: "stepper-step";
2943
+ type: "update";
2880
2944
  key?: string;
2881
- nodes: (DocumentBlocksEssentials | DocumentBlockContentRef | DocumentBlockCode | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockImages | DocumentBlockDrawing | DocumentBlockHint | DocumentBlockPrompt | DocumentBlockQuote | DocumentBlockMath | DocumentBlockIntegration | DocumentBlockExpandable | DocumentBlockTable | DocumentBlockTabs | DocumentBlockIf | DocumentBlockReusableContent | DocumentBlockStepper)[];
2945
+ nodes: (DocumentBlocksEssentials | DocumentBlockContentRef | DocumentBlockCode | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockImages | DocumentBlockDrawing | DocumentBlockHint | DocumentBlockPrompt | DocumentBlockQuote | DocumentBlockMath | DocumentBlockIntegration | DocumentBlockTabs | DocumentBlockExpandable | DocumentBlockTable | DocumentBlockIf | DocumentBlockStepper)[];
2882
2946
  data: {
2883
- icon?: string;
2947
+ /** Date of the update. Accepts a YYYY-MM-DD date or a timestamp. Timestamps are normalized to their UTC calendar date; responses use YYYY-MM-DD. */
2948
+ date: string | Timestamp;
2949
+ /** Array of tags. Each tag is id'ed by its slug. */
2950
+ tags?: ContentRefTag[];
2884
2951
  };
2885
2952
  isVoid?: false;
2886
2953
  }
@@ -3034,24 +3101,12 @@ export interface DocumentBlockColumns {
3034
3101
  nodes: DocumentBlockColumn[];
3035
3102
  isVoid: false;
3036
3103
  }
3037
- export interface DocumentBlockUpdate {
3038
- object: "block";
3039
- type: "update";
3040
- key?: string;
3041
- nodes: (DocumentBlocksEssentials | DocumentBlockContentRef | DocumentBlockCode | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockImages | DocumentBlockDrawing | DocumentBlockHint | DocumentBlockPrompt | DocumentBlockQuote | DocumentBlockMath | DocumentBlockIntegration | DocumentBlockTabs | DocumentBlockExpandable | DocumentBlockTable | DocumentBlockIf | DocumentBlockStepper)[];
3042
- data: {
3043
- /** Date of the update. Accepts a YYYY-MM-DD date or a timestamp. Timestamps are normalized to their UTC calendar date; responses use YYYY-MM-DD. */
3044
- date: string | Timestamp;
3045
- /** Array of tags. Each tag is id'ed by its slug. */
3046
- tags?: ContentRefTag[];
3047
- };
3048
- isVoid?: false;
3049
- }
3050
3104
  export interface DocumentBlockUpdates {
3051
3105
  object: "block";
3052
3106
  type: "updates";
3053
3107
  key?: string;
3054
- nodes: DocumentBlockUpdate[];
3108
+ /** The updates. An `if` block wraps updates shown only when its expression is true; it holds `update` blocks only. */
3109
+ nodes: (DocumentBlockUpdate | DocumentBlockIf)[];
3055
3110
  isVoid?: false;
3056
3111
  data: {
3057
3112
  /** @default "full" */
@@ -3438,6 +3493,10 @@ export type RevisionTag = {
3438
3493
  slug: string;
3439
3494
  /** Display label for the tag. Can be renamed and differ from the slug. */
3440
3495
  label: string;
3496
+ /** Categories organize tags and cannot be assigned to pages or blocks. Immutable after creation. */
3497
+ kind?: "category";
3498
+ /** Slug of the parent tag or category. Omitted for root tags. Normal tags nest one level beneath another normal tag; categories nest up to three levels deep. */
3499
+ parent?: string;
3441
3500
  /** Allowed color tokens for color marks (text and background; background reuses this enum). Named colors are fixed palette keys. `$*` tokens are semantic: resolved from the published sites customization when rendering; authors may still persist them in content when valid. */
3442
3501
  color: DocumentTextColor;
3443
3502
  } & ({
@@ -3469,7 +3528,7 @@ export interface RevisionBase {
3469
3528
  pages: RevisionPage[];
3470
3529
  files: RevisionFile[];
3471
3530
  reusableContents: RevisionReusableContent[];
3472
- /** List of available tags within this revision */
3531
+ /** Tags and categories in hierarchy order: parents before children, sibling categories by manual position, then normal tags by manual position inside a parent and by label at the top level */
3473
3532
  tags: RevisionTag[];
3474
3533
  variables?: Variables;
3475
3534
  /** When the revision was created. */
@@ -3819,7 +3878,10 @@ export interface ChangeRequestReview {
3819
3878
  };
3820
3879
  }
3821
3880
  /** Exact review totals for the applied filters, independent of pagination. Keyed by review status, with a count of zero for a status nobody used. */
3822
- export type ChangeRequestReviewStats = Record<ChangeRequestReviewStatus, number>;
3881
+ export interface ChangeRequestReviewStats {
3882
+ approved: number;
3883
+ "changes-requested": number;
3884
+ }
3823
3885
  export interface Team {
3824
3886
  /** Type of Object, always equals to "team" */
3825
3887
  object: "team";
@@ -3959,7 +4021,7 @@ export type ChangeRequestContentChangeUpdatePage = RevisionPageUpdate & {
3959
4021
  operation: "update_page";
3960
4022
  /** ID of the page to update. */
3961
4023
  page: string;
3962
- /** New document for the page. When provided as markdown, its frontmatter is read to update the page metadata. Omit to update only the metadata fields. */
4024
+ /** New document for the page. When provided as markdown, its frontmatter is read to update the page metadata. A `tags` list replaces the page's tags; each must be an existing tag slug in the space. Omit to update only the metadata fields. */
3963
4025
  document?: Document;
3964
4026
  /** Move the page to be a child of this page ID. Set to `null` to move it to the root of the page tree. Omit to leave the page's parent unchanged. The target cannot be the page itself or one of its own descendants. */
3965
4027
  into?: string | null;
@@ -3990,7 +4052,7 @@ export type ChangeRequestContentChangeInsertPage = RevisionPageUpdate & {
3990
4052
  * @maxLength 255
3991
4053
  */
3992
4054
  stableKey?: string;
3993
- /** Document for the new page. When provided as markdown, its frontmatter is read to set the page metadata. */
4055
+ /** Document for the new page. When provided as markdown, its frontmatter is read to set the page metadata, including its `tags` (existing tag slugs in the space). */
3994
4056
  document: Document;
3995
4057
  };
3996
4058
  /**
@@ -4172,12 +4234,12 @@ export interface ChangeRequestContentChangeDeleteVariable {
4172
4234
  variable: VariableName;
4173
4235
  }
4174
4236
  /**
4175
- * Display label of a tag.
4237
+ * Display label of a tag or category.
4176
4238
  * @minLength 1
4177
4239
  * @maxLength 50
4178
4240
  */
4179
4241
  export type RevisionTagLabel = string;
4180
- /** Create flat tags in array order. The batch is rejected atomically if any tag is invalid. */
4242
+ /** Create normal tags and categories in array order. Parents must exist or appear earlier in the array. The batch is rejected atomically if any tag is invalid. Kind cannot be changed through an update or a delete-and-reinsert within the same batch. After deletion in an earlier request, the slug can be reused for a new definition. */
4181
4243
  export interface ChangeRequestContentChangeInsertTags {
4182
4244
  operation: "insert_tags";
4183
4245
  /**
@@ -4190,7 +4252,8 @@ export interface ChangeRequestContentChangeInsertTags {
4190
4252
  * @minLength 1
4191
4253
  */
4192
4254
  slug?: string;
4193
- /** Display label of a tag. */
4255
+ kind?: "category";
4256
+ /** Display label of a tag or category. */
4194
4257
  label: RevisionTagLabel;
4195
4258
  /** Allowed color tokens for color marks (text and background; background reuses this enum). Named colors are fixed palette keys. `$*` tokens are semantic: resolved from the published sites customization when rendering; authors may still persist them in content when valid. */
4196
4259
  color?: DocumentTextColor;
@@ -4198,17 +4261,24 @@ export interface ChangeRequestContentChangeInsertTags {
4198
4261
  icon?: Icon;
4199
4262
  /** Unicode codepoint or character of the emoji */
4200
4263
  emoji?: Emoji;
4264
+ /** Parent category or normal tag slug. Null places the tag at the root. */
4265
+ parent?: string | null;
4266
+ /**
4267
+ * Zero-based position among siblings of the same kind (categories, or tags inside a category or parent tag). Top-level tags sort by label and take no position; omit to append when moving to another parent.
4268
+ * @min 0
4269
+ */
4270
+ at?: number;
4201
4271
  }[];
4202
4272
  }
4203
- /** Rename or restyle an existing tag. The slug is immutable. */
4273
+ /** Rename, restyle, reparent or reorder an existing tag or category. Moving a parent keeps all descendants attached. Kind cannot be changed. */
4204
4274
  export interface ChangeRequestContentChangeUpdateTag {
4205
4275
  operation: "update_tag";
4206
4276
  /**
4207
- * Slug of the tag to update.
4277
+ * Slug of the tag or category to update.
4208
4278
  * @minLength 1
4209
4279
  */
4210
4280
  tag: string;
4211
- /** Display label of a tag. */
4281
+ /** Display label of a tag or category. */
4212
4282
  label?: RevisionTagLabel;
4213
4283
  /** Allowed color tokens for color marks (text and background; background reuses this enum). Named colors are fixed palette keys. `$*` tokens are semantic: resolved from the published sites customization when rendering; authors may still persist them in content when valid. */
4214
4284
  color?: DocumentTextColor;
@@ -4216,8 +4286,15 @@ export interface ChangeRequestContentChangeUpdateTag {
4216
4286
  icon?: Icon | null;
4217
4287
  /** Emoji to set. Null removes the emoji; omission preserves it. */
4218
4288
  emoji?: Emoji | null;
4289
+ /** Parent category or normal tag slug. Null places the tag at the root. */
4290
+ parent?: string | null;
4291
+ /**
4292
+ * Zero-based position among siblings of the same kind (categories, or tags inside a category or parent tag). Top-level tags sort by label and take no position; omit to append when moving to another parent.
4293
+ * @min 0
4294
+ */
4295
+ at?: number;
4219
4296
  }
4220
- /** Delete an existing tag definition. Page and block references remain in content but stop resolving. */
4297
+ /** Delete an empty category or a normal tag. A normal tag's children are reparented to its parent. Page and block references to the deleted tag stop resolving. */
4221
4298
  export interface ChangeRequestContentChangeDeleteTag {
4222
4299
  operation: "delete_tag";
4223
4300
  /** @minLength 1 */
@@ -4408,6 +4485,10 @@ export interface RevisionSemanticChangeReusableContentEdited {
4408
4485
  export interface ChangedRevisionTag {
4409
4486
  slug: string;
4410
4487
  label: string;
4488
+ /** Present for categories; omitted for normal tags. */
4489
+ kind?: "category";
4490
+ /** Parent tag or category slug. Omitted for root tags. */
4491
+ parent?: string;
4411
4492
  }
4412
4493
  export interface RevisionSemanticChangeTagCreated {
4413
4494
  type: "tag_created";
@@ -4419,6 +4500,22 @@ export interface RevisionSemanticChangeTagDeleted {
4419
4500
  }
4420
4501
  export interface RevisionTagChangeAttributes {
4421
4502
  label?: ChangeAttributeString;
4503
+ kind?: ChangeAttributeString;
4504
+ parent?: ChangeAttributeString;
4505
+ orderIndex?: ChangeAttributeString;
4506
+ color?: ChangeAttributeString;
4507
+ icon?: {
4508
+ /** Name of the icon */
4509
+ before?: Icon;
4510
+ /** Name of the icon */
4511
+ after?: Icon;
4512
+ };
4513
+ emoji?: {
4514
+ /** Unicode codepoint or character of the emoji */
4515
+ before?: Emoji;
4516
+ /** Unicode codepoint or character of the emoji */
4517
+ after?: Emoji;
4518
+ };
4422
4519
  }
4423
4520
  export interface RevisionSemanticChangeTagEdited {
4424
4521
  type: "tag_edited";
@@ -4734,8 +4831,12 @@ export interface Organization {
4734
4831
  defaultRole?: MemberRoleOrGuest;
4735
4832
  /** The default content for the organization */
4736
4833
  defaultContent?: OrganizationDefaultContent;
4737
- /** Whether SSO is enforced organization-wide */
4834
+ /** Whether SSO is enforced organization-wide. Requires an active SAML provider and at least one organization admin linked through SSO. */
4738
4835
  sso?: boolean;
4836
+ /** Whether Enforce SSO is turned on, regardless of whether its requirements are met. */
4837
+ ssoPreference?: boolean;
4838
+ /** Whether Enforce SSO applies to the current user, because one of the organization's SAML providers can sign in their email. Members no provider can sign in keep their other sign-in methods. */
4839
+ ssoRequired?: boolean;
4739
4840
  /** If true, the organization is configured to use all our AI features. */
4740
4841
  ai?: boolean;
4741
4842
  /** Whether the master AI setting is turned on, regardless of plan availability. Contract overrides forcing AI off take precedence. */
@@ -5304,6 +5405,8 @@ export interface Site {
5304
5405
  /** Can the user edit the adaptive schema of the site. */
5305
5406
  editAdaptiveSchema: boolean;
5306
5407
  };
5408
+ /** Whether visitors can preview change requests and historical revisions on the published site. Previews inside GitBook are not affected. */
5409
+ publicChangeRequestPreviews: boolean;
5307
5410
  /** Whether the site is live or not. If true, the site is accessible to the audience defined by the visibility setting. */
5308
5411
  published: boolean;
5309
5412
  siteSpaces: number;
@@ -5682,6 +5785,13 @@ export interface ContentKitRenderOutputComplete {
5682
5785
  }
5683
5786
  /** Output of the integration when rendering a UI. */
5684
5787
  export type ContentKitRenderOutput = ContentKitRenderOutputElement | ContentKitRenderOutputComplete;
5788
+ export interface Error {
5789
+ error: {
5790
+ /** @format int32 */
5791
+ code: number;
5792
+ message: string;
5793
+ };
5794
+ }
5685
5795
  /** Common properties for ContentKit context. */
5686
5796
  export interface ContentKitContextBase {
5687
5797
  theme: "dark" | "light";
@@ -6244,6 +6354,12 @@ export interface InviteUsersToOrganization {
6244
6354
  })[];
6245
6355
  /** Default role to set on newly invited members. */
6246
6356
  role?: MemberRoleOrGuest;
6357
+ /**
6358
+ * Teams to add the invitees to as Members, preserving existing team roles. The caller must be an owner of every team or an organization admin. Team-owner email invitations require acceptance before granting organization Guest and team Member access, including when the recipient already belongs to the organization. Existing roles are preserved. Granting an organization role or SSO access requires an organization admin.
6359
+ * @minItems 1
6360
+ * @uniqueItems true
6361
+ */
6362
+ teamIds?: EntityId[];
6247
6363
  /** If true, invites the user as an SSO user of the organization. Defaults to false. */
6248
6364
  sso?: boolean;
6249
6365
  }
@@ -6283,6 +6399,15 @@ export interface InviteLinkToOrganization {
6283
6399
  role: MemberRoleOrGuest;
6284
6400
  /** An invite is redundant if the requesting user already has all necessary permissions. */
6285
6401
  redundant: boolean;
6402
+ /** Details shown to the recipient before accepting a team invitation. */
6403
+ teamInvitation?: {
6404
+ /** Display name of the person who sent the invitation. */
6405
+ inviter: string;
6406
+ teams: {
6407
+ id: string;
6408
+ title: string;
6409
+ }[];
6410
+ };
6286
6411
  }
6287
6412
  export interface CreateInviteToOrganization {
6288
6413
  /** The role of the member in the organization */
@@ -6698,6 +6823,19 @@ export type SAMLProviderLabel = string;
6698
6823
  export type SAMLProviderEntityID = string;
6699
6824
  /** @maxLength 10000 */
6700
6825
  export type SAMLProviderCertificate = string;
6826
+ /** Role given to people on their first sign-in through the provider. null adds them as guests, "default" uses the organization's default role, and "domain" uses the role of the verified email domain they signed in with. */
6827
+ export type SAMLProviderDefaultRole = MemberRole | null | "default" | "domain";
6828
+ /** An email domain of a SAML provider, with its verification state in the organization. */
6829
+ export interface SAMLProviderDomain {
6830
+ domain: string;
6831
+ /**
6832
+ * State of a SAML provider's email domain in the organization.
6833
+ * - `verified`: People with an email on this domain can sign in through the provider.
6834
+ * - `pending`, `error`, `legacy`: The domain isn't verified yet, so it doesn't let anyone sign in.
6835
+ * - `removed`: The organization no longer has this domain.
6836
+ */
6837
+ status: SAMLProviderDomainStatus;
6838
+ }
6701
6839
  export interface OrganizationSAMLProvider {
6702
6840
  /** Type of Object, always equals to "saml-provider" */
6703
6841
  object: "saml-provider";
@@ -6708,8 +6846,10 @@ export interface OrganizationSAMLProvider {
6708
6846
  entityID: SAMLProviderEntityID;
6709
6847
  certificate: SAMLProviderCertificate;
6710
6848
  defaultTeam?: OrganizationTeam;
6711
- /** The role of a member in an organization, null for guests */
6712
- defaultRole: MemberRoleOrGuest;
6849
+ /** Whether people join the team of the verified email domain they signed in with, instead of `defaultTeam`. */
6850
+ defaultTeamFromDomain?: boolean;
6851
+ /** Role given to people on their first sign-in through the provider. null adds them as guests, "default" uses the organization's default role, and "domain" uses the role of the verified email domain they signed in with. */
6852
+ defaultRole: SAMLProviderDefaultRole;
6713
6853
  /** Date at which the provider was created. */
6714
6854
  createdAt: Timestamp;
6715
6855
  /**
@@ -6718,6 +6858,8 @@ export interface OrganizationSAMLProvider {
6718
6858
  * - `pending`: The provider is pending and is not yet fully configured.
6719
6859
  */
6720
6860
  status: SAMLProviderStatus;
6861
+ /** Email domains the provider signs people in for. Absent on providers created before domains existed, which accept any email. */
6862
+ domains?: SAMLProviderDomain[];
6721
6863
  /** Metadata about the service provider. */
6722
6864
  service: {
6723
6865
  /**
@@ -6741,6 +6883,12 @@ export interface OrganizationSAMLProvider {
6741
6883
  location: string;
6742
6884
  };
6743
6885
  }
6886
+ /**
6887
+ * Email domains the provider signs people in for. Each one must be an email domain of the organization. Only emails on a verified domain in this list can sign in through the provider.
6888
+ * @maxItems 50
6889
+ * @uniqueItems true
6890
+ */
6891
+ export type SAMLProviderDomains = string[];
6744
6892
  /** Role given to people who join through the domain. "default" uses the organization's default role, and "guest" adds them as guests. */
6745
6893
  export type OrganizationDomainDefaultRole = MemberRole | "default" | "guest";
6746
6894
  /** An email domain of an organization. */
@@ -7390,6 +7538,8 @@ export type GitSyncInstallation = GitSyncInstallationSetup & {
7390
7538
  createdAt: Timestamp;
7391
7539
  /** Identifier of the user who created the installation. */
7392
7540
  createdBy: string;
7541
+ /** Identifier of the user who connected the Git provider credentials. Only this user can browse repositories or change the repository and branch with them. Null when it is unknown, for credentials connected before it was recorded, until someone reconnects the provider. */
7542
+ authorizedBy: string | null;
7393
7543
  updatedAt: Timestamp;
7394
7544
  /** URLs associated with the installation */
7395
7545
  urls: {
@@ -7400,13 +7550,6 @@ export type GitSyncInstallation = GitSyncInstallationSetup & {
7400
7550
  location: string;
7401
7551
  };
7402
7552
  };
7403
- export interface Error {
7404
- error: {
7405
- /** @format int32 */
7406
- code: number;
7407
- message: string;
7408
- };
7409
- }
7410
7553
  /** Groups of countries exposed to adaptive content as `visitor.region`. The key of each entry is the region name; `visitor.region` is undefined for a visitor whose country is in none of the regions. A site can declare at most 10 regions. */
7411
7554
  export type SiteAdaptiveRegions = Record<any, {
7412
7555
  /** ISO 3166-1 alpha-2 codes of the countries in the region. */
@@ -7994,6 +8137,16 @@ export interface SearchRecordResult {
7994
8137
  */
7995
8138
  url: string;
7996
8139
  }
8140
+ /** Short-lived credential that lets a published site's visitor call the site search operation directly. It is opaque, accepted only by that operation for one site, and expires within five minutes. */
8141
+ export interface SiteSearchPass {
8142
+ /** Credential to send as a bearer token in the Authorization header. */
8143
+ token: string;
8144
+ /**
8145
+ * When the credential expires.
8146
+ * @format date-time
8147
+ */
8148
+ expiresAt: string;
8149
+ }
7997
8150
  /**
7998
8151
  * The end goal the agent is trying to accomplish on behalf of the user. Unlike the immediate query, the goal describes the broader task or outcome the agent is working towards.
7999
8152
  * @maxLength 1024
@@ -8445,6 +8598,36 @@ export interface SiteQuestionStatsVisitorTypes {
8445
8598
  bot: number;
8446
8599
  unknown: number;
8447
8600
  }
8601
+ /** Count of answers by the intent of their question. `unlabelled` counts questions not labelled yet. */
8602
+ export interface SiteQuestionStatsIntents {
8603
+ "can-it": number;
8604
+ "how-to": number;
8605
+ "how-it-works": number;
8606
+ details: number;
8607
+ troubleshoot: number;
8608
+ pricing: number;
8609
+ trust: number;
8610
+ fit: number;
8611
+ other: number;
8612
+ unlabelled: number;
8613
+ }
8614
+ /** Count of answers by what the site said about the main thing asked. `unlabelled` counts answers not labelled yet. */
8615
+ export interface SiteQuestionStatsSiteSaid {
8616
+ covered: number;
8617
+ limited: number;
8618
+ unsupported: number;
8619
+ "no-answer": number;
8620
+ "needs-support": number;
8621
+ unlabelled: number;
8622
+ }
8623
+ /** Count of answers by who should act on them (see `SiteQuestionEscalation`). `unlabelled` counts answers that cannot be escalated until their question and answer are labelled. */
8624
+ export interface SiteQuestionStatsEscalations {
8625
+ docs: number;
8626
+ team: number;
8627
+ support: number;
8628
+ none: number;
8629
+ unlabelled: number;
8630
+ }
8448
8631
  /** Aggregated stats for questions and linked answers. */
8449
8632
  export interface SiteQuestionStats {
8450
8633
  /** Total count of questions included in the aggregation. */
@@ -8463,6 +8646,14 @@ export interface SiteQuestionStats {
8463
8646
  channels: SiteQuestionStatsChannels;
8464
8647
  /** Count of answers by visitor type. */
8465
8648
  visitorTypes: SiteQuestionStatsVisitorTypes;
8649
+ /** Count of answers by the intent of their question. `unlabelled` counts questions not labelled yet. */
8650
+ intents: SiteQuestionStatsIntents;
8651
+ /** Count of answers by what the site said about the main thing asked. `unlabelled` counts answers not labelled yet. */
8652
+ siteSaid: SiteQuestionStatsSiteSaid;
8653
+ /** Count of answers by who should act on them (see `SiteQuestionEscalation`). `unlabelled` counts answers that cannot be escalated until their question and answer are labelled. */
8654
+ escalations: SiteQuestionStatsEscalations;
8655
+ /** Count of distinct goals agents gave with the answers. */
8656
+ goals: number;
8466
8657
  /**
8467
8658
  * Weekly count of related question answers for the past 3 months.
8468
8659
  * @maxItems 13
@@ -8478,6 +8669,8 @@ export interface SiteQuestion {
8478
8669
  question: string;
8479
8670
  /** Type classification of the user question. */
8480
8671
  type: SiteQuestionType;
8672
+ /** What the person was asking for; `null` until the question is labelled. */
8673
+ intent: SiteQuestionIntent | null;
8481
8674
  createdAt: Timestamp;
8482
8675
  askedAt: Timestamp;
8483
8676
  /** Aggregated stats for questions and linked answers. */
@@ -8887,6 +9080,24 @@ export interface SiteQuestionTimelineBucket {
8887
9080
  export interface SiteQuestionTimeline {
8888
9081
  items: SiteQuestionTimelineBucket[];
8889
9082
  }
9083
+ /** A distinct goal AI agents gave when asking a site's questions: the task they were working on for someone. Agents giving the same goal in the same words share one goal. */
9084
+ export interface SiteGoal {
9085
+ object: "site-goal";
9086
+ /** The ID of the site goal. */
9087
+ id: string;
9088
+ /** The goal as the first agent to give it wrote it. */
9089
+ goal: string;
9090
+ createdAt: Timestamp;
9091
+ /** Activity of the goal within the requested filters. */
9092
+ stats: {
9093
+ /** Count of distinct questions agents asked with this goal. */
9094
+ questions: number;
9095
+ /** Count of answers given to questions asked with this goal. */
9096
+ answers: number;
9097
+ /** When a question was last asked with this goal. */
9098
+ askedAt: Timestamp;
9099
+ };
9100
+ }
8890
9101
  export interface SiteQuestionAnswer {
8891
9102
  object: "site-question-answer";
8892
9103
  /** The ID of the site question answer. */
@@ -10263,10 +10474,12 @@ export interface SiteInsightsQueryEventsAggregation {
10263
10474
  * @default 1000
10264
10475
  */
10265
10476
  limit?: number;
10477
+ /** The `next.page` value of a previous result, to fetch the rows that follow it. Send the rest of the query unchanged. Relative ranges stay fixed to the time of the first page, but events recorded while paging can still move rows between pages. */
10478
+ page?: string;
10266
10479
  }
10267
- export interface SiteInsightsQueryEventsAggregationResult {
10480
+ export type SiteInsightsQueryEventsAggregationResult = List & {
10268
10481
  columns: SiteInsightsQueryEventsValues[];
10269
- }
10482
+ };
10270
10483
  /** A segment of visitors with the same characteristics. */
10271
10484
  export interface SiteInsightsVisitorSegment {
10272
10485
  /** The title of the visitor profile. */
@@ -10445,6 +10658,26 @@ export interface CustomHostname {
10445
10658
  location: string;
10446
10659
  };
10447
10660
  }
10661
+ /** The browser's answer to the passkey sign-in options (AuthenticationResponseJSON). */
10662
+ export interface PasskeyAuthenticationResponse {
10663
+ id: string;
10664
+ rawId: string;
10665
+ type: "public-key";
10666
+ response: {
10667
+ clientDataJSON: string;
10668
+ authenticatorData: string;
10669
+ signature: string;
10670
+ userHandle?: string;
10671
+ };
10672
+ clientExtensionResults: Record<string, any>;
10673
+ authenticatorAttachment?: "platform" | "cross-platform";
10674
+ }
10675
+ /** WebAuthn options for signing in with a passkey (PublicKeyCredentialRequestOptionsJSON), to pass unchanged to the browser. */
10676
+ export interface PasskeySignInOptions {
10677
+ /** Single-use challenge the passkey must sign. */
10678
+ challenge: string;
10679
+ [key: string]: any;
10680
+ }
10448
10681
  export interface UnsplashImage {
10449
10682
  kind: "unsplash_image";
10450
10683
  id: string;
@@ -13646,7 +13879,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13646
13879
  computed?: boolean;
13647
13880
  }, params?: RequestParams) => Promise<HttpResponse<Revision, any>>;
13648
13881
  /**
13649
- * @description Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, rename, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request. **Renaming a page** — `update_page` can change a page's `title` and/or its `slug` (the path segment used to build its URL within its current parent). Both fields are independent: to rename only the title without changing the URL, set `title` and omit `slug`; to change the URL without changing the title, set `slug` and omit `title`. **Moving a page** — `update_page` can also change a page's parent and/or its position among siblings with `into`/`at`. Set `into` to the new parent's page ID, or `null` to move the page to the root of the tree; omit `into` to leave the parent unchanged. Set `at` to place the page at a specific zero-based index among its new siblings; omit it to leave the position unchanged (when the parent isn't changing) or append at the end (when it is). A page cannot be moved under itself or one of its own descendants. `insert_page`'s `into`/`at` remain the way to place a **new** page at creation time. **Tags**: create flat tag definitions with `insert_tags` and a `tags` array of 1-50 entries, edit their label or appearance with `update_tag`, and remove definitions with `delete_tag`. Slugs are immutable and generated from the label when omitted on insertion. Operations apply in order, so later updates or deletions can target newly inserted tags. Set `icon` or `emoji` to `null` to clear that field; omission preserves it. A non-null icon takes precedence over a non-null emoji. Deleting a tag leaves references in content unresolved. For example: `{"changes":[{"operation":"insert_tags","tags":[{"label":"Beta"}]}, {"operation":"update_tag","tag":"beta","color":"blue"}]}`. To put an image or attachment in a page, upload it with an `insert_files` change. Give the file a `ref` and a page inserted in the same batch can reference it as `![Alt](./<ref>)` or `[File](./<ref>)`, which resolves to the file's ID at apply time regardless of operation order. Uploaded files are also listed as `insertedFiles` when `compat=false`, and a file already in the change request can be referenced directly as `/files/<fileId>`. Inline `data:` URIs in markdown are not ingested and large image blocks are dropped, so upload the bytes with `insert_files` instead. **Reusable content** (snippets shared by several pages, Git Sync's `.gitbook/includes/`) is created with `insert_reusable_contents`, changed with `update_reusable_content` and removed with `delete_reusable_content`. A page includes one in markdown as `{% include "/reusable-content/<reusableContentId>" %}`; give a new one a `ref` and a page in the same batch can include it as `{% include "./<ref>" %}`, regardless of operation order. Created reusable contents are listed as `insertedReusableContents` when `compat=false`. An update keeps the ID, so every page including it shows the change. Deleting one leaves the includes in pages unresolved, as in the editor: remove them from those pages too. Reusable content cannot include other reusable content, so an include in its document is dropped. Unlike a link, an include that matches no reusable content of the change request (or of the batch) rejects the batch, since dropping it would remove it from the page silently. **Variables** (space variables, Git Sync's `.gitbook/vars.yaml`) are created with `insert_variables`, changed with `update_variable` and removed with `delete_variable`. A variable is identified by its name, which content references as an expression: `<code class="expression">space.vars.<name></code>` in markdown. Inserting a name the change request already uses, or updating or deleting one it does not, rejects the batch. Deleting a variable keeps the expressions referencing it, as in the editor: remove them from those pages too. A page's own variables (`page.vars.<name>`) are set with `insert_page`/`update_page`'s `variables`, or the `vars` frontmatter of a markdown document, which replace all of that page's variables. To change one of them without resending the rest, give `insert_variables`, `update_variable` or `delete_variable` a `page`; the same rules apply to that page's variables. **Publishing an OpenAPI spec** — an OpenAPI spec belongs to the organization (see `createOpenAPISpec`) and appears in a space only through a page that renders it. Insert that page with an `insert_computed_page` change: `{ "operation": "insert_computed_page", "title": "API reference", "computed": { "type": "builtin:openapi", "props": { "models": true }, "dependencies": { "spec": { "ref": { "kind": "openapi", "spec": "<spec slug>" } } } } }`. GitBook replaces that page, at its position, with the API reference: one page per tag (or per operation with `"grouping": "by-operation"` in `props`), plus a models page when `models` is true, regenerated whenever the spec changes. Use `into` to nest the reference under an existing page. Do not recreate a spec with `insert_page`: `openapi-operation` blocks in a document only render the operations they name. When page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by: - Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`). - Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>` for a nested page (e.g. `/pages/guides/getting-started`). - Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page, or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is `/pages/README.md`. - Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`, `../other.md`, or `../README.md` (the parent page). Folder-style links without an extension (e.g. `./section`) resolve to that folder's page. External URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail. GitBook normalizes submitted content, so the stored page may differ from what was sent. To help callers reconcile local state with the stored result, the response can list each created and modified page with its resolved ID and a `urls.location` to fetch the page's persisted content. For change requests with frequent concurrent edits, consider `expectedRevision` to protect against overwriting changes made since your read. If the branch has changed since the supplied revision, the batch is rejected with HTTP 409 and none of the submitted changes are applied. **Response shape (`compat`)** — this endpoint is changing what it returns: - `compat=true` (current default) returns the updated change request, matching the endpoint's original behavior. - `compat=false` returns the updated change request **and** the list of affected pages (see the response schema). The default is `true` for now to preserve backwards compatibility, but **will switch to `false` in a future release**, at which point the affected-page list is always included. You should pass `compat=false` if you want the new behavior today and avoid unexpected errors when the default flips in the future.
13882
+ * @description Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, rename, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request. **Renaming a page** — `update_page` can change a page's `title` and/or its `slug` (the path segment used to build its URL within its current parent). Both fields are independent: to rename only the title without changing the URL, set `title` and omit `slug`; to change the URL without changing the title, set `slug` and omit `title`. **Moving a page** — `update_page` can also change a page's parent and/or its position among siblings with `into`/`at`. Set `into` to the new parent's page ID, or `null` to move the page to the root of the tree; omit `into` to leave the parent unchanged. Set `at` to place the page at a specific zero-based index among its new siblings; omit it to leave the position unchanged (when the parent isn't changing) or append at the end (when it is). A page cannot be moved under itself or one of its own descendants. `insert_page`'s `into`/`at` remain the way to place a **new** page at creation time. **Tags and categories**: create with `insert_tags` using a `tags` array (1-50 entries), change appearance or placement with `update_tag`, and delete with `delete_tag`. A category (`kind: category`) must be empty before deletion and cannot be assigned to pages or blocks. Categories nest up to three levels deep; normal tags nest one level under other normal tags. Deleting a normal tag reparents its children to its parent. Changes apply in order, so newly created tags can be used by later changes, including page frontmatter. Tags within an insert apply in array order; create parents before children. For example: `{"changes":[{"operation":"insert_tags","tags":[{"label":"Products","slug":"products","kind":"category"}, {"label":"Autonomous DEM","slug":"autonomous-dem","parent":"products"}, {"label":"Core","slug":"core","parent":"autonomous-dem"}]}]}`. To put an image or attachment in a page, upload it with an `insert_files` change. Give the file a `ref` and a page inserted in the same batch can reference it as `![Alt](./<ref>)` or `[File](./<ref>)`, which resolves to the file's ID at apply time regardless of operation order. Uploaded files are also listed as `insertedFiles` when `compat=false`, and a file already in the change request can be referenced directly as `/files/<fileId>`. Inline `data:` URIs in markdown are not ingested and large image blocks are dropped, so upload the bytes with `insert_files` instead. **Reusable content** (snippets shared by several pages, Git Sync's `.gitbook/includes/`) is created with `insert_reusable_contents`, changed with `update_reusable_content` and removed with `delete_reusable_content`. A page includes one in markdown as `{% include "/reusable-content/<reusableContentId>" %}`; give a new one a `ref` and a page in the same batch can include it as `{% include "./<ref>" %}`, regardless of operation order. Created reusable contents are listed as `insertedReusableContents` when `compat=false`. An update keeps the ID, so every page including it shows the change. Deleting one leaves the includes in pages unresolved, as in the editor: remove them from those pages too. Reusable content cannot include other reusable content, so an include in its document is dropped. Unlike a link, an include that matches no reusable content of the change request (or of the batch) rejects the batch, since dropping it would remove it from the page silently. **Variables** (space variables, Git Sync's `.gitbook/vars.yaml`) are created with `insert_variables`, changed with `update_variable` and removed with `delete_variable`. A variable is identified by its name, which content references as an expression: `<code class="expression">space.vars.<name></code>` in markdown. Inserting a name the change request already uses, or updating or deleting one it does not, rejects the batch. Deleting a variable keeps the expressions referencing it, as in the editor: remove them from those pages too. A page's own variables (`page.vars.<name>`) are set with `insert_page`/`update_page`'s `variables`, or the `vars` frontmatter of a markdown document, which replace all of that page's variables. To change one of them without resending the rest, give `insert_variables`, `update_variable` or `delete_variable` a `page`; the same rules apply to that page's variables. **Publishing an OpenAPI spec** — an OpenAPI spec belongs to the organization (see `createOpenAPISpec`) and appears in a space only through a page that renders it. Insert that page with an `insert_computed_page` change: `{ "operation": "insert_computed_page", "title": "API reference", "computed": { "type": "builtin:openapi", "props": { "models": true }, "dependencies": { "spec": { "ref": { "kind": "openapi", "spec": "<spec slug>" } } } } }`. GitBook replaces that page, at its position, with the API reference: one page per tag (or per operation with `"grouping": "by-operation"` in `props`), plus a models page when `models` is true, regenerated whenever the spec changes. Use `into` to nest the reference under an existing page. Do not recreate a spec with `insert_page`: `openapi-operation` blocks in a document only render the operations they name. When page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by: - Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`). - Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>` for a nested page (e.g. `/pages/guides/getting-started`). - Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page, or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is `/pages/README.md`. - Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`, `../other.md`, or `../README.md` (the parent page). Folder-style links without an extension (e.g. `./section`) resolve to that folder's page. External URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail. GitBook normalizes submitted content, so the stored page may differ from what was sent. To help callers reconcile local state with the stored result, the response can list each created and modified page with its resolved ID and a `urls.location` to fetch the page's persisted content. For change requests with frequent concurrent edits, consider `expectedRevision` to protect against overwriting changes made since your read. If the branch has changed since the supplied revision, the batch is rejected with HTTP 409 and none of the submitted changes are applied. **Response shape (`compat`)** — this endpoint is changing what it returns: - `compat=true` (current default) returns the updated change request, matching the endpoint's original behavior. - `compat=false` returns the updated change request **and** the list of affected pages (see the response schema). The default is `true` for now to preserve backwards compatibility, but **will switch to `false` in a future release**, at which point the affected-page list is always included. You should pass `compat=false` if you want the new behavior today and avoid unexpected errors when the default flips in the future.
13650
13883
  *
13651
13884
  * @tags change-request-content
13652
13885
  * @name UpdateChangeRequestContent
@@ -15055,7 +15288,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15055
15288
  */
15056
15289
  disableIntegrationDevelopmentMode: (integrationName: string, params?: RequestParams) => Promise<HttpResponse<void, any>>;
15057
15290
  /**
15058
- * No description
15291
+ * @description Declared integration input errors return 422. Integration connection or configuration failures return 424, independently of the caller's GitBook authentication. Invalid or failing integration responses return 502. Transport failures remain 5xx. Failed actions are not automatically retried.
15059
15292
  *
15060
15293
  * @tags integrations
15061
15294
  * @name RenderIntegrationUiWithGet
@@ -15066,9 +15299,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15066
15299
  renderIntegrationUiWithGet: (integrationName: string, query: {
15067
15300
  /** LZ-string compressed JSON request */
15068
15301
  request: string;
15069
- }, params?: RequestParams) => Promise<HttpResponse<ContentKitRenderOutput, any>>;
15302
+ }, params?: RequestParams) => Promise<HttpResponse<ContentKitRenderOutput, Error>>;
15070
15303
  /**
15071
- * No description
15304
+ * @description Declared integration input errors return 422. Integration connection or configuration failures return 424, independently of the caller's GitBook authentication. Invalid or failing integration responses return 502. Transport failures remain 5xx. Failed actions are not automatically retried.
15072
15305
  *
15073
15306
  * @tags integrations
15074
15307
  * @name RenderIntegrationUiWithPost
@@ -15076,7 +15309,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15076
15309
  * @request POST:/integrations/{integrationName}/render
15077
15310
  * @secure
15078
15311
  */
15079
- renderIntegrationUiWithPost: (integrationName: string, data: RenderIntegrationUI, params?: RequestParams) => Promise<HttpResponse<ContentKitRenderOutput, any>>;
15312
+ renderIntegrationUiWithPost: (integrationName: string, data: RenderIntegrationUI, params?: RequestParams) => Promise<HttpResponse<ContentKitRenderOutput, Error>>;
15080
15313
  /**
15081
15314
  * No description
15082
15315
  *
@@ -15558,7 +15791,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15558
15791
  };
15559
15792
  }>>;
15560
15793
  /**
15561
- * @description Lists recorded changes for an activated organization. Access is restricted to organization administrators and GitBook staff, and results are ordered by occurrence time, newest first. An active Enterprise plan is required except for GitBook's own organization.
15794
+ * @description Lists recorded changes for an activated organization. Access is restricted to organization administrators and GitBook staff, and results are ordered by occurrence time, newest first. An active Enterprise plan is required except for GitBook's own organization. Only events from the latest 365 days are available, including in counts and facets.
15562
15795
  *
15563
15796
  * @tags organizations
15564
15797
  * @name ListOrganizationAuditEvents
@@ -15577,7 +15810,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15577
15810
  */
15578
15811
  limit?: number;
15579
15812
  /**
15580
- * Include events occurring at or after this time.
15813
+ * Include events occurring at or after this time, within the latest 365 days.
15581
15814
  * @format date-time
15582
15815
  */
15583
15816
  from?: string;
@@ -15636,7 +15869,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15636
15869
  };
15637
15870
  }>>;
15638
15871
  /**
15639
- * @description Returns the full allowlisted payload for one recorded organization change. Access is restricted to organization administrators and GitBook staff. The organization must be activated and on an active Enterprise plan, except for GitBook's own organization.
15872
+ * @description Returns the full allowlisted payload for one recorded organization change. Access is restricted to organization administrators and GitBook staff. The organization must be activated and on an active Enterprise plan, except for GitBook's own organization. Events older than 365 days are unavailable and return 404.
15640
15873
  *
15641
15874
  * @tags organizations
15642
15875
  * @name GetOrganizationAuditEvent
@@ -15976,7 +16209,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15976
16209
  */
15977
16210
  deleteMemberFromOrganizationTeamById: (organizationId: EntityId, teamId: EntityId, userId: string, params?: RequestParams) => Promise<HttpResponse<void, any>>;
15978
16211
  /**
15979
- * No description
16212
+ * @description Optionally adds invitees to teams using teamIds. Team owners may invite organization Guests into teams they own. Other organization invitations require an organization admin.
15980
16213
  *
15981
16214
  * @tags organization-invites
15982
16215
  * @name InviteUsersToOrganization
@@ -15988,7 +16221,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15988
16221
  users: string[];
15989
16222
  /** The number of users who were added to the organization */
15990
16223
  invited: number;
16224
+ /** @deprecated */
15991
16225
  failedSSOEmails?: string[];
16226
+ /** Addresses awaiting acceptance of a team-owner invitation. Every requested address follows this flow, regardless of account existence or organization membership. No access is granted until acceptance. */
16227
+ pendingConsentEmails?: string[];
16228
+ /** Email addresses that must be verified before their existing accounts can be invited. */
16229
+ unverifiedEmails?: string[];
15992
16230
  }, {
15993
16231
  error: {
15994
16232
  /** @format int32 */
@@ -16409,8 +16647,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
16409
16647
  certificate?: SAMLProviderCertificate;
16410
16648
  ssoURL?: URL;
16411
16649
  defaultTeam?: string;
16412
- /** The role of a member in an organization, null for guests */
16413
- defaultRole?: MemberRoleOrGuest;
16650
+ defaultTeamFromDomain?: boolean;
16651
+ /** Role given to people on their first sign-in through the provider. null adds them as guests, "default" uses the organization's default role, and "domain" uses the role of the verified email domain they signed in with. */
16652
+ defaultRole?: SAMLProviderDefaultRole;
16653
+ /** Email domains the provider signs people in for. Each one must be an email domain of the organization. Only emails on a verified domain in this list can sign in through the provider. */
16654
+ domains?: SAMLProviderDomains;
16414
16655
  }, params?: RequestParams) => Promise<HttpResponse<OrganizationSAMLProvider, any>>;
16415
16656
  /**
16416
16657
  * No description
@@ -16443,8 +16684,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
16443
16684
  certificate?: SAMLProviderCertificate;
16444
16685
  ssoURL?: URL;
16445
16686
  defaultTeam?: string;
16446
- /** The role of a member in an organization, null for guests */
16447
- defaultRole?: MemberRoleOrGuest;
16687
+ defaultTeamFromDomain?: boolean;
16688
+ /** Role given to people on their first sign-in through the provider. null adds them as guests, "default" uses the organization's default role, and "domain" uses the role of the verified email domain they signed in with. */
16689
+ defaultRole?: SAMLProviderDefaultRole;
16690
+ /** Email domains the provider signs people in for. Each one must be an email domain of the organization. Only emails on a verified domain in this list can sign in through the provider. */
16691
+ domains?: SAMLProviderDomains;
16448
16692
  }, params?: RequestParams) => Promise<HttpResponse<OrganizationSAMLProvider, any>>;
16449
16693
  /**
16450
16694
  * No description
@@ -17451,6 +17695,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17451
17695
  updateSiteById: (organizationId: EntityId, siteId: string, data: {
17452
17696
  /** Title of the site */
17453
17697
  title?: SiteTitle;
17698
+ /** Allow visitors to preview change requests and historical revisions on the published site. */
17699
+ publicChangeRequestPreviews?: boolean;
17454
17700
  /**
17455
17701
  * The visibility setting of the site determines the audience of the site.
17456
17702
  * * `public`: Anyone can access the site, and the site is indexed by search engines.
@@ -18373,6 +18619,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18373
18619
  }, params?: RequestParams) => Promise<HttpResponse<List & {
18374
18620
  items: (SearchSpaceResult | SearchRecordResult)[];
18375
18621
  }, any>>;
18622
+ /**
18623
+ * @description Exchanges the content token of a published site's visitor for a short-lived search pass, which lets the visitor's browser call the site search operation directly. The reply has no pass when search passes are not enabled for the site, or when the visitor token of an authenticated visitor is missing, invalid or expired.
18624
+ *
18625
+ * @tags sites
18626
+ * @name GenerateSiteSearchPass
18627
+ * @summary Generate a site search pass
18628
+ * @request POST:/orgs/{organizationId}/sites/{siteId}/search/pass
18629
+ * @secure
18630
+ */
18631
+ generateSiteSearchPass: (organizationId: EntityId, siteId: string, data?: {
18632
+ /** Visitor token of the session the content token was resolved for. Required for a pass on a site with visitor authentication or for an authenticated visitor; the pass never outlives it. */
18633
+ visitorToken?: string;
18634
+ }, params?: RequestParams) => Promise<HttpResponse<{
18635
+ /** Short-lived credential that lets a published site's visitor call the site search operation directly. It is opaque, accepted only by that operation for one site, and expires within five minutes. */
18636
+ searchPass?: SiteSearchPass;
18637
+ }, any>>;
18376
18638
  /**
18377
18639
  * @description Hints the search backend that latency-sensitive site search requests are likely to arrive soon. Call this when a visitor opens the site's search interface.
18378
18640
  *
@@ -18912,6 +19174,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18912
19174
  channelType?: SiteChannelType[];
18913
19175
  /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18914
19176
  visitorType?: SiteQuestionVisitorType[];
19177
+ /** Filter by the AI agent or bot that asked the question. */
19178
+ visitorBot?: SiteInsightsVisitorBot[];
19179
+ /** Filter by the intent of the question. */
19180
+ intent?: SiteQuestionIntent[];
19181
+ /** Filter by what the site said in the answer about the main thing asked. */
19182
+ siteSaid?: SiteQuestionAnswerSiteSaid[];
19183
+ /** Filter by who should act on the answer (docs, another team, support or nobody). */
19184
+ escalation?: SiteQuestionEscalation[];
19185
+ /** Filter by whether the visitor who asked was signed in to the site. */
19186
+ visitorAuthentication?: SiteQuestionVisitorAuthentication[];
18915
19187
  /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
18916
19188
  citedPage?: string[];
18917
19189
  /** Filter stats by answer resolution. */
@@ -18973,6 +19245,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18973
19245
  channelType?: SiteChannelType[];
18974
19246
  /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18975
19247
  visitorType?: SiteQuestionVisitorType[];
19248
+ /** Filter by the AI agent or bot that asked the question. */
19249
+ visitorBot?: SiteInsightsVisitorBot[];
19250
+ /** Filter by the intent of the question. */
19251
+ intent?: SiteQuestionIntent[];
19252
+ /** Filter by what the site said in the answer about the main thing asked. */
19253
+ siteSaid?: SiteQuestionAnswerSiteSaid[];
19254
+ /** Filter by who should act on the answer (docs, another team, support or nobody). */
19255
+ escalation?: SiteQuestionEscalation[];
19256
+ /** Filter by whether the visitor who asked was signed in to the site. */
19257
+ visitorAuthentication?: SiteQuestionVisitorAuthentication[];
18976
19258
  /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
18977
19259
  citedPage?: string[];
18978
19260
  /** Filter questions whose text contains this value. */
@@ -19019,6 +19301,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
19019
19301
  channelType?: SiteChannelType[];
19020
19302
  /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
19021
19303
  visitorType?: SiteQuestionVisitorType[];
19304
+ /** Filter by whether the visitor who asked was signed in to the site. */
19305
+ visitorAuthentication?: SiteQuestionVisitorAuthentication[];
19022
19306
  /** Filter stats by answer resolution. */
19023
19307
  answered?: SiteQuestionAnswerResolution[];
19024
19308
  }, params?: RequestParams) => Promise<HttpResponse<SiteQuestion, any>>;
@@ -19050,6 +19334,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
19050
19334
  channelType?: SiteChannelType[];
19051
19335
  /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
19052
19336
  visitorType?: SiteQuestionVisitorType[];
19337
+ /** Filter by whether the visitor who asked was signed in to the site. */
19338
+ visitorAuthentication?: SiteQuestionVisitorAuthentication[];
19053
19339
  /** Filter answer sources by answer resolution. */
19054
19340
  answered?: SiteQuestionAnswerResolution[];
19055
19341
  }, params?: RequestParams) => Promise<HttpResponse<List & {
@@ -19077,6 +19363,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
19077
19363
  channelType?: SiteChannelType[];
19078
19364
  /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
19079
19365
  visitorType?: SiteQuestionVisitorType[];
19366
+ /** Filter by the AI agent or bot that asked the question. */
19367
+ visitorBot?: SiteInsightsVisitorBot[];
19368
+ /** Filter by the intent of the question. */
19369
+ intent?: SiteQuestionIntent[];
19370
+ /** Filter by what the site said in the answer about the main thing asked. */
19371
+ siteSaid?: SiteQuestionAnswerSiteSaid[];
19372
+ /** Filter by who should act on the answer (docs, another team, support or nobody). */
19373
+ escalation?: SiteQuestionEscalation[];
19374
+ /** Filter by whether the visitor who asked was signed in to the site. */
19375
+ visitorAuthentication?: SiteQuestionVisitorAuthentication[];
19080
19376
  /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
19081
19377
  citedPage?: string[];
19082
19378
  /** Filter stats by answer resolution. */
@@ -19106,6 +19402,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
19106
19402
  channelType?: SiteChannelType[];
19107
19403
  /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
19108
19404
  visitorType?: SiteQuestionVisitorType[];
19405
+ /** Filter by the AI agent or bot that asked the question. */
19406
+ visitorBot?: SiteInsightsVisitorBot[];
19407
+ /** Filter by the intent of the question. */
19408
+ intent?: SiteQuestionIntent[];
19409
+ /** Filter by what the site said in the answer about the main thing asked. */
19410
+ siteSaid?: SiteQuestionAnswerSiteSaid[];
19411
+ /** Filter by who should act on the answer (docs, another team, support or nobody). */
19412
+ escalation?: SiteQuestionEscalation[];
19413
+ /** Filter by whether the visitor who asked was signed in to the site. */
19414
+ visitorAuthentication?: SiteQuestionVisitorAuthentication[];
19109
19415
  /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
19110
19416
  citedPage?: string[];
19111
19417
  /** Filter answers by resolution. */
@@ -19139,6 +19445,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
19139
19445
  channelType?: SiteChannelType[];
19140
19446
  /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
19141
19447
  visitorType?: SiteQuestionVisitorType[];
19448
+ /** Filter by whether the visitor who asked was signed in to the site. */
19449
+ visitorAuthentication?: SiteQuestionVisitorAuthentication[];
19142
19450
  /** Filter answers by question type. */
19143
19451
  "question.type"?: SiteQuestionType;
19144
19452
  /** Filter answers by associated site topic ID. */
@@ -19822,7 +20130,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
19822
20130
  events: SiteInsightsEvent[];
19823
20131
  }, params?: RequestParams) => Promise<HttpResponse<void, any>>;
19824
20132
  /**
19825
- * @description Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation: page views, visitors, searches, referrers, and broken URLs (404s). A 404 is a `page_view` or `search_open_result` event whose `page` is `null`, in the `site` display context; filter `eventPageNotFoundType` not in `conditional` to leave out 404s that adaptive content explains. Group by `datetime` for a trend over time and by `urlPath` for the top broken URLs.
20133
+ * @description Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation: page views, visitors, searches, referrers, and broken URLs (404s). A 404 is a `page_view` or `search_open_result` event whose `page` is `null`, in the `site` display context; filter `eventPageNotFoundType` not in `conditional` to leave out 404s that adaptive content explains. Group by `datetime` for a trend over time and by `urlPath` for the top broken URLs. A result holds at most `limit` rows; when more match, pass its `next.page` back as `page` to fetch the rest.
19826
20134
  *
19827
20135
  * @tags site-insights
19828
20136
  * @name AggregateSiteEvents