Skip to main content
PUT
/
api
/
text2sql
/
databases
/
{database_id}
Update Database
curl --request PUT \
  --url https://api.example.com/api/text2sql/databases/{database_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "<string>",
  "url": "<string>",
  "read_only": true
}
'
{
  "id": 123,
  "name": "<string>",
  "type": "<string>",
  "url": "<string>",
  "read_only": true,
  "status": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "table_count": 123,
  "last_connected_at": "<string>",
  "error_message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

database_id
integer
required

Body

application/json

Request schema for creating a new database configuration

name
string
required

Database display name

Required string length: 1 - 255
type
string
required

Database type (sqlite, postgresql, mysql, sqlserver)

url
string
required

Database connection URL

Minimum string length: 1
read_only
boolean
default:true

Whether database is read-only

Response

Successful Response

Response schema for database configuration

id
integer
required
name
string
required
type
string
required
url
string
required
read_only
boolean
required
status
string
required
created_at
string
required
updated_at
string
required
table_count
integer | null
last_connected_at
string | null
error_message
string | null