Skip to content
HelicarrierDevelopers

Execute a SQL query

Run a SQL query against a managed database. Queries can modify data; inspect the response for execution errors.

POST/api/services/{id}/db/consoleHTTPS
Request & response examples
Request exampleServer-side
curl --fail-with-body --request POST \
'https://app.helicarrier.xyz/api/services/YOUR_ID/db/console' \
-H "Authorization: Bearer $HELI_API_KEY" \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT 1;"
}'
Response example200
{
"output": "1\n"
}

Illustrative values · selected fields

Authorization

An account key with access to the resource. Project and service keys do not authorize this operation.

Authorization: Bearer <key>Key setup

Path parameters

idstringrequired

Database service id.

Request body

querystringrequired

SQL to execute.

Response 200

Returns console output as text. Inspect error even on HTTP 200: a SQL execution failure is returned in the response body. Query execution can modify data.

Examples show selected response fields with illustrative values. Your response can contain additional fields.

outputstring

Database console output as text.

Errors

400

Invalid parameters. Check the required fields, types, and resource configuration.

401

The API key is missing, invalid, or revoked.

403

The caller or key scope does not permit this operation.

Error handling and safe retries
ALSO AVAILABLE VIA MCP

db_query

Required MCP arguments: id, query. Send path, query, and body fields together as tool arguments.

Connect your agent