Connect an application
On this page
Connect a client to your workspace with two values from ScopeDB Console:
- the ScopeDB API address;
- an API key.
Use the address as the base URL for ScopeDB data APIs. Send the API key as a bearer token from your server-side code, jobs, SDKs, or CLI.
Before you start
You need:
- access to the intended workspace in ScopeDB Console;
- a terminal or application environment where you can store secrets safely.
1. Copy the ScopeDB API address
For a terminal workflow, the ScopeDB CLI can sign in, show your workspace endpoint, and create an application key. Its login is stored separately from SDK credentials.
In ScopeDB Console for the current workspace, open Connect.
Under ScopeDB API, copy the address shown by the Console. It is an HTTPS base URL:
https://<endpoint>Use the purpose label in Connect to choose the address. Do not construct an address from workspace names or other Console values.
2. Create an API key
From Connect, choose Manage keys, or open API Keys for the workspace. Create a key for your application or development environment.
Copy the secret when it is shown. This is the only time the Console displays the complete secret. If it is lost, create a new key; an existing secret cannot be revealed again.
Store the key in a server-side secret manager or local environment file. Do not put ScopeDB API keys in browser code, mobile apps, or client-visible configuration.
3. Set environment variables
Set the endpoint and API key in your local shell:
export SCOPEDB_ENDPOINT="https://<endpoint>"
export SCOPEDB_API_KEY="<api-key>"Use separate API keys for development, staging, and production so each environment can be rotated independently.
4. Send a test request
If you have the ScopeDB CLI installed, verify the same endpoint and key before connecting your SDK:
scope status
scope doctor
scope query --format json 'SELECT 1 AS ready'Set both connection variables: together they override the CLI login; a partial pair fails. A successful test query confirms access without requiring an application table. Pass the same values explicitly to your SDK client.
Alternatively, submit a small ScopeQL statement directly with the HTTP API:
curl -X POST "$SCOPEDB_ENDPOINT/v1/statements" \
-H "Authorization: Bearer $SCOPEDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"statement": "SELECT 1 AS ok",
"format": "json"
}'A successful statement reaches finished and returns a result containing ok.
If the first response is pending or running, poll its statement_id as
described in the HTTP API guide.
Use the connection
The Connect page also provides copy-ready recipes for supported clients. For the full behavior of each interface, choose an SDK or use the HTTP API. The ScopeDB CLI signs in with a Cloud account for interactive use; its non-interactive mode uses the API address and API key configured here.