Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Cancel Sql Query

POST/api/v2/sqlQueries/{sqlQueryId}/cancel
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Cancels a query. If the query is no longer running this is effectively a no-op.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:sql-queries-execute.

Path parameters

sqlQueryId
string

The id of a query.

Query parameters

preview
boolean
optional

Enables the use of preview functionality.

Examples

Request

Copied!
1 2 3 curl -X POST \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/sqlQueries/OikKBfqBaWRjOGQ3YTJkNzMtYjhiZi00ZDMzLTlkOWMtOGQzOW/cancel?preview=true"

Error responses

Error Name
QueryPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe provided token does not have permission to access the given query.
ParametersqueryId
QueryCanceledError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe query was canceled.
ParametersqueryId
QueryFailedError CodeINTERNAL
Status Code500
DescriptionThe query failed.
ParametersqueryId, errorMessage
QueryParseErrorError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe query cannot be parsed.
ParameterserrorMessage
QueryRunningError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe query is running.
ParametersqueryId
ReadQueryInputsPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionThe provided token does not have permission to access the inputs to the query.
Parametersrids
CancelSqlQueryPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not cancel the SqlQuery.
ParameterssqlQueryId