curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default"
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database_upload"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database_upload"
},
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database",
"name": "source-encrypted-db"
},
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const database = await turso.databases.create("new-database", {
group: "default",
});
{
"database": {
"DbId": "<unknown>",
"Hostname": "<unknown>",
"Name": "<unknown>"
}
}{
"error": "group not found"
}{
"error": "database with name [databaseName] already exists"
}Create Database
Creates a new database in a group for the organization or user.
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default"
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database_upload"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database_upload"
},
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database",
"name": "source-encrypted-db"
},
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const database = await turso.databases.create("new-database", {
group: "default",
});
{
"database": {
"DbId": "<unknown>",
"Hostname": "<unknown>",
"Name": "<unknown>"
}
}{
"error": "group not found"
}{
"error": "database with name [databaseName] already exists"
}curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default"
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database_upload"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database_upload"
},
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases' \
-H 'Authorization: Bearer TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "new-database",
"group": "default",
"seed": {
"type": "database",
"name": "source-encrypted-db"
},
"remote_encryption": {
"encryption_key": "BASE64_ENCRYPTION_KEY",
"encryption_cipher": "aes256gcm"
}
}'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const database = await turso.databases.create("new-database", {
group: "default",
});
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The slug of the organization or user account.
Body
Database data to create a new database
The name of the new database. Must contain only lowercase letters, numbers, dashes. No longer than 64 characters.
The name of the group where the database should be created. The group must already exist.
Show child attributes
Show child attributes
The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb.
Encryption configuration for the database. Can be used when creating a new encrypted database, creating a encrypted database from upload (seed.type = "database_upload"), or forking from an encrypted database (required when the source database is encrypted).
Show child attributes
Show child attributes
Response
Successful response
The newly created database
Show child attributes
Show child attributes
Was this page helpful?