@@ -17,9 +17,8 @@ Authorization: Bearer <APIKEY>
1717```
1818
1919- Base URL: ` https://cloudsync.sqlite.ai `
20- - Use a management API key with the ` workspace-admin ` role.
20+ - Use a management API key with the ` workspace-admin ` role. In the dashboard, go to your project, then ** CloudSync ** > ** API Keys ** .
2121- The workspace is derived from the key itself.
22- - When a workspace-scoped key creates a managed database, you must omit ` workspaceId ` .
2322- You cannot override the workspace with headers, query parameters, or path segments.
2423
2524Use this API from backend services, CI, or trusted automation. Client apps should use the runtime sync APIs instead.
@@ -48,13 +47,11 @@ Example error response:
4847
4948## Quickstart
5049
51- Start with a workspace-level management API key from the dashboard:
50+ Start with a workspace-level management API key from your project's ** CloudSync ** > ** API Keys ** page in the dashboard:
5251
5352``` bash
5453export BASE_URL=" https://cloudsync.sqlite.ai"
5554export APIKEY=" <workspace-admin-management-api-key>"
56- export PROJECT_ID=" project-a"
57- export DATABASE=" appdb"
5855```
5956
6057### 1. Register a Database
@@ -70,7 +67,6 @@ curl --request POST "$BASE_URL/v1/databases" \
7067 "connectionString": "sqlitecloud://project.sqlite.cloud:8860?apikey=xxxx",
7168 "provider": "sqlitecloud",
7269 "flavor": "sqlitecloud",
73- "projectId": "project-a",
7470 "databaseName": "appdb"
7571 }'
7672```
@@ -96,7 +92,7 @@ export MGMT_DB_ID="db_xxxxxxxxxxxxxxxxxxxxxxxx"
9692Useful when you want to recover the managed database ID later.
9793
9894``` bash
99- curl --request GET " $BASE_URL /v1/databases?projectId= $PROJECT_ID &database= $DATABASE " \
95+ curl --request GET " $BASE_URL /v1/databases" \
10096 --header " Authorization: Bearer $APIKEY "
10197```
10298
@@ -178,7 +174,6 @@ Required fields:
178174- ` connectionString `
179175- ` provider ` — ` postgres ` or ` sqlitecloud `
180176- ` flavor ` — for example ` vanilla ` , ` supabase ` , or ` sqlitecloud `
181- - ` projectId `
182177- ` databaseName `
183178
184179Optional fields:
@@ -202,15 +197,10 @@ Common database failure codes include `database_paused`, `database_auth_failed`,
202197
203198Lists managed databases visible to the key.
204199
205- Supported query parameters:
206-
207- - ` projectId `
208- - ` database ` — requires ` projectId `
209-
210200Example:
211201
212202``` bash
213- curl " $BASE_URL /v1/databases?projectId= $PROJECT_ID &database= $DATABASE " \
203+ curl " $BASE_URL /v1/databases" \
214204 --header " Authorization: Bearer $APIKEY "
215205```
216206
@@ -238,7 +228,6 @@ Supported fields:
238228
239229Notes:
240230
241- - ` projectId ` cannot be changed
242231- when ` connectionString ` is provided, CloudSync verifies the new connection before storing it
243232- omitting ` jwtSecret ` leaves the current secret unchanged
244233- sending ` "jwtSecret": "" ` clears the current secret
0 commit comments