curl -L -X POST 'https://api.turso.tech/v3/organizations/{organizationId}/databases/{databaseId}/restore' \
-H 'Authorization: Bearer TOKEN'
curl -L -X POST 'https://api.turso.tech/v3/organizations/{organizationId}/databases/{databaseId}/restore' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{ "name": "my-restored-database" }'
{
"database": {
"Name": "<string>",
"DbId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Hostname": "<string>",
"group": "<string>",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"regions": [
"<string>"
],
"primaryRegion": "<string>",
"delete_protection": true,
"deleted_at": "2023-11-07T05:31:56Z",
"group_deleted_at": "2023-11-07T05:31:56Z"
}
}Databases
Restore Database
Restore a database deleted within the last five days, exactly as it was at the moment it was deleted. Requires a paid plan, an admin or owner of the organization, and recovery enabled for the organization.
POST
/
v3
/
organizations
/
{organizationId}
/
databases
/
{databaseId}
/
restore
curl -L -X POST 'https://api.turso.tech/v3/organizations/{organizationId}/databases/{databaseId}/restore' \
-H 'Authorization: Bearer TOKEN'
curl -L -X POST 'https://api.turso.tech/v3/organizations/{organizationId}/databases/{databaseId}/restore' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{ "name": "my-restored-database" }'
{
"database": {
"Name": "<string>",
"DbId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Hostname": "<string>",
"group": "<string>",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"regions": [
"<string>"
],
"primaryRegion": "<string>",
"delete_protection": true,
"deleted_at": "2023-11-07T05:31:56Z",
"group_deleted_at": "2023-11-07T05:31:56Z"
}
}Unlike the v1 endpoints, this endpoint identifies the organization and database
by UUID — use the
id field from
Retrieve Organization and the DbId
field from List Deleted Databases.curl -L -X POST 'https://api.turso.tech/v3/organizations/{organizationId}/databases/{databaseId}/restore' \
-H 'Authorization: Bearer TOKEN'
curl -L -X POST 'https://api.turso.tech/v3/organizations/{organizationId}/databases/{databaseId}/restore' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{ "name": "my-restored-database" }'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The UUID of the organization. Retrieve it with the Retrieve Organization endpoint (the id field).
The UUID of the database, as returned when listing deleted databases (the DbId field).
Body
application/json
Optional new name for the restored database. If omitted, the original name is reused. The hostname is re-derived from the name.
Response
Successful response
The restored database.
Show child attributes
Show child attributes
Was this page helpful?