Databases API reference
Provision and operate project-scoped managed databases.
Published contracts: @socra/db-api@0.0.2.
Base URL
https://db.socra.cloudDatabases
An isolated, project-scoped managed PostgreSQL database.
Create database
POST
/v1/projects/{project_id}/databasesRequired scopes: db.socra.cloud/databases.manage
Path parameters
project_idcustomrequiredRequest body
namestringrequiredmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9-]*$storage_size_gibintegeroptionaldefault: 10 · min: 1 · max: 1024Response
12 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredstatus"provisioning" | "ready" | "failed"requiredstorage_size_gibintegerrequiredgreater than: 0 · max: 9007199254740991hoststring | nullrequiredportintegerrequiredgreater than: 0 · max: 9007199254740991databasestringrequiredusernamestringrequirederrorstring | nullrequiredcreated_atcustomrequiredupdated_atcustomrequiredList databases
GET
/v1/projects/{project_id}/databasesRequired scopes: db.socra.cloud/databases.read
Path parameters
project_idcustomrequiredQuery parameters
limitintegeroptionalmin: 1 · max: 100afterstringoptionalResponse
2 fields
dataobject[]required
dataobject[]requiredidcustomrequiredproject_idcustomrequirednamestringrequiredstatus"provisioning" | "ready" | "failed"requiredstorage_size_gibintegerrequiredgreater than: 0 · max: 9007199254740991hoststring | nullrequiredportintegerrequiredgreater than: 0 · max: 9007199254740991databasestringrequiredusernamestringrequirederrorstring | nullrequiredcreated_atcustomrequiredupdated_atcustomrequiredhas_morebooleanrequiredGet database
GET
/v1/projects/{project_id}/databases/{database_id}Required scopes: db.socra.cloud/databases.read
Path parameters
project_idcustomrequireddatabase_idcustomrequiredQuery parameters
No query parameters
Response
12 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredstatus"provisioning" | "ready" | "failed"requiredstorage_size_gibintegerrequiredgreater than: 0 · max: 9007199254740991hoststring | nullrequiredportintegerrequiredgreater than: 0 · max: 9007199254740991databasestringrequiredusernamestringrequirederrorstring | nullrequiredcreated_atcustomrequiredupdated_atcustomrequiredUpdate database
PATCH
/v1/projects/{project_id}/databases/{database_id}Required scopes: db.socra.cloud/databases.manage
Path parameters
project_idcustomrequireddatabase_idcustomrequiredRequest body
namestringrequiredmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9-]*$Response
12 fields
idcustomrequiredproject_idcustomrequirednamestringrequiredstatus"provisioning" | "ready" | "failed"requiredstorage_size_gibintegerrequiredgreater than: 0 · max: 9007199254740991hoststring | nullrequiredportintegerrequiredgreater than: 0 · max: 9007199254740991databasestringrequiredusernamestringrequirederrorstring | nullrequiredcreated_atcustomrequiredupdated_atcustomrequiredDelete database
DELETE
/v1/projects/{project_id}/databases/{database_id}Required scopes: db.socra.cloud/databases.manage
Path parameters
project_idcustomrequireddatabase_idcustomrequiredQuery parameters
No query parameters
Response
No response body
Database connections
A write-only database connection stored as an immutable Socra Secret version.
Create database connection
Store DATABASE_URL in Socra Secret and return only its metadata reference.
POST
/v1/projects/{project_id}/databases/{database_id}/connectionRequired scopes: db.socra.cloud/databases.manage
Path parameters
project_idcustomrequireddatabase_idcustomrequiredRequest body
secret_namestringoptionalmin length: 1 · max length: 63 · pattern: ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$Response
4 fields
database_idcustomrequiredsecret_idcustomrequiredsecret_version_idcustomrequiredenvironment_variable"DATABASE_URL"required