Skip to main content
POST
Connects an application of the stack to a database, a Blob folder or another application of the stack. The platform writes the variables into the application and, for a database, the client certificates into /app/.vertra/certs/<database_id>/. The network mode is public: the application reaches the public address of the database with a client certificate. Needs the stacks:write scope when called with an API key.
string
required
The stack ID.
string
The workspace the stack belongs to, when you act on it as the workspace owner.
string
required
The application of the stack that receives the variables.
string
The database to connect to. Send exactly one of database_id, blob_id and target_app_id.
string
The ID of the Blob member to connect to.
string
Another application of the stack to connect to.
object
Variable names and what each receives. Without it the platform uses the standard names of the engine (DATABASE_URL, MONGODB_URI, REDIS_URL, MYSQL_URL), prefixed with the service name from the second connection of an engine. Allowed values:
  • Database: url, host, port, user, password, database, ssl.ca_path, ssl.cert_path, ssl.key_path, ssl.pem_path (key, certificate and CA in one file, the format MongoDB reads), ssl.p12_path (PKCS#12 with an empty password, the format Prisma 6 and earlier read) and prisma_url (a PostgreSQL URL for Prisma 6 and earlier; never added by default).
  • Another application (or the application itself): url and domain (the host name only, without the scheme). Both follow a change of subdomain or domain.
  • Blob folder: endpoint, bucket, region, prefix, access_key_id, secret_access_key and public_base_url (empty when the folder is private).

Response

201 with the connection (same fields as List Stack Connections) plus restart_required and apps_to_restart. An application reads variables and certificates only when it starts, so restart the applications listed in apps_to_restart.

Errors

Last modified on October 30, 2026