@gitbook/api 0.208.0 → 0.209.1

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
@@ -313,6 +313,11 @@ export declare enum SiteInsightsLinkPosition {
313
313
  Sidebar = "sidebar",
314
314
  Content = "content"
315
315
  }
316
+ export declare enum PageFeedbackRating {
317
+ Bad = "bad",
318
+ Ok = "ok",
319
+ Good = "good"
320
+ }
316
321
  /** How a page's markdown was requested. `page-action` means a reader used the site's page-actions menu — its copy or view-as-markdown action — rather than a client fetching the URL directly. */
317
322
  export declare enum SiteInsightsMarkdownSource {
318
323
  PageAction = "page-action"
@@ -341,6 +346,8 @@ export declare enum SiteSettingsScanTopics {
341
346
  * - `suggest-fixes` drafts fixes for approval and applies none.
342
347
  * - `fix-clear-matches` applies the clearest fixes and drafts the less certain ones for approval.
343
348
  * - `fix-close-matches` applies the clear and the close fixes.
349
+ * At every level, GitBook drafts change requests that fix broken links to other sites, and never
350
+ * merges them.
344
351
  */
345
352
  export declare enum SiteSettingsBrokenLinksAutonomyLevel {
346
353
  SuggestFixes = "suggest-fixes",
@@ -863,6 +870,13 @@ export declare enum SCIMConnectionProvider {
863
870
  Entra = "entra",
864
871
  Generic = "generic"
865
872
  }
873
+ /** Verification status of the domain. "legacy" is a domain added before verification existed: it keeps letting people join automatically without being verified. */
874
+ export declare enum OrganizationDomainStatus {
875
+ Legacy = "legacy",
876
+ Pending = "pending",
877
+ Verified = "verified",
878
+ Error = "error"
879
+ }
866
880
  /**
867
881
  * Status of the provider.
868
882
  * - `active`: The provider is active and can be used to authenticate users.
@@ -886,6 +900,7 @@ export declare enum OrganizationFeature {
886
900
  MembersTeamOwners = "members-team-owners",
887
901
  SecuritySaml = "security-saml",
888
902
  Scim = "scim",
903
+ VerifiedDomains = "verified-domains",
889
904
  ChangeRequestsMergeRules = "change-requests-merge-rules"
890
905
  }
891
906
  /**
@@ -1042,11 +1057,6 @@ export declare enum SiteType {
1042
1057
  Ultimate = "ultimate",
1043
1058
  Sponsored = "sponsored"
1044
1059
  }
1045
- export declare enum PageFeedbackRating {
1046
- Bad = "bad",
1047
- Ok = "ok",
1048
- Good = "good"
1049
- }
1050
1060
  /** Describe whether all sites have been selected or there's a selection involved */
1051
1061
  export declare enum IntegrationInstallationSiteSelection {
1052
1062
  All = "all",
@@ -1162,11 +1172,13 @@ export declare enum IntegrationTarget {
1162
1172
  * "billing": The organization's plan has reached its maximum number of members.
1163
1173
  * "scim": The member was deactivated by the organization's identity provider.
1164
1174
  * "admin": An organization admin disabled the member.
1175
+ * "gitbook": GitBook blocked the organization.
1165
1176
  */
1166
1177
  export declare enum MemberDisabledReason {
1167
1178
  Billing = "billing",
1168
1179
  Scim = "scim",
1169
- Admin = "admin"
1180
+ Admin = "admin",
1181
+ Gitbook = "gitbook"
1170
1182
  }
1171
1183
  /** The core layout presets for a page. */
1172
1184
  export declare enum RevisionPageLayoutPreset {
@@ -1381,7 +1393,7 @@ export declare enum ContentVisibility {
1381
1393
  /** Data passed through a realtime channel */
1382
1394
  export type APIChannelData = APIChannelGitSyncOperationData | APIChannelGitSyncSiteOperationData | APIChannelTranslationRunData | APIChannelImportRunData | APIChannelMutationData;
1383
1395
  /** Channel to subscribe to for realtime updates. */
1384
- export type APIChannel = APIChannelSpaceInfo | APIChannelSpaceContent | APIChannelSpaceGitInfo | APIChannelSpacePublishingAuth | APIChannelSpacePublishingCustomization | APIChannelSpaceIntegrations | APIChannelUserAPITokens | APIChannelUserOrganizations | APIChannelUserProfile | APIChannelChangeRequest | APIChannelChangeRequests | APIChannelChangeRequestReviews | APIChannelCollection | APIChannelCollectionPublishingCustomization | APIChannelOrganizationInfo | APIChannelOrganizationAgentData | APIChannelOrganizationInviteLinks | APIChannelOrganizationMembers | APIChannelOrganizationMember | APIChannelOrganizationSAML | APIChannelOrganizationTeams | APIChannelOrganizationTeam | APIChannelOrganizationTeamMembers | APIChannelOrganizationTeamMember | APIChannelOrganizationSpaces | APIChannelOrganizationCollections | APIChannelOrganizationIntegrations | APIChannelOrganizationInstallations | APIChannelOrganizationSites | APIChannelOrganizationOpenAPISpecs | APIChannelOrganizationTranslations | APIChannelOrganizationTranslationsGlossary | APIChannelOrganizationSCIMConnections | APIChannelOrganizationCustomFonts | APIChannelOrganizationAgentInstructions | APIChannelOrganizationChangeRequests | APIChannelSpaceComments | APIChannelChangeRequestComments | APIChannelCommentInfo | APIChannelCommentReplies | APIChannelIntegration | APIChannelIntegrationInstallation | APIChannelIntegrationSpaceInstallation | APIChannelIntegrationSpaceInstallations | APIChannelIntegrationSiteInstallation | APIChannelIntegrationSiteInstallations | APIChannelPublishedContentSite | APIChannelSiteRedirects | APIChannelSite | APIChannelSiteChannels | APIChannelSiteContext | APIChannelSiteCustomization | APIChannelSiteAgentSettings | APIChannelSiteIntegrations | APIChannelSiteSpace | APIChannelSiteSpaceCustomization | APIChannelSiteStructure | APIChannelSiteAdaptiveSchema | APIChannelSitePublishingAuth | APIChannelSiteShareLinks | APIChannelSiteShareLink | APIChannelSiteMcpServers | APIChannelSiteMcpServer | APIChannelSiteSection | APIChannelCustomHostname | APIChannelGitSyncInstallation | APIChannelGitSyncOperation | APIChannelGitSyncSiteOperation | APIChannelOpenAPISpec | APIChannelSubdomain | APIChannelTranslation | APIChannelTranslationRun | APIChannelImportRun;
1396
+ export type APIChannel = APIChannelSpaceInfo | APIChannelSpaceContent | APIChannelSpaceGitInfo | APIChannelSpacePublishingAuth | APIChannelSpacePublishingCustomization | APIChannelSpaceIntegrations | APIChannelUserAPITokens | APIChannelUserOrganizations | APIChannelUserPasskeys | APIChannelUserProfile | APIChannelChangeRequest | APIChannelChangeRequests | APIChannelChangeRequestReviews | APIChannelCollection | APIChannelCollectionPublishingCustomization | APIChannelOrganizationInfo | APIChannelOrganizationAgentData | APIChannelOrganizationInviteLinks | APIChannelOrganizationMembers | APIChannelOrganizationMember | APIChannelOrganizationSAML | APIChannelOrganizationTeams | APIChannelOrganizationTeam | APIChannelOrganizationTeamMembers | APIChannelOrganizationTeamMember | APIChannelOrganizationSpaces | APIChannelOrganizationCollections | APIChannelOrganizationIntegrations | APIChannelOrganizationInstallations | APIChannelOrganizationSites | APIChannelOrganizationOpenAPISpecs | APIChannelOrganizationTranslations | APIChannelOrganizationTranslationsGlossary | APIChannelOrganizationSCIMConnections | APIChannelOrganizationDomains | APIChannelOrganizationCustomFonts | APIChannelOrganizationAgentInstructions | APIChannelOrganizationChangeRequests | APIChannelSpaceComments | APIChannelChangeRequestComments | APIChannelCommentInfo | APIChannelCommentReplies | APIChannelIntegration | APIChannelIntegrationInstallation | APIChannelIntegrationSpaceInstallation | APIChannelIntegrationSpaceInstallations | APIChannelIntegrationSiteInstallation | APIChannelIntegrationSiteInstallations | APIChannelPublishedContentSite | APIChannelSiteRedirects | APIChannelSite | APIChannelSiteChannels | APIChannelSiteContext | APIChannelSiteCustomization | APIChannelSiteAgentSettings | APIChannelSiteIntegrations | APIChannelSiteSpace | APIChannelSiteSpaceCustomization | APIChannelSiteStructure | APIChannelSiteAdaptiveSchema | APIChannelSitePublishingAuth | APIChannelSiteShareLinks | APIChannelSiteShareLink | APIChannelSiteMcpServers | APIChannelSiteMcpServer | APIChannelSiteSection | APIChannelCustomHostname | APIChannelGitSyncInstallation | APIChannelGitSyncOperation | APIChannelGitSyncSiteOperation | APIChannelOpenAPISpec | APIChannelSubdomain | APIChannelTranslation | APIChannelTranslationRun | APIChannelImportRun;
1385
1397
  /** The plan upgrade that would make a feature available. */
1386
1398
  export type FeatureUpgradeRequirement = {
1387
1399
  type: "organization";
@@ -1416,6 +1428,8 @@ export type FeatureUpgradeRequirement = {
1416
1428
  */
1417
1429
  url: string;
1418
1430
  };
1431
+ /** Any event that can be received from GitBook. */
1432
+ export type Event = InstallationSetupEvent | InstallationDeletedEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | SiteInstallationSetupEvent | SiteInstallationDeletedEvent | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | TaskEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent | ContentComputeDocumentEvent | ContentComputeRevisionEvent | PageFeedbackEvent;
1419
1433
  /** An absolute reference to content in GitBook. */
1420
1434
  export type ContentLocation = ContentLocationFile | ContentLocationURL | ContentLocationPage | ContentLocationUser | ContentLocationCollection | ContentLocationSpace | ContentLocationReusableContent | ContentLocationOpenAPI;
1421
1435
  export type PublishedContentRedirect = {
@@ -1455,8 +1469,6 @@ export type ContentKitRootElement = ContentKitBlock | ContentKitModal | ContentK
1455
1469
  export type ContentKitInlineElement = ContentKitText | ContentKitImage | ContentKitLink;
1456
1470
  /** Any element that can be used as children. */
1457
1471
  export type ContentKitDescendantElement = ContentKitButton | ContentKitTextInput | ContentKitHStack | ContentKitVStack | ContentKitBox | ContentKitDivider | ContentKitWebFrame | ContentKitCodeBlock | ContentKitMarkdown | ContentKitCard | ContentKitImage | ContentKitInput | ContentKitSelect | ContentKitSwitch | ContentKitCheckbox | ContentKitRadio | ContentKitText | ContentKitHint | ContentKitLink | ContentKitStepperStep;
1458
- /** Any event that can be received from GitBook. */
1459
- export type Event = InstallationSetupEvent | InstallationDeletedEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | SiteInstallationSetupEvent | SiteInstallationDeletedEvent | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | TaskEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent | ContentComputeDocumentEvent | ContentComputeRevisionEvent | PageFeedbackEvent;
1460
1472
  /** An outcome of a content change. */
1461
1473
  export type ChangeRequestContentUpdateChange = ({
1462
1474
  object: "created_page";
@@ -1487,7 +1499,15 @@ export type ChangeRequestContentChange = ({
1487
1499
  operation: "insert_variables";
1488
1500
  } & ChangeRequestContentChangeInsertVariables) | ({
1489
1501
  operation: "update_variable";
1490
- } & ChangeRequestContentChangeUpdateVariable);
1502
+ } & ChangeRequestContentChangeUpdateVariable) | ({
1503
+ operation: "delete_variable";
1504
+ } & ChangeRequestContentChangeDeleteVariable) | ({
1505
+ operation: "insert_tags";
1506
+ } & ChangeRequestContentChangeInsertTags) | ({
1507
+ operation: "update_tag";
1508
+ } & ChangeRequestContentChangeUpdateTag) | ({
1509
+ operation: "delete_tag";
1510
+ } & ChangeRequestContentChangeDeleteTag);
1491
1511
  export type Revision = RevisionTypeEdits | RevisionTypeMerge | RevisionTypeRollback | RevisionTypeUpdate | RevisionTypeComputed;
1492
1512
  export type RevisionPage = RevisionPageDocument | RevisionPageGroup | RevisionPageLink | RevisionPageComputed;
1493
1513
  export interface ApiInformation {
@@ -1535,6 +1555,46 @@ export interface APITemporaryToken {
1535
1555
  /** Temporary access token to authenticate with the API */
1536
1556
  token: string;
1537
1557
  }
1558
+ /** @format date-time */
1559
+ export type Timestamp = string;
1560
+ /** A passkey the user registered to sign in to GitBook. */
1561
+ export interface UserPasskey {
1562
+ /** The object type, which is always "passkey" */
1563
+ object: "passkey";
1564
+ /** Unique identifier of the passkey. */
1565
+ id: string;
1566
+ /** Name the user gave the passkey, usually the device or password manager that holds it. */
1567
+ name: string;
1568
+ /** When the passkey was registered. */
1569
+ createdAt: Timestamp;
1570
+ /** When the passkey was last used to sign in. Absent if it has never been used. */
1571
+ lastUsedAt?: Timestamp;
1572
+ /** Whether the passkey is synced across devices, for example by a password manager. */
1573
+ backedUp: boolean;
1574
+ }
1575
+ /** The browser's answer to the passkey registration options (RegistrationResponseJSON). */
1576
+ export interface PasskeyRegistrationResponse {
1577
+ id: string;
1578
+ rawId: string;
1579
+ type: "public-key";
1580
+ response: {
1581
+ clientDataJSON: string;
1582
+ attestationObject: string;
1583
+ /**
1584
+ * How the browser reaches the authenticator, such as usb, nfc, ble, smart-card, hybrid or internal. WebAuthn can add values, so any short lowercase name is accepted.
1585
+ * @maxItems 8
1586
+ */
1587
+ transports?: string[];
1588
+ };
1589
+ clientExtensionResults: Record<string, any>;
1590
+ authenticatorAttachment?: "platform" | "cross-platform";
1591
+ }
1592
+ /** WebAuthn options for creating a passkey (PublicKeyCredentialCreationOptionsJSON), to pass unchanged to the browser. */
1593
+ export interface PasskeyRegistrationOptions {
1594
+ /** Single-use challenge the new passkey must sign. */
1595
+ challenge: string;
1596
+ [key: string]: any;
1597
+ }
1538
1598
  export interface List {
1539
1599
  next?: {
1540
1600
  /** Unique identifier to query the next results page */
@@ -1545,8 +1605,6 @@ export interface List {
1545
1605
  }
1546
1606
  /** @maxLength 50 */
1547
1607
  export type APITokenLabel = string;
1548
- /** @format date-time */
1549
- export type Timestamp = string;
1550
1608
  /** The API token details, excluding the token itself. */
1551
1609
  export interface UserAPIToken {
1552
1610
  /** The API token ID. */
@@ -1555,6 +1613,10 @@ export interface UserAPIToken {
1555
1613
  label: APITokenLabel;
1556
1614
  /** The API token creation date. */
1557
1615
  createdAt: Timestamp;
1616
+ /** Whether the API token can no longer be used to authenticate, because it was revoked or has expired. */
1617
+ revoked: boolean;
1618
+ /** When the API token stops authenticating. Absent for a token that never expires. */
1619
+ expiresAt?: Timestamp;
1558
1620
  }
1559
1621
  /** The API token details, including the token itself. */
1560
1622
  export type UserAPITokenExtended = UserAPIToken & {
@@ -3886,6 +3948,8 @@ export interface RevisionPageUpdate {
3886
3948
  noRobotsIndex?: boolean;
3887
3949
  /** Adaptive-content condition controlling whether the page is shown to a visitor. Set to an empty string to remove the condition. */
3888
3950
  condition?: string;
3951
+ /** Page variables, referenced in the page's content as `page.vars.<name>`. They are separate from space variables (`space.vars.<name>`). The object replaces all of the page's variables: set it to `{}` to remove them, or omit it to leave them unchanged. In a markdown document, the `vars` frontmatter sets them too. Names follow the same rules as space variables. Document pages only. */
3952
+ variables?: Variables;
3889
3953
  }
3890
3954
  /**
3891
3955
  * Update an existing page. Its document and/or its metadata (title, icon, description, visibility, adaptive-content condition) can be changed, and it can be moved to a new parent and/or position with `into`/`at`.
@@ -3946,7 +4010,10 @@ export interface ChangeRequestContentChangeRevertPage {
3946
4010
  operation: "revert_page";
3947
4011
  /** ID of the page to revert. */
3948
4012
  page: string;
3949
- /** ID of the revision to revert the page to. If omitted, the change request's base revision is used. */
4013
+ /**
4014
+ * ID of the revision to revert the page to. If omitted, the change request's base revision is used.
4015
+ * @pattern ^[a-zA-Z0-9_-]+$
4016
+ */
3950
4017
  revision?: string;
3951
4018
  /** Keys of the specific blocks to revert within the page's document, as they appear in the page's document. If omitted, the whole page is reverted. */
3952
4019
  block?: string[];
@@ -4062,11 +4129,13 @@ export interface ChangeRequestContentChangeDeleteReusableContent {
4062
4129
  */
4063
4130
  export type VariableName = string;
4064
4131
  /**
4065
- * Create space variables in the change request (Git Sync's `.gitbook/vars.yaml`). Content references one as an expression, `<code class="expression">space.vars.<name></code>` in markdown, which renders the variable's value.
4132
+ * Create space variables in the change request (Git Sync's `.gitbook/vars.yaml`), or with `page`, variables of that page. Content references one as an expression, `<code class="expression">space.vars.<name></code>` (or `page.vars.<name>` on that page) in markdown, which renders the variable's value. To replace all of a page's variables at once, set the page's `variables` or its `vars` frontmatter instead.
4066
4133
  * @example {"operation":"insert_variables","variables":[{"name":"version","value":"2.0"}]}
4067
4134
  */
4068
4135
  export interface ChangeRequestContentChangeInsertVariables {
4069
4136
  operation: "insert_variables";
4137
+ /** ID of a document page to add the variables to, as its own variables (`page.vars.<name>`). Omit to add space variables. */
4138
+ page?: string;
4070
4139
  /**
4071
4140
  * @maxItems 50
4072
4141
  * @minItems 1
@@ -4079,16 +4148,81 @@ export interface ChangeRequestContentChangeInsertVariables {
4079
4148
  }[];
4080
4149
  }
4081
4150
  /**
4082
- * Change the value of an existing space variable. Every expression referencing it shows the new value.
4151
+ * Change the value of an existing space variable, or with `page`, of one of that page's own variables without resending the others. Every expression referencing it shows the new value.
4083
4152
  * @example {"operation":"update_variable","variable":"version","value":"2.1"}
4084
4153
  */
4085
4154
  export interface ChangeRequestContentChangeUpdateVariable {
4086
4155
  operation: "update_variable";
4156
+ /** ID of a document page whose own variable (`page.vars.<name>`) to update. Omit to update a space variable. */
4157
+ page?: string;
4087
4158
  /** Name of the variable to update. */
4088
4159
  variable: VariableName;
4089
4160
  /** New value of the variable. */
4090
4161
  value: VariableValue;
4091
4162
  }
4163
+ /**
4164
+ * Delete an existing space variable from the change request, or with `page`, one of that page's own variables. Expressions referencing it are kept in pages, as in the editor.
4165
+ * @example {"operation":"delete_variable","variable":"version"}
4166
+ */
4167
+ export interface ChangeRequestContentChangeDeleteVariable {
4168
+ operation: "delete_variable";
4169
+ /** ID of a document page whose own variable (`page.vars.<name>`) to delete. Omit to delete a space variable. */
4170
+ page?: string;
4171
+ /** Name of the variable to delete. */
4172
+ variable: VariableName;
4173
+ }
4174
+ /**
4175
+ * Display label of a tag.
4176
+ * @minLength 1
4177
+ * @maxLength 50
4178
+ */
4179
+ export type RevisionTagLabel = string;
4180
+ /** Create flat tags in array order. The batch is rejected atomically if any tag is invalid. */
4181
+ export interface ChangeRequestContentChangeInsertTags {
4182
+ operation: "insert_tags";
4183
+ /**
4184
+ * @maxItems 50
4185
+ * @minItems 1
4186
+ */
4187
+ tags: {
4188
+ /**
4189
+ * Stable tag identifier; generated from the label when omitted.
4190
+ * @minLength 1
4191
+ */
4192
+ slug?: string;
4193
+ /** Display label of a tag. */
4194
+ label: RevisionTagLabel;
4195
+ /** 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
+ color?: DocumentTextColor;
4197
+ /** Name of the icon */
4198
+ icon?: Icon;
4199
+ /** Unicode codepoint or character of the emoji */
4200
+ emoji?: Emoji;
4201
+ }[];
4202
+ }
4203
+ /** Rename or restyle an existing tag. The slug is immutable. */
4204
+ export interface ChangeRequestContentChangeUpdateTag {
4205
+ operation: "update_tag";
4206
+ /**
4207
+ * Slug of the tag to update.
4208
+ * @minLength 1
4209
+ */
4210
+ tag: string;
4211
+ /** Display label of a tag. */
4212
+ label?: RevisionTagLabel;
4213
+ /** 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
+ color?: DocumentTextColor;
4215
+ /** Icon to set. Null removes the icon; omission preserves it. */
4216
+ icon?: Icon | null;
4217
+ /** Emoji to set. Null removes the emoji; omission preserves it. */
4218
+ emoji?: Emoji | null;
4219
+ }
4220
+ /** Delete an existing tag definition. Page and block references remain in content but stop resolving. */
4221
+ export interface ChangeRequestContentChangeDeleteTag {
4222
+ operation: "delete_tag";
4223
+ /** @minLength 1 */
4224
+ tag: string;
4225
+ }
4092
4226
  export interface ChangeRequestContentUpdatePageRef {
4093
4227
  /** Type of Object, always equals to "page". */
4094
4228
  object: "page";
@@ -4285,46 +4419,13 @@ export interface RevisionSemanticChangeTagDeleted {
4285
4419
  }
4286
4420
  export interface RevisionTagChangeAttributes {
4287
4421
  label?: ChangeAttributeString;
4288
- group?: ChangeAttributeString;
4289
- parent?: ChangeAttributeString;
4290
4422
  }
4291
4423
  export interface RevisionSemanticChangeTagEdited {
4292
4424
  type: "tag_edited";
4293
4425
  tag: ChangedRevisionTag;
4294
4426
  attributes: RevisionTagChangeAttributes;
4295
4427
  }
4296
- /** A space-scoped group of tags in this revision. Groups may contain other groups. */
4297
- export interface RevisionTagGroup {
4298
- /** Immutable group identifier, unique within the revision. */
4299
- slug: string;
4300
- /** Display name of the group. */
4301
- label: string;
4302
- /** Parent group slug. Omitted for root groups. */
4303
- parent?: string;
4304
- /** Lexicographic sibling sort key. Break ties using the slug. */
4305
- orderIndex: string;
4306
- }
4307
- export interface RevisionSemanticChangeTagGroupCreated {
4308
- type: "tag_group_created";
4309
- /** A space-scoped group of tags in this revision. Groups may contain other groups. */
4310
- tagGroup: RevisionTagGroup;
4311
- }
4312
- export interface RevisionSemanticChangeTagGroupEdited {
4313
- type: "tag_group_edited";
4314
- /** A space-scoped group of tags in this revision. Groups may contain other groups. */
4315
- tagGroup: RevisionTagGroup;
4316
- attributes: {
4317
- label?: ChangeAttributeString;
4318
- parent?: ChangeAttributeString;
4319
- orderIndex?: ChangeAttributeString;
4320
- };
4321
- }
4322
- export interface RevisionSemanticChangeTagGroupDeleted {
4323
- type: "tag_group_deleted";
4324
- /** A space-scoped group of tags in this revision. Groups may contain other groups. */
4325
- tagGroup: RevisionTagGroup;
4326
- }
4327
- export type RevisionSemanticChange = RevisionSemanticChangePageCreated | RevisionSemanticChangePageEdited | RevisionSemanticChangePageDeleted | RevisionSemanticChangePageMoved | RevisionSemanticChangeFileCreated | RevisionSemanticChangeFileEdited | RevisionSemanticChangeFileDeleted | RevisionSemanticChangeVariablesEdited | RevisionSemanticChangeReusableContentCreated | RevisionSemanticChangeReusableContentDeleted | RevisionSemanticChangeReusableContentEdited | RevisionSemanticChangeTagCreated | RevisionSemanticChangeTagDeleted | RevisionSemanticChangeTagEdited | RevisionSemanticChangeTagGroupCreated | RevisionSemanticChangeTagGroupEdited | RevisionSemanticChangeTagGroupDeleted;
4428
+ export type RevisionSemanticChange = RevisionSemanticChangePageCreated | RevisionSemanticChangePageEdited | RevisionSemanticChangePageDeleted | RevisionSemanticChangePageMoved | RevisionSemanticChangeFileCreated | RevisionSemanticChangeFileEdited | RevisionSemanticChangeFileDeleted | RevisionSemanticChangeVariablesEdited | RevisionSemanticChangeReusableContentCreated | RevisionSemanticChangeReusableContentDeleted | RevisionSemanticChangeReusableContentEdited | RevisionSemanticChangeTagCreated | RevisionSemanticChangeTagDeleted | RevisionSemanticChangeTagEdited;
4328
4429
  export interface RevisionSemanticChanges {
4329
4430
  /** The change request object that initiated the changes in the case of a merge revision. */
4330
4431
  mergedFrom?: ChangeRequest;
@@ -4614,6 +4715,7 @@ export type OrganizationSupportCost = {
4614
4715
  * @maxLength 255
4615
4716
  */
4616
4717
  export type BlockReason = string;
4718
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
4617
4719
  export interface Organization {
4618
4720
  /** Type of Object, always equals to "organization" */
4619
4721
  object: "organization";
@@ -4621,11 +4723,11 @@ export interface Organization {
4621
4723
  id: string;
4622
4724
  /** Name of the organization */
4623
4725
  title: OrganizationTitle;
4624
- createdAt: Timestamp;
4625
- emailDomains: OrganizationEmailDomains;
4726
+ createdAt?: Timestamp;
4727
+ emailDomains?: OrganizationEmailDomains;
4626
4728
  /** Default hostname for the organization's public content, e.g. <org-hostname>.gitbook.io */
4627
4729
  hostname?: OrganizationHostname;
4628
- type: OrganizationType;
4730
+ type?: OrganizationType;
4629
4731
  useCase?: OrganizationUseCase;
4630
4732
  communityType?: OrganizationCommunityType;
4631
4733
  /** The role of a member in an organization, null for guests */
@@ -4647,10 +4749,10 @@ export interface Organization {
4647
4749
  /** Whether audit logs can currently be accessed for this organization. */
4648
4750
  auditLogs?: boolean;
4649
4751
  /** Name of the product */
4650
- plan: BillingProduct;
4752
+ plan?: BillingProduct;
4651
4753
  /** Billing details, only available for org members. */
4652
4754
  billing?: OrganizationBilling;
4653
- mergeRules: MergeRulesStandaloneConfiguration;
4755
+ mergeRules?: MergeRulesStandaloneConfiguration;
4654
4756
  /** Support cost set by the organization, only available for org members. */
4655
4757
  supportCost?: OrganizationSupportCost;
4656
4758
  /** URLs associated with the object */
@@ -4668,7 +4770,7 @@ export interface Organization {
4668
4770
  /** URL of the logo of this organization, if defined. */
4669
4771
  logo?: URL;
4670
4772
  };
4671
- trial: {
4773
+ trial?: {
4672
4774
  /** - notapplicable, no trial can be started for this organization. - none, no trial has been started yet. - active, trial is active. - ended, the trial has ended and the user has choosen to stay on the free plan or has upgraded to a paid plan. - expired, the trial has ended but the user hasn't deciced yet what to do. */
4673
4775
  status: BillingTrialStatus;
4674
4776
  /** Number of trials the organization has consumed. */
@@ -4784,6 +4886,7 @@ export interface Integration {
4784
4886
  configurations?: IntegrationConfigurations;
4785
4887
  /** External urls configured by the developer of the integration */
4786
4888
  externalLinks: IntegrationExternalLinks;
4889
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
4787
4890
  owner: Organization;
4788
4891
  /** URLs associated with the object */
4789
4892
  urls: {
@@ -4930,7 +5033,7 @@ export interface PublishIntegration {
4930
5033
  */
4931
5034
  contentSecurityPolicy?: IntegrationContentSecurityPolicy;
4932
5035
  }
4933
- /** Configuration of the integration at the account level */
5036
+ /** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
4934
5037
  export type IntegrationInstallationConfiguration = Record<string, any>;
4935
5038
  /**
4936
5039
  * External IDs assigned by the integration.
@@ -4956,7 +5059,7 @@ export interface IntegrationInstallation {
4956
5059
  site_selection: IntegrationInstallationSiteSelection;
4957
5060
  /** Count of spaces, the installation is managing */
4958
5061
  spaces: number;
4959
- /** Configuration of the integration at the account level */
5062
+ /** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
4960
5063
  configuration: IntegrationInstallationConfiguration;
4961
5064
  createdAt: Timestamp;
4962
5065
  updatedAt: Timestamp;
@@ -4990,374 +5093,95 @@ export interface IntegrationInstallation {
4990
5093
  /** Network configuration for the installation */
4991
5094
  network?: IntegrationNetwork;
4992
5095
  }
4993
- /** Common properties for all events. */
4994
- export interface BaseEvent {
4995
- /** Unique identifier for the event. */
5096
+ /** Safe diagnostic metadata for an integration event. This is not the event delivered to the integration. Configuration snapshots, request bodies and headers, URLs, visitor data, task and UI payloads, provider responses and arbitrary custom fields are omitted. */
5097
+ export interface IntegrationEventDiagnosticPayload {
5098
+ /** Event type, or unknown for an unrecognized or malformed historical payload. */
5099
+ type: "installation_setup" | "installation_deleted" | "space_installation_setup" | "space_installation_deleted" | "site_installation_setup" | "site_installation_deleted" | "site_view" | "space_content_updated" | "space_gitsync_completed" | "space_gitsync_started" | "space_visibility_updated" | "task" | "fetch" | "fetch_published_script" | "fetch_visitor_authentication" | "ui_render" | "content_compute_document" | "content_compute_revision" | "page_feedback" | "unknown";
4996
5100
  eventId: string;
4997
- /** Type of the event. */
4998
- type: string;
5101
+ installationId?: string;
5102
+ siteId?: string;
5103
+ spaceId?: string;
5104
+ pageId?: string;
5105
+ revisionId?: string;
4999
5106
  }
5000
- /** Common properties for all events related to an installation */
5001
- export type InstallationEvent = BaseEvent & {
5107
+ /** Diagnostic metadata for a delivered event, including historical records. The payload is intentionally limited to event type and identifiers; it is not the full runtime event. Events and configuration delivered to the integration runtime are unaffected. */
5108
+ export interface IntegrationEvent {
5109
+ /** Unique ID of the event. */
5110
+ id: string;
5111
+ /** Unique ID of the integration. */
5112
+ integrationId: string;
5113
+ /** Unique ID of the integration installation. */
5114
+ installationId?: string;
5115
+ createdAt: Timestamp;
5116
+ /** Safe diagnostic metadata for an integration event. This is not the event delivered to the integration. Configuration snapshots, request bodies and headers, URLs, visitor data, task and UI payloads, provider responses and arbitrary custom fields are omitted. */
5117
+ payload: IntegrationEventDiagnosticPayload;
5118
+ /** Correlation ID of the integration execution. */
5119
+ rayId?: string;
5120
+ /**
5121
+ * HTTP status of the integration execution, when available.
5122
+ * @min 100
5123
+ * @max 599
5124
+ */
5125
+ statusCode?: number;
5126
+ /** Stable failure category. Raw error messages are never returned. */
5127
+ errorCategory?: "http_error" | "execution_error";
5128
+ /** Status of the event. */
5129
+ status: "success" | "failed";
5130
+ }
5131
+ export interface IntegrationEventLog {
5132
+ /** The message of the log entry. */
5133
+ message?: string;
5134
+ timestamp?: Timestamp;
5135
+ /** The level of the log entry. */
5136
+ level?: "debug" | "info" | "warn" | "error";
5137
+ }
5138
+ /** Safe execution metadata. Worker log and exception text are suppressed. */
5139
+ export interface IntegrationEventTrace {
5140
+ /** Always empty until a safe diagnostic log format is available. */
5141
+ logs: IntegrationEventLog[];
5142
+ /** Correlation ID of the integration execution. */
5143
+ rayId?: string;
5144
+ createdAt?: Timestamp;
5145
+ outcome?: "ok" | "exception" | "exceededCpu" | "exceededMemory" | "canceled" | "unknown";
5146
+ /**
5147
+ * @min 100
5148
+ * @max 599
5149
+ */
5150
+ statusCode?: number;
5151
+ }
5152
+ /** Base properties of an installation of an integration on a site or space. */
5153
+ export interface IntegrationContentInstallationBase {
5154
+ /** Unique name identifier of the integration */
5155
+ integration: string;
5002
5156
  /** ID of the integration installation */
5003
- installationId: string;
5004
- };
5005
- /** Event received when integration has been installed or updated. */
5006
- export type InstallationSetupEvent = InstallationEvent & {
5007
- type: "installation_setup";
5008
- status: IntegrationInstallationStatus;
5009
- /** The state of the installation at the account level before it was updated. */
5010
- previous?: {
5011
- status: IntegrationInstallationStatus;
5012
- /** The previous configuration of the installation at the account level. */
5013
- configuration?: object;
5014
- };
5015
- };
5016
- /** Event received when integration has been uninstalled from an organization. */
5017
- export type InstallationDeletedEvent = InstallationEvent & {
5018
- type: "installation_deleted";
5019
- /** The state of the installation before it was deleted. */
5020
- previous: {
5021
- /** The previous configuration of the installation. */
5022
- configuration?: object;
5023
- };
5024
- };
5025
- /** Common properties for all events related to a specific space. */
5026
- export type SpaceEvent = InstallationEvent & {
5027
- /** ID of the space */
5028
- spaceId: string;
5029
- };
5030
- /** Event received when integration has been installed or updated on a space. */
5031
- export type SpaceInstallationSetupEvent = SpaceEvent & {
5032
- type: "space_installation_setup";
5033
- status: IntegrationInstallationStatus;
5034
- /** The state of the Space installation before it was updated. */
5035
- previous?: {
5036
- status: IntegrationInstallationStatus;
5037
- /** The previous configuration of the Space installation. */
5038
- configuration?: object;
5039
- };
5040
- };
5041
- /** Event received when integration has been uninstalled from a space. */
5042
- export type SpaceInstallationDeletedEvent = SpaceEvent & {
5043
- type: "space_installation_deleted";
5044
- /** The state of the Space installation before it was deleted. */
5045
- previous: {
5046
- /** The previous configuration of the Space installation. */
5047
- configuration?: object;
5048
- };
5049
- };
5050
- /** Common properties for all events related to a specific site. */
5051
- export type SiteEvent = InstallationEvent & {
5052
- /** ID of the site */
5053
- siteId: string;
5054
- };
5055
- /** Event received when integration has been installed or updated on a site. */
5056
- export type SiteInstallationSetupEvent = SiteEvent & {
5057
- type: "site_installation_setup";
5157
+ installation: string;
5058
5158
  status: IntegrationInstallationStatus;
5059
- /** The state of the site installation before it was updated. */
5060
- previous?: {
5061
- status: IntegrationInstallationStatus;
5062
- /** The previous configuration of the site installation. */
5063
- configuration?: object;
5064
- };
5065
- };
5066
- /** Event received when integration has been uninstalled from a site. */
5067
- export type SiteInstallationDeletedEvent = SiteEvent & {
5068
- type: "site_installation_deleted";
5069
- /** The state of the site installation before it was deleted. */
5070
- previous: {
5071
- /** The previous configuration of the site installation. */
5072
- configuration?: object;
5159
+ /** Configuration for this site or space. For user authentication, oauth_credentials is returned as a boolean connection indicator. Send true when saving to preserve the connection, or omit the field to clear it. Only the integration or the matching installation can read or set OAuth credentials. */
5160
+ configuration: object;
5161
+ /** External IDs assigned by the integration. */
5162
+ externalIds: IntegrationInstallationExternalIds;
5163
+ /** URLs associated with the object */
5164
+ urls: {
5165
+ /**
5166
+ * URL of the integration's installation in the API
5167
+ * @format uri
5168
+ */
5169
+ location: string;
5170
+ /**
5171
+ * Public HTTP endpoint for the integration's installation
5172
+ * @format uri
5173
+ */
5174
+ publicEndpoint: string;
5175
+ /**
5176
+ * Public endpoint serving the integration's rendered content (e.g. WebFrames), isolated from the cookie-bearing publicEndpoint origin. Equals publicEndpoint when no separate content origin is configured.
5177
+ * @format uri
5178
+ */
5179
+ publicContentEndpoint: string;
5073
5180
  };
5074
- };
5075
- /** Analytics info on the GitBook's content visitor. */
5076
- export interface EventVisitor {
5077
- /** GitBook's unique identifier of the visitor. */
5078
- anonymousId: string;
5079
- /** The visitors cookies. */
5080
- cookies: Record<string, string>;
5081
- /** User-agent of the visitor. */
5082
- userAgent: string;
5083
- /** IP address of the visitor. */
5084
- ip: string;
5085
- /** Language of the visitor. */
5086
- language?: string;
5087
5181
  }
5088
- /** Event received when a page has been visited on a site. */
5089
- export type SiteViewEvent = SiteEvent & {
5090
- type: "site_view";
5091
- /**
5092
- * Unique identifier of the visited space in the site.
5093
- * @deprecated
5094
- */
5095
- spaceId?: string;
5096
- /** The site-space that was viewed */
5097
- siteSpaceId?: string;
5098
- /** Unique identifier of the visited page. */
5099
- pageId?: string;
5100
- /** Analytics info on the GitBook's content visitor. */
5101
- visitor: EventVisitor;
5102
- /** The GitBook content's URL visited (including URL params). */
5103
- url: string;
5104
- /** The URL of referrer that linked to the page. */
5105
- referrer: string;
5106
- };
5107
- /** Event when the primary content of a space has been updated. */
5108
- export type SpaceContentUpdatedEvent = SpaceEvent & {
5109
- type: "space_content_updated";
5110
- /** Unique identifier of the new content revision */
5111
- revisionId: string;
5112
- /** Users who updated the content */
5113
- updatedBy: User[];
5114
- };
5115
- /** Event when a GitSync operation has been completed. */
5116
- export type SpaceGitSyncCompletedEvent = SpaceEvent & {
5117
- type: "space_gitsync_completed";
5118
- state: "success" | "failure";
5119
- /** Unique identifier of the new content revision */
5120
- revisionId: string;
5121
- /** Unique identifier for the commit (sha) */
5122
- commitId: string;
5123
- };
5124
- /** Event when a GitSync operation has been started. */
5125
- export type SpaceGitSyncStartedEvent = SpaceEvent & {
5126
- type: "space_gitsync_started";
5127
- /** Unique identifier of the new content revision */
5128
- revisionId: string;
5129
- /** Unique identifier for the commit (sha) */
5130
- commitId: string;
5131
- };
5132
- /** Event when the visibility of the space has been changed. */
5133
- export type SpaceVisibilityUpdatedEvent = SpaceEvent & {
5134
- type: "space_visibility_updated";
5135
- /**
5136
- * * `public`: Anyone can access the content, and the content is indexed by search engines.
5137
- * * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
5138
- * * `share-link`: Anyone with a secret token in the url can access the content.
5139
- * * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
5140
- * * `in-collection`: Anyone who can access the parent collection can access the content.
5141
- * Only available for spaces in a collection.
5142
- * * `private`: Authorized members can access the content.
5143
- */
5144
- previousVisibility: ContentVisibility;
5145
- /**
5146
- * * `public`: Anyone can access the content, and the content is indexed by search engines.
5147
- * * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
5148
- * * `share-link`: Anyone with a secret token in the url can access the content.
5149
- * * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
5150
- * * `in-collection`: Anyone who can access the parent collection can access the content.
5151
- * Only available for spaces in a collection.
5152
- * * `private`: Authorized members can access the content.
5153
- */
5154
- visibility: ContentVisibility;
5155
- };
5156
- /** Event representing a background task trigger for an integration. */
5157
- export type TaskEvent = BaseEvent & {
5158
- type: "task";
5159
- /** Payload associated with the integration task. */
5160
- task: object;
5161
- };
5162
- export interface FetchRequest {
5163
- method: "post" | "get" | "put" | "delete";
5164
- url: string;
5165
- headers: Record<string, string>;
5166
- }
5167
- /** Event representing an incoming HTTP request. */
5168
- export type FetchEvent = BaseEvent & {
5169
- /** The space ID, if requests are specific to a single space */
5170
- spaceId?: string;
5171
- /** The site ID, if requests are specific to a single site */
5172
- siteId?: string;
5173
- /** The installation ID, if requests are specific to a single installation */
5174
- installationId?: string;
5175
- auth?: {
5176
- /** The user's ID. */
5177
- userId: string;
5178
- };
5179
- type: "fetch";
5180
- request: FetchRequest;
5181
- };
5182
- /** Common properties for all events related to fetching a published script from an installation */
5183
- export type FetchPublishedScriptEvent = SiteEvent & {
5184
- type: "fetch_published_script";
5185
- };
5186
- /** Common properties for all events related to authenticated access from an installation */
5187
- export type FetchVisitorAuthenticationEvent = SiteEvent & {
5188
- type: "fetch_visitor_authentication";
5189
- location?: string;
5190
- /** Whitelisted search parameters from the visitor authentication request. */
5191
- searchParams?: Record<string, string>;
5192
- /** Whitelisted cookies from the visitor authentication request. */
5193
- cookies?: Record<string, string>;
5194
- /** The visitor authentication action to resolve. If omitted, integrations resolve to the existing login redirect. */
5195
- action?: "logout";
5196
- };
5197
- /** Common properties for ContentKit context. */
5198
- export interface ContentKitContextBase {
5199
- theme: "dark" | "light";
5200
- }
5201
- /** Context while rendering in an account installation's configuration. */
5202
- export type ContentKitContextConfigurationAccount = ContentKitContextBase & {
5203
- type: "configuration_account";
5204
- /** ID of the organization the account installation configuration is in. */
5205
- organizationId: string;
5206
- };
5207
- /** Context while rendering in a space-installation's configuration. */
5208
- export type ContentKitContextConfigurationSpace = ContentKitContextBase & {
5209
- type: "configuration_space";
5210
- /** ID of the space the space-installation configuration is in. */
5211
- spaceId: string;
5212
- };
5213
- /** Context while rendering in a site-installation's configuration. */
5214
- export type ContentKitContextConfigurationSite = ContentKitContextBase & {
5215
- type: "configuration_site";
5216
- /** ID of the site the site-installation configuration is in. */
5217
- siteId: string;
5218
- };
5219
- /** Context while rendering the configuration flow of a content source. */
5220
- export type ContentKitContextConfigurationContentSource = ContentKitContextBase & {
5221
- type: "configuration_contentsource";
5222
- /** ID of the organization the content source installation configuration is in. */
5223
- organizationId: string;
5224
- /** Optional ID of the space the content source installation configuration is in. */
5225
- spaceId?: string;
5226
- };
5227
- /** Context while rendering in a document. */
5228
- export type ContentKitContextDocument = ContentKitContextBase & {
5229
- type: "document";
5230
- /** ID of the space content the document is in. */
5231
- spaceId: string;
5232
- editable: boolean;
5233
- };
5234
- /** Object representing the context in which a ContentKit component is rendered. */
5235
- export type ContentKitContext = ContentKitContextConfigurationAccount | ContentKitContextConfigurationSpace | ContentKitContextConfigurationSite | ContentKitContextConfigurationContentSource | ContentKitContextDocument;
5236
- /** Event generated when rendering a UI */
5237
- export type UIRenderEvent = (SpaceEvent | SiteEvent | InstallationEvent) & {
5238
- auth?: {
5239
- /** The user's ID. */
5240
- userId: string;
5241
- };
5242
- type: "ui_render";
5243
- componentId: string;
5244
- /** Properties to render the UI. */
5245
- props: object;
5246
- /** State of the UI. */
5247
- state?: object;
5248
- /** Object representing the context in which a ContentKit component is rendered. */
5249
- context: ContentKitContext;
5250
- action?: object;
5251
- };
5252
- /** Generic event when computing the content of a space */
5253
- export type ContentComputeEvent = SpaceEvent & {
5254
- sourceId: string;
5255
- /** Properties passed to the rendering. */
5256
- props: PlainObject;
5257
- /** Dependencies of the computation. */
5258
- dependencies: Record<string, ComputedContentDependencyResolved>;
5259
- };
5260
- /**
5261
- * Event generated when computing the document of a pages.
5262
- * The integration should respond with a `Document`.
5263
- */
5264
- export type ContentComputeDocumentEvent = ContentComputeEvent & {
5265
- type: "content_compute_document";
5266
- };
5267
- /**
5268
- * Event generated when computing revision in a content.
5269
- * The integration should respond with an array of pages and files.
5270
- */
5271
- export type ContentComputeRevisionEvent = ContentComputeEvent & {
5272
- type: "content_compute_revision";
5273
- };
5274
- /** Event received when feedback has been submitted on a page. */
5275
- export type PageFeedbackEvent = BaseEvent & {
5276
- type: "page_feedback";
5277
- /** ID of the integration installation */
5278
- installationId: string;
5279
- /**
5280
- * Unique identifier of the space in the site.
5281
- * @deprecated
5282
- */
5283
- spaceId?: string;
5284
- /** Unique identifier of the site. */
5285
- siteId: string;
5286
- /** Unique identifier of the page where feedback was submitted. */
5287
- pageId?: string;
5288
- /** The feedback data submitted by the visitor. */
5289
- feedback: {
5290
- rating: PageFeedbackRating;
5291
- /**
5292
- * Optional comment provided with the feedback.
5293
- * @minLength 1
5294
- * @maxLength 512
5295
- */
5296
- comment?: string;
5297
- };
5298
- /** Analytics info on the GitBook's content visitor. */
5299
- visitor: EventVisitor;
5300
- /** The GitBook content's URL where feedback was submitted. */
5301
- url: string;
5302
- /** The URL of referrer that linked to the page. */
5303
- referrer: string;
5304
- };
5305
- export interface IntegrationEvent {
5306
- /** Unique ID of the event. */
5307
- id: string;
5308
- /** Unique ID of the integration. */
5309
- integrationId: string;
5310
- /** Unique ID of the integration installation. */
5311
- installationId?: string;
5312
- createdAt: Timestamp;
5313
- /** Any event that can be received from GitBook. */
5314
- payload: Event;
5315
- /** Status of the event. */
5316
- status: "success" | "failed";
5317
- }
5318
- export interface IntegrationEventLog {
5319
- /** The message of the log entry. */
5320
- message?: string;
5321
- timestamp?: Timestamp;
5322
- /** The level of the log entry. */
5323
- level?: "debug" | "info" | "warn" | "error";
5324
- }
5325
- export interface IntegrationEventTrace {
5326
- logs: IntegrationEventLog[];
5327
- }
5328
- /** Base properties of an installation of an integration on a site or space. */
5329
- export interface IntegrationContentInstallationBase {
5330
- /** Unique name identifier of the integration */
5331
- integration: string;
5332
- /** ID of the integration installation */
5333
- installation: string;
5334
- status: IntegrationInstallationStatus;
5335
- /** Configuration of the integration for this site */
5336
- configuration: object;
5337
- /** External IDs assigned by the integration. */
5338
- externalIds: IntegrationInstallationExternalIds;
5339
- /** URLs associated with the object */
5340
- urls: {
5341
- /**
5342
- * URL of the integration's installation in the API
5343
- * @format uri
5344
- */
5345
- location: string;
5346
- /**
5347
- * Public HTTP endpoint for the integration's installation
5348
- * @format uri
5349
- */
5350
- publicEndpoint: string;
5351
- /**
5352
- * Public endpoint serving the integration's rendered content (e.g. WebFrames), isolated from the cookie-bearing publicEndpoint origin. Equals publicEndpoint when no separate content origin is configured.
5353
- * @format uri
5354
- */
5355
- publicContentEndpoint: string;
5356
- };
5357
- }
5358
- export type IntegrationSpaceInstallation = IntegrationContentInstallationBase & {
5359
- /** The space the integration is installed on. Using the string value is deprecated in favor of space.id */
5360
- space: string | Space;
5182
+ export type IntegrationSpaceInstallation = IntegrationContentInstallationBase & {
5183
+ /** The space the integration is installed on. Using the string value is deprecated in favor of space.id */
5184
+ space: string | Space;
5361
5185
  };
5362
5186
  /**
5363
5187
  * Title of the site
@@ -5858,6 +5682,45 @@ export interface ContentKitRenderOutputComplete {
5858
5682
  }
5859
5683
  /** Output of the integration when rendering a UI. */
5860
5684
  export type ContentKitRenderOutput = ContentKitRenderOutputElement | ContentKitRenderOutputComplete;
5685
+ /** Common properties for ContentKit context. */
5686
+ export interface ContentKitContextBase {
5687
+ theme: "dark" | "light";
5688
+ }
5689
+ /** Context while rendering in an account installation's configuration. */
5690
+ export type ContentKitContextConfigurationAccount = ContentKitContextBase & {
5691
+ type: "configuration_account";
5692
+ /** ID of the organization the account installation configuration is in. */
5693
+ organizationId: string;
5694
+ };
5695
+ /** Context while rendering in a space-installation's configuration. */
5696
+ export type ContentKitContextConfigurationSpace = ContentKitContextBase & {
5697
+ type: "configuration_space";
5698
+ /** ID of the space the space-installation configuration is in. */
5699
+ spaceId: string;
5700
+ };
5701
+ /** Context while rendering in a site-installation's configuration. */
5702
+ export type ContentKitContextConfigurationSite = ContentKitContextBase & {
5703
+ type: "configuration_site";
5704
+ /** ID of the site the site-installation configuration is in. */
5705
+ siteId: string;
5706
+ };
5707
+ /** Context while rendering the configuration flow of a content source. */
5708
+ export type ContentKitContextConfigurationContentSource = ContentKitContextBase & {
5709
+ type: "configuration_contentsource";
5710
+ /** ID of the organization the content source installation configuration is in. */
5711
+ organizationId: string;
5712
+ /** Optional ID of the space the content source installation configuration is in. */
5713
+ spaceId?: string;
5714
+ };
5715
+ /** Context while rendering in a document. */
5716
+ export type ContentKitContextDocument = ContentKitContextBase & {
5717
+ type: "document";
5718
+ /** ID of the space content the document is in. */
5719
+ spaceId: string;
5720
+ editable: boolean;
5721
+ };
5722
+ /** Object representing the context in which a ContentKit component is rendered. */
5723
+ export type ContentKitContext = ContentKitContextConfigurationAccount | ContentKitContextConfigurationSpace | ContentKitContextConfigurationSite | ContentKitContextConfigurationContentSource | ContentKitContextDocument;
5861
5724
  export interface RenderIntegrationUI {
5862
5725
  /** ID of the component to render in the integration. */
5863
5726
  componentId: string;
@@ -5873,25 +5736,91 @@ export interface RenderIntegrationUI {
5873
5736
  export interface UpdateIntegrationInstallation {
5874
5737
  /** External IDs assigned by the integration. */
5875
5738
  externalIds?: IntegrationInstallationExternalIds;
5876
- /** Configuration of the integration at the account level */
5739
+ /** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
5877
5740
  configuration?: IntegrationInstallationConfiguration;
5878
5741
  /** Describe whether all spaces have been selected or there's a selection involved */
5879
5742
  space_selection?: IntegrationInstallationSpaceSelection;
5880
5743
  /** Describe whether all sites have been selected or there's a selection involved */
5881
5744
  site_selection?: IntegrationInstallationSiteSelection;
5745
+ /** ID of a consumed OAuth transaction for this exact target, authorizing a credential write. Single use. */
5746
+ oauthTransaction?: string;
5747
+ }
5748
+ /** At most one of `spaceId` and `siteId` can be set. */
5749
+ export interface CreateIntegrationOAuthTransaction {
5750
+ /** Connect this space installation instead of the installation. */
5751
+ spaceId?: string;
5752
+ /** Connect this site installation instead of the installation. */
5753
+ siteId?: string;
5754
+ }
5755
+ export interface IntegrationOAuthTransactionStart {
5756
+ object: "integration-oauth-transaction-start";
5757
+ /** Opaque ID of the transaction, sent as the OAuth `state`. */
5758
+ id: string;
5759
+ expiresAt: Timestamp;
5760
+ /**
5761
+ * URL to open in the browser completing the flow: the target's `/oauth` route with `gitbook_oauth_transaction` and `gitbook_oauth_code_challenge`. Holds no secret.
5762
+ * @format uri
5763
+ */
5764
+ startURL: string;
5765
+ }
5766
+ export interface ConsumeIntegrationOAuthTransaction {
5767
+ /** The exact `redirect_uri` sent to the provider's authorize and token endpoints. */
5768
+ redirectUri: string;
5769
+ /** The authorization code received on the callback. */
5770
+ code: string;
5771
+ }
5772
+ export interface IntegrationOAuthTransaction {
5773
+ object: "integration-oauth-transaction";
5774
+ id: string;
5775
+ /** ID of the organization of the installation. */
5776
+ organization: string;
5777
+ /** ID of the installation the credentials must be written to. */
5778
+ installation: string;
5779
+ /** ID of the space whose installation the credentials must be written to. */
5780
+ space?: string;
5781
+ /** ID of the site whose installation the credentials must be written to. */
5782
+ site?: string;
5783
+ /** PKCE code verifier, to send as `code_verifier` when exchanging the code. */
5784
+ codeVerifier: string;
5785
+ /** The validated redirect URI. */
5786
+ redirectUri: string;
5787
+ grantExpiresAt: Timestamp;
5788
+ }
5789
+ export interface ConfirmIntegrationOAuthTransaction {
5790
+ /** The one-time key from the confirm page's URL fragment. */
5791
+ key: string;
5792
+ }
5793
+ export interface IntegrationOAuthTransactionConfirmation {
5794
+ object: "integration-oauth-transaction-confirmation";
5795
+ /**
5796
+ * Callback URL to return the browser to, on the integrations host.
5797
+ * @format uri
5798
+ */
5799
+ callbackURL: string;
5882
5800
  }
5883
5801
  export interface UpdateIntegrationSpaceInstallation {
5884
5802
  /** External IDs assigned by the integration. */
5885
5803
  externalIds?: IntegrationInstallationExternalIds;
5886
- /** Configuration of the integration at the account level */
5804
+ /** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
5887
5805
  configuration?: IntegrationInstallationConfiguration;
5806
+ /** ID of a consumed OAuth transaction for this exact target, authorizing a credential write. Single use. */
5807
+ oauthTransaction?: string;
5888
5808
  }
5889
5809
  export interface UpdateIntegrationSiteInstallation {
5890
5810
  /** External IDs assigned by the integration. */
5891
5811
  externalIds?: IntegrationInstallationExternalIds;
5892
- /** Configuration of the integration at the account level */
5812
+ /** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
5893
5813
  configuration?: IntegrationInstallationConfiguration;
5814
+ /** ID of a consumed OAuth transaction for this exact target, authorizing a credential write. Single use. */
5815
+ oauthTransaction?: string;
5894
5816
  }
5817
+ /**
5818
+ * Name of a new organization
5819
+ * @minLength 2
5820
+ * @maxLength 80
5821
+ * @pattern \S.*\S
5822
+ */
5823
+ export type NewOrganizationTitle = string;
5895
5824
  /** Preferences collected from the user during site onboarding, used to tailor recommendations and to apply their initial setup choices. */
5896
5825
  export interface SiteOnboardingPreferences {
5897
5826
  source: SiteOnboardingSource | null;
@@ -5899,8 +5828,12 @@ export interface SiteOnboardingPreferences {
5899
5828
  interests: SiteOnboardingInterest[];
5900
5829
  }
5901
5830
  export interface CreateOrganization {
5902
- /** Name of the organization */
5903
- title: OrganizationTitle;
5831
+ /** Name of a new organization */
5832
+ title: NewOrganizationTitle;
5833
+ /**
5834
+ * No longer supported: a non-empty list is rejected. Add and verify domains with the domain management API after the organization is created.
5835
+ * @deprecated
5836
+ */
5904
5837
  emailDomains?: OrganizationEmailDomains;
5905
5838
  /** Preferences collected from the user during onboarding, to apply to the organization's default site. Only used when `withDefaultSite` is true. */
5906
5839
  onboardingPreferences?: SiteOnboardingPreferences;
@@ -6414,13 +6347,11 @@ export type BillingCancellationFeedback = {
6414
6347
  } | {
6415
6348
  reason: "will_vibe_code_our_own_app";
6416
6349
  /** The tool the organization is moving to */
6417
- reasonDetail: "claude" | "codex" | "replit";
6418
- } | {
6419
- reason: "will_vibe_code_our_own_app";
6420
- /** The tool the organization is moving to */
6421
- reasonDetail: "other";
6350
+ reasonDetail: "claude" | "codex" | "cursor" | "lovable" | "replit" | "other";
6422
6351
  /** Free-text detail a user typed alongside their cancellation reason. */
6423
- reasonComment: BillingCancellationComment;
6352
+ reasonComment?: BillingCancellationComment;
6353
+ /** Where the organization plans to host its own solution */
6354
+ reasonHosting?: "own_website_or_app" | "vercel" | "netlify" | "github_pages" | "cloudflare_pages" | "not_decided" | "other";
6424
6355
  } | {
6425
6356
  reason: "found_better_alternative";
6426
6357
  /** Free-text detail a user typed alongside their cancellation reason. */
@@ -6431,6 +6362,28 @@ export type BillingCancellationFeedback = {
6431
6362
  reason: "other_reason";
6432
6363
  /** Free-text detail a user typed alongside their cancellation reason. */
6433
6364
  reasonComment: BillingCancellationComment;
6365
+ } | {
6366
+ reason: "not_using_enough";
6367
+ reasonDetail: "yes_in_a_few_months" | "no";
6368
+ /** Free-text detail a user typed alongside their cancellation reason. */
6369
+ reasonComment?: BillingCancellationComment;
6370
+ } | {
6371
+ reason: "found_better_alternative";
6372
+ reasonDetail: "mintlify" | "readme" | "docusaurus" | "notion" | "confluence" | "self_hosted" | "other";
6373
+ /** Free-text detail a user typed alongside their cancellation reason. */
6374
+ reasonComment?: BillingCancellationComment;
6375
+ } | {
6376
+ reason: "not_satisfied_with_product";
6377
+ /** Free-text detail a user typed alongside their cancellation reason. */
6378
+ reasonComment: BillingCancellationComment;
6379
+ } | {
6380
+ reason: "budget";
6381
+ reasonDetail: "budget_cuts" | "plan_price_increase" | "consolidating_tools" | "funding_changed" | "excess_seats_or_sites" | "project_budget_reduced";
6382
+ } | {
6383
+ reason: "budget";
6384
+ reasonDetail: "other";
6385
+ /** Free-text detail a user typed alongside their cancellation reason. */
6386
+ reasonComment: BillingCancellationComment;
6434
6387
  };
6435
6388
  /**
6436
6389
  * Coupon or promotion code to apply to billing operations.
@@ -6788,6 +6741,40 @@ export interface OrganizationSAMLProvider {
6788
6741
  location: string;
6789
6742
  };
6790
6743
  }
6744
+ /** Role given to people who join through the domain. "default" uses the organization's default role, and "guest" adds them as guests. */
6745
+ export type OrganizationDomainDefaultRole = MemberRole | "default" | "guest";
6746
+ /** An email domain of an organization. */
6747
+ export interface OrganizationDomain {
6748
+ /** The object type, which is always "organization-domain" */
6749
+ object: "organization-domain";
6750
+ /** The email domain, such as "example.com" */
6751
+ domain: string;
6752
+ /** Verification status of the domain. "legacy" is a domain added before verification existed: it keeps letting people join automatically without being verified. */
6753
+ status: OrganizationDomainStatus;
6754
+ /** Why the last verification failed */
6755
+ statusDescription?: string;
6756
+ /** DNS TXT record to add to the domain to verify it */
6757
+ verificationRecord?: {
6758
+ type: "TXT";
6759
+ name: string;
6760
+ value: string;
6761
+ };
6762
+ /** Whether people with an email on the domain join the organization automatically */
6763
+ autoJoinEnabled: boolean;
6764
+ /** Role given to people who join through the domain. "default" uses the organization's default role, and "guest" adds them as guests. */
6765
+ defaultRole: OrganizationDomainDefaultRole;
6766
+ /** ID of the team that people joining through the domain are added to */
6767
+ defaultTeam?: string;
6768
+ /** Date the domain was verified */
6769
+ verifiedAt?: Timestamp;
6770
+ /** Date the domain was added */
6771
+ createdAt: Timestamp;
6772
+ /** URLs associated with the object */
6773
+ urls: {
6774
+ /** URL of the domain in the API */
6775
+ location: URL;
6776
+ };
6777
+ }
6791
6778
  /**
6792
6779
  * Name of the SCIM connection, shown to organization admins.
6793
6780
  * @minLength 1
@@ -9467,6 +9454,8 @@ export interface AIMessage {
9467
9454
  }
9468
9455
  export type SiteQuestionAnswerWithResponse = SiteQuestionAnswer & {
9469
9456
  response: AIMessage;
9457
+ /** Claims of the site visitor who asked, as recorded by site insights. Absent when the visitor sent no claims. */
9458
+ visitorClaims?: PlainObject;
9470
9459
  };
9471
9460
  export type SiteSpaceCustomizationSettings = SiteCustomizationSettings & {
9472
9461
  /** Indicates whether the site customization settings have been overridden. */
@@ -9704,6 +9693,8 @@ export interface SiteSettingsBrokenLinks {
9704
9693
  * - `suggest-fixes` drafts fixes for approval and applies none.
9705
9694
  * - `fix-clear-matches` applies the clearest fixes and drafts the less certain ones for approval.
9706
9695
  * - `fix-close-matches` applies the clear and the close fixes.
9696
+ * At every level, GitBook drafts change requests that fix broken links to other sites, and never
9697
+ * merges them.
9707
9698
  */
9708
9699
  autonomyLevel: SiteSettingsBrokenLinksAutonomyLevel;
9709
9700
  }
@@ -10723,6 +10714,22 @@ export interface SiteVisitorPayload {
10723
10714
  country?: string;
10724
10715
  unsignedClaims?: PlainObject;
10725
10716
  }
10717
+ /** JSON schema describing the expected attributes of an Adaptive site schema. */
10718
+ export interface SiteAdaptiveJSONSchema {
10719
+ $schema?: "http://json-schema.org/draft-07/schema#";
10720
+ type: "object";
10721
+ properties: {
10722
+ /** Unsigned claims of the site visitor. */
10723
+ unsigned?: {
10724
+ type: "object";
10725
+ description: "Unsigned claims of the site visitor.";
10726
+ properties: Record<string, SiteAdaptiveJSONSchemaClaimsProperties>;
10727
+ additionalProperties: false;
10728
+ };
10729
+ [key: string]: any;
10730
+ };
10731
+ additionalProperties: false;
10732
+ }
10726
10733
  /** GitHub repository that can be selected for Git Sync. */
10727
10734
  export interface GitSyncGitHubRepository {
10728
10735
  id: number;
@@ -10839,6 +10846,7 @@ export interface ContentLocationChangeRequestContext {
10839
10846
  }
10840
10847
  export interface ContentLocationFile {
10841
10848
  kind: "file";
10849
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
10842
10850
  organization: Organization;
10843
10851
  space: Space;
10844
10852
  versionContext?: ContentLocationRevisionContext | ContentLocationChangeRequestContext;
@@ -10860,6 +10868,7 @@ export interface ContentLocationPageNode {
10860
10868
  }
10861
10869
  export interface ContentLocationPage {
10862
10870
  kind: "page";
10871
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
10863
10872
  organization: Organization;
10864
10873
  page: RevisionPage;
10865
10874
  space: Space;
@@ -10872,16 +10881,19 @@ export interface ContentLocationUser {
10872
10881
  }
10873
10882
  export interface ContentLocationCollection {
10874
10883
  kind: "collection";
10884
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
10875
10885
  organization: Organization;
10876
10886
  collection: Collection;
10877
10887
  }
10878
10888
  export interface ContentLocationSpace {
10879
10889
  kind: "space";
10890
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
10880
10891
  organization: Organization;
10881
10892
  space: Space;
10882
10893
  }
10883
10894
  export interface ContentLocationReusableContent {
10884
10895
  kind: "reusable-content";
10896
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
10885
10897
  organization: Organization;
10886
10898
  space: Space;
10887
10899
  versionContext?: ContentLocationRevisionContext | ContentLocationChangeRequestContext;
@@ -10889,6 +10901,7 @@ export interface ContentLocationReusableContent {
10889
10901
  }
10890
10902
  export interface ContentLocationOpenAPI {
10891
10903
  kind: "openapi";
10904
+ /** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
10892
10905
  organization: Organization;
10893
10906
  openAPISpec: OpenAPISpec;
10894
10907
  }
@@ -11480,17 +11493,290 @@ export interface IntegrationEnvironment {
11480
11493
  /** API authentication token representing the current installation. */
11481
11494
  installation?: string;
11482
11495
  };
11483
- /** Network configuration for the integration environment */
11484
- network?: IntegrationNetwork;
11485
- }
11486
- export interface SpaceIntegrationScript {
11487
- /** Script URL to load. */
11488
- script: URL;
11489
- /** Content Security Policy to secure the loading of this script. */
11490
- contentSecurityPolicy?: string;
11491
- /** If true, the script will potentially load use cookies and visitors should be aware. */
11492
- cookies: boolean;
11493
- }
11496
+ /** Network configuration for the integration environment */
11497
+ network?: IntegrationNetwork;
11498
+ }
11499
+ export interface SpaceIntegrationScript {
11500
+ /** Script URL to load. */
11501
+ script: URL;
11502
+ /** Content Security Policy to secure the loading of this script. */
11503
+ contentSecurityPolicy?: string;
11504
+ /** If true, the script will potentially load use cookies and visitors should be aware. */
11505
+ cookies: boolean;
11506
+ }
11507
+ /** Common properties for all events. */
11508
+ export interface BaseEvent {
11509
+ /** Unique identifier for the event. */
11510
+ eventId: string;
11511
+ /** Type of the event. */
11512
+ type: string;
11513
+ }
11514
+ /** Common properties for all events related to an installation */
11515
+ export type InstallationEvent = BaseEvent & {
11516
+ /** ID of the integration installation */
11517
+ installationId: string;
11518
+ };
11519
+ /** Event received when integration has been installed or updated. */
11520
+ export type InstallationSetupEvent = InstallationEvent & {
11521
+ type: "installation_setup";
11522
+ status: IntegrationInstallationStatus;
11523
+ /** The state of the installation at the account level before it was updated. */
11524
+ previous?: {
11525
+ status: IntegrationInstallationStatus;
11526
+ /** The previous configuration of the installation at the account level. */
11527
+ configuration?: object;
11528
+ };
11529
+ };
11530
+ /** Event received when integration has been uninstalled from an organization. */
11531
+ export type InstallationDeletedEvent = InstallationEvent & {
11532
+ type: "installation_deleted";
11533
+ /** The state of the installation before it was deleted. */
11534
+ previous: {
11535
+ /** The previous configuration of the installation. */
11536
+ configuration?: object;
11537
+ };
11538
+ };
11539
+ /** Common properties for all events related to a specific space. */
11540
+ export type SpaceEvent = InstallationEvent & {
11541
+ /** ID of the space */
11542
+ spaceId: string;
11543
+ };
11544
+ /** Event received when integration has been installed or updated on a space. */
11545
+ export type SpaceInstallationSetupEvent = SpaceEvent & {
11546
+ type: "space_installation_setup";
11547
+ status: IntegrationInstallationStatus;
11548
+ /** The state of the Space installation before it was updated. */
11549
+ previous?: {
11550
+ status: IntegrationInstallationStatus;
11551
+ /** The previous configuration of the Space installation. */
11552
+ configuration?: object;
11553
+ };
11554
+ };
11555
+ /** Event received when integration has been uninstalled from a space. */
11556
+ export type SpaceInstallationDeletedEvent = SpaceEvent & {
11557
+ type: "space_installation_deleted";
11558
+ /** The state of the Space installation before it was deleted. */
11559
+ previous: {
11560
+ /** The previous configuration of the Space installation. */
11561
+ configuration?: object;
11562
+ };
11563
+ };
11564
+ /** Common properties for all events related to a specific site. */
11565
+ export type SiteEvent = InstallationEvent & {
11566
+ /** ID of the site */
11567
+ siteId: string;
11568
+ };
11569
+ /** Event received when integration has been installed or updated on a site. */
11570
+ export type SiteInstallationSetupEvent = SiteEvent & {
11571
+ type: "site_installation_setup";
11572
+ status: IntegrationInstallationStatus;
11573
+ /** The state of the site installation before it was updated. */
11574
+ previous?: {
11575
+ status: IntegrationInstallationStatus;
11576
+ /** The previous configuration of the site installation. */
11577
+ configuration?: object;
11578
+ };
11579
+ };
11580
+ /** Event received when integration has been uninstalled from a site. */
11581
+ export type SiteInstallationDeletedEvent = SiteEvent & {
11582
+ type: "site_installation_deleted";
11583
+ /** The state of the site installation before it was deleted. */
11584
+ previous: {
11585
+ /** The previous configuration of the site installation. */
11586
+ configuration?: object;
11587
+ };
11588
+ };
11589
+ /** Analytics info on the GitBook's content visitor. */
11590
+ export interface EventVisitor {
11591
+ /** GitBook's unique identifier of the visitor. */
11592
+ anonymousId: string;
11593
+ /** The visitors cookies. */
11594
+ cookies: Record<string, string>;
11595
+ /** User-agent of the visitor. */
11596
+ userAgent: string;
11597
+ /** IP address of the visitor. */
11598
+ ip: string;
11599
+ /** Language of the visitor. */
11600
+ language?: string;
11601
+ }
11602
+ /** Event received when a page has been visited on a site. */
11603
+ export type SiteViewEvent = SiteEvent & {
11604
+ type: "site_view";
11605
+ /**
11606
+ * Unique identifier of the visited space in the site.
11607
+ * @deprecated
11608
+ */
11609
+ spaceId?: string;
11610
+ /** The site-space that was viewed */
11611
+ siteSpaceId?: string;
11612
+ /** Unique identifier of the visited page. */
11613
+ pageId?: string;
11614
+ /** Analytics info on the GitBook's content visitor. */
11615
+ visitor: EventVisitor;
11616
+ /** The GitBook content's URL visited (including URL params). */
11617
+ url: string;
11618
+ /** The URL of referrer that linked to the page. */
11619
+ referrer: string;
11620
+ };
11621
+ /** Event when the primary content of a space has been updated. */
11622
+ export type SpaceContentUpdatedEvent = SpaceEvent & {
11623
+ type: "space_content_updated";
11624
+ /** Unique identifier of the new content revision */
11625
+ revisionId: string;
11626
+ /** Users who updated the content */
11627
+ updatedBy: User[];
11628
+ };
11629
+ /** Event when a GitSync operation has been completed. */
11630
+ export type SpaceGitSyncCompletedEvent = SpaceEvent & {
11631
+ type: "space_gitsync_completed";
11632
+ state: "success" | "failure";
11633
+ /** Unique identifier of the new content revision */
11634
+ revisionId: string;
11635
+ /** Unique identifier for the commit (sha) */
11636
+ commitId: string;
11637
+ };
11638
+ /** Event when a GitSync operation has been started. */
11639
+ export type SpaceGitSyncStartedEvent = SpaceEvent & {
11640
+ type: "space_gitsync_started";
11641
+ /** Unique identifier of the new content revision */
11642
+ revisionId: string;
11643
+ /** Unique identifier for the commit (sha) */
11644
+ commitId: string;
11645
+ };
11646
+ /** Event when the visibility of the space has been changed. */
11647
+ export type SpaceVisibilityUpdatedEvent = SpaceEvent & {
11648
+ type: "space_visibility_updated";
11649
+ /**
11650
+ * * `public`: Anyone can access the content, and the content is indexed by search engines.
11651
+ * * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
11652
+ * * `share-link`: Anyone with a secret token in the url can access the content.
11653
+ * * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
11654
+ * * `in-collection`: Anyone who can access the parent collection can access the content.
11655
+ * Only available for spaces in a collection.
11656
+ * * `private`: Authorized members can access the content.
11657
+ */
11658
+ previousVisibility: ContentVisibility;
11659
+ /**
11660
+ * * `public`: Anyone can access the content, and the content is indexed by search engines.
11661
+ * * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
11662
+ * * `share-link`: Anyone with a secret token in the url can access the content.
11663
+ * * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
11664
+ * * `in-collection`: Anyone who can access the parent collection can access the content.
11665
+ * Only available for spaces in a collection.
11666
+ * * `private`: Authorized members can access the content.
11667
+ */
11668
+ visibility: ContentVisibility;
11669
+ };
11670
+ /** Event representing a background task trigger for an integration. */
11671
+ export type TaskEvent = BaseEvent & {
11672
+ type: "task";
11673
+ /** Payload associated with the integration task. */
11674
+ task: object;
11675
+ };
11676
+ export interface FetchRequest {
11677
+ method: "post" | "get" | "put" | "delete";
11678
+ url: string;
11679
+ headers: Record<string, string>;
11680
+ }
11681
+ /** Event representing an incoming HTTP request. */
11682
+ export type FetchEvent = BaseEvent & {
11683
+ /** The space ID, if requests are specific to a single space */
11684
+ spaceId?: string;
11685
+ /** The site ID, if requests are specific to a single site */
11686
+ siteId?: string;
11687
+ /** The installation ID, if requests are specific to a single installation */
11688
+ installationId?: string;
11689
+ auth?: {
11690
+ /** The user's ID. */
11691
+ userId: string;
11692
+ };
11693
+ type: "fetch";
11694
+ request: FetchRequest;
11695
+ };
11696
+ /** Common properties for all events related to fetching a published script from an installation */
11697
+ export type FetchPublishedScriptEvent = SiteEvent & {
11698
+ type: "fetch_published_script";
11699
+ };
11700
+ /** Common properties for all events related to authenticated access from an installation */
11701
+ export type FetchVisitorAuthenticationEvent = SiteEvent & {
11702
+ type: "fetch_visitor_authentication";
11703
+ location?: string;
11704
+ /** Whitelisted search parameters from the visitor authentication request. */
11705
+ searchParams?: Record<string, string>;
11706
+ /** Whitelisted cookies from the visitor authentication request. */
11707
+ cookies?: Record<string, string>;
11708
+ /** The visitor authentication action to resolve. If omitted, integrations resolve to the existing login redirect. */
11709
+ action?: "logout";
11710
+ };
11711
+ /** Event generated when rendering a UI */
11712
+ export type UIRenderEvent = (SpaceEvent | SiteEvent | InstallationEvent) & {
11713
+ auth?: {
11714
+ /** The user's ID. */
11715
+ userId: string;
11716
+ };
11717
+ type: "ui_render";
11718
+ componentId: string;
11719
+ /** Properties to render the UI. */
11720
+ props: object;
11721
+ /** State of the UI. */
11722
+ state?: object;
11723
+ /** Object representing the context in which a ContentKit component is rendered. */
11724
+ context: ContentKitContext;
11725
+ action?: object;
11726
+ };
11727
+ /** Generic event when computing the content of a space */
11728
+ export type ContentComputeEvent = SpaceEvent & {
11729
+ sourceId: string;
11730
+ /** Properties passed to the rendering. */
11731
+ props: PlainObject;
11732
+ /** Dependencies of the computation. */
11733
+ dependencies: Record<string, ComputedContentDependencyResolved>;
11734
+ };
11735
+ /**
11736
+ * Event generated when computing the document of a pages.
11737
+ * The integration should respond with a `Document`.
11738
+ */
11739
+ export type ContentComputeDocumentEvent = ContentComputeEvent & {
11740
+ type: "content_compute_document";
11741
+ };
11742
+ /**
11743
+ * Event generated when computing revision in a content.
11744
+ * The integration should respond with an array of pages and files.
11745
+ */
11746
+ export type ContentComputeRevisionEvent = ContentComputeEvent & {
11747
+ type: "content_compute_revision";
11748
+ };
11749
+ /** Event received when feedback has been submitted on a page. */
11750
+ export type PageFeedbackEvent = BaseEvent & {
11751
+ type: "page_feedback";
11752
+ /** ID of the integration installation */
11753
+ installationId: string;
11754
+ /**
11755
+ * Unique identifier of the space in the site.
11756
+ * @deprecated
11757
+ */
11758
+ spaceId?: string;
11759
+ /** Unique identifier of the site. */
11760
+ siteId: string;
11761
+ /** Unique identifier of the page where feedback was submitted. */
11762
+ pageId?: string;
11763
+ /** The feedback data submitted by the visitor. */
11764
+ feedback: {
11765
+ rating: PageFeedbackRating;
11766
+ /**
11767
+ * Optional comment provided with the feedback.
11768
+ * @minLength 1
11769
+ * @maxLength 512
11770
+ */
11771
+ comment?: string;
11772
+ };
11773
+ /** Analytics info on the GitBook's content visitor. */
11774
+ visitor: EventVisitor;
11775
+ /** The GitBook content's URL where feedback was submitted. */
11776
+ url: string;
11777
+ /** The URL of referrer that linked to the page. */
11778
+ referrer: string;
11779
+ };
11494
11780
  /** Response expected for an event of type `content_compute_document`. */
11495
11781
  export interface ContentComputeDocumentEventResponse {
11496
11782
  document: Document;
@@ -11585,6 +11871,10 @@ export interface APIChannelUserOrganizations {
11585
11871
  channel: "user-organizations";
11586
11872
  user: string;
11587
11873
  }
11874
+ export interface APIChannelUserPasskeys {
11875
+ channel: "user-passkeys";
11876
+ user: string;
11877
+ }
11588
11878
  export interface APIChannelUserProfile {
11589
11879
  channel: "user-profile";
11590
11880
  user: string;
@@ -11700,6 +11990,11 @@ export interface APIChannelOrganizationSCIMConnections {
11700
11990
  channel: "organization-scim-connections";
11701
11991
  organization: string;
11702
11992
  }
11993
+ /** Subscription channel for changes in the email domains of an organization. */
11994
+ export interface APIChannelOrganizationDomains {
11995
+ channel: "organization-domains";
11996
+ organization: string;
11997
+ }
11703
11998
  /** Subscription channel for changes in custom fonts in an organization. */
11704
11999
  export interface APIChannelOrganizationCustomFonts {
11705
12000
  channel: "organization-fonts";
@@ -11912,22 +12207,6 @@ export interface APIChannelMutationData {
11912
12207
  executionId: string;
11913
12208
  };
11914
12209
  }
11915
- /** JSON schema describing the expected attributes of an Adaptive site schema. */
11916
- export interface SiteAdaptiveJSONSchema {
11917
- $schema?: "http://json-schema.org/draft-07/schema#";
11918
- type: "object";
11919
- properties: {
11920
- /** Unsigned claims of the site visitor. */
11921
- unsigned?: {
11922
- type: "object";
11923
- description: "Unsigned claims of the site visitor.";
11924
- properties: Record<string, SiteAdaptiveJSONSchemaClaimsProperties>;
11925
- additionalProperties: false;
11926
- };
11927
- [key: string]: any;
11928
- };
11929
- additionalProperties: false;
11930
- }
11931
12210
  export type SiteAdaptiveDeterministicJSONSchemaClaimsProperties = SiteAdaptiveDeterministicJSONSchemaPrimitives | {
11932
12211
  type: "object";
11933
12212
  description: string;
@@ -12077,6 +12356,9 @@ export type RequestPublishIntegration = PublishIntegration;
12077
12356
  export type RequestUpdateIntegrationInstallation = UpdateIntegrationInstallation;
12078
12357
  export type RequestUpdateIntegrationSpaceInstallation = UpdateIntegrationSpaceInstallation;
12079
12358
  export type RequestUpdateIntegrationSiteInstallation = UpdateIntegrationSiteInstallation;
12359
+ export type RequestCreateIntegrationOAuthTransaction = CreateIntegrationOAuthTransaction;
12360
+ export type RequestConsumeIntegrationOAuthTransaction = ConsumeIntegrationOAuthTransaction;
12361
+ export type RequestConfirmIntegrationOAuthTransaction = ConfirmIntegrationOAuthTransaction;
12080
12362
  export type RequestUpgradeOrganizationBilling = UpgradeOrganizationBilling;
12081
12363
  export type RequestInviteUsersToOrganization = InviteUsersToOrganization;
12082
12364
  export type RequestImportGitRepository = ImportGitRepository;
@@ -13364,7 +13646,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13364
13646
  computed?: boolean;
13365
13647
  }, params?: RequestParams) => Promise<HttpResponse<Revision, any>>;
13366
13648
  /**
13367
- * @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. 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` and changed with `update_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 one it does not, rejects the batch. **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.
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.
13368
13650
  *
13369
13651
  * @tags change-request-content
13370
13652
  * @name UpdateChangeRequestContent
@@ -14554,7 +14836,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14554
14836
  };
14555
14837
  }>>;
14556
14838
  /**
14557
- * No description
14839
+ * @description Publishes integration code and configuration. GitBook-owned integrations in production require a controlled deployment and cannot be created, updated or transferred through this operation.
14558
14840
  *
14559
14841
  * @tags integrations
14560
14842
  * @name PublishIntegration
@@ -14563,6 +14845,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14563
14845
  * @secure
14564
14846
  */
14565
14847
  publishIntegration: (integrationName: string, data: PublishIntegration, params?: RequestParams) => Promise<HttpResponse<Integration, {
14848
+ error: {
14849
+ /** @format int32 */
14850
+ code: 403;
14851
+ message: string;
14852
+ };
14853
+ } | {
14566
14854
  error: {
14567
14855
  /** @format int32 */
14568
14856
  code: 404;
@@ -14570,7 +14858,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14570
14858
  };
14571
14859
  }>>;
14572
14860
  /**
14573
- * No description
14861
+ * @description Removes an integration. GitBook-owned production integrations require a controlled deployment and cannot be removed through this operation.
14574
14862
  *
14575
14863
  * @tags integrations
14576
14864
  * @name UnpublishIntegration
@@ -14578,7 +14866,13 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14578
14866
  * @request DELETE:/integrations/{integrationName}
14579
14867
  * @secure
14580
14868
  */
14581
- unpublishIntegration: (integrationName: string, params?: RequestParams) => Promise<HttpResponse<void, any>>;
14869
+ unpublishIntegration: (integrationName: string, params?: RequestParams) => Promise<HttpResponse<void, {
14870
+ error: {
14871
+ /** @format int32 */
14872
+ code: 403;
14873
+ message: string;
14874
+ };
14875
+ }>>;
14582
14876
  /**
14583
14877
  * No description
14584
14878
  *
@@ -14649,7 +14943,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14649
14943
  * @secure
14650
14944
  */
14651
14945
  getIntegrationEvent: (integrationName: string, eventId: string, params?: RequestParams) => Promise<HttpResponse<{
14946
+ /** Diagnostic metadata for a delivered event, including historical records. The payload is intentionally limited to event type and identifiers; it is not the full runtime event. Events and configuration delivered to the integration runtime are unaffected. */
14652
14947
  event: IntegrationEvent;
14948
+ /** Safe execution metadata. Worker log and exception text are suppressed. */
14653
14949
  trace?: IntegrationEventTrace;
14654
14950
  }, {
14655
14951
  error: {
@@ -14715,7 +15011,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14715
15011
  items: IntegrationSiteInstallation[];
14716
15012
  }, any>>;
14717
15013
  /**
14718
- * No description
15014
+ * @description Enables a development tunnel. GitBook-owned production integrations cannot enable development mode; previously configured tunnels are ignored when dispatching their events.
14719
15015
  *
14720
15016
  * @tags integrations
14721
15017
  * @name SetIntegrationDevelopmentMode
@@ -14736,6 +15032,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14736
15032
  */
14737
15033
  all?: boolean;
14738
15034
  }, params?: RequestParams) => Promise<HttpResponse<void, {
15035
+ error: {
15036
+ /** @format int32 */
15037
+ code: 403;
15038
+ message: string;
15039
+ };
15040
+ } | {
14739
15041
  error: {
14740
15042
  /** @format int32 */
14741
15043
  code: 404;
@@ -14801,7 +15103,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14801
15103
  };
14802
15104
  }>>;
14803
15105
  /**
14804
- * @description Returns the organization-level installation of an integration, including its account configuration and how many spaces it manages. The configuration can contain credentials the integration stored for third-party services.
15106
+ * @description Returns the organization-level installation of an integration, including its account configuration and how many spaces it manages. For user authentication, saved OAuth credentials are replaced with a boolean connection indicator.
14805
15107
  *
14806
15108
  * @tags integrations
14807
15109
  * @name GetIntegrationInstallationById
@@ -14817,7 +15119,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14817
15119
  };
14818
15120
  }>>;
14819
15121
  /**
14820
- * @description Updates the account-level configuration of an installation, and which spaces or sites it applies to.
15122
+ * @description Updates the account-level configuration of an installation, and which spaces or sites it applies to. Only a user can change `space_selection` and `site_selection`; integration and installation tokens get a 403 when they send them.
14821
15123
  *
14822
15124
  * @tags integrations
14823
15125
  * @name UpdateIntegrationInstallation
@@ -14852,6 +15154,84 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14852
15154
  message: string;
14853
15155
  };
14854
15156
  }>>;
15157
+ /**
15158
+ * @description Creates a short-lived, single-use transaction binding an OAuth authorization flow to the authenticated user, the installation and an optional space or site installation. Open the returned `startURL` in the browser that will complete the flow.
15159
+ *
15160
+ * @tags integrations
15161
+ * @name CreateIntegrationOAuthTransaction
15162
+ * @summary Start an OAuth connection for an integration installation
15163
+ * @request POST:/integrations/{integrationName}/installations/{installationId}/oauth-transactions
15164
+ * @secure
15165
+ */
15166
+ createIntegrationOAuthTransaction: (integrationName: string, installationId: string, data?: CreateIntegrationOAuthTransaction, params?: RequestParams) => Promise<HttpResponse<IntegrationOAuthTransactionStart, {
15167
+ error: {
15168
+ /** @format int32 */
15169
+ code: 400;
15170
+ message: string;
15171
+ };
15172
+ } | {
15173
+ error: {
15174
+ /** @format int32 */
15175
+ code: 403;
15176
+ message: string;
15177
+ };
15178
+ } | {
15179
+ error: {
15180
+ /** @format int32 */
15181
+ code: 404;
15182
+ message: string;
15183
+ };
15184
+ }>>;
15185
+ /**
15186
+ * @description Consumes the OAuth transaction whose ID was received as the `state` of an OAuth callback. A transaction can be consumed once, by the integration that it was created for, and only with the authorization code that the user who started the connection confirmed in GitBook. Returns the installation the credentials must be written to, the PKCE code verifier, and a single-use grant to pass as `oauthTransaction` when writing the credentials.
15187
+ *
15188
+ * @tags integrations
15189
+ * @name ConsumeIntegrationOAuthTransaction
15190
+ * @summary Consume an integration OAuth transaction
15191
+ * @request POST:/integrations/{integrationName}/oauth-transactions/{transactionId}/consume
15192
+ * @secure
15193
+ */
15194
+ consumeIntegrationOAuthTransaction: (integrationName: string, transactionId: string, data: ConsumeIntegrationOAuthTransaction, params?: RequestParams) => Promise<HttpResponse<IntegrationOAuthTransaction, {
15195
+ error: {
15196
+ /** @format int32 */
15197
+ code: 403;
15198
+ message: string;
15199
+ };
15200
+ } | {
15201
+ error: {
15202
+ /** @format int32 */
15203
+ code: 404;
15204
+ message: string;
15205
+ };
15206
+ }>>;
15207
+ /**
15208
+ * @description Confirms, as the user who created the transaction, the provider callback GitBook intercepted for it. Returns the callback URL to send the browser back to.
15209
+ *
15210
+ * @tags integrations
15211
+ * @name ConfirmIntegrationOAuthTransaction
15212
+ * @summary Confirm the callback of an integration OAuth transaction
15213
+ * @request POST:/integrations/{integrationName}/oauth-transactions/{transactionId}/confirm
15214
+ * @secure
15215
+ */
15216
+ confirmIntegrationOAuthTransaction: (integrationName: string, transactionId: string, data: ConfirmIntegrationOAuthTransaction, params?: RequestParams) => Promise<HttpResponse<IntegrationOAuthTransactionConfirmation, {
15217
+ error: {
15218
+ /** @format int32 */
15219
+ code: 403;
15220
+ message: string;
15221
+ };
15222
+ } | {
15223
+ error: {
15224
+ /** @format int32 */
15225
+ code: 404;
15226
+ message: string;
15227
+ };
15228
+ } | {
15229
+ error: {
15230
+ /** @format int32 */
15231
+ code: 409;
15232
+ message: string;
15233
+ };
15234
+ }>>;
14855
15235
  /**
14856
15236
  * @description Returns a paginated list of the spaces an installation is enabled on, with the configuration of the integration for each of them. Pass extended to get the full space object instead of its ID.
14857
15237
  *
@@ -15069,9 +15449,17 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15069
15449
  * @max 1000
15070
15450
  */
15071
15451
  limit?: number;
15452
+ /** The property to sort the list by. With `lastSeenAt`, only the organizations the user has opened are returned, most recently opened first. It returns at most `limit` items with no next page, and cannot be combined with `page`, because the order changes every time the user opens an organization. */
15453
+ sort?: "lastSeenAt";
15072
15454
  }, params?: RequestParams) => Promise<HttpResponse<List & {
15073
15455
  items: Organization[];
15074
- }, any>>;
15456
+ }, {
15457
+ error: {
15458
+ /** @format int32 */
15459
+ code: 400;
15460
+ message: string;
15461
+ };
15462
+ }>>;
15075
15463
  /**
15076
15464
  * No description
15077
15465
  *
@@ -15686,7 +16074,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15686
16074
  */
15687
16075
  deleteOrganizationInviteById: (organizationId: EntityId, inviteId: EntityId, params?: RequestParams) => Promise<HttpResponse<void, any>>;
15688
16076
  /**
15689
- * @description Join an organization if the user's verified email domain matches one of the organization's allowed email domains. This endpoint allows existing users to join organizations they're eligible for based on their email domain.
16077
+ * @description Join an organization if the user's verified email domain matches one of the organization's allowed email domains. This endpoint allows existing users to join organizations they're eligible for based on their email domain. If the user is already a member, refresh their access without changing their membership.
15690
16078
  *
15691
16079
  * @tags organizations
15692
16080
  * @name JoinOrganization
@@ -16068,6 +16456,137 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
16068
16456
  * @secure
16069
16457
  */
16070
16458
  deleteOrganizationSamlProvider: (organizationId: EntityId, samlProviderId: string, params?: RequestParams) => Promise<HttpResponse<void, any>>;
16459
+ /**
16460
+ * No description
16461
+ *
16462
+ * @tags organizations
16463
+ * @name ListOrganizationDomains
16464
+ * @summary List the email domains of an organization
16465
+ * @request GET:/orgs/{organizationId}/domains
16466
+ * @secure
16467
+ */
16468
+ listOrganizationDomains: (organizationId: EntityId, params?: RequestParams) => Promise<HttpResponse<List & {
16469
+ items: OrganizationDomain[];
16470
+ }, {
16471
+ error: {
16472
+ /** @format int32 */
16473
+ code: 404;
16474
+ message: string;
16475
+ };
16476
+ }>>;
16477
+ /**
16478
+ * @description Adds an email domain. People only join through it once the domain is verified.
16479
+ *
16480
+ * @tags organizations
16481
+ * @name AddOrganizationDomain
16482
+ * @summary Add an email domain to an organization
16483
+ * @request POST:/orgs/{organizationId}/domains
16484
+ * @secure
16485
+ */
16486
+ addOrganizationDomain: (organizationId: EntityId, data: {
16487
+ /** @maxLength 253 */
16488
+ domain: string;
16489
+ }, params?: RequestParams) => Promise<HttpResponse<OrganizationDomain, {
16490
+ error: {
16491
+ /** @format int32 */
16492
+ code: 400;
16493
+ message: string;
16494
+ };
16495
+ } | {
16496
+ error: {
16497
+ /** @format int32 */
16498
+ code: 404;
16499
+ message: string;
16500
+ };
16501
+ } | {
16502
+ error: {
16503
+ /** @format int32 */
16504
+ code: 409;
16505
+ message: string;
16506
+ };
16507
+ }>>;
16508
+ /**
16509
+ * No description
16510
+ *
16511
+ * @tags organizations
16512
+ * @name GetOrganizationDomain
16513
+ * @summary Get an email domain of an organization
16514
+ * @request GET:/orgs/{organizationId}/domains/{emailDomain}
16515
+ * @secure
16516
+ */
16517
+ getOrganizationDomain: (organizationId: EntityId, emailDomain: string, params?: RequestParams) => Promise<HttpResponse<OrganizationDomain, {
16518
+ error: {
16519
+ /** @format int32 */
16520
+ code: 404;
16521
+ message: string;
16522
+ };
16523
+ }>>;
16524
+ /**
16525
+ * No description
16526
+ *
16527
+ * @tags organizations
16528
+ * @name UpdateOrganizationDomain
16529
+ * @summary Update an email domain of an organization
16530
+ * @request PATCH:/orgs/{organizationId}/domains/{emailDomain}
16531
+ * @secure
16532
+ */
16533
+ updateOrganizationDomain: (organizationId: EntityId, emailDomain: string, data: {
16534
+ autoJoinEnabled?: boolean;
16535
+ /** Role given to people who join through the domain. "default" uses the organization's default role, and "guest" adds them as guests. */
16536
+ defaultRole?: OrganizationDomainDefaultRole;
16537
+ /** ID of a team of the organization, or null to add no team */
16538
+ defaultTeam?: string | null;
16539
+ }, params?: RequestParams) => Promise<HttpResponse<OrganizationDomain, {
16540
+ error: {
16541
+ /** @format int32 */
16542
+ code: 400;
16543
+ message: string;
16544
+ };
16545
+ } | {
16546
+ error: {
16547
+ /** @format int32 */
16548
+ code: 404;
16549
+ message: string;
16550
+ };
16551
+ }>>;
16552
+ /**
16553
+ * @description Removes an email domain. Members who joined through it stay members.
16554
+ *
16555
+ * @tags organizations
16556
+ * @name DeleteOrganizationDomain
16557
+ * @summary Remove an email domain from an organization
16558
+ * @request DELETE:/orgs/{organizationId}/domains/{emailDomain}
16559
+ * @secure
16560
+ */
16561
+ deleteOrganizationDomain: (organizationId: EntityId, emailDomain: string, params?: RequestParams) => Promise<HttpResponse<void, {
16562
+ error: {
16563
+ /** @format int32 */
16564
+ code: 404;
16565
+ message: string;
16566
+ };
16567
+ }>>;
16568
+ /**
16569
+ * @description Checks the domain's DNS TXT record. A legacy domain first gets its verification record, and keeps letting people join until it is verified.
16570
+ *
16571
+ * @tags organizations
16572
+ * @name VerifyOrganizationDomain
16573
+ * @summary Verify an email domain of an organization
16574
+ * @request POST:/orgs/{organizationId}/domains/{emailDomain}/verify
16575
+ * @secure
16576
+ */
16577
+ verifyOrganizationDomain: (organizationId: EntityId, emailDomain: string, params?: RequestParams) => Promise<HttpResponse<OrganizationDomain, {
16578
+ error: {
16579
+ /** @format int32 */
16580
+ code: 404;
16581
+ message: string;
16582
+ };
16583
+ } | {
16584
+ error: {
16585
+ /** @format int32 */
16586
+ code: 409;
16587
+ message: string;
16588
+ };
16589
+ }>>;
16071
16590
  /**
16072
16591
  * No description
16073
16592
  *
@@ -18114,26 +18633,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18114
18633
  * @secure
18115
18634
  */
18116
18635
  getSiteFindingById: (organizationId: EntityId, siteId: string, siteFindingId: string, params?: RequestParams) => Promise<HttpResponse<SiteFinding, any>>;
18117
- /**
18118
- * @description Changes the status of a documentation issue found by GitBook's AI. Refuses `broken-link` findings, whose status follows the redirects at their path. Deprecated in favour of `applySiteFindingAction`, which applies one of the `actions` a finding lists: `mark-resolved`, `ignore`, `reopen` or `restore`.
18119
- *
18120
- * @tags site-context
18121
- * @name UpdateSiteFindingById
18122
- * @summary Resolve, dismiss, or reopen a documentation issue. (Deprecated) use applySiteFindingAction instead.
18123
- * @request PATCH:/orgs/{organizationId}/sites/{siteId}/findings/{siteFindingId}
18124
- * @deprecated
18125
- * @secure
18126
- */
18127
- updateSiteFindingById: (organizationId: EntityId, siteId: string, siteFindingId: string, data: {
18128
- /**
18129
- * Status of a site finding.
18130
- * - `candidate` is a finding that has been raised but not yet confirmed. Typically these are not shown to users.
18131
- * - `open` is a finding that has been surfaced to users and is still under investigation.
18132
- * - `done` is a finding that has been resolved and is no longer under investigation.
18133
- * - `canceled` is a finding that has been canceled and is no longer under investigation.
18134
- */
18135
- status: SiteFindingStatus;
18136
- }, params?: RequestParams) => Promise<HttpResponse<SiteFinding, any>>;
18137
18636
  /**
18138
18637
  * @description Lists the change requests created to fix a documentation issue. Use this to check whether an issue already has a pending or merged fix before triggering a new one.
18139
18638
  *
@@ -18411,8 +18910,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18411
18910
  relevance?: SiteQuestionAnswerRelevance[];
18412
18911
  /** Filter stats by answer channel type. */
18413
18912
  channelType?: SiteChannelType[];
18414
- /** Filter by whether a person or an AI agent asked the question. */
18913
+ /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18415
18914
  visitorType?: SiteQuestionVisitorType[];
18915
+ /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
18916
+ citedPage?: string[];
18416
18917
  /** Filter stats by answer resolution. */
18417
18918
  answered?: SiteQuestionAnswerResolution[];
18418
18919
  }, params?: RequestParams) => Promise<HttpResponse<{
@@ -18470,8 +18971,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18470
18971
  relevance?: SiteQuestionAnswerRelevance[];
18471
18972
  /** Filter questions by answer channel type. */
18472
18973
  channelType?: SiteChannelType[];
18473
- /** Filter by whether a person or an AI agent asked the question. */
18974
+ /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18474
18975
  visitorType?: SiteQuestionVisitorType[];
18976
+ /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
18977
+ citedPage?: string[];
18978
+ /** Filter questions whose text contains this value. */
18979
+ search?: string;
18475
18980
  /** Filter questions by answer resolution. */
18476
18981
  answered?: SiteQuestionAnswerResolution[];
18477
18982
  /** Filter questions by associated site topic IDs. */
@@ -18512,7 +19017,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18512
19017
  relevance?: SiteQuestionAnswerRelevance[];
18513
19018
  /** Filter stats by answer channel type. */
18514
19019
  channelType?: SiteChannelType[];
18515
- /** Filter by whether a person or an AI agent asked the question. */
19020
+ /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18516
19021
  visitorType?: SiteQuestionVisitorType[];
18517
19022
  /** Filter stats by answer resolution. */
18518
19023
  answered?: SiteQuestionAnswerResolution[];
@@ -18543,7 +19048,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18543
19048
  relevance?: SiteQuestionAnswerRelevance[];
18544
19049
  /** Filter answer sources by answer channel type. */
18545
19050
  channelType?: SiteChannelType[];
18546
- /** Filter by whether a person or an AI agent asked the question. */
19051
+ /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18547
19052
  visitorType?: SiteQuestionVisitorType[];
18548
19053
  /** Filter answer sources by answer resolution. */
18549
19054
  answered?: SiteQuestionAnswerResolution[];
@@ -18570,8 +19075,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18570
19075
  relevance?: SiteQuestionAnswerRelevance[];
18571
19076
  /** Filter stats by answer channel type. */
18572
19077
  channelType?: SiteChannelType[];
18573
- /** Filter by whether a person or an AI agent asked the question. */
19078
+ /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18574
19079
  visitorType?: SiteQuestionVisitorType[];
19080
+ /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
19081
+ citedPage?: string[];
18575
19082
  /** Filter stats by answer resolution. */
18576
19083
  answered?: SiteQuestionAnswerResolution[];
18577
19084
  }, params?: RequestParams) => Promise<HttpResponse<SiteQuestionStats, any>>;
@@ -18597,8 +19104,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18597
19104
  relevance?: SiteQuestionAnswerRelevance[];
18598
19105
  /** Filter answers by channel type. */
18599
19106
  channelType?: SiteChannelType[];
18600
- /** Filter by whether a person or an AI agent asked the question. */
19107
+ /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18601
19108
  visitorType?: SiteQuestionVisitorType[];
19109
+ /** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
19110
+ citedPage?: string[];
18602
19111
  /** Filter answers by resolution. */
18603
19112
  answered?: SiteQuestionAnswerResolution[];
18604
19113
  }, params?: RequestParams) => Promise<HttpResponse<SiteQuestionTimeline, any>>;
@@ -18628,7 +19137,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18628
19137
  relevance?: SiteQuestionAnswerRelevance[];
18629
19138
  /** Filter answers by answer channel type. */
18630
19139
  channelType?: SiteChannelType[];
18631
- /** Filter by whether a person or an AI agent asked the question. */
19140
+ /** Filter by who asked the question (a person, an AI agent, another bot, or unknown). */
18632
19141
  visitorType?: SiteQuestionVisitorType[];
18633
19142
  /** Filter answers by question type. */
18634
19143
  "question.type"?: SiteQuestionType;
@@ -18789,8 +19298,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
18789
19298
  warningColor?: CustomizationThemedColor | null;
18790
19299
  /** Used for destructive actions or raising attention to critical information. Set to null to reset the override. */
18791
19300
  dangerColor?: CustomizationThemedColor | null;
18792
- /** The tint will color the site’s UI beyond links and buttons, such as header, sidebar and background. By default, the tint colour is the same as your Primary colour, but you can set a custom one too. */
18793
- tint?: CustomizationTint | null;
19301
+ /** The tint will color the site’s UI beyond links and buttons, such as header, sidebar and background. By default, the tint colour is the same as your Primary colour, but you can set a custom one too. Set to false to remove the tint from this site space, or to null to reset the override. */
19302
+ tint?: CustomizationTint | false | null;
18794
19303
  /** The style of the corners to use. Set to null to reset the override. */
18795
19304
  corners?: CustomizationCorners | null;
18796
19305
  /** The depth of elements on the site. Set to null to reset the override. */