PostgreSQL API Authentication
How to authenticate PostgreSQL API requests: one Bearer API key plus a connectionId. MindCloud handles PostgreSQL's custom auth scheme for you.
Every PostgreSQL API request through MindCloud needs two things: a MindCloud API Key and a connectionId for your PostgreSQL account. This page covers both, plus exactly how to send them, so you do not need to visit any other page to get authenticated.
Steps to authenticate
- Create a MindCloud account at app.mindcloud.co if you do not already have one.
- Generate a MindCloud API Key in API Keys. This is the Bearer token you send on every request. Keep it on your server.
- Create a PostgreSQL connection in Connections. PostgreSQL uses its own authentication scheme. You provide whatever it requires when you create the connection — MindCloud handles the provider-specific details for you.
- Copy the connection’s
connectionId— you will send it on every request alongside your MindCloud API Key.
How requests are authenticated
Authentication has two layers. Your MindCloud API Key authenticates the request to MindCloud, sent as a Bearer token in the Authorization header. The connectionId selects the connected PostgreSQL account that should run the action. MindCloud stores and refreshes the PostgreSQL credentials behind that connection, so you never send provider tokens with your requests.
Pass connectionId in the query string for GET and DELETE actions, and in the JSON body for POST, PUT, and PATCH actions.
For example, calling with an PostgreSQL connection looks like this:
The Authorization: Bearer <your MindCloud API Key> header authenticates you to MindCloud; the connectionId tells MindCloud which PostgreSQL account to run the action against. Missing or invalid Authorization returns 401, and a missing or mismatched connectionId returns 400.
Set up your PostgreSQL connection
You need the PostgreSQL host, database name, user name, and password for the account MindCloud should use. If your server requires TLS verification, also get the CA/root certificate and any SSL instructions from your database administrator or hosting provider.
- Collect the PostgreSQL connection details
Get the Host, Database, User, and Password values for the PostgreSQL database you want MindCloud to access. If your administrator uses a non-default server port, get that Port value as well.
- Enter the basic connection fields in MindCloud
In the MindCloud PostgreSQL connection form, enter Host, Port, Database, User, and Password exactly as provided. If your administrator did not give you a custom port, you can leave Port empty and use the server default.
- Configure SSL only if your PostgreSQL server requires it
Turn on SSL when your server requires an encrypted connection. If your administrator provided a trusted CA/root certificate for server verification, paste it into Certificate and keep Reject Unauthorized enabled so the server certificate is validated against that trusted certificate.
- Fill in advanced options only when your environment calls for them
Set Timeout only if you need to limit how long the connection waits before failing. Leave Use ODBC off unless your PostgreSQL environment specifically requires the official psqlODBC driver.
Keep your key safe
Keep your MindCloud API Key on your server; do not ship it in browser code, mobile apps, public repositories, or logs. Anyone with the key can call the Universal API as your MindCloud account, across every connection you have created.