Get database connection
Read a database’s connection details. The password is masked unless you pass reveal=true, which is audited and needs a key that can write.
Request & response examples
curl --fail-with-body --request GET \ 'https://app.helicarrier.xyz/api/services/YOUR_ID/connection' \ -H "Authorization: Bearer $HELI_API_KEY"const response = await fetch( "https://app.helicarrier.xyz/api/services/YOUR_ID/connection", { method: "GET", headers: { Authorization: `Bearer ${process.env.HELI_API_KEY}` } });const data = await response.json();if (!response.ok) { throw new Error(`HTTP ${response.status}: ${data.error}`);}// Inspect data; avoid logging secret responses.import osimport requests
response = requests.request( "GET", "https://app.helicarrier.xyz/api/services/YOUR_ID/connection", headers={ "Authorization": f"Bearer {os.environ['HELI_API_KEY']}" }, timeout=30,)response.raise_for_status()data = response.json()# Inspect data; avoid logging secret responses.{ "engine": "postgres", "internal": "postgres://app:<hidden:call-with-reveal=true>@YOUR_PRIVATE_DATABASE_HOST:5432/app", "host": "YOUR_PRIVATE_DATABASE_HOST", "port": 5432, "username": "app", "password": "", "passwordMasked": true, "reveal": "The password is not included. Call GET /api/services/{id}/connection?reveal=true (MCP: get_db_connection with reveal=true) to read it; each reveal is recorded in the audit trail and needs a key that can write.", "database": "app", "externalAccess": false, "tls": false, "allowIps": []}Illustrative values · selected fields
Path parameters
idstringrequiredDatabase service id.
Query parameters
revealbooleanoptionaltrue returns the real password and full URLs (audited; refused for read-only keys). Omit for the masked view.
Response 200
The password is masked by default: password is empty, passwordMasked is true, and the URLs carry <hidden:call-with-reveal=true> in its place, which is deliberately not a parseable URL. Pass reveal=true to get the real value; a reveal is recorded in the audit trail and refused (403) for read-only keys. A revealed response contains database credentials: do not log it or commit it to source control. Services linked to the database already receive its credentials as references, so reveal only to hand them to something outside the platform. Database connection access is not granted by a service-scoped key.
Examples show selected response fields with illustrative values. Your response can contain additional fields.
enginestringDatabase engine key.
internalstringhoststringPrivate database hostname.
portintegerPort number for the resource.
usernamestringDatabase login name.
passwordstringDatabase password. Treat this response as a secret.
passwordMaskedbooleanrevealstringdatabasestringDatabase name.
externalAccessbooleanWhether external database access is enabled.
tlsbooleanWhether external database TLS is enabled.
allowIpsarrayAllowed external source CIDRs. An empty list permits any source.
Errors
400Invalid parameters. Check the required fields, types, and resource configuration.
401The API key is missing, invalid, or revoked.
403The caller or key scope does not permit this operation.
500The operation could not be completed. Check resource state before retrying a write.
get_db_connection
Required MCP arguments: id. Send path, query, and body fields together as tool arguments.