- Overview
- Get started
- Work with data
- Manage access
Connect an application
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
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
Submit a small ScopeQL statement to confirm the endpoint and API key work:
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, use the HTTP API, or continue with the ScopeQL CLI.