latestOpenAPI 3.1.02026-08-221163801019.2 KB

f0f28319e448

Admin

Submit a SQL query

Execute a read-only SQL query on Amigo's databases for the specified organization.

Permissions

This endpoint requires the authenticated user to have greater privileges than the DefaultAdministratorRole.

post/v1/{organization}/admin/sql_query

Path parameters

organizationstring required

Headers

x-mongo-cluster-namestring nullable

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

Sec-WebSocket-Protocolstring[]

Request body

sql_querystring required
async_queryfalse required

Whether the query is asynchronous. If true, a signed URL will be returned to download the results once the query is complete. If false, the results will be returned in the response, but at most 1000 rows will be returned, and the query is subject to a 30 second execution timeout.

Response

Succeeded.

execution_time_msinteger required

The time taken to execute the query in milliseconds.

truncatedboolean required

Whether the result was truncated due to the row limit.