{"note":"OpenAPI conversion -- returning structured metadata","name":"turso","description":"Turso Platform API","version":"0.1.0","base_url":"https://api.turso.tech","endpoints":46,"raw":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Turso Platform API\n@base https://api.turso.tech\n@version 0.1.0\n@auth Bearer bearer\n@endpoints 46\n@hint download_for_search\n@toc organizations(41), locations(1), auth(4)\n\n@group organizations\n@endpoint GET /v1/organizations/{organizationSlug}/databases\n@desc List Databases\n@required {organizationSlug: str # The slug of the organization or user account.}\n@optional {group: str # Filter databases by group name., schema: str # The schema database name that can be used to get databases that belong to that parent schema., parent: str # Filter database branches by using their parent database ID.}\n@returns(200) {databases: [map]} # Successful response\n\n@endpoint POST /v1/organizations/{organizationSlug}/databases\n@desc Create Database\n@required {organizationSlug: str # The slug of the organization or user account., name: str # The name of the new database. Must contain only lowercase letters, numbers, dashes. No longer than 64 characters., group: str # The name of the group where the database should be created. **The group must already exist.**}\n@optional {seed: map{type: str, name: str, timestamp: str}, size_limit: str # The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb., remote_encryption: map{encryption_key: str, encryption_cipher: str} # 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).}\n@returns(200) {database: map{DbId: str, Hostname: str, Name: str}} # Successful response\n@errors {400: Bad Request, 409: Conflict}\n\n@endpoint GET /v1/organizations/{organizationSlug}/databases/{databaseName}\n@desc Retrieve Database\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@returns(200) {database: map{Name: str, DbId: str, Hostname: str, block_reads: bool, block_writes: bool, regions: [str], primaryRegion: str, group: str, delete_protection: bool, parent: map?{id: str, name: str, branched_at: str(date-time)}}} # Successful response\n@errors {404: Database not found}\n\n@endpoint DELETE /v1/organizations/{organizationSlug}/databases/{databaseName}\n@desc Delete Database\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@returns(200) {database: str} # Successful response\n@errors {404: Database not found}\n\n@endpoint GET /v1/organizations/{organizationSlug}/databases/{databaseName}/configuration\n@desc Retrieve Database Configuration\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@returns(200) {size_limit: str, allow_attach: bool, block_reads: bool, block_writes: bool, delete_protection: bool} # Successful response\n\n@endpoint PATCH /v1/organizations/{organizationSlug}/databases/{databaseName}/configuration\n@desc Update Database Configuration\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@optional {size_limit: str # The maximum size of the database in bytes. Values with units are also accepted, e.g. 1mb, 256mb, 1gb., allow_attach: bool # Allow or disallow attaching databases to the current database., block_reads: bool # Block all database reads., block_writes: bool # Block all database writes., delete_protection: bool # Prevent the database from being deleted.}\n@returns(200) {size_limit: str, allow_attach: bool, block_reads: bool, block_writes: bool, delete_protection: bool} # Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}/databases/{databaseName}/instances\n@desc List Database Instances\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@returns(200) {instances: [map]} # Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}/databases/{databaseName}/instances/{instanceName}\n@desc Retrieve Database Instance\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database., instanceName: str # The name of the instance (location code).}\n@returns(200) {instance: map{uuid: str, name: str, type: str, region: str, hostname: str}} # Successful response\n\n@endpoint POST /v1/organizations/{organizationSlug}/databases/{databaseName}/auth/tokens\n@desc Generate Database Auth Token\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@optional {expiration: str=never # Expiration time for the token (e.g., 2w1d30m)., authorization: str(full-access/read-only)=full-access # Authorization level for the token (full-access or read-only)., permissions: map{read_attach: map} # The permissions for the token.}\n@returns(200) {jwt: str} # Successful response\n@errors {400: Bad Request, 404: Database not found}\n\n@endpoint GET /v1/organizations/{organizationSlug}/databases/{databaseName}/usage\n@desc Retrieve Database Usage\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@optional {from: str(date-time) # The datetime to retrieve usage **from** in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Defaults to the current calendar month if not provided. Example: `2023-01-01T00:00:00Z`, to: str(date-time) # The datetime to retrieve usage **to** in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Defaults to the current calendar month if not provided. Example: `2023-02-01T00:00:00Z`}\n@returns(200) {database: map{uuid: str, instances: [map], total: map{rows_read: int, rows_written: int, storage_bytes: int, bytes_synced: int}}} # Successful response\n@errors {400: Bad Request, 404: Database not found}\n\n@endpoint GET /v1/organizations/{organizationSlug}/databases/{databaseName}/stats\n@desc Retrieve Database Stats\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@returns(200) {top_queries: [map]?} # Successful response\n@errors {404: Database not found}\n\n@endpoint POST /v1/organizations/{organizationSlug}/databases/{databaseName}/auth/rotate\n@desc Invalidate All Database Auth Tokens\n@required {organizationSlug: str # The slug of the organization or user account., databaseName: str # The name of the database.}\n@returns(200) Successful response (No Content)\n@errors {404: Database not found}\n\n@endpoint GET /v1/organizations/{organizationSlug}/groups\n@desc List Groups\n@required {organizationSlug: str # The slug of the organization or user account.}\n@returns(200) {groups: [any]} # Successful response\n\n@endpoint POST /v1/organizations/{organizationSlug}/groups\n@desc Create Group\n@required {organizationSlug: str # The slug of the organization or user account., name: str # The name of the new group., location: str # The location key for the new group.}\n@optional {extensions: any # 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](/features/ai-and-embeddings).}\n@returns(200) {group: any} # Successful response\n@errors {409: Conflict}\n\n@endpoint GET /v1/organizations/{organizationSlug}/groups/{groupName}\n@desc Retrieve Group\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@returns(200) {group: any} # Successful response\n@errors {404: Group not found}\n\n@endpoint DELETE /v1/organizations/{organizationSlug}/groups/{groupName}\n@desc Delete Group\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@returns(200) {group: any} # Successful response\n@errors {404: Group not found}\n\n@endpoint GET /v1/organizations/{organizationSlug}/groups/{groupName}/configuration\n@desc Retrieve Group Configuration\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@returns(200) {delete_protection: bool} # Successful response\n\n@endpoint PATCH /v1/organizations/{organizationSlug}/groups/{groupName}/configuration\n@desc Update Group Configuration\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@optional {delete_protection: bool # Prevent the group from being deleted.}\n@returns(200) {delete_protection: bool} # Successful response\n\n@endpoint POST /v1/organizations/{organizationSlug}/groups/{groupName}/transfer\n@desc Transfer Group\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@optional {organization: str # The slug of the organization to transfer the group to.}\n@returns(200) Successful response\n@errors {404: Group not found}\n\n@endpoint POST /v1/organizations/{organizationSlug}/groups/{groupName}/unarchive\n@desc Unarchive Group\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@returns(200) {group: any} # Successful response\n@errors {404: Group not found}\n\n@endpoint POST /v1/organizations/{organizationSlug}/groups/{groupName}/locations/{location}\n@desc Add Location to Group\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group., location: str # The location code to add to the group.}\n@returns(200) {group: any} # Successful response\n@errors {400: Bad Request, 404: Group not found}\n\n@endpoint DELETE /v1/organizations/{organizationSlug}/groups/{groupName}/locations/{location}\n@desc Remove Location from Group\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group., location: str # The location code to remove from the group.}\n@returns(200) {group: any} # Successful response\n@errors {400: Bad Request, 404: Group not found}\n\n@endpoint POST /v1/organizations/{organizationSlug}/groups/{groupName}/update\n@desc Update Databases in a Group\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@returns(200) Successful response (No Content)\n@errors {404: Group not found}\n\n@endpoint POST /v1/organizations/{organizationSlug}/groups/{groupName}/auth/tokens\n@desc Create Group Auth Token\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@optional {expiration: str=never # Expiration time for the token (e.g., 2w1d30m)., authorization: str(full-access/read-only)=full-access # Authorization level for the token (full-access or read-only)., permissions: map{read_attach: map} # The permissions for the token.}\n@returns(200) {jwt: str} # Successful response\n@errors {400: Bad Request, 404: Group not found}\n\n@endpoint POST /v1/organizations/{organizationSlug}/groups/{groupName}/auth/rotate\n@desc Invalidate All Group Auth Tokens\n@required {organizationSlug: str # The slug of the organization or user account., groupName: str # The name of the group.}\n@returns(200) Successful response (No Content)\n@errors {404: Group not found}\n\n@endgroup\n\n@group locations\n@endpoint GET /v1/locations\n@desc List Locations\n@returns(200) {locations: map} # Successful response\n\n@endgroup\n\n@group organizations\n@endpoint GET /v1/organizations\n@desc List Organizations\n@returns(200) Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}\n@desc Retrieve Organization\n@required {organizationSlug: str # The slug of the organization or user account.}\n@returns(200) {organization: map{name: str, slug: str, type: str, overages: bool, blocked_reads: bool, blocked_writes: bool, plan_id: str, plan_timeline: str, platform: str}} # Successful response\n@errors {404: Organization not found}\n\n@endpoint PATCH /v1/organizations/{organizationSlug}\n@desc Update Organization\n@required {organizationSlug: str # The slug of the organization or user account.}\n@optional {overages: bool # Enable or disable overages for the organization.}\n@returns(200) {organization: map{name: str, slug: str, type: str, overages: bool, blocked_reads: bool, blocked_writes: bool, plan_id: str, plan_timeline: str, platform: str}} # Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}/plans\n@desc List Plans\n@required {organizationSlug: str # The slug of the organization or user account.}\n@returns(200) {plans: [map]} # Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}/invoices\n@desc List Invoices\n@required {organizationSlug: str # The slug of the organization or user account.}\n@optional {type: str(all/upcoming/issued) # The type of invoice to retrieve.}\n@returns(200) {invoices: [map]} # Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}/subscription\n@desc Current Subscription\n@required {organizationSlug: str # The slug of the organization or user account.}\n@returns(200) {subscription: map{name: str, overages: bool, plan: str, timeline: str}} # Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}/usage\n@desc Organization Usage\n@required {organizationSlug: str # The slug of the organization or user account.}\n@returns(200) {organization: map{uuid: str, usage: map{rows_read: int, rows_written: int, databases: int, locations: int, storage_bytes: int, groups: int, bytes_synced: int}, databases: [map]}} # Successful response\n\n@endpoint GET /v1/organizations/{organizationSlug}/members\n@desc List Members\n@required {organizationSlug: str # The slug of the organization or user account.}\n@returns(200) {members: [map]} # Successful response\n\n@endpoint POST /v1/organizations/{organizationSlug}/members\n@desc Add Member\n@required {organizationSlug: str # The slug of the organization or user account.}\n@optional {username: str # The username of an existing Turso user., role: str(admin/member/viewer)=member # The role given to the user.}\n@returns(200) {member: str, role: str} # Successful response\n@errors {404: Member not found, 409: Conflict}\n\n@endpoint GET /v1/organizations/{organizationSlug}/members/{username}\n@desc Retrieve Member\n@required {organizationSlug: str # The slug of the organization or user account., username: str # The username of a Turso user or organization member.}\n@returns(200) {member: map{username: str, role: str, email: str}} # Successful response\n@errors {404: Member not found}\n\n@endpoint PATCH /v1/organizations/{organizationSlug}/members/{username}\n@desc Update Member Role\n@required {organizationSlug: str # The slug of the organization or user account., username: str # The username of a Turso user or organization member., role: str(admin/member/viewer) # The new role to assign to the member.}\n@returns(200) {member: map{username: str, email: str, role: str}} # Successful response\n@errors {400: Bad Request, 403: Forbidden, 404: Not Found}\n\n@endpoint DELETE /v1/organizations/{organizationSlug}/members/{username}\n@desc Remove Member\n@required {organizationSlug: str # The slug of the organization or user account., username: str # The username of a Turso user or organization member.}\n@returns(200) {member: str} # Successful response\n@errors {404: Member not found}\n\n@endpoint GET /v1/organizations/{organizationSlug}/invites\n@desc List Invites\n@required {organizationSlug: str # The slug of the organization or user account.}\n@returns(200) {invites: [map]} # Successful response\n\n@endpoint POST /v1/organizations/{organizationSlug}/invites\n@desc Invite Organization Member\n@required {organizationSlug: str # The slug of the organization or user account., email: str # The email of the user you want to invite.}\n@optional {role: str(admin/member/viewer)=member # The role given to the user.}\n@returns(200) {invited: map{ID: int, CreatedAt: str, UpdatedAt: str, DeletedAt: str, Role: str, Email: str, OrganizationID: int, Token: str, Organization: map{name: str, slug: str, type: str, overages: bool, blocked_reads: bool, blocked_writes: bool, plan_id: str, plan_timeline: str, platform: str}, Accepted: bool}} # Successful response\n\n@endpoint DELETE /v1/organizations/{organizationSlug}/invites/{email}\n@desc Delete Invite\n@required {organizationSlug: str # The slug of the organization or user account., email: str}\n@returns(200) Successful response (No Content)\n@errors {404: Invite not found}\n\n@endgroup\n\n@group auth\n@endpoint GET /v1/auth/validate\n@desc Validate API Token\n@returns(200) {exp: int} # Successful response\n\n@endpoint GET /v1/auth/api-tokens\n@desc List API Tokens\n@returns(200) {tokens: [map]} # Successful response\n\n@endpoint POST /v1/auth/api-tokens/{tokenName}\n@desc Create API Token\n@required {tokenName: str # The name of the api token.}\n@optional {organization: str # The organization slug to restrict this token to. If omitted, the token grants access to all organizations the user belongs to.}\n@returns(200) {name: str, id: str, token: str} # Successful response\n\n@endpoint DELETE /v1/auth/api-tokens/{tokenName}\n@desc Revoke API Token\n@required {tokenName: str # The name of the api token.}\n@returns(200) {token: str} # Successful response\n\n@endgroup\n\n@group organizations\n@endpoint GET /v1/organizations/{organizationSlug}/audit-logs\n@desc List Audit Logs\n@required {organizationSlug: str # The slug of the organization or user account.}\n@optional {page_size: int # The limit of items to return per page. Defaults to 100., page: int # The page number to return. Defaults to 1.}\n@returns(200) {audit_logs: [map], pagination: map{page: int, page_size: int, total_pages: int, total_rows: int}} # Successful response\n\n@endgroup\n\n@end\n"}