@gitbook/api 0.192.0 → 0.194.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/spec/openapi.json CHANGED
@@ -3867,7 +3867,7 @@
3867
3867
  "post": {
3868
3868
  "operationId": "updateChangeRequestContent",
3869
3869
  "summary": "Apply a batch of content changes to a change request",
3870
- "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, 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.\n\nWhen 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:\n- Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`).\n- Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>`\n for a nested page (e.g. `/pages/guides/getting-started`).\n\n- Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page,\n or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is\n `/pages/README.md`.\n\n- Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`,\n `../other.md`, or `../README.md` (the parent page). Folder-style links without an\n extension (e.g. `./section`) resolve to that folder's page.\n\nExternal 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.",
3870
+ "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, 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.\nTo 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.\nWhen 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:\n- Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`).\n- Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>`\n for a nested page (e.g. `/pages/guides/getting-started`).\n\n- Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page,\n or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is\n `/pages/README.md`.\n\n- Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`,\n `../other.md`, or `../README.md` (the parent page). Folder-style links without an\n extension (e.g. `./section`) resolve to that folder's page.\n\nExternal 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.\nGitBook 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.\n\n**Response shape (`compat`)** — this endpoint is changing what it returns:\n- `compat=true` (current default) returns the updated change request, matching the endpoint's\n original behavior.\n\n- `compat=false` returns the updated change request **and** the list of affected pages (see\n the response schema).\n\nThe 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.",
3871
3871
  "x-gitbook-mcp": true,
3872
3872
  "tags": [
3873
3873
  "change-request-content"
@@ -3888,6 +3888,15 @@
3888
3888
  },
3889
3889
  {
3890
3890
  "$ref": "#/components/parameters/changeRequestId"
3891
+ },
3892
+ {
3893
+ "name": "compat",
3894
+ "in": "query",
3895
+ "description": "When `true`, the updated change request is returned. When `false`, the updated change request and the list of affected pages are returned.",
3896
+ "schema": {
3897
+ "type": "boolean",
3898
+ "default": true
3899
+ }
3891
3900
  }
3892
3901
  ],
3893
3902
  "requestBody": {
@@ -3919,7 +3928,15 @@
3919
3928
  "content": {
3920
3929
  "application/json": {
3921
3930
  "schema": {
3922
- "$ref": "#/components/schemas/ChangeRequest"
3931
+ "description": "The change request when `compat=true` (default), or the change request plus the list of affected pages when `compat=false`.",
3932
+ "oneOf": [
3933
+ {
3934
+ "$ref": "#/components/schemas/ChangeRequest"
3935
+ },
3936
+ {
3937
+ "$ref": "#/components/schemas/ChangeRequestContentUpdate"
3938
+ }
3939
+ ]
3923
3940
  }
3924
3941
  }
3925
3942
  }
@@ -13897,6 +13914,17 @@
13897
13914
  "type": "boolean",
13898
13915
  "default": false,
13899
13916
  "description": "Whether the site space should be created as draft. Defaults to false."
13917
+ },
13918
+ "pageId": {
13919
+ "oneOf": [
13920
+ {
13921
+ "type": "string"
13922
+ },
13923
+ {
13924
+ "type": "null"
13925
+ }
13926
+ ],
13927
+ "description": "Custom home page within the space, rendered at the site space's path root instead of the space's default landing page."
13900
13928
  }
13901
13929
  },
13902
13930
  "required": [
@@ -15356,6 +15384,24 @@
15356
15384
  }
15357
15385
  }
15358
15386
  },
15387
+ {
15388
+ "name": "updatedAfter",
15389
+ "in": "query",
15390
+ "description": "Only return findings last updated at or after this date.",
15391
+ "schema": {
15392
+ "type": "string",
15393
+ "format": "date-time"
15394
+ }
15395
+ },
15396
+ {
15397
+ "name": "updatedBefore",
15398
+ "in": "query",
15399
+ "description": "Only return findings last updated before this date.",
15400
+ "schema": {
15401
+ "type": "string",
15402
+ "format": "date-time"
15403
+ }
15404
+ },
15359
15405
  {
15360
15406
  "name": "orderBy",
15361
15407
  "in": "query",
@@ -17282,6 +17328,17 @@
17282
17328
  }
17283
17329
  ]
17284
17330
  },
17331
+ "pageId": {
17332
+ "description": "Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. If not set, the page will remain unchanged unless spaceId is changed, in which case the custom home page will be removed. If set to null, the custom home page will be removed.",
17333
+ "oneOf": [
17334
+ {
17335
+ "type": "string"
17336
+ },
17337
+ {
17338
+ "type": "null"
17339
+ }
17340
+ ]
17341
+ },
17285
17342
  "spaceId": {
17286
17343
  "type": "string",
17287
17344
  "description": "The content that this site space points to. If not set, the space will remain unchanged."
@@ -21070,7 +21127,23 @@
21070
21127
  "content": {
21071
21128
  "application/json": {
21072
21129
  "schema": {
21073
- "$ref": "#/components/schemas/GitSyncInstallationSetup"
21130
+ "allOf": [
21131
+ {
21132
+ "$ref": "#/components/schemas/GitSyncInstallationSetup"
21133
+ },
21134
+ {
21135
+ "type": "object",
21136
+ "properties": {
21137
+ "childInstallationProjectDirectories": {
21138
+ "type": "object",
21139
+ "description": "Project directories keyed by child installation ID for a site installation.",
21140
+ "additionalProperties": {
21141
+ "type": "string"
21142
+ }
21143
+ }
21144
+ }
21145
+ }
21146
+ ]
21074
21147
  }
21075
21148
  }
21076
21149
  }
@@ -30703,6 +30776,10 @@
30703
30776
  "minLength": 1,
30704
30777
  "description": "Title of the page."
30705
30778
  },
30779
+ "slug": {
30780
+ "description": "Slug of the page in its parent, used to build the page's path. When omitted, the slug is derived from the title. The slug must be unique among the page's siblings; any collision is rejected.",
30781
+ "$ref": "#/components/schemas/RevisionPageSlug"
30782
+ },
30706
30783
  "emoji": {
30707
30784
  "description": "Emoji of the page. Set to an empty string to remove it.",
30708
30785
  "$ref": "#/components/schemas/Emoji"
@@ -30772,7 +30849,7 @@
30772
30849
  }
30773
30850
  },
30774
30851
  "ChangeRequestContentChangeInsertPage": {
30775
- "description": "Insert a new page into the change request.",
30852
+ "description": "Insert a new page into the change request. The title is taken from `title`, or, when the document is markdown, from the document's frontmatter or leading heading (which take precedence, matching Git Sync). When no title can be resolved, the page falls back to a default title.",
30776
30853
  "allOf": [
30777
30854
  {
30778
30855
  "$ref": "#/components/schemas/RevisionPageUpdate"
@@ -30781,7 +30858,6 @@
30781
30858
  "type": "object",
30782
30859
  "required": [
30783
30860
  "operation",
30784
- "title",
30785
30861
  "document"
30786
30862
  ],
30787
30863
  "properties": {
@@ -30800,6 +30876,10 @@
30800
30876
  "minimum": 0,
30801
30877
  "description": "Zero-based index to insert the page at among its siblings. If omitted, the page is appended at the end."
30802
30878
  },
30879
+ "ref": {
30880
+ "type": "string",
30881
+ "description": "Temporary local reference for the page, used only for the lifetime of this request and never persisted. Other pages inserted in the same batch can link to this page by its ref (e.g. `[Page](./<ref>.md)`), which resolves to the page's ID at apply time — regardless of operation order or the page's eventual slug. A ref must be unique within the batch and must not collide with an existing page's path."
30882
+ },
30803
30883
  "document": {
30804
30884
  "description": "Document for the new page. When provided as markdown, its frontmatter is read to set the page metadata.",
30805
30885
  "$ref": "#/components/schemas/Document"
@@ -30874,6 +30954,88 @@
30874
30954
  "page": "page_id"
30875
30955
  }
30876
30956
  },
30957
+ "ChangeRequestContentChangeInsertFiles": {
30958
+ "type": "object",
30959
+ "description": "Upload files (images or attachments) into the change request. A document references one as `![Alt](/files/<fileId>)` or `[Label](/files/<fileId>)` — use a `ref` to reference it from a later change in the same batch, or read the generated IDs from `insertedFiles`.",
30960
+ "required": [
30961
+ "operation",
30962
+ "files"
30963
+ ],
30964
+ "properties": {
30965
+ "operation": {
30966
+ "type": "string",
30967
+ "enum": [
30968
+ "insert_files"
30969
+ ]
30970
+ },
30971
+ "files": {
30972
+ "type": "array",
30973
+ "minItems": 1,
30974
+ "maxItems": 20,
30975
+ "items": {
30976
+ "type": "object",
30977
+ "description": "A file to upload. Set exactly one source: `url` (GitBook fetches it) or `base64` (inline bytes, max 1MB). Prefer `url`.",
30978
+ "required": [
30979
+ "name"
30980
+ ],
30981
+ "properties": {
30982
+ "ref": {
30983
+ "type": "string",
30984
+ "description": "Temporary local reference for the file, used only for the lifetime of this request and never persisted. Pages inserted in the same batch can link to this file by its ref (e.g. `[File](./<ref>)`), which resolves to the file's ID at apply time — regardless of operation order or the file's eventual path. A ref must be unique within the batch and must not collide a page ref in the batch or an existing page path."
30985
+ },
30986
+ "name": {
30987
+ "type": "string",
30988
+ "minLength": 1,
30989
+ "maxLength": 256,
30990
+ "description": "Filename to store the file under, including its extension."
30991
+ },
30992
+ "contentType": {
30993
+ "type": "string",
30994
+ "description": "MIME type. Required with `base64`; overrides the source's own type otherwise."
30995
+ }
30996
+ },
30997
+ "oneOf": [
30998
+ {
30999
+ "type": "object",
31000
+ "properties": {
31001
+ "url": {
31002
+ "type": "string",
31003
+ "format": "uri",
31004
+ "maxLength": 2048,
31005
+ "description": "Public http(s) URL to fetch the file from. A URL resolving to a private or reserved address is rejected — send internally hosted bytes with `base64` instead."
31006
+ }
31007
+ },
31008
+ "required": [
31009
+ "url"
31010
+ ]
31011
+ },
31012
+ {
31013
+ "type": "object",
31014
+ "properties": {
31015
+ "base64": {
31016
+ "type": "string",
31017
+ "description": "Base64-encoded bytes, max 1MB. Requires `contentType`."
31018
+ }
31019
+ },
31020
+ "required": [
31021
+ "base64"
31022
+ ]
31023
+ }
31024
+ ]
31025
+ }
31026
+ }
31027
+ },
31028
+ "example": {
31029
+ "operation": "insert_files",
31030
+ "files": [
31031
+ {
31032
+ "ref": "architecture.png",
31033
+ "name": "architecture.png",
31034
+ "url": "https://example.com/architecture.png"
31035
+ }
31036
+ ]
31037
+ }
31038
+ },
30877
31039
  "ChangeRequestContentChange": {
30878
31040
  "oneOf": [
30879
31041
  {
@@ -30887,6 +31049,9 @@
30887
31049
  },
30888
31050
  {
30889
31051
  "$ref": "#/components/schemas/ChangeRequestContentChangeRevertPage"
31052
+ },
31053
+ {
31054
+ "$ref": "#/components/schemas/ChangeRequestContentChangeInsertFiles"
30890
31055
  }
30891
31056
  ],
30892
31057
  "discriminator": {
@@ -30895,7 +31060,158 @@
30895
31060
  "update_page": "#/components/schemas/ChangeRequestContentChangeUpdatePage",
30896
31061
  "insert_page": "#/components/schemas/ChangeRequestContentChangeInsertPage",
30897
31062
  "delete_page": "#/components/schemas/ChangeRequestContentChangeDeletePage",
30898
- "revert_page": "#/components/schemas/ChangeRequestContentChangeRevertPage"
31063
+ "revert_page": "#/components/schemas/ChangeRequestContentChangeRevertPage",
31064
+ "insert_files": "#/components/schemas/ChangeRequestContentChangeInsertFiles"
31065
+ }
31066
+ }
31067
+ },
31068
+ "ChangeRequestContentUpdatePageRef": {
31069
+ "type": "object",
31070
+ "required": [
31071
+ "object",
31072
+ "id",
31073
+ "urls"
31074
+ ],
31075
+ "properties": {
31076
+ "object": {
31077
+ "type": "string",
31078
+ "description": "Type of Object, always equals to \"page\".",
31079
+ "enum": [
31080
+ "page"
31081
+ ]
31082
+ },
31083
+ "id": {
31084
+ "type": "string",
31085
+ "description": "Unique identifier of the page."
31086
+ },
31087
+ "urls": {
31088
+ "type": "object",
31089
+ "required": [
31090
+ "location"
31091
+ ],
31092
+ "properties": {
31093
+ "location": {
31094
+ "description": "API URL to fetch the page's full, normalized content.",
31095
+ "$ref": "#/components/schemas/URL"
31096
+ }
31097
+ }
31098
+ }
31099
+ }
31100
+ },
31101
+ "ChangeRequestContentUpdateInsertedPage": {
31102
+ "type": "object",
31103
+ "description": "A page created by the operation with its resolved ID, ref as passed by the caller, and a URL to fetch its content.",
31104
+ "required": [
31105
+ "object",
31106
+ "page"
31107
+ ],
31108
+ "properties": {
31109
+ "object": {
31110
+ "type": "string",
31111
+ "description": "Type of Object, always equals to \"created_page\".",
31112
+ "enum": [
31113
+ "created_page"
31114
+ ]
31115
+ },
31116
+ "ref": {
31117
+ "type": "string",
31118
+ "description": "The batch-local `ref` provided on the insert operation, echoed so the caller can map their reference to the created page's ID. Absent when the operation had no ref."
31119
+ },
31120
+ "page": {
31121
+ "description": "Reference to the created page, with a URL to fetch its normalized content.",
31122
+ "$ref": "#/components/schemas/ChangeRequestContentUpdatePageRef"
31123
+ }
31124
+ }
31125
+ },
31126
+ "ChangeRequestContentUpdateUpdatedPage": {
31127
+ "type": "object",
31128
+ "description": "A page updated by the operation, with a URL to fetch its content.",
31129
+ "required": [
31130
+ "object",
31131
+ "page"
31132
+ ],
31133
+ "properties": {
31134
+ "object": {
31135
+ "type": "string",
31136
+ "description": "Type of Object, always equals to \"updated_page\".",
31137
+ "enum": [
31138
+ "updated_page"
31139
+ ]
31140
+ },
31141
+ "page": {
31142
+ "description": "Reference to the updated page, with a URL to fetch its normalized content.",
31143
+ "$ref": "#/components/schemas/ChangeRequestContentUpdatePageRef"
31144
+ }
31145
+ }
31146
+ },
31147
+ "ChangeRequestContentUpdateDeletedPage": {
31148
+ "type": "object",
31149
+ "description": "A page deleted by the batch. Only its ID is returned, as it no longer has content.",
31150
+ "required": [
31151
+ "object",
31152
+ "page"
31153
+ ],
31154
+ "properties": {
31155
+ "object": {
31156
+ "type": "string",
31157
+ "description": "Type of Object, always equals to \"deleted_page\".",
31158
+ "enum": [
31159
+ "deleted_page"
31160
+ ]
31161
+ },
31162
+ "page": {
31163
+ "type": "string",
31164
+ "description": "ID of the deleted page."
31165
+ }
31166
+ }
31167
+ },
31168
+ "ChangeRequestContentUpdateChange": {
31169
+ "description": "An outcome of a content change.",
31170
+ "oneOf": [
31171
+ {
31172
+ "$ref": "#/components/schemas/ChangeRequestContentUpdateInsertedPage"
31173
+ },
31174
+ {
31175
+ "$ref": "#/components/schemas/ChangeRequestContentUpdateUpdatedPage"
31176
+ },
31177
+ {
31178
+ "$ref": "#/components/schemas/ChangeRequestContentUpdateDeletedPage"
31179
+ }
31180
+ ],
31181
+ "discriminator": {
31182
+ "propertyName": "object",
31183
+ "mapping": {
31184
+ "created_page": "#/components/schemas/ChangeRequestContentUpdateInsertedPage",
31185
+ "updated_page": "#/components/schemas/ChangeRequestContentUpdateUpdatedPage",
31186
+ "deleted_page": "#/components/schemas/ChangeRequestContentUpdateDeletedPage"
31187
+ }
31188
+ }
31189
+ },
31190
+ "ChangeRequestContentUpdate": {
31191
+ "type": "object",
31192
+ "description": "The result of applying a batch of content changes.",
31193
+ "required": [
31194
+ "changeRequest",
31195
+ "changes"
31196
+ ],
31197
+ "properties": {
31198
+ "changeRequest": {
31199
+ "description": "The change request after the batch was applied.",
31200
+ "$ref": "#/components/schemas/ChangeRequest"
31201
+ },
31202
+ "changes": {
31203
+ "type": "array",
31204
+ "description": "One entry per affected page (deduplicated), in the order the pages were first touched by the batch.",
31205
+ "items": {
31206
+ "$ref": "#/components/schemas/ChangeRequestContentUpdateChange"
31207
+ }
31208
+ },
31209
+ "insertedFiles": {
31210
+ "type": "array",
31211
+ "description": "Files created by the `insert_files` changes in this batch, in the order they were inserted. Use their IDs to reference them from a document.",
31212
+ "items": {
31213
+ "$ref": "#/components/schemas/RevisionFile"
31214
+ }
30899
31215
  }
30900
31216
  }
30901
31217
  },
@@ -32134,6 +32450,17 @@
32134
32450
  "enabled"
32135
32451
  ]
32136
32452
  },
32453
+ "BillingCreditsBundle": {
32454
+ "type": "string",
32455
+ "description": "The AI credit bundle to top up every month",
32456
+ "enum": [
32457
+ "none",
32458
+ 135001500,
32459
+ 240006000,
32460
+ 4200018000,
32461
+ 6500035000
32462
+ ]
32463
+ },
32137
32464
  "OrganizationBilling": {
32138
32465
  "type": "object",
32139
32466
  "properties": {
@@ -32216,6 +32543,17 @@
32216
32543
  "canUseSAML": {
32217
32544
  "description": "Whether configuring SAML is allowed",
32218
32545
  "type": "boolean"
32546
+ },
32547
+ "creditsBundle": {
32548
+ "description": "The AI credit bundle the organization tops up every month, or null when the organization is not billed for AI usage. `none` means pay as you go.",
32549
+ "oneOf": [
32550
+ {
32551
+ "$ref": "#/components/schemas/BillingCreditsBundle"
32552
+ },
32553
+ {
32554
+ "type": "null"
32555
+ }
32556
+ ]
32219
32557
  }
32220
32558
  },
32221
32559
  "required": [
@@ -32227,7 +32565,8 @@
32227
32565
  "pricing",
32228
32566
  "usageAddons",
32229
32567
  "canChangeInterval",
32230
- "canUseSAML"
32568
+ "canUseSAML",
32569
+ "creditsBundle"
32231
32570
  ]
32232
32571
  },
32233
32572
  "BillingTrialStatus": {
@@ -34647,6 +34986,7 @@
34647
34986
  "sites-ai-assistant",
34648
34987
  "sites-ai-insights",
34649
34988
  "sites-connections",
34989
+ "sites-content-gaps",
34650
34990
  "sites-channels",
34651
34991
  "sites-embed",
34652
34992
  "sites-api-playground",
@@ -34816,6 +35156,11 @@
34816
35156
  "type": "string",
34817
35157
  "format": "date-time"
34818
35158
  },
35159
+ "lastScanAt": {
35160
+ "type": "string",
35161
+ "format": "date-time",
35162
+ "description": "When GitBook last completed a scan of the site's content\ngaps. Absent until the site has been scanned at least once.\n"
35163
+ },
34819
35164
  "adaptiveContent": {
34820
35165
  "$ref": "#/components/schemas/SiteAdaptiveContent"
34821
35166
  },
@@ -36405,6 +36750,17 @@
36405
36750
  "description": "Conditional expression used to evaluate whether the site space should be shown to the site's visitor.",
36406
36751
  "$ref": "#/components/schemas/Expression"
36407
36752
  },
36753
+ "pageId": {
36754
+ "oneOf": [
36755
+ {
36756
+ "type": "string"
36757
+ },
36758
+ {
36759
+ "type": "null"
36760
+ }
36761
+ ],
36762
+ "description": "Custom home page within the space, rendered at the site space's path root instead of the space's default landing page."
36763
+ },
36408
36764
  "draft": {
36409
36765
  "type": "boolean",
36410
36766
  "description": "Whether the site space is draft and not live."
@@ -37263,6 +37619,9 @@
37263
37619
  "$ref": "#/components/schemas/BillingMeter"
37264
37620
  }
37265
37621
  },
37622
+ "creditsBundle": {
37623
+ "$ref": "#/components/schemas/BillingCreditsBundle"
37624
+ },
37266
37625
  "mode": {
37267
37626
  "type": "string",
37268
37627
  "description": "Mode to use for the upgrade (default value is `commit`): - `commit`: a checkout session is returned or the upgrade is applied directly - `preview`: a preview invoice is always returned\n",
@@ -37277,6 +37636,98 @@
37277
37636
  "interval"
37278
37637
  ]
37279
37638
  },
37639
+ "BillingInvoiceSummaryLine": {
37640
+ "type": "object",
37641
+ "description": "A product line of an invoice, enriched and normalized for the billing summary UI.",
37642
+ "properties": {
37643
+ "description": {
37644
+ "description": "How Stripe describes the line, as a fallback for lines the client cannot label itself.",
37645
+ "type": "string"
37646
+ },
37647
+ "amount": {
37648
+ "type": "number"
37649
+ },
37650
+ "quantity": {
37651
+ "description": "How many units the line bills, such as the number of members.",
37652
+ "type": "number"
37653
+ },
37654
+ "siteType": {
37655
+ "description": "Which kind of site a `sites` line bills for.",
37656
+ "$ref": "#/components/schemas/SiteType"
37657
+ },
37658
+ "unitAmount": {
37659
+ "description": "Price of a single unit, over the period the line covers.",
37660
+ "type": "number"
37661
+ },
37662
+ "periodStart": {
37663
+ "$ref": "#/components/schemas/Timestamp"
37664
+ },
37665
+ "periodEnd": {
37666
+ "$ref": "#/components/schemas/Timestamp"
37667
+ },
37668
+ "category": {
37669
+ "type": "string",
37670
+ "description": "What the invoice line is billing for, so a preview can be grouped by product area.",
37671
+ "enum": [
37672
+ "members",
37673
+ "sites",
37674
+ "addons",
37675
+ "credits",
37676
+ "usage",
37677
+ "watermark_removal",
37678
+ "other"
37679
+ ]
37680
+ }
37681
+ },
37682
+ "required": [
37683
+ "amount",
37684
+ "description",
37685
+ "periodStart",
37686
+ "periodEnd",
37687
+ "category"
37688
+ ]
37689
+ },
37690
+ "BillingInvoiceAdjustment": {
37691
+ "type": "object",
37692
+ "description": "An amount adjusting an invoice, summed across everything of its type.",
37693
+ "properties": {
37694
+ "type": {
37695
+ "type": "string",
37696
+ "description": "What adjusts the amount an invoice bills, beyond the products it lists. `proration` is the net of the mid-period changes, and `balance` the credit applied from the customer's balance.",
37697
+ "enum": [
37698
+ "proration",
37699
+ "watermark_removal",
37700
+ "balance"
37701
+ ]
37702
+ },
37703
+ "amount": {
37704
+ "description": "The adjustment, negative when it reduces the amount billed.",
37705
+ "type": "number"
37706
+ }
37707
+ },
37708
+ "required": [
37709
+ "type",
37710
+ "amount"
37711
+ ]
37712
+ },
37713
+ "BillingCreditsTotals": {
37714
+ "type": "object",
37715
+ "description": "A total of AI credits, and how much of it is left.",
37716
+ "properties": {
37717
+ "grantedCredits": {
37718
+ "description": "Credits granted for the current AI billing period.",
37719
+ "type": "number"
37720
+ },
37721
+ "remainingCredits": {
37722
+ "description": "Credits still available of those granted.",
37723
+ "type": "number"
37724
+ }
37725
+ },
37726
+ "required": [
37727
+ "grantedCredits",
37728
+ "remainingCredits"
37729
+ ]
37730
+ },
37280
37731
  "BillingInvoicePreview": {
37281
37732
  "type": "object",
37282
37733
  "properties": {
@@ -37327,6 +37778,204 @@
37327
37778
  ]
37328
37779
  }
37329
37780
  },
37781
+ "summary": {
37782
+ "type": "object",
37783
+ "description": "Structured representation of the invoice for the current billing summary UI.",
37784
+ "properties": {
37785
+ "lines": {
37786
+ "type": "array",
37787
+ "description": "Product lines enriched and normalized for the billing summary UI.",
37788
+ "items": {
37789
+ "$ref": "#/components/schemas/BillingInvoiceSummaryLine"
37790
+ }
37791
+ },
37792
+ "adjustments": {
37793
+ "type": "array",
37794
+ "description": "What adjusts the amount billed beyond the products listed, each summed across its type. Only the ones that apply are returned.",
37795
+ "items": {
37796
+ "$ref": "#/components/schemas/BillingInvoiceAdjustment"
37797
+ }
37798
+ },
37799
+ "creditGrants": {
37800
+ "type": "array",
37801
+ "description": "AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage.",
37802
+ "items": {
37803
+ "type": "object",
37804
+ "description": "AI credits granted to the organization for the current AI billing period.",
37805
+ "properties": {
37806
+ "type": {
37807
+ "type": "string",
37808
+ "description": "Where the credits come from. `paid` is the credits the monthly bundle pays for, `bonus` the ones included with it, `site` the allowance of the organization's published paid sites, and `rollover` what was left of the previous period.",
37809
+ "enum": [
37810
+ "paid",
37811
+ "bonus",
37812
+ "site",
37813
+ "rollover"
37814
+ ]
37815
+ },
37816
+ "grantedCredits": {
37817
+ "description": "Credits the grant was created with.",
37818
+ "type": "number"
37819
+ },
37820
+ "usedCredits": {
37821
+ "description": "Credits of the grant spent by the usage metered so far.",
37822
+ "type": "number"
37823
+ },
37824
+ "remainingCredits": {
37825
+ "description": "Credits of the grant still available.",
37826
+ "type": "number"
37827
+ },
37828
+ "sites": {
37829
+ "description": "For a `site` grant, the published sites the credits come from.",
37830
+ "type": "array",
37831
+ "items": {
37832
+ "type": "object",
37833
+ "description": "The published sites of one type that the grant comes from.",
37834
+ "properties": {
37835
+ "siteType": {
37836
+ "$ref": "#/components/schemas/SiteType"
37837
+ },
37838
+ "count": {
37839
+ "description": "How many sites of this type are published.",
37840
+ "type": "number"
37841
+ },
37842
+ "creditsPerSite": {
37843
+ "description": "Credits included with one site of this type.",
37844
+ "type": "number"
37845
+ },
37846
+ "grantedCredits": {
37847
+ "description": "Credits these sites contribute to the grant.",
37848
+ "type": "number"
37849
+ }
37850
+ },
37851
+ "required": [
37852
+ "siteType",
37853
+ "count",
37854
+ "creditsPerSite",
37855
+ "grantedCredits"
37856
+ ]
37857
+ }
37858
+ }
37859
+ },
37860
+ "required": [
37861
+ "type",
37862
+ "grantedCredits",
37863
+ "usedCredits",
37864
+ "remainingCredits"
37865
+ ]
37866
+ }
37867
+ },
37868
+ "credits": {
37869
+ "type": "object",
37870
+ "description": "The AI credits of the current billing period, grouped the ways the billing screens display them.",
37871
+ "properties": {
37872
+ "grantedCredits": {
37873
+ "description": "Credits granted across every grant.",
37874
+ "type": "number"
37875
+ },
37876
+ "usedCredits": {
37877
+ "description": "Credits spent by the usage metered so far.",
37878
+ "type": "number"
37879
+ },
37880
+ "remainingCredits": {
37881
+ "description": "Credits still available across every grant.",
37882
+ "type": "number"
37883
+ },
37884
+ "coveredAmount": {
37885
+ "description": "Part of the metered AI usage paid by credits rather than billed, as a positive amount.",
37886
+ "type": "number"
37887
+ },
37888
+ "paid": {
37889
+ "description": "The credits the organization pays for.",
37890
+ "$ref": "#/components/schemas/BillingCreditsTotals"
37891
+ },
37892
+ "free": {
37893
+ "description": "The credits included at no extra cost, from the bundle, sites and rollover.",
37894
+ "$ref": "#/components/schemas/BillingCreditsTotals"
37895
+ },
37896
+ "bundle": {
37897
+ "description": "The credits of the monthly bundle, both paid and bonus.",
37898
+ "$ref": "#/components/schemas/BillingCreditsTotals"
37899
+ }
37900
+ },
37901
+ "required": [
37902
+ "grantedCredits",
37903
+ "usedCredits",
37904
+ "remainingCredits",
37905
+ "coveredAmount",
37906
+ "paid",
37907
+ "free",
37908
+ "bundle"
37909
+ ]
37910
+ },
37911
+ "chargeDate": {
37912
+ "description": "When the upcoming invoice is charged.",
37913
+ "$ref": "#/components/schemas/Timestamp"
37914
+ },
37915
+ "renewal": {
37916
+ "description": "The renewal invoice, when the plan and the AI usage bill on different cadences. Absent when a single invoice covers everything.",
37917
+ "type": "object",
37918
+ "properties": {
37919
+ "lines": {
37920
+ "type": "array",
37921
+ "description": "Product lines of the renewal invoice.",
37922
+ "items": {
37923
+ "$ref": "#/components/schemas/BillingInvoiceSummaryLine"
37924
+ }
37925
+ },
37926
+ "adjustments": {
37927
+ "type": "array",
37928
+ "description": "What adjusts the renewal beyond the products listed. Prorations and the customer balance are reported on the upcoming invoice instead.",
37929
+ "items": {
37930
+ "$ref": "#/components/schemas/BillingInvoiceAdjustment"
37931
+ }
37932
+ },
37933
+ "discounts": {
37934
+ "type": "array",
37935
+ "description": "Discounts still applying when the subscription renews.",
37936
+ "items": {
37937
+ "type": "object",
37938
+ "properties": {
37939
+ "description": {
37940
+ "description": "The description of the applied discount.",
37941
+ "type": "string"
37942
+ },
37943
+ "amount": {
37944
+ "description": "The amount of the applied discount.",
37945
+ "type": "number"
37946
+ }
37947
+ },
37948
+ "required": [
37949
+ "amount",
37950
+ "description"
37951
+ ]
37952
+ }
37953
+ },
37954
+ "amount": {
37955
+ "description": "Total owed for the renewal invoice.",
37956
+ "type": "number"
37957
+ },
37958
+ "chargeDate": {
37959
+ "description": "When the renewal invoice is charged.",
37960
+ "$ref": "#/components/schemas/Timestamp"
37961
+ }
37962
+ },
37963
+ "required": [
37964
+ "lines",
37965
+ "adjustments",
37966
+ "discounts",
37967
+ "amount",
37968
+ "chargeDate"
37969
+ ]
37970
+ }
37971
+ },
37972
+ "required": [
37973
+ "lines",
37974
+ "adjustments",
37975
+ "creditGrants",
37976
+ "credits"
37977
+ ]
37978
+ },
37330
37979
  "discounts": {
37331
37980
  "type": "array",
37332
37981
  "description": "Discounts applied to the subscription.",
@@ -37355,7 +38004,8 @@
37355
38004
  "amountDueToday",
37356
38005
  "customerBalance",
37357
38006
  "remainingCustomerBalance",
37358
- "lines"
38007
+ "lines",
38008
+ "summary"
37359
38009
  ]
37360
38010
  },
37361
38011
  "BillingUpgrade": {
@@ -39251,12 +39901,11 @@
39251
39901
  },
39252
39902
  "previewExternalBranches": {
39253
39903
  "type": "boolean",
39254
- "default": false,
39255
- "description": "Whether previews should be generated from branches outside the configured branch."
39904
+ "description": "Whether previews should be generated from branches outside the configured branch. For space installations belonging to a parent installation, this field is inherited from the parent installation and cannot be set."
39256
39905
  },
39257
39906
  "agentInstructions": {
39258
39907
  "type": "array",
39259
- "description": "Agent instruction files GitBook should always export at the repository root.",
39908
+ "description": "Agent instruction files GitBook should always export at the repository root. For space installations belonging to a parent installation, this field is inherited from the parent installation and cannot be set.",
39260
39909
  "items": {
39261
39910
  "type": "string",
39262
39911
  "enum": [
@@ -39550,6 +40199,60 @@
39550
40199
  "updatedAt"
39551
40200
  ]
39552
40201
  },
40202
+ "GitSyncRoot": {
40203
+ "type": "object",
40204
+ "description": "A repository-backed review and permission boundary for GitBook content.",
40205
+ "properties": {
40206
+ "object": {
40207
+ "type": "string",
40208
+ "enum": [
40209
+ "git-sync-root"
40210
+ ]
40211
+ },
40212
+ "id": {
40213
+ "type": "string",
40214
+ "description": "Unique identifier of the Sync Root."
40215
+ },
40216
+ "installationId": {
40217
+ "type": "string",
40218
+ "description": "Unique identifier of the top-level installation that owns this Sync Root."
40219
+ },
40220
+ "target": {
40221
+ "$ref": "#/components/schemas/GitSyncInstallationTarget"
40222
+ },
40223
+ "defaultMergeAuthorityPolicy": {
40224
+ "type": "string",
40225
+ "enum": [
40226
+ "provider",
40227
+ "gitbook"
40228
+ ],
40229
+ "description": "System responsible for completing merges by default for this Sync Root."
40230
+ },
40231
+ "status": {
40232
+ "type": "string",
40233
+ "enum": [
40234
+ "active",
40235
+ "disabled"
40236
+ ]
40237
+ },
40238
+ "createdAt": {
40239
+ "$ref": "#/components/schemas/Timestamp"
40240
+ },
40241
+ "updatedAt": {
40242
+ "$ref": "#/components/schemas/Timestamp"
40243
+ }
40244
+ },
40245
+ "required": [
40246
+ "object",
40247
+ "id",
40248
+ "installationId",
40249
+ "target",
40250
+ "defaultMergeAuthorityPolicy",
40251
+ "status",
40252
+ "createdAt",
40253
+ "updatedAt"
40254
+ ]
40255
+ },
39553
40256
  "GitSyncInstallation": {
39554
40257
  "allOf": [
39555
40258
  {
@@ -39584,6 +40287,10 @@
39584
40287
  "repositoryRef": {
39585
40288
  "$ref": "#/components/schemas/GitRepositoryRef"
39586
40289
  },
40290
+ "syncRoot": {
40291
+ "$ref": "#/components/schemas/GitSyncRoot",
40292
+ "description": "Effective Sync Root for this installation, inherited from its parent when present."
40293
+ },
39587
40294
  "createdAt": {
39588
40295
  "$ref": "#/components/schemas/Timestamp"
39589
40296
  },
@@ -41604,10 +42311,10 @@
41604
42311
  "enum": [
41605
42312
  "updatedAt",
41606
42313
  "severity",
41607
- "questions"
42314
+ "sources"
41608
42315
  ],
41609
42316
  "default": "updatedAt",
41610
- "description": "The field to sort site findings by. `updatedAt` returns the most recently updated findings first. `severity` returns the most severe findings first. `questions` returns the most asked-about findings first. Defaults to 'updatedAt'."
42317
+ "description": "The field to sort site findings by. `updatedAt` returns the most recently updated findings first. `severity` returns the most severe findings first. `sources` returns the findings with the most linked sources (questions plus records) first. Defaults to 'updatedAt'."
41611
42318
  },
41612
42319
  "SiteFindingTitle": {
41613
42320
  "type": "string",
@@ -46306,6 +47013,20 @@
46306
47013
  }
46307
47014
  }
46308
47015
  },
47016
+ {
47017
+ "type": "object",
47018
+ "required": [
47019
+ "column"
47020
+ ],
47021
+ "properties": {
47022
+ "column": {
47023
+ "type": "string",
47024
+ "enum": [
47025
+ "urlPath"
47026
+ ]
47027
+ }
47028
+ }
47029
+ },
46309
47030
  {
46310
47031
  "type": "object",
46311
47032
  "required": [
@@ -47040,6 +47761,27 @@
47040
47761
  }
47041
47762
  }
47042
47763
  },
47764
+ {
47765
+ "type": "object",
47766
+ "required": [
47767
+ "column",
47768
+ "values"
47769
+ ],
47770
+ "properties": {
47771
+ "column": {
47772
+ "type": "string",
47773
+ "enum": [
47774
+ "urlPath"
47775
+ ]
47776
+ },
47777
+ "values": {
47778
+ "type": "array",
47779
+ "items": {
47780
+ "type": "string"
47781
+ }
47782
+ }
47783
+ }
47784
+ },
47043
47785
  {
47044
47786
  "type": "object",
47045
47787
  "required": [
@@ -49295,6 +50037,12 @@
49295
50037
  "minimum": 0,
49296
50038
  "description": "Current numeric billing override, when set."
49297
50039
  },
50040
+ "OrganizationBillingPercentageOverride": {
50041
+ "type": "number",
50042
+ "minimum": 0,
50043
+ "maximum": 100,
50044
+ "description": "Current percentage billing override, when set."
50045
+ },
49298
50046
  "OrganizationBillingOverrides": {
49299
50047
  "type": "object",
49300
50048
  "properties": {
@@ -49309,6 +50057,14 @@
49309
50057
  "description": "Current SAML override, when set.",
49310
50058
  "$ref": "#/components/schemas/OrganizationBillingDateOverride"
49311
50059
  },
50060
+ "aiCreditAllowance": {
50061
+ "description": "Contractual AI credit allowance for Enterprise organizations only.",
50062
+ "$ref": "#/components/schemas/OrganizationBillingNumericOverride"
50063
+ },
50064
+ "aiCreditRollover": {
50065
+ "description": "Percentage of remaining paid AI credits carried into the next billing period. Paid self-serve organizations default to 50% when unset.",
50066
+ "$ref": "#/components/schemas/OrganizationBillingPercentageOverride"
50067
+ },
49312
50068
  "minUsers": {
49313
50069
  "description": "Current minimum users override, when set.",
49314
50070
  "$ref": "#/components/schemas/OrganizationBillingNumericOverride"
@@ -50459,7 +51215,7 @@
50459
51215
  "finalize"
50460
51216
  ]
50461
51217
  },
50462
- "GitSyncOperation": {
51218
+ "GitSyncSpaceOperation": {
50463
51219
  "type": "object",
50464
51220
  "properties": {
50465
51221
  "state": {
@@ -50504,6 +51260,59 @@
50504
51260
  "updatedAt"
50505
51261
  ]
50506
51262
  },
51263
+ "GitSyncOperation": {
51264
+ "description": "Deprecated. Use `GitSyncSpaceOperation` instead.",
51265
+ "deprecated": true,
51266
+ "allOf": [
51267
+ {
51268
+ "$ref": "#/components/schemas/GitSyncSpaceOperation"
51269
+ }
51270
+ ]
51271
+ },
51272
+ "GitSyncSiteOperation": {
51273
+ "type": "object",
51274
+ "properties": {
51275
+ "state": {
51276
+ "$ref": "#/components/schemas/GitSyncOperationState"
51277
+ },
51278
+ "direction": {
51279
+ "$ref": "#/components/schemas/GitSyncOperationDirection"
51280
+ },
51281
+ "stage": {
51282
+ "$ref": "#/components/schemas/GitSyncOperationStage"
51283
+ },
51284
+ "startedAt": {
51285
+ "description": "Date when the operation was started",
51286
+ "$ref": "#/components/schemas/Timestamp"
51287
+ },
51288
+ "updatedAt": {
51289
+ "description": "Date when the operation was last updated",
51290
+ "$ref": "#/components/schemas/Timestamp"
51291
+ },
51292
+ "completedAt": {
51293
+ "description": "Date when the operation was successful (when state is `success`)",
51294
+ "$ref": "#/components/schemas/Timestamp"
51295
+ },
51296
+ "error": {
51297
+ "type": "string",
51298
+ "description": "Error details, defined if state is `failure`."
51299
+ },
51300
+ "spaces": {
51301
+ "type": "object",
51302
+ "additionalProperties": {
51303
+ "$ref": "#/components/schemas/GitSyncSpaceOperation"
51304
+ }
51305
+ }
51306
+ },
51307
+ "required": [
51308
+ "state",
51309
+ "direction",
51310
+ "stage",
51311
+ "startedAt",
51312
+ "updatedAt",
51313
+ "spaces"
51314
+ ]
51315
+ },
50507
51316
  "GitSyncSiteStructureSectionGroup": {
50508
51317
  "type": "object",
50509
51318
  "additionalProperties": false,
@@ -52382,6 +53191,24 @@
52382
53191
  "space"
52383
53192
  ]
52384
53193
  },
53194
+ "APIChannelGitSyncSiteOperation": {
53195
+ "type": "object",
53196
+ "properties": {
53197
+ "channel": {
53198
+ "type": "string",
53199
+ "enum": [
53200
+ "site-gitsync-operation"
53201
+ ]
53202
+ },
53203
+ "site": {
53204
+ "type": "string"
53205
+ }
53206
+ },
53207
+ "required": [
53208
+ "channel",
53209
+ "site"
53210
+ ]
53211
+ },
52385
53212
  "APIChannelOpenAPISpec": {
52386
53213
  "type": "object",
52387
53214
  "description": "Subscription channel for changes in OpenAPI specification.",
@@ -52674,6 +53501,9 @@
52674
53501
  {
52675
53502
  "$ref": "#/components/schemas/APIChannelGitSyncOperation"
52676
53503
  },
53504
+ {
53505
+ "$ref": "#/components/schemas/APIChannelGitSyncSiteOperation"
53506
+ },
52677
53507
  {
52678
53508
  "$ref": "#/components/schemas/APIChannelOpenAPISpec"
52679
53509
  },
@@ -52757,7 +53587,25 @@
52757
53587
  ]
52758
53588
  },
52759
53589
  "data": {
52760
- "$ref": "#/components/schemas/GitSyncOperation"
53590
+ "$ref": "#/components/schemas/GitSyncSpaceOperation"
53591
+ }
53592
+ },
53593
+ "required": [
53594
+ "channel",
53595
+ "data"
53596
+ ]
53597
+ },
53598
+ "APIChannelGitSyncSiteOperationData": {
53599
+ "type": "object",
53600
+ "properties": {
53601
+ "channel": {
53602
+ "type": "string",
53603
+ "enum": [
53604
+ "site-gitsync-operation"
53605
+ ]
53606
+ },
53607
+ "data": {
53608
+ "$ref": "#/components/schemas/GitSyncSiteOperation"
52761
53609
  }
52762
53610
  },
52763
53611
  "required": [
@@ -52799,6 +53647,9 @@
52799
53647
  {
52800
53648
  "$ref": "#/components/schemas/APIChannelGitSyncOperationData"
52801
53649
  },
53650
+ {
53651
+ "$ref": "#/components/schemas/APIChannelGitSyncSiteOperationData"
53652
+ },
52802
53653
  {
52803
53654
  "$ref": "#/components/schemas/APIChannelTranslationRunData"
52804
53655
  },