Databases

Attach a database to a project: writes its internal connection string as a secret variable (default DATABASE_URL)

post/databases/{databaseId}/attach

Request

  • Base URL: https://hostingsurge.com/api/v1
  • URL: https://hostingsurge.com/api/v1/databases/{databaseId}/attach
  • Auth: one of:
    • HTTP bearer
    • API key in cookie __Host-hs_session

Path parameters

databaseIdstring uuid required
Example:3f2b8a4e-5c1d-4e8f-9a7b-2c6d1e0f4a5b

Request body

projectIdstring uuid required
envKeystring
overwriteboolean

replace an existing variable with the same key (otherwise 409 conflict)

conventionsboolean

also every name the usual frameworks read, like Vercel's integrations (PostgreSQL: POSTGRES_URL, POSTGRES_PRISMA_URL, POSTGRES_URL_NON_POOLING, POSTGRES_HOST/USER/PASSWORD/DATABASE, PG*; MySQL/MariaDB: MYSQL_URL, MYSQL_*; MongoDB: MONGODB_URI, MONGO_URL; Redis: REDIS_URL, KV_URL); overwrite then applies to each of them

Response

Attached

Changes

No recorded changes to this operation across all 1 revision of this API.