Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
On this page
Connect a database
Returns how to connect to the database: its endpoint and its own engine credentials.
Returns how to connect to the database: its endpoint and its own engine credentials. The credentials are not API keys and are returned only here.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/databases/database:connect - Scope
data:write - Effect
read— nothing is written. - Collection databases
#Request
| Field | Type | What it is |
|---|---|---|
name | string | The name of the database. Required. |
profile | ConnectionProfile | POOLED (default) or DIRECT. One of pooled, direct. |
#Response
| Field | Type | What it is |
|---|---|---|
connection_info | ConnectionInfo | How to connect. |
#ConnectionInfo
| Field | Type | What it is |
|---|---|---|
host | string | The endpoint host, {ref}.sylphx.net. |
port | int32 | The TLS port: 5432 Postgres, 6379 Valkey, 8108 search, 443 objects. |
username | string | The engine user. |
password | string | The engine password. Never returned again. |
database | string | The Postgres database name; empty for other kinds. |
uri | string | A driver URL embedding the credentials. Never returned again. |
direct_uri | string | Postgres only: the direct URL for migrations, pg_dump, LISTEN/NOTIFY, session SET, and logical replication. Never returned again. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.INVALID_STATE— The Resource is in a state that forbids the call.
Every error arrives in the body Errors describes.
#Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/databases/database:connect" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'