@netlify/open-api 2.51.0 → 2.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/swagger.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "swagger": "2.0",
3
3
  "info": {
4
- "version": "2.51.0",
4
+ "version": "2.53.0",
5
5
  "title": "Netlify's API documentation",
6
6
  "description": "Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication.\n\nThis document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify's API](https://community.netlify.com/t/common-issue-understanding-and-using-netlifys-api/160).\n\nAdditionally, we have two API clients for your convenience:\n- [Go Client](https://github.com/netlify/open-api#go-client)\n- [JS Client](https://github.com/netlify/build/tree/main/packages/js-client)",
7
7
  "termsOfService": "https://www.netlify.com/legal/terms-of-use/",
@@ -5779,6 +5779,12 @@
5779
5779
  }
5780
5780
  }
5781
5781
  }
5782
+ },
5783
+ "event_subscriptions": {
5784
+ "type": "array",
5785
+ "items": {
5786
+ "type": "string"
5787
+ }
5782
5788
  }
5783
5789
  }
5784
5790
  }
@@ -6327,6 +6333,12 @@
6327
6333
  }
6328
6334
  }
6329
6335
  }
6336
+ },
6337
+ "event_subscriptions": {
6338
+ "type": "array",
6339
+ "items": {
6340
+ "type": "string"
6341
+ }
6330
6342
  }
6331
6343
  }
6332
6344
  }
@@ -17298,7 +17310,6 @@
17298
17310
  }
17299
17311
  ],
17300
17312
  "post": {
17301
- "x-internal": true,
17302
17313
  "operationId": "createSiteDatabase",
17303
17314
  "tags": [
17304
17315
  "database"
@@ -17372,12 +17383,23 @@
17372
17383
  }
17373
17384
  },
17374
17385
  "get": {
17375
- "x-internal": true,
17376
17386
  "operationId": "getSiteDatabase",
17377
17387
  "tags": [
17378
17388
  "database"
17379
17389
  ],
17380
17390
  "description": "Returns the database connection string for the specified site.",
17391
+ "parameters": [
17392
+ {
17393
+ "name": "role",
17394
+ "type": "string",
17395
+ "in": "query",
17396
+ "description": "The database role to use for the connection string. Defaults to netlifydb_owner if not specified.",
17397
+ "enum": [
17398
+ "netlifydb_owner",
17399
+ "netlifydb_readonly"
17400
+ ]
17401
+ }
17402
+ ],
17381
17403
  "responses": {
17382
17404
  "200": {
17383
17405
  "description": "OK",
@@ -17414,7 +17436,6 @@
17414
17436
  }
17415
17437
  },
17416
17438
  "delete": {
17417
- "x-internal": true,
17418
17439
  "operationId": "deleteSiteDatabase",
17419
17440
  "tags": [
17420
17441
  "database"
@@ -17456,12 +17477,11 @@
17456
17477
  }
17457
17478
  ],
17458
17479
  "post": {
17459
- "x-internal": true,
17460
17480
  "operationId": "createSiteDatabaseBranch",
17461
17481
  "tags": [
17462
17482
  "database"
17463
17483
  ],
17464
- "description": "Creates a new database branch for a deploy. If a branch already exists for the specified deploy ID, returns the existing connection string.",
17484
+ "description": "Creates a new database branch. If a branch already exists for the specified branch ID, returns the existing connection string.",
17465
17485
  "consumes": [
17466
17486
  "application/json"
17467
17487
  ],
@@ -17473,16 +17493,21 @@
17473
17493
  "type": "object",
17474
17494
  "description": "Request body for creating a database branch",
17475
17495
  "required": [
17476
- "deploy_id"
17496
+ "branch_id"
17477
17497
  ],
17478
17498
  "properties": {
17479
17499
  "parent_branch_id": {
17480
17500
  "type": "string",
17481
17501
  "description": "The ID of the parent branch to create the new branch from. Defaults to the production branch if not specified."
17482
17502
  },
17483
- "deploy_id": {
17503
+ "branch_id": {
17484
17504
  "type": "string",
17485
- "description": "The deploy ID to associate with this branch"
17505
+ "description": "The branch identifier"
17506
+ },
17507
+ "metadata": {
17508
+ "type": "object",
17509
+ "description": "Arbitrary metadata to associate with the branch",
17510
+ "additionalProperties": true
17486
17511
  }
17487
17512
  }
17488
17513
  },
@@ -17491,7 +17516,7 @@
17491
17516
  ],
17492
17517
  "responses": {
17493
17518
  "200": {
17494
- "description": "Branch already exists for this deploy",
17519
+ "description": "Branch already exists",
17495
17520
  "schema": {
17496
17521
  "type": "object",
17497
17522
  "description": "Response containing the database branch connection string",
@@ -17499,6 +17524,11 @@
17499
17524
  "connection_string": {
17500
17525
  "type": "string",
17501
17526
  "description": "The connection string for the database branch"
17527
+ },
17528
+ "metadata": {
17529
+ "type": "object",
17530
+ "description": "Metadata associated with the branch",
17531
+ "additionalProperties": true
17502
17532
  }
17503
17533
  }
17504
17534
  }
@@ -17512,6 +17542,150 @@
17512
17542
  "connection_string": {
17513
17543
  "type": "string",
17514
17544
  "description": "The connection string for the database branch"
17545
+ },
17546
+ "metadata": {
17547
+ "type": "object",
17548
+ "description": "Metadata associated with the branch",
17549
+ "additionalProperties": true
17550
+ }
17551
+ }
17552
+ }
17553
+ },
17554
+ "default": {
17555
+ "description": "error",
17556
+ "schema": {
17557
+ "type": "object",
17558
+ "required": [
17559
+ "message"
17560
+ ],
17561
+ "properties": {
17562
+ "code": {
17563
+ "type": "integer",
17564
+ "format": "int64"
17565
+ },
17566
+ "message": {
17567
+ "type": "string",
17568
+ "x-nullable": false
17569
+ }
17570
+ }
17571
+ }
17572
+ }
17573
+ }
17574
+ }
17575
+ },
17576
+ "/sites/{site_id}/database/branches": {
17577
+ "parameters": [
17578
+ {
17579
+ "name": "site_id",
17580
+ "type": "string",
17581
+ "in": "path",
17582
+ "required": true
17583
+ }
17584
+ ],
17585
+ "get": {
17586
+ "operationId": "listSiteDatabaseBranches",
17587
+ "tags": [
17588
+ "database"
17589
+ ],
17590
+ "description": "Returns all branches for the site's database with compute status and metadata.",
17591
+ "responses": {
17592
+ "200": {
17593
+ "description": "OK",
17594
+ "schema": {
17595
+ "type": "object",
17596
+ "description": "Response containing a list of database branches",
17597
+ "properties": {
17598
+ "branches": {
17599
+ "type": "array",
17600
+ "items": {
17601
+ "type": "object",
17602
+ "description": "Detailed information about a database branch",
17603
+ "properties": {
17604
+ "branch_id": {
17605
+ "type": "string",
17606
+ "description": "The branch identifier"
17607
+ },
17608
+ "name": {
17609
+ "type": "string",
17610
+ "description": "The branch name"
17611
+ },
17612
+ "connection_string": {
17613
+ "type": "string",
17614
+ "description": "The connection string for the branch"
17615
+ },
17616
+ "state": {
17617
+ "type": "string",
17618
+ "description": "The current state of the branch",
17619
+ "enum": [
17620
+ "init",
17621
+ "creating",
17622
+ "resetting",
17623
+ "ready",
17624
+ "archived"
17625
+ ]
17626
+ },
17627
+ "logical_size_bytes": {
17628
+ "type": "integer",
17629
+ "format": "int64",
17630
+ "description": "The logical size of the branch in bytes"
17631
+ },
17632
+ "created_at": {
17633
+ "type": "string",
17634
+ "format": "dateTime",
17635
+ "description": "When the branch was created"
17636
+ },
17637
+ "updated_at": {
17638
+ "type": "string",
17639
+ "format": "dateTime",
17640
+ "description": "When the branch was last updated"
17641
+ },
17642
+ "last_active_at": {
17643
+ "type": "string",
17644
+ "format": "dateTime",
17645
+ "description": "When the branch was last active"
17646
+ },
17647
+ "compute": {
17648
+ "type": "object",
17649
+ "description": "Compute endpoint status for a branch",
17650
+ "properties": {
17651
+ "current_state": {
17652
+ "type": "string",
17653
+ "description": "The current state of the compute endpoint",
17654
+ "enum": [
17655
+ "active",
17656
+ "idle"
17657
+ ]
17658
+ },
17659
+ "autoscaling_limit_min_cu": {
17660
+ "type": "number",
17661
+ "format": "double",
17662
+ "description": "Minimum compute units for autoscaling"
17663
+ },
17664
+ "autoscaling_limit_max_cu": {
17665
+ "type": "number",
17666
+ "format": "double",
17667
+ "description": "Maximum compute units for autoscaling"
17668
+ },
17669
+ "suspend_timeout_seconds": {
17670
+ "type": "integer",
17671
+ "format": "int64",
17672
+ "description": "Seconds of inactivity before the compute endpoint is suspended"
17673
+ },
17674
+ "last_active": {
17675
+ "type": "string",
17676
+ "format": "dateTime",
17677
+ "description": "When the compute endpoint was last active"
17678
+ }
17679
+ }
17680
+ },
17681
+ "metadata": {
17682
+ "type": "object",
17683
+ "description": "Metadata associated with the branch",
17684
+ "additionalProperties": true
17685
+ }
17686
+ }
17687
+ },
17688
+ "description": "List of database branches"
17515
17689
  }
17516
17690
  }
17517
17691
  }
@@ -17538,7 +17712,7 @@
17538
17712
  }
17539
17713
  }
17540
17714
  },
17541
- "/sites/{site_id}/database/branch/{deploy_id}": {
17715
+ "/sites/{site_id}/database/branch/{branch_id}": {
17542
17716
  "parameters": [
17543
17717
  {
17544
17718
  "name": "site_id",
@@ -17547,20 +17721,31 @@
17547
17721
  "required": true
17548
17722
  },
17549
17723
  {
17550
- "name": "deploy_id",
17724
+ "name": "branch_id",
17551
17725
  "type": "string",
17552
17726
  "in": "path",
17553
17727
  "required": true,
17554
- "description": "The deploy ID associated with the database branch"
17728
+ "description": "The branch ID"
17555
17729
  }
17556
17730
  ],
17557
17731
  "get": {
17558
- "x-internal": true,
17559
17732
  "operationId": "getSiteDatabaseBranch",
17560
17733
  "tags": [
17561
17734
  "database"
17562
17735
  ],
17563
- "description": "Returns the database branch connection string for a specific deploy.",
17736
+ "description": "Returns the database branch connection string for a specific branch.",
17737
+ "parameters": [
17738
+ {
17739
+ "name": "role",
17740
+ "type": "string",
17741
+ "in": "query",
17742
+ "description": "The database role to use for the connection string. Defaults to netlifydb_owner if not specified.",
17743
+ "enum": [
17744
+ "netlifydb_owner",
17745
+ "netlifydb_readonly"
17746
+ ]
17747
+ }
17748
+ ],
17564
17749
  "responses": {
17565
17750
  "200": {
17566
17751
  "description": "OK",
@@ -17571,12 +17756,17 @@
17571
17756
  "connection_string": {
17572
17757
  "type": "string",
17573
17758
  "description": "The connection string for the database branch"
17759
+ },
17760
+ "metadata": {
17761
+ "type": "object",
17762
+ "description": "Metadata associated with the branch",
17763
+ "additionalProperties": true
17574
17764
  }
17575
17765
  }
17576
17766
  }
17577
17767
  },
17578
17768
  "404": {
17579
- "description": "Branch not found for this deploy"
17769
+ "description": "Branch not found"
17580
17770
  },
17581
17771
  "default": {
17582
17772
  "description": "error",
@@ -17600,12 +17790,11 @@
17600
17790
  }
17601
17791
  },
17602
17792
  "delete": {
17603
- "x-internal": true,
17604
17793
  "operationId": "deleteSiteDatabaseBranch",
17605
17794
  "tags": [
17606
17795
  "database"
17607
17796
  ],
17608
- "description": "Deletes a database branch associated with a deploy.",
17797
+ "description": "Deletes a database branch.",
17609
17798
  "responses": {
17610
17799
  "204": {
17611
17800
  "description": "Deleted"
@@ -17632,68 +17821,92 @@
17632
17821
  }
17633
17822
  }
17634
17823
  },
17635
- "/sites/{site_id}/database/snapshot": {
17824
+ "/sites/{site_id}/database/branch/{branch_id}/reset": {
17636
17825
  "parameters": [
17637
17826
  {
17638
17827
  "name": "site_id",
17639
17828
  "type": "string",
17640
17829
  "in": "path",
17641
17830
  "required": true
17831
+ },
17832
+ {
17833
+ "name": "branch_id",
17834
+ "type": "string",
17835
+ "in": "path",
17836
+ "required": true,
17837
+ "description": "The branch ID to reset"
17642
17838
  }
17643
17839
  ],
17644
17840
  "post": {
17645
- "x-internal": true,
17646
- "operationId": "createSiteDatabaseSnapshot",
17841
+ "operationId": "resetSiteDatabaseBranch",
17647
17842
  "tags": [
17648
17843
  "database"
17649
17844
  ],
17650
- "description": "Creates a point-in-time snapshot of a database branch. Defaults to the production branch if no branch name is specified.",
17845
+ "description": "Resets a non-production database branch by re-forking it from a source branch (defaults to the production branch). If the target branch is already in sync with the source, returns the existing connection string without performing a reset, unless `force=true` is passed. The production branch cannot be reset.",
17651
17846
  "consumes": [
17652
17847
  "application/json"
17653
17848
  ],
17654
17849
  "parameters": [
17655
17850
  {
17656
- "name": "snapshot",
17851
+ "name": "force",
17852
+ "type": "boolean",
17853
+ "in": "query",
17854
+ "description": "If true, resets the branch even when it is already in sync with the source."
17855
+ },
17856
+ {
17857
+ "name": "role",
17858
+ "type": "string",
17859
+ "in": "query",
17860
+ "description": "The database role to use for the returned connection string. Defaults to netlifydb_owner if not specified.",
17861
+ "enum": [
17862
+ "netlifydb_owner",
17863
+ "netlifydb_readonly"
17864
+ ]
17865
+ },
17866
+ {
17867
+ "name": "reset",
17657
17868
  "in": "body",
17658
17869
  "schema": {
17659
17870
  "type": "object",
17660
- "description": "Request body for creating a database snapshot",
17871
+ "description": "Request body for resetting a database branch",
17661
17872
  "properties": {
17662
- "branch_name": {
17663
- "type": "string",
17664
- "description": "The name of the branch to snapshot. Defaults to \"production\" if not specified."
17665
- },
17666
- "name": {
17873
+ "source_branch_id": {
17667
17874
  "type": "string",
17668
- "description": "An optional name for the snapshot"
17875
+ "description": "The ID of the branch to re-fork the target branch from. Defaults to \"production\" if not specified."
17669
17876
  }
17670
17877
  }
17671
17878
  }
17672
17879
  }
17673
17880
  ],
17674
17881
  "responses": {
17675
- "201": {
17676
- "description": "Created",
17882
+ "200": {
17883
+ "description": "OK",
17677
17884
  "schema": {
17678
17885
  "type": "object",
17679
- "description": "A point-in-time snapshot of a database branch",
17886
+ "description": "Response for a database branch reset",
17680
17887
  "properties": {
17681
- "id": {
17682
- "type": "string",
17683
- "description": "The unique identifier of the snapshot"
17888
+ "reset": {
17889
+ "type": "boolean",
17890
+ "description": "Whether the branch was actually re-forked. False when the target was already in sync with the source and `force=true` was not set."
17684
17891
  },
17685
- "timestamp": {
17892
+ "connection_string": {
17686
17893
  "type": "string",
17687
- "format": "dateTime",
17688
- "description": "The timestamp when the snapshot was created"
17894
+ "description": "The connection string for the reset (or unchanged) branch"
17689
17895
  },
17690
- "source_branch_id": {
17691
- "type": "string",
17692
- "description": "The ID of the branch that was snapshotted"
17896
+ "metadata": {
17897
+ "type": "object",
17898
+ "description": "Metadata associated with the branch",
17899
+ "additionalProperties": true
17693
17900
  }
17694
17901
  }
17695
17902
  }
17696
17903
  },
17904
+ "400": {
17905
+ "description": "Invalid request — for example, the target is the production branch or the source branch is the same as the target."
17906
+ },
17907
+ "404": {
17908
+ "description": "Database or branch not found"
17909
+ },
17697
17910
  "default": {
17698
17911
  "description": "error",
17699
17912
  "schema": {
@@ -17716,55 +17929,95 @@
17716
17929
  }
17717
17930
  }
17718
17931
  },
17719
- "/sites/{site_id}/database/snapshots": {
17932
+ "/sites/{site_id}/database/branch/{branch_id}/compute/settings": {
17720
17933
  "parameters": [
17721
17934
  {
17722
17935
  "name": "site_id",
17723
17936
  "type": "string",
17724
17937
  "in": "path",
17725
17938
  "required": true
17939
+ },
17940
+ {
17941
+ "name": "branch_id",
17942
+ "type": "string",
17943
+ "in": "path",
17944
+ "required": true,
17945
+ "description": "The branch ID"
17726
17946
  }
17727
17947
  ],
17728
- "get": {
17729
- "x-internal": true,
17730
- "operationId": "listSiteDatabaseSnapshots",
17948
+ "put": {
17949
+ "operationId": "setSiteDatabaseBranchComputeSettings",
17731
17950
  "tags": [
17732
17951
  "database"
17733
17952
  ],
17734
- "description": "Returns all snapshots for the site's database.",
17953
+ "description": "Sets compute settings for a specific database branch, overriding project-level settings. Requires a Pro or higher plan.",
17954
+ "consumes": [
17955
+ "application/json"
17956
+ ],
17957
+ "parameters": [
17958
+ {
17959
+ "name": "computeSettings",
17960
+ "in": "body",
17961
+ "schema": {
17962
+ "type": "object",
17963
+ "description": "Request body for setting compute settings. All fields are optional; only provided fields are updated.",
17964
+ "properties": {
17965
+ "min_cu": {
17966
+ "type": "number",
17967
+ "format": "double",
17968
+ "minimum": 0.25,
17969
+ "maximum": 16,
17970
+ "x-nullable": true,
17971
+ "description": "Minimum compute units (0.25 to 16.0). Must be less than or equal to max_cu."
17972
+ },
17973
+ "max_cu": {
17974
+ "type": "number",
17975
+ "format": "double",
17976
+ "minimum": 0.25,
17977
+ "maximum": 16,
17978
+ "x-nullable": true,
17979
+ "description": "Maximum compute units (0.25 to 16.0). Must be greater than or equal to min_cu. max_cu - min_cu must not exceed 8.0."
17980
+ },
17981
+ "sleep_timeout_seconds": {
17982
+ "type": "integer",
17983
+ "format": "int64",
17984
+ "minimum": -1,
17985
+ "x-nullable": true,
17986
+ "description": "Seconds of inactivity before the compute endpoint is suspended. Use -1 for always on, or a non-negative value."
17987
+ }
17988
+ }
17989
+ },
17990
+ "required": true
17991
+ }
17992
+ ],
17735
17993
  "responses": {
17736
17994
  "200": {
17737
17995
  "description": "OK",
17738
17996
  "schema": {
17739
17997
  "type": "object",
17740
- "description": "Response containing a list of database snapshots",
17998
+ "description": "Compute settings for a database or branch",
17741
17999
  "properties": {
17742
- "snapshots": {
17743
- "type": "array",
17744
- "items": {
17745
- "type": "object",
17746
- "description": "A point-in-time snapshot of a database branch",
17747
- "properties": {
17748
- "id": {
17749
- "type": "string",
17750
- "description": "The unique identifier of the snapshot"
17751
- },
17752
- "timestamp": {
17753
- "type": "string",
17754
- "format": "dateTime",
17755
- "description": "The timestamp when the snapshot was created"
17756
- },
17757
- "source_branch_id": {
17758
- "type": "string",
17759
- "description": "The ID of the branch that was snapshotted"
17760
- }
17761
- }
17762
- },
17763
- "description": "List of database snapshots"
18000
+ "min_cu": {
18001
+ "type": "number",
18002
+ "format": "double",
18003
+ "description": "Minimum compute units"
18004
+ },
18005
+ "max_cu": {
18006
+ "type": "number",
18007
+ "format": "double",
18008
+ "description": "Maximum compute units"
18009
+ },
18010
+ "sleep_timeout_seconds": {
18011
+ "type": "integer",
18012
+ "format": "int64",
18013
+ "description": "Seconds of inactivity before suspension"
17764
18014
  }
17765
18015
  }
17766
18016
  }
17767
18017
  },
18018
+ "403": {
18019
+ "description": "Compute customization requires a Pro or higher plan"
18020
+ },
17768
18021
  "default": {
17769
18022
  "description": "error",
17770
18023
  "schema": {
@@ -17787,37 +18040,701 @@
17787
18040
  }
17788
18041
  }
17789
18042
  },
17790
- "/sites/{site_id}/database/snapshot/{snapshot_id}": {
18043
+ "/sites/{site_id}/database/compute/settings": {
17791
18044
  "parameters": [
17792
18045
  {
17793
18046
  "name": "site_id",
17794
18047
  "type": "string",
17795
18048
  "in": "path",
17796
18049
  "required": true
17797
- },
17798
- {
17799
- "name": "snapshot_id",
17800
- "type": "string",
17801
- "in": "path",
17802
- "required": true,
17803
- "description": "The snapshot ID"
17804
18050
  }
17805
18051
  ],
17806
- "delete": {
17807
- "x-internal": true,
17808
- "operationId": "deleteSiteDatabaseSnapshot",
18052
+ "put": {
18053
+ "operationId": "setSiteDatabaseComputeSettings",
17809
18054
  "tags": [
17810
18055
  "database"
17811
18056
  ],
17812
- "description": "Deletes a database snapshot.",
17813
- "responses": {
17814
- "204": {
17815
- "description": "Deleted"
17816
- },
17817
- "default": {
17818
- "description": "error",
17819
- "schema": {
17820
- "type": "object",
18057
+ "description": "Sets project-level compute settings for the database. Applied to new branches. Can be overridden per-branch. Requires a Pro or higher plan.",
18058
+ "consumes": [
18059
+ "application/json"
18060
+ ],
18061
+ "parameters": [
18062
+ {
18063
+ "name": "computeSettings",
18064
+ "in": "body",
18065
+ "schema": {
18066
+ "type": "object",
18067
+ "description": "Request body for setting compute settings. All fields are optional; only provided fields are updated.",
18068
+ "properties": {
18069
+ "min_cu": {
18070
+ "type": "number",
18071
+ "format": "double",
18072
+ "minimum": 0.25,
18073
+ "maximum": 16,
18074
+ "x-nullable": true,
18075
+ "description": "Minimum compute units (0.25 to 16.0). Must be less than or equal to max_cu."
18076
+ },
18077
+ "max_cu": {
18078
+ "type": "number",
18079
+ "format": "double",
18080
+ "minimum": 0.25,
18081
+ "maximum": 16,
18082
+ "x-nullable": true,
18083
+ "description": "Maximum compute units (0.25 to 16.0). Must be greater than or equal to min_cu. max_cu - min_cu must not exceed 8.0."
18084
+ },
18085
+ "sleep_timeout_seconds": {
18086
+ "type": "integer",
18087
+ "format": "int64",
18088
+ "minimum": -1,
18089
+ "x-nullable": true,
18090
+ "description": "Seconds of inactivity before the compute endpoint is suspended. Use -1 for always on, or a non-negative value."
18091
+ }
18092
+ }
18093
+ },
18094
+ "required": true
18095
+ }
18096
+ ],
18097
+ "responses": {
18098
+ "200": {
18099
+ "description": "OK",
18100
+ "schema": {
18101
+ "type": "object",
18102
+ "description": "Compute settings for a database or branch",
18103
+ "properties": {
18104
+ "min_cu": {
18105
+ "type": "number",
18106
+ "format": "double",
18107
+ "description": "Minimum compute units"
18108
+ },
18109
+ "max_cu": {
18110
+ "type": "number",
18111
+ "format": "double",
18112
+ "description": "Maximum compute units"
18113
+ },
18114
+ "sleep_timeout_seconds": {
18115
+ "type": "integer",
18116
+ "format": "int64",
18117
+ "description": "Seconds of inactivity before suspension"
18118
+ }
18119
+ }
18120
+ }
18121
+ },
18122
+ "403": {
18123
+ "description": "Compute customization requires a Pro or higher plan"
18124
+ },
18125
+ "default": {
18126
+ "description": "error",
18127
+ "schema": {
18128
+ "type": "object",
18129
+ "required": [
18130
+ "message"
18131
+ ],
18132
+ "properties": {
18133
+ "code": {
18134
+ "type": "integer",
18135
+ "format": "int64"
18136
+ },
18137
+ "message": {
18138
+ "type": "string",
18139
+ "x-nullable": false
18140
+ }
18141
+ }
18142
+ }
18143
+ }
18144
+ }
18145
+ },
18146
+ "get": {
18147
+ "operationId": "getSiteDatabaseComputeSettings",
18148
+ "tags": [
18149
+ "database"
18150
+ ],
18151
+ "description": "Returns the project-level compute settings for the database. Returns effective settings (custom or tier defaults). Requires a Pro or higher plan.",
18152
+ "responses": {
18153
+ "200": {
18154
+ "description": "OK",
18155
+ "schema": {
18156
+ "type": "object",
18157
+ "description": "Compute settings for a database or branch",
18158
+ "properties": {
18159
+ "min_cu": {
18160
+ "type": "number",
18161
+ "format": "double",
18162
+ "description": "Minimum compute units"
18163
+ },
18164
+ "max_cu": {
18165
+ "type": "number",
18166
+ "format": "double",
18167
+ "description": "Maximum compute units"
18168
+ },
18169
+ "sleep_timeout_seconds": {
18170
+ "type": "integer",
18171
+ "format": "int64",
18172
+ "description": "Seconds of inactivity before suspension"
18173
+ }
18174
+ }
18175
+ }
18176
+ },
18177
+ "403": {
18178
+ "description": "Compute customization requires a Pro or higher plan"
18179
+ },
18180
+ "default": {
18181
+ "description": "error",
18182
+ "schema": {
18183
+ "type": "object",
18184
+ "required": [
18185
+ "message"
18186
+ ],
18187
+ "properties": {
18188
+ "code": {
18189
+ "type": "integer",
18190
+ "format": "int64"
18191
+ },
18192
+ "message": {
18193
+ "type": "string",
18194
+ "x-nullable": false
18195
+ }
18196
+ }
18197
+ }
18198
+ }
18199
+ }
18200
+ },
18201
+ "delete": {
18202
+ "operationId": "clearSiteDatabaseComputeSettings",
18203
+ "tags": [
18204
+ "database"
18205
+ ],
18206
+ "description": "Resets project-level compute settings to tier defaults. Requires a Pro or higher plan.",
18207
+ "responses": {
18208
+ "204": {
18209
+ "description": "Cleared"
18210
+ },
18211
+ "403": {
18212
+ "description": "Compute customization requires a Pro or higher plan"
18213
+ },
18214
+ "default": {
18215
+ "description": "error",
18216
+ "schema": {
18217
+ "type": "object",
18218
+ "required": [
18219
+ "message"
18220
+ ],
18221
+ "properties": {
18222
+ "code": {
18223
+ "type": "integer",
18224
+ "format": "int64"
18225
+ },
18226
+ "message": {
18227
+ "type": "string",
18228
+ "x-nullable": false
18229
+ }
18230
+ }
18231
+ }
18232
+ }
18233
+ }
18234
+ }
18235
+ },
18236
+ "/sites/{site_id}/database/migrations": {
18237
+ "parameters": [
18238
+ {
18239
+ "name": "site_id",
18240
+ "type": "string",
18241
+ "in": "path",
18242
+ "required": true
18243
+ }
18244
+ ],
18245
+ "get": {
18246
+ "operationId": "listSiteDatabaseMigrations",
18247
+ "tags": [
18248
+ "database"
18249
+ ],
18250
+ "description": "Returns the list of migrations available for the specified branch, indicating which ones have been applied to the database.",
18251
+ "parameters": [
18252
+ {
18253
+ "name": "branch",
18254
+ "type": "string",
18255
+ "in": "query",
18256
+ "description": "The branch ID to list migrations for. Defaults to \"production\" if not specified."
18257
+ }
18258
+ ],
18259
+ "responses": {
18260
+ "200": {
18261
+ "description": "OK",
18262
+ "schema": {
18263
+ "type": "object",
18264
+ "description": "Response containing the list of migrations for a branch",
18265
+ "properties": {
18266
+ "migrations": {
18267
+ "type": "array",
18268
+ "items": {
18269
+ "type": "object",
18270
+ "description": "A migration available to a database branch",
18271
+ "properties": {
18272
+ "version": {
18273
+ "type": "integer",
18274
+ "format": "int64",
18275
+ "description": "The migration version number"
18276
+ },
18277
+ "name": {
18278
+ "type": "string",
18279
+ "description": "The migration name"
18280
+ },
18281
+ "path": {
18282
+ "type": "string",
18283
+ "description": "The path to the migration file in the deploy bundle"
18284
+ },
18285
+ "applied": {
18286
+ "type": "boolean",
18287
+ "description": "Whether this migration has been applied to the branch"
18288
+ }
18289
+ }
18290
+ },
18291
+ "description": "List of migrations"
18292
+ }
18293
+ }
18294
+ }
18295
+ },
18296
+ "404": {
18297
+ "description": "Database or branch not found"
18298
+ },
18299
+ "423": {
18300
+ "description": "Database is disabled"
18301
+ },
18302
+ "default": {
18303
+ "description": "error",
18304
+ "schema": {
18305
+ "type": "object",
18306
+ "required": [
18307
+ "message"
18308
+ ],
18309
+ "properties": {
18310
+ "code": {
18311
+ "type": "integer",
18312
+ "format": "int64"
18313
+ },
18314
+ "message": {
18315
+ "type": "string",
18316
+ "x-nullable": false
18317
+ }
18318
+ }
18319
+ }
18320
+ }
18321
+ }
18322
+ }
18323
+ },
18324
+ "/sites/{site_id}/database/migrations/{name}": {
18325
+ "parameters": [
18326
+ {
18327
+ "name": "site_id",
18328
+ "type": "string",
18329
+ "in": "path",
18330
+ "required": true
18331
+ },
18332
+ {
18333
+ "name": "name",
18334
+ "type": "string",
18335
+ "in": "path",
18336
+ "required": true,
18337
+ "description": "The migration name"
18338
+ }
18339
+ ],
18340
+ "get": {
18341
+ "operationId": "getSiteDatabaseMigration",
18342
+ "tags": [
18343
+ "database"
18344
+ ],
18345
+ "description": "Returns the contents of a named migration for the specified branch.",
18346
+ "parameters": [
18347
+ {
18348
+ "name": "branch",
18349
+ "type": "string",
18350
+ "in": "query",
18351
+ "description": "The branch ID to look up the migration on. Defaults to the currently published deploy's branch."
18352
+ }
18353
+ ],
18354
+ "responses": {
18355
+ "200": {
18356
+ "description": "OK",
18357
+ "schema": {
18358
+ "type": "object",
18359
+ "description": "A migration with its file contents",
18360
+ "properties": {
18361
+ "version": {
18362
+ "type": "integer",
18363
+ "format": "int64",
18364
+ "description": "The migration version number"
18365
+ },
18366
+ "name": {
18367
+ "type": "string",
18368
+ "description": "The migration name"
18369
+ },
18370
+ "path": {
18371
+ "type": "string",
18372
+ "description": "The path to the migration file in the deploy bundle"
18373
+ },
18374
+ "content": {
18375
+ "type": "string",
18376
+ "description": "The raw contents of the migration file"
18377
+ }
18378
+ }
18379
+ }
18380
+ },
18381
+ "404": {
18382
+ "description": "Migration, database, or branch not found"
18383
+ },
18384
+ "423": {
18385
+ "description": "Database is disabled"
18386
+ },
18387
+ "default": {
18388
+ "description": "error",
18389
+ "schema": {
18390
+ "type": "object",
18391
+ "required": [
18392
+ "message"
18393
+ ],
18394
+ "properties": {
18395
+ "code": {
18396
+ "type": "integer",
18397
+ "format": "int64"
18398
+ },
18399
+ "message": {
18400
+ "type": "string",
18401
+ "x-nullable": false
18402
+ }
18403
+ }
18404
+ }
18405
+ }
18406
+ }
18407
+ }
18408
+ },
18409
+ "/sites/{site_id}/database/migrations/{deploy_id}": {
18410
+ "parameters": [
18411
+ {
18412
+ "name": "site_id",
18413
+ "type": "string",
18414
+ "in": "path",
18415
+ "required": true
18416
+ },
18417
+ {
18418
+ "name": "deploy_id",
18419
+ "type": "string",
18420
+ "in": "path",
18421
+ "required": true,
18422
+ "description": "The deploy ID to run migrations for"
18423
+ }
18424
+ ],
18425
+ "post": {
18426
+ "operationId": "runSiteDatabaseMigrations",
18427
+ "tags": [
18428
+ "database"
18429
+ ],
18430
+ "description": "Runs database migrations for the specified deploy. Finds the deploy and determines the appropriate branch.",
18431
+ "consumes": [
18432
+ "application/json"
18433
+ ],
18434
+ "parameters": [
18435
+ {
18436
+ "name": "migrations",
18437
+ "in": "body",
18438
+ "schema": {
18439
+ "type": "object",
18440
+ "description": "Request body for running database migrations",
18441
+ "properties": {
18442
+ "dry_run": {
18443
+ "type": "boolean",
18444
+ "description": "If true, validates migrations without applying them."
18445
+ }
18446
+ }
18447
+ }
18448
+ }
18449
+ ],
18450
+ "responses": {
18451
+ "200": {
18452
+ "description": "OK"
18453
+ },
18454
+ "409": {
18455
+ "description": "Migration conflict - migration modified or removed after being applied"
18456
+ },
18457
+ "422": {
18458
+ "description": "Migration validation failed"
18459
+ },
18460
+ "default": {
18461
+ "description": "error",
18462
+ "schema": {
18463
+ "type": "object",
18464
+ "required": [
18465
+ "message"
18466
+ ],
18467
+ "properties": {
18468
+ "code": {
18469
+ "type": "integer",
18470
+ "format": "int64"
18471
+ },
18472
+ "message": {
18473
+ "type": "string",
18474
+ "x-nullable": false
18475
+ }
18476
+ }
18477
+ }
18478
+ }
18479
+ }
18480
+ }
18481
+ },
18482
+ "/sites/{site_id}/database/snapshot": {
18483
+ "parameters": [
18484
+ {
18485
+ "name": "site_id",
18486
+ "type": "string",
18487
+ "in": "path",
18488
+ "required": true
18489
+ }
18490
+ ],
18491
+ "post": {
18492
+ "operationId": "createSiteDatabaseSnapshot",
18493
+ "tags": [
18494
+ "database"
18495
+ ],
18496
+ "description": "Creates a point-in-time snapshot of a database branch. Defaults to the production branch if no branch name is specified.",
18497
+ "consumes": [
18498
+ "application/json"
18499
+ ],
18500
+ "parameters": [
18501
+ {
18502
+ "name": "snapshot",
18503
+ "in": "body",
18504
+ "schema": {
18505
+ "type": "object",
18506
+ "description": "Request body for creating a database snapshot",
18507
+ "properties": {
18508
+ "branch_id": {
18509
+ "type": "string",
18510
+ "description": "The ID of the branch to snapshot. Defaults to \"production\" if not specified."
18511
+ },
18512
+ "name": {
18513
+ "type": "string",
18514
+ "description": "A name for the snapshot"
18515
+ },
18516
+ "metadata": {
18517
+ "type": "object",
18518
+ "description": "Metadata associated with a snapshot",
18519
+ "properties": {
18520
+ "deploy": {
18521
+ "type": "object",
18522
+ "description": "Deploy information associated with the snapshot",
18523
+ "additionalProperties": true
18524
+ },
18525
+ "source": {
18526
+ "type": "string",
18527
+ "description": "The source that created the snapshot"
18528
+ }
18529
+ }
18530
+ }
18531
+ }
18532
+ }
18533
+ }
18534
+ ],
18535
+ "responses": {
18536
+ "201": {
18537
+ "description": "Created",
18538
+ "schema": {
18539
+ "type": "object",
18540
+ "description": "A point-in-time snapshot of a database branch",
18541
+ "properties": {
18542
+ "id": {
18543
+ "type": "string",
18544
+ "description": "The unique identifier of the snapshot"
18545
+ },
18546
+ "source_branch_id": {
18547
+ "type": "string",
18548
+ "description": "The ID of the branch that was snapshotted"
18549
+ },
18550
+ "manual": {
18551
+ "type": "boolean",
18552
+ "description": "Whether this snapshot was manually created"
18553
+ },
18554
+ "created_at": {
18555
+ "type": "string",
18556
+ "format": "dateTime",
18557
+ "description": "When the snapshot was created"
18558
+ },
18559
+ "expires_at": {
18560
+ "type": "string",
18561
+ "format": "dateTime",
18562
+ "description": "When the snapshot expires"
18563
+ },
18564
+ "timestamp": {
18565
+ "type": "string",
18566
+ "format": "dateTime",
18567
+ "description": "The point-in-time timestamp of the snapshot"
18568
+ },
18569
+ "metadata": {
18570
+ "type": "object",
18571
+ "description": "Metadata associated with a snapshot",
18572
+ "properties": {
18573
+ "deploy": {
18574
+ "type": "object",
18575
+ "description": "Deploy information associated with the snapshot",
18576
+ "additionalProperties": true
18577
+ },
18578
+ "source": {
18579
+ "type": "string",
18580
+ "description": "The source that created the snapshot"
18581
+ }
18582
+ }
18583
+ }
18584
+ }
18585
+ }
18586
+ },
18587
+ "default": {
18588
+ "description": "error",
18589
+ "schema": {
18590
+ "type": "object",
18591
+ "required": [
18592
+ "message"
18593
+ ],
18594
+ "properties": {
18595
+ "code": {
18596
+ "type": "integer",
18597
+ "format": "int64"
18598
+ },
18599
+ "message": {
18600
+ "type": "string",
18601
+ "x-nullable": false
18602
+ }
18603
+ }
18604
+ }
18605
+ }
18606
+ }
18607
+ }
18608
+ },
18609
+ "/sites/{site_id}/database/snapshots": {
18610
+ "parameters": [
18611
+ {
18612
+ "name": "site_id",
18613
+ "type": "string",
18614
+ "in": "path",
18615
+ "required": true
18616
+ }
18617
+ ],
18618
+ "get": {
18619
+ "operationId": "listSiteDatabaseSnapshots",
18620
+ "tags": [
18621
+ "database"
18622
+ ],
18623
+ "description": "Returns all snapshots for the site's database.",
18624
+ "responses": {
18625
+ "200": {
18626
+ "description": "OK",
18627
+ "schema": {
18628
+ "type": "object",
18629
+ "description": "Response containing a list of database snapshots",
18630
+ "properties": {
18631
+ "snapshots": {
18632
+ "type": "array",
18633
+ "items": {
18634
+ "type": "object",
18635
+ "description": "A point-in-time snapshot of a database branch",
18636
+ "properties": {
18637
+ "id": {
18638
+ "type": "string",
18639
+ "description": "The unique identifier of the snapshot"
18640
+ },
18641
+ "source_branch_id": {
18642
+ "type": "string",
18643
+ "description": "The ID of the branch that was snapshotted"
18644
+ },
18645
+ "manual": {
18646
+ "type": "boolean",
18647
+ "description": "Whether this snapshot was manually created"
18648
+ },
18649
+ "created_at": {
18650
+ "type": "string",
18651
+ "format": "dateTime",
18652
+ "description": "When the snapshot was created"
18653
+ },
18654
+ "expires_at": {
18655
+ "type": "string",
18656
+ "format": "dateTime",
18657
+ "description": "When the snapshot expires"
18658
+ },
18659
+ "timestamp": {
18660
+ "type": "string",
18661
+ "format": "dateTime",
18662
+ "description": "The point-in-time timestamp of the snapshot"
18663
+ },
18664
+ "metadata": {
18665
+ "type": "object",
18666
+ "description": "Metadata associated with a snapshot",
18667
+ "properties": {
18668
+ "deploy": {
18669
+ "type": "object",
18670
+ "description": "Deploy information associated with the snapshot",
18671
+ "additionalProperties": true
18672
+ },
18673
+ "source": {
18674
+ "type": "string",
18675
+ "description": "The source that created the snapshot"
18676
+ }
18677
+ }
18678
+ }
18679
+ }
18680
+ },
18681
+ "description": "List of database snapshots"
18682
+ }
18683
+ }
18684
+ }
18685
+ },
18686
+ "default": {
18687
+ "description": "error",
18688
+ "schema": {
18689
+ "type": "object",
18690
+ "required": [
18691
+ "message"
18692
+ ],
18693
+ "properties": {
18694
+ "code": {
18695
+ "type": "integer",
18696
+ "format": "int64"
18697
+ },
18698
+ "message": {
18699
+ "type": "string",
18700
+ "x-nullable": false
18701
+ }
18702
+ }
18703
+ }
18704
+ }
18705
+ }
18706
+ }
18707
+ },
18708
+ "/sites/{site_id}/database/snapshot/{snapshot_id}": {
18709
+ "parameters": [
18710
+ {
18711
+ "name": "site_id",
18712
+ "type": "string",
18713
+ "in": "path",
18714
+ "required": true
18715
+ },
18716
+ {
18717
+ "name": "snapshot_id",
18718
+ "type": "string",
18719
+ "in": "path",
18720
+ "required": true,
18721
+ "description": "The snapshot ID"
18722
+ }
18723
+ ],
18724
+ "delete": {
18725
+ "operationId": "deleteSiteDatabaseSnapshot",
18726
+ "tags": [
18727
+ "database"
18728
+ ],
18729
+ "description": "Deletes a database snapshot.",
18730
+ "responses": {
18731
+ "204": {
18732
+ "description": "Deleted"
18733
+ },
18734
+ "default": {
18735
+ "description": "error",
18736
+ "schema": {
18737
+ "type": "object",
17821
18738
  "required": [
17822
18739
  "message"
17823
18740
  ],
@@ -17853,7 +18770,6 @@
17853
18770
  }
17854
18771
  ],
17855
18772
  "post": {
17856
- "x-internal": true,
17857
18773
  "operationId": "restoreSiteDatabaseSnapshot",
17858
18774
  "tags": [
17859
18775
  "database"
@@ -17870,9 +18786,9 @@
17870
18786
  "type": "object",
17871
18787
  "description": "Request body for restoring a database snapshot",
17872
18788
  "properties": {
17873
- "branch_name": {
18789
+ "branch_id": {
17874
18790
  "type": "string",
17875
- "description": "The name of the branch to restore the snapshot to. Defaults to \"production\" if not specified."
18791
+ "description": "The ID of the branch to restore the snapshot to. Defaults to \"production\" if not specified."
17876
18792
  }
17877
18793
  }
17878
18794
  }
@@ -17900,56 +18816,286 @@
17900
18816
  }
17901
18817
  }
17902
18818
  }
17903
- }
17904
- }
17905
- }
17906
- }
17907
- },
17908
- "definitions": {
17909
- "createDatabaseRequest": {
17910
- "type": "object",
17911
- "description": "Request body for creating a database",
17912
- "properties": {
17913
- "region": {
17914
- "type": "string",
17915
- "description": "The region where the database should be created. Defaults to the site's functions region if not specified."
18819
+ }
18820
+ }
18821
+ }
18822
+ }
18823
+ },
18824
+ "definitions": {
18825
+ "createDatabaseRequest": {
18826
+ "type": "object",
18827
+ "description": "Request body for creating a database",
18828
+ "properties": {
18829
+ "region": {
18830
+ "type": "string",
18831
+ "description": "The region where the database should be created. Defaults to the site's functions region if not specified."
18832
+ }
18833
+ }
18834
+ },
18835
+ "databaseResponse": {
18836
+ "type": "object",
18837
+ "description": "Response containing the database connection string",
18838
+ "properties": {
18839
+ "connection_string": {
18840
+ "type": "string",
18841
+ "description": "The connection string for the database"
18842
+ }
18843
+ }
18844
+ },
18845
+ "createDatabaseBranchRequest": {
18846
+ "type": "object",
18847
+ "description": "Request body for creating a database branch",
18848
+ "required": [
18849
+ "branch_id"
18850
+ ],
18851
+ "properties": {
18852
+ "parent_branch_id": {
18853
+ "type": "string",
18854
+ "description": "The ID of the parent branch to create the new branch from. Defaults to the production branch if not specified."
18855
+ },
18856
+ "branch_id": {
18857
+ "type": "string",
18858
+ "description": "The branch identifier"
18859
+ },
18860
+ "metadata": {
18861
+ "type": "object",
18862
+ "description": "Arbitrary metadata to associate with the branch",
18863
+ "additionalProperties": true
18864
+ }
18865
+ }
18866
+ },
18867
+ "databaseBranchResponse": {
18868
+ "type": "object",
18869
+ "description": "Response containing the database branch connection string",
18870
+ "properties": {
18871
+ "connection_string": {
18872
+ "type": "string",
18873
+ "description": "The connection string for the database branch"
18874
+ },
18875
+ "metadata": {
18876
+ "type": "object",
18877
+ "description": "Metadata associated with the branch",
18878
+ "additionalProperties": true
18879
+ }
18880
+ }
18881
+ },
18882
+ "databaseBranchesResponse": {
18883
+ "type": "object",
18884
+ "description": "Response containing a list of database branches",
18885
+ "properties": {
18886
+ "branches": {
18887
+ "type": "array",
18888
+ "items": {
18889
+ "type": "object",
18890
+ "description": "Detailed information about a database branch",
18891
+ "properties": {
18892
+ "branch_id": {
18893
+ "type": "string",
18894
+ "description": "The branch identifier"
18895
+ },
18896
+ "name": {
18897
+ "type": "string",
18898
+ "description": "The branch name"
18899
+ },
18900
+ "connection_string": {
18901
+ "type": "string",
18902
+ "description": "The connection string for the branch"
18903
+ },
18904
+ "state": {
18905
+ "type": "string",
18906
+ "description": "The current state of the branch",
18907
+ "enum": [
18908
+ "init",
18909
+ "creating",
18910
+ "resetting",
18911
+ "ready",
18912
+ "archived"
18913
+ ]
18914
+ },
18915
+ "logical_size_bytes": {
18916
+ "type": "integer",
18917
+ "format": "int64",
18918
+ "description": "The logical size of the branch in bytes"
18919
+ },
18920
+ "created_at": {
18921
+ "type": "string",
18922
+ "format": "dateTime",
18923
+ "description": "When the branch was created"
18924
+ },
18925
+ "updated_at": {
18926
+ "type": "string",
18927
+ "format": "dateTime",
18928
+ "description": "When the branch was last updated"
18929
+ },
18930
+ "last_active_at": {
18931
+ "type": "string",
18932
+ "format": "dateTime",
18933
+ "description": "When the branch was last active"
18934
+ },
18935
+ "compute": {
18936
+ "type": "object",
18937
+ "description": "Compute endpoint status for a branch",
18938
+ "properties": {
18939
+ "current_state": {
18940
+ "type": "string",
18941
+ "description": "The current state of the compute endpoint",
18942
+ "enum": [
18943
+ "active",
18944
+ "idle"
18945
+ ]
18946
+ },
18947
+ "autoscaling_limit_min_cu": {
18948
+ "type": "number",
18949
+ "format": "double",
18950
+ "description": "Minimum compute units for autoscaling"
18951
+ },
18952
+ "autoscaling_limit_max_cu": {
18953
+ "type": "number",
18954
+ "format": "double",
18955
+ "description": "Maximum compute units for autoscaling"
18956
+ },
18957
+ "suspend_timeout_seconds": {
18958
+ "type": "integer",
18959
+ "format": "int64",
18960
+ "description": "Seconds of inactivity before the compute endpoint is suspended"
18961
+ },
18962
+ "last_active": {
18963
+ "type": "string",
18964
+ "format": "dateTime",
18965
+ "description": "When the compute endpoint was last active"
18966
+ }
18967
+ }
18968
+ },
18969
+ "metadata": {
18970
+ "type": "object",
18971
+ "description": "Metadata associated with the branch",
18972
+ "additionalProperties": true
18973
+ }
18974
+ }
18975
+ },
18976
+ "description": "List of database branches"
17916
18977
  }
17917
18978
  }
17918
18979
  },
17919
- "databaseResponse": {
18980
+ "databaseBranchDetail": {
17920
18981
  "type": "object",
17921
- "description": "Response containing the database connection string",
18982
+ "description": "Detailed information about a database branch",
17922
18983
  "properties": {
18984
+ "branch_id": {
18985
+ "type": "string",
18986
+ "description": "The branch identifier"
18987
+ },
18988
+ "name": {
18989
+ "type": "string",
18990
+ "description": "The branch name"
18991
+ },
17923
18992
  "connection_string": {
17924
18993
  "type": "string",
17925
- "description": "The connection string for the database"
17926
- }
17927
- }
17928
- },
17929
- "createDatabaseBranchRequest": {
17930
- "type": "object",
17931
- "description": "Request body for creating a database branch",
17932
- "required": [
17933
- "deploy_id"
17934
- ],
17935
- "properties": {
17936
- "parent_branch_id": {
18994
+ "description": "The connection string for the branch"
18995
+ },
18996
+ "state": {
17937
18997
  "type": "string",
17938
- "description": "The ID of the parent branch to create the new branch from. Defaults to the production branch if not specified."
18998
+ "description": "The current state of the branch",
18999
+ "enum": [
19000
+ "init",
19001
+ "creating",
19002
+ "resetting",
19003
+ "ready",
19004
+ "archived"
19005
+ ]
17939
19006
  },
17940
- "deploy_id": {
19007
+ "logical_size_bytes": {
19008
+ "type": "integer",
19009
+ "format": "int64",
19010
+ "description": "The logical size of the branch in bytes"
19011
+ },
19012
+ "created_at": {
19013
+ "type": "string",
19014
+ "format": "dateTime",
19015
+ "description": "When the branch was created"
19016
+ },
19017
+ "updated_at": {
19018
+ "type": "string",
19019
+ "format": "dateTime",
19020
+ "description": "When the branch was last updated"
19021
+ },
19022
+ "last_active_at": {
17941
19023
  "type": "string",
17942
- "description": "The deploy ID to associate with this branch"
19024
+ "format": "dateTime",
19025
+ "description": "When the branch was last active"
19026
+ },
19027
+ "compute": {
19028
+ "type": "object",
19029
+ "description": "Compute endpoint status for a branch",
19030
+ "properties": {
19031
+ "current_state": {
19032
+ "type": "string",
19033
+ "description": "The current state of the compute endpoint",
19034
+ "enum": [
19035
+ "active",
19036
+ "idle"
19037
+ ]
19038
+ },
19039
+ "autoscaling_limit_min_cu": {
19040
+ "type": "number",
19041
+ "format": "double",
19042
+ "description": "Minimum compute units for autoscaling"
19043
+ },
19044
+ "autoscaling_limit_max_cu": {
19045
+ "type": "number",
19046
+ "format": "double",
19047
+ "description": "Maximum compute units for autoscaling"
19048
+ },
19049
+ "suspend_timeout_seconds": {
19050
+ "type": "integer",
19051
+ "format": "int64",
19052
+ "description": "Seconds of inactivity before the compute endpoint is suspended"
19053
+ },
19054
+ "last_active": {
19055
+ "type": "string",
19056
+ "format": "dateTime",
19057
+ "description": "When the compute endpoint was last active"
19058
+ }
19059
+ }
19060
+ },
19061
+ "metadata": {
19062
+ "type": "object",
19063
+ "description": "Metadata associated with the branch",
19064
+ "additionalProperties": true
17943
19065
  }
17944
19066
  }
17945
19067
  },
17946
- "databaseBranchResponse": {
19068
+ "databaseBranchCompute": {
17947
19069
  "type": "object",
17948
- "description": "Response containing the database branch connection string",
19070
+ "description": "Compute endpoint status for a branch",
17949
19071
  "properties": {
17950
- "connection_string": {
19072
+ "current_state": {
17951
19073
  "type": "string",
17952
- "description": "The connection string for the database branch"
19074
+ "description": "The current state of the compute endpoint",
19075
+ "enum": [
19076
+ "active",
19077
+ "idle"
19078
+ ]
19079
+ },
19080
+ "autoscaling_limit_min_cu": {
19081
+ "type": "number",
19082
+ "format": "double",
19083
+ "description": "Minimum compute units for autoscaling"
19084
+ },
19085
+ "autoscaling_limit_max_cu": {
19086
+ "type": "number",
19087
+ "format": "double",
19088
+ "description": "Maximum compute units for autoscaling"
19089
+ },
19090
+ "suspend_timeout_seconds": {
19091
+ "type": "integer",
19092
+ "format": "int64",
19093
+ "description": "Seconds of inactivity before the compute endpoint is suspended"
19094
+ },
19095
+ "last_active": {
19096
+ "type": "string",
19097
+ "format": "dateTime",
19098
+ "description": "When the compute endpoint was last active"
17953
19099
  }
17954
19100
  }
17955
19101
  },
@@ -17957,13 +19103,28 @@
17957
19103
  "type": "object",
17958
19104
  "description": "Request body for creating a database snapshot",
17959
19105
  "properties": {
17960
- "branch_name": {
19106
+ "branch_id": {
17961
19107
  "type": "string",
17962
- "description": "The name of the branch to snapshot. Defaults to \"production\" if not specified."
19108
+ "description": "The ID of the branch to snapshot. Defaults to \"production\" if not specified."
17963
19109
  },
17964
19110
  "name": {
17965
19111
  "type": "string",
17966
- "description": "An optional name for the snapshot"
19112
+ "description": "A name for the snapshot"
19113
+ },
19114
+ "metadata": {
19115
+ "type": "object",
19116
+ "description": "Metadata associated with a snapshot",
19117
+ "properties": {
19118
+ "deploy": {
19119
+ "type": "object",
19120
+ "description": "Deploy information associated with the snapshot",
19121
+ "additionalProperties": true
19122
+ },
19123
+ "source": {
19124
+ "type": "string",
19125
+ "description": "The source that created the snapshot"
19126
+ }
19127
+ }
17967
19128
  }
17968
19129
  }
17969
19130
  },
@@ -17975,14 +19136,58 @@
17975
19136
  "type": "string",
17976
19137
  "description": "The unique identifier of the snapshot"
17977
19138
  },
19139
+ "source_branch_id": {
19140
+ "type": "string",
19141
+ "description": "The ID of the branch that was snapshotted"
19142
+ },
19143
+ "manual": {
19144
+ "type": "boolean",
19145
+ "description": "Whether this snapshot was manually created"
19146
+ },
19147
+ "created_at": {
19148
+ "type": "string",
19149
+ "format": "dateTime",
19150
+ "description": "When the snapshot was created"
19151
+ },
19152
+ "expires_at": {
19153
+ "type": "string",
19154
+ "format": "dateTime",
19155
+ "description": "When the snapshot expires"
19156
+ },
17978
19157
  "timestamp": {
17979
19158
  "type": "string",
17980
19159
  "format": "dateTime",
17981
- "description": "The timestamp when the snapshot was created"
19160
+ "description": "The point-in-time timestamp of the snapshot"
17982
19161
  },
17983
- "source_branch_id": {
19162
+ "metadata": {
19163
+ "type": "object",
19164
+ "description": "Metadata associated with a snapshot",
19165
+ "properties": {
19166
+ "deploy": {
19167
+ "type": "object",
19168
+ "description": "Deploy information associated with the snapshot",
19169
+ "additionalProperties": true
19170
+ },
19171
+ "source": {
19172
+ "type": "string",
19173
+ "description": "The source that created the snapshot"
19174
+ }
19175
+ }
19176
+ }
19177
+ }
19178
+ },
19179
+ "databaseSnapshotMetadata": {
19180
+ "type": "object",
19181
+ "description": "Metadata associated with a snapshot",
19182
+ "properties": {
19183
+ "deploy": {
19184
+ "type": "object",
19185
+ "description": "Deploy information associated with the snapshot",
19186
+ "additionalProperties": true
19187
+ },
19188
+ "source": {
17984
19189
  "type": "string",
17985
- "description": "The ID of the branch that was snapshotted"
19190
+ "description": "The source that created the snapshot"
17986
19191
  }
17987
19192
  }
17988
19193
  },
@@ -18000,14 +19205,43 @@
18000
19205
  "type": "string",
18001
19206
  "description": "The unique identifier of the snapshot"
18002
19207
  },
18003
- "timestamp": {
19208
+ "source_branch_id": {
19209
+ "type": "string",
19210
+ "description": "The ID of the branch that was snapshotted"
19211
+ },
19212
+ "manual": {
19213
+ "type": "boolean",
19214
+ "description": "Whether this snapshot was manually created"
19215
+ },
19216
+ "created_at": {
18004
19217
  "type": "string",
18005
19218
  "format": "dateTime",
18006
- "description": "The timestamp when the snapshot was created"
19219
+ "description": "When the snapshot was created"
18007
19220
  },
18008
- "source_branch_id": {
19221
+ "expires_at": {
18009
19222
  "type": "string",
18010
- "description": "The ID of the branch that was snapshotted"
19223
+ "format": "dateTime",
19224
+ "description": "When the snapshot expires"
19225
+ },
19226
+ "timestamp": {
19227
+ "type": "string",
19228
+ "format": "dateTime",
19229
+ "description": "The point-in-time timestamp of the snapshot"
19230
+ },
19231
+ "metadata": {
19232
+ "type": "object",
19233
+ "description": "Metadata associated with a snapshot",
19234
+ "properties": {
19235
+ "deploy": {
19236
+ "type": "object",
19237
+ "description": "Deploy information associated with the snapshot",
19238
+ "additionalProperties": true
19239
+ },
19240
+ "source": {
19241
+ "type": "string",
19242
+ "description": "The source that created the snapshot"
19243
+ }
19244
+ }
18011
19245
  }
18012
19246
  }
18013
19247
  },
@@ -18019,9 +19253,177 @@
18019
19253
  "type": "object",
18020
19254
  "description": "Request body for restoring a database snapshot",
18021
19255
  "properties": {
18022
- "branch_name": {
19256
+ "branch_id": {
19257
+ "type": "string",
19258
+ "description": "The ID of the branch to restore the snapshot to. Defaults to \"production\" if not specified."
19259
+ }
19260
+ }
19261
+ },
19262
+ "databaseComputeSettingsRequest": {
19263
+ "type": "object",
19264
+ "description": "Request body for setting compute settings. All fields are optional; only provided fields are updated.",
19265
+ "properties": {
19266
+ "min_cu": {
19267
+ "type": "number",
19268
+ "format": "double",
19269
+ "minimum": 0.25,
19270
+ "maximum": 16,
19271
+ "x-nullable": true,
19272
+ "description": "Minimum compute units (0.25 to 16.0). Must be less than or equal to max_cu."
19273
+ },
19274
+ "max_cu": {
19275
+ "type": "number",
19276
+ "format": "double",
19277
+ "minimum": 0.25,
19278
+ "maximum": 16,
19279
+ "x-nullable": true,
19280
+ "description": "Maximum compute units (0.25 to 16.0). Must be greater than or equal to min_cu. max_cu - min_cu must not exceed 8.0."
19281
+ },
19282
+ "sleep_timeout_seconds": {
19283
+ "type": "integer",
19284
+ "format": "int64",
19285
+ "minimum": -1,
19286
+ "x-nullable": true,
19287
+ "description": "Seconds of inactivity before the compute endpoint is suspended. Use -1 for always on, or a non-negative value."
19288
+ }
19289
+ }
19290
+ },
19291
+ "databaseComputeSettings": {
19292
+ "type": "object",
19293
+ "description": "Compute settings for a database or branch",
19294
+ "properties": {
19295
+ "min_cu": {
19296
+ "type": "number",
19297
+ "format": "double",
19298
+ "description": "Minimum compute units"
19299
+ },
19300
+ "max_cu": {
19301
+ "type": "number",
19302
+ "format": "double",
19303
+ "description": "Maximum compute units"
19304
+ },
19305
+ "sleep_timeout_seconds": {
19306
+ "type": "integer",
19307
+ "format": "int64",
19308
+ "description": "Seconds of inactivity before suspension"
19309
+ }
19310
+ }
19311
+ },
19312
+ "runDatabaseMigrationsRequest": {
19313
+ "type": "object",
19314
+ "description": "Request body for running database migrations",
19315
+ "properties": {
19316
+ "dry_run": {
19317
+ "type": "boolean",
19318
+ "description": "If true, validates migrations without applying them."
19319
+ }
19320
+ }
19321
+ },
19322
+ "resetDatabaseBranchRequest": {
19323
+ "type": "object",
19324
+ "description": "Request body for resetting a database branch",
19325
+ "properties": {
19326
+ "source_branch_id": {
19327
+ "type": "string",
19328
+ "description": "The ID of the branch to re-fork the target branch from. Defaults to \"production\" if not specified."
19329
+ }
19330
+ }
19331
+ },
19332
+ "resetDatabaseBranchResponse": {
19333
+ "type": "object",
19334
+ "description": "Response for a database branch reset",
19335
+ "properties": {
19336
+ "reset": {
19337
+ "type": "boolean",
19338
+ "description": "Whether the branch was actually re-forked. False when the target was already in sync with the source and `force=true` was not set."
19339
+ },
19340
+ "connection_string": {
19341
+ "type": "string",
19342
+ "description": "The connection string for the reset (or unchanged) branch"
19343
+ },
19344
+ "metadata": {
19345
+ "type": "object",
19346
+ "description": "Metadata associated with the branch",
19347
+ "additionalProperties": true
19348
+ }
19349
+ }
19350
+ },
19351
+ "listDatabaseMigrationsResponse": {
19352
+ "type": "object",
19353
+ "description": "Response containing the list of migrations for a branch",
19354
+ "properties": {
19355
+ "migrations": {
19356
+ "type": "array",
19357
+ "items": {
19358
+ "type": "object",
19359
+ "description": "A migration available to a database branch",
19360
+ "properties": {
19361
+ "version": {
19362
+ "type": "integer",
19363
+ "format": "int64",
19364
+ "description": "The migration version number"
19365
+ },
19366
+ "name": {
19367
+ "type": "string",
19368
+ "description": "The migration name"
19369
+ },
19370
+ "path": {
19371
+ "type": "string",
19372
+ "description": "The path to the migration file in the deploy bundle"
19373
+ },
19374
+ "applied": {
19375
+ "type": "boolean",
19376
+ "description": "Whether this migration has been applied to the branch"
19377
+ }
19378
+ }
19379
+ },
19380
+ "description": "List of migrations"
19381
+ }
19382
+ }
19383
+ },
19384
+ "databaseMigration": {
19385
+ "type": "object",
19386
+ "description": "A migration available to a database branch",
19387
+ "properties": {
19388
+ "version": {
19389
+ "type": "integer",
19390
+ "format": "int64",
19391
+ "description": "The migration version number"
19392
+ },
19393
+ "name": {
19394
+ "type": "string",
19395
+ "description": "The migration name"
19396
+ },
19397
+ "path": {
19398
+ "type": "string",
19399
+ "description": "The path to the migration file in the deploy bundle"
19400
+ },
19401
+ "applied": {
19402
+ "type": "boolean",
19403
+ "description": "Whether this migration has been applied to the branch"
19404
+ }
19405
+ }
19406
+ },
19407
+ "databaseMigrationDetail": {
19408
+ "type": "object",
19409
+ "description": "A migration with its file contents",
19410
+ "properties": {
19411
+ "version": {
19412
+ "type": "integer",
19413
+ "format": "int64",
19414
+ "description": "The migration version number"
19415
+ },
19416
+ "name": {
19417
+ "type": "string",
19418
+ "description": "The migration name"
19419
+ },
19420
+ "path": {
18023
19421
  "type": "string",
18024
- "description": "The name of the branch to restore the snapshot to. Defaults to \"production\" if not specified."
19422
+ "description": "The path to the migration file in the deploy bundle"
19423
+ },
19424
+ "content": {
19425
+ "type": "string",
19426
+ "description": "The raw contents of the migration file"
18025
19427
  }
18026
19428
  }
18027
19429
  },
@@ -19679,6 +21081,12 @@
19679
21081
  }
19680
21082
  }
19681
21083
  }
21084
+ },
21085
+ "event_subscriptions": {
21086
+ "type": "array",
21087
+ "items": {
21088
+ "type": "string"
21089
+ }
19682
21090
  }
19683
21091
  }
19684
21092
  }
@@ -21309,6 +22717,12 @@
21309
22717
  }
21310
22718
  }
21311
22719
  }
22720
+ },
22721
+ "event_subscriptions": {
22722
+ "type": "array",
22723
+ "items": {
22724
+ "type": "string"
22725
+ }
21312
22726
  }
21313
22727
  }
21314
22728
  },