Turso
App · 20 actions
Manage Turso Cloud databases, groups and their configuration.
Actions
| Action | What it does |
|---|---|
| Create database | Creates a new database in a group for the organization or user. |
| Create group | Creates a new group for the organization or user. |
| Delete database | Delete a database belonging to the organization or user. |
| Delete group | Delete a group belonging to the organization or user. |
| Get current user | Returns information about the currently authenticated user. |
| Get database | Returns a database belonging to the organization or user. |
| Get database configuration | Retrieve an individual database configuration belonging to the organization or user. |
| Get database instance | Return the individual database instance by name. |
| Get database statistics | Fetch the top queries of a database, including the count of rows read and written. |
| Get database usage | Fetch activity usage for a database in a given time period. |
| Get group | Returns a group belonging to the organization or user. |
| Get group configuration | Retrieve an individual group configuration belonging to the organization or user. |
| Get organization | Retrieve details of a specific organization. |
| List database instances | Returns a list of instances of a database. |
| List databases | Returns a list of databases belonging to the organization or user. |
| List groups | Returns a list of groups belonging to the organization or user. |
| List locations | Returns a list of locations where you can create or replicate databases. |
| List organizations | Returns a list of organizations the authenticated user owns or is a member of. |
| Update database configuration | Update a database configuration belonging to the organization or user. |
| Validate platform token | Validates an API token belonging to a user. |
Create database
Creates a new database in a group for the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Name
nametextRequired - The name of the new database. Must contain only lowercase letters, numbers, dashes. No longer than 64 characters.
- Group
grouptextRequired - The name of the group where the database should be created. The group must already exist.
- Seed
seedobject - Seed.
- Size limit
size_limittext - The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb.
- Remote encryption
remote_encryptionobject - 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).
Outputs
dataobject- Result.
Example output
{
"data": {
"database": {
"DbId": "example",
"Hostname": "example",
"Name": "example"
}
}
}Create group
Creates a new group for the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Name
nametextRequired - The name of the new group.
- Location
locationtextRequired - The location key for the new group.
- Extensions
extensionstext - The extensions to enable for new databases created in this group. Users looking to enable vector extensions should instead use the native libSQL vector datatype.
Outputs
dataobject- Result.
Example output
{
"data": {
"group": {
"delete_protection": false,
"locations": [],
"name": "example",
"primary": "example",
"uuid": "example",
"version": "example"
}
}
}Delete database
Delete a database belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
Outputs
dataobject- Result.
Example output
{
"data": {
"database": "example"
}
}Delete group
Delete a group belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Group name
group_nametextRequired - The name of the group.
Outputs
dataobject- Result.
Example output
{
"data": {
"group": {
"delete_protection": false,
"locations": [],
"name": "example",
"primary": "example",
"uuid": "example",
"version": "example"
}
}
}Get current user
Returns information about the currently authenticated user.
Inputs
None.
Outputs
dataobject- Result.
Example output
{
"data": {
"user": {
"avatarUrl": "example",
"email": "example",
"has_pending_invites": false,
"mfa": false,
"name": "example",
"plan": "example",
"username": "example"
}
}
}Get database
Returns a database belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
Outputs
dataobject- Result.
Example output
{
"data": {
"database": {
"DbId": "example",
"Hostname": "example",
"Name": "example",
"block_reads": false,
"block_writes": false,
"delete_protection": false,
"group": "example",
"parent": {
"branched_at": "example",
"id": "example",
"name": "example"
},
"primaryRegion": "example",
"regions": []
}
}
}Get database configuration
Retrieve an individual database configuration belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
Outputs
dataobject- Result.
Example output
{
"data": {
"allow_attach": false,
"allowed_aws_vpc_ids": [],
"allowed_ips": [],
"block_reads": false,
"block_writes": false,
"delete_protection": false,
"size_limit": "example"
}
}Get database instance
Return the individual database instance by name.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
- Instance name
instance_nametextRequired - The name of the instance (location code).
Outputs
dataobject- Result.
Example output
{
"data": {
"instance": {
"hostname": "example",
"name": "example",
"region": "example",
"type": "example",
"uuid": "example"
}
}
}Get database statistics
Fetch the top queries of a database, including the count of rows read and written.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
Outputs
dataobject- Result.
Example output
{
"data": {
"top_queries": []
}
}Get database usage
Fetch activity usage for a database in a given time period.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
- Start time
start_timedate and time - The datetime to retrieve usage from in ISO 8601 format. Defaults to the current calendar month if not provided. Example: 2023-01-01T00:00:00Z
- End time
end_timedate and time - The datetime to retrieve usage to in ISO 8601 format. Defaults to the current calendar month if not provided. Example: 2023-02-01T00:00:00Z
Outputs
dataobject- Result.
Example output
{
"data": {
"database": {
"instances": [],
"total": {
"bytes_synced": 1,
"rows_read": 1,
"rows_written": 1,
"storage_bytes": 1
},
"uuid": "example"
}
}
}Get group
Returns a group belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Group name
group_nametextRequired - The name of the group.
Outputs
dataobject- Result.
Example output
{
"data": {
"group": {
"delete_protection": false,
"locations": [],
"name": "example",
"primary": "example",
"uuid": "example",
"version": "example"
}
}
}Get group configuration
Retrieve an individual group configuration belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Group name
group_nametextRequired - The name of the group.
Outputs
dataobject- Result.
Example output
{
"data": {
"delete_protection": false
}
}Get organization
Retrieve details of a specific organization.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
Outputs
dataobject- Result.
Example output
{
"data": {
"organization": {
"blocked_reads": false,
"blocked_writes": false,
"name": "example",
"overages": false,
"plan_id": "example",
"plan_timeline": "example",
"platform": "example",
"require_mfa": false,
"restore_enabled": false,
"slug": "example",
"type": "example"
}
}
}List database instances
Returns a list of instances of a database. Instances are the individual primary or replica databases in each region defined by the group.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
Outputs
dataobject- Result.
Example output
{
"data": {
"instances": []
}
}List databases
Returns a list of databases belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Group
grouptext - Filter databases by group name.
- Schema
schematext - The schema database name that can be used to get databases that belong to that parent schema.
- Parent
parenttext - Filter database branches by using their parent database ID.
Outputs
dataobject- Result.
Example output
{
"data": {
"databases": []
}
}List groups
Returns a list of groups belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
Outputs
dataobject- Result.
Example output
{
"data": {
"groups": []
}
}List locations
Returns a list of locations where you can create or replicate databases.
Inputs
None.
Outputs
dataobject- Result.
Example output
{
"data": {
"locations": {}
}
}List organizations
Returns a list of organizations the authenticated user owns or is a member of.
Inputs
None.
Outputs
datalist- Result.
Example output
{
"data": []
}Update database configuration
Update a database configuration belonging to the organization or user.
Inputs
- Organization slug
organization_slugtextRequired - The slug of the organization or user account.
- Database name
database_nametextRequired - The name of the database.
- Size limit
size_limittext - The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb.
- Allow attach
allow_attachtrue/false - Allow or disallow attaching databases to the current database.
- Block reads
block_readstrue/false - Block all database reads.
- Block writes
block_writestrue/false - Block all database writes.
- Delete protection
delete_protectiontrue/false - Prevent the database from being deleted.
- Allowed ips
allowed_ipslist - List of allowed IP addresses and CIDR blocks. Only connections from these sources are accepted. Pass an empty array to clear the list. Omit to leave unchanged.
- Allowed aws vpc IDS
allowed_aws_vpc_idslist - List of allowed AWS VPC endpoint IDs (vpce-...). Only connections arriving through these endpoints are accepted. Pass an empty array to clear the list. Omit to leave unchanged.
Outputs
dataobject- Result.
Example output
{
"data": {
"allow_attach": false,
"allowed_aws_vpc_ids": [],
"allowed_ips": [],
"block_reads": false,
"block_writes": false,
"delete_protection": false,
"size_limit": "example"
}
}Validate platform token
Validates an API token belonging to a user.
Inputs
None.
Outputs
dataobject- Result.
Example output
{
"data": {
"exp": 1
}
}