Skip to main content
POST

Body

application/json

Create SQL audit task request

sqlSource
object
required

SQL source configuration

workspaceId
string
required

Workspace ID

Example:

"1730411624641736706"

ruleTemplateId
string
required

Audit template ID

Example:

"100"

platformCode
string
required

Platform instance identifier (e.g. blueking-prod, coding-prod)

Example:

"blueking-prod"

requestId
string

Idempotency key (external request ID, optional. When empty, idempotency is not checked and the audit runs every time)

dbVersion
string

Database version

operatorEmail
string

Operator email (optional. When provided, the audit task is created as this user)

enableIndexRecommendation
boolean
default:true

Whether to run index recommendation, default true; when false, only audits without index recommendation

platformType
string

Platform type: blueking/coding (optional, used to explicitly specify the source platform)

extra
object

Extended data (passed through to the result)

Response

Audit task created successfully

SQL audit task response

taskId
string

Task ID

requestId
string

Idempotency key (external request ID)

status
enum<string>

Task status: accepted/running/finished

Available options:
accepted,
running,
finished
result
enum<string>

Decision result: allow/deny/timeout/failed

Available options:
allow,
deny,
timeout,
failed
errorCode
integer

Error code (only present when result=failed)

errorMessage
string

Error message (only present when result=failed)

riskLevel
enum<integer>

Risk level: 0-critical 1-warning 2-notice

Available options:
0,
1,
2
riskLevelDesc
enum<string>

Risk level description: critical/warning/notice

Available options:
critical,
warning,
notice
statistics
object

Statistics information

summary
string

Audit summary (Markdown format, suitable for display)

summaryData
object

Audit summary (structured JSON, suitable for metrics analysis)

reportUrl
string

Report detail page URL

reportHtml
string

Report HTML content

callbackStatus
string

Callback status: pending/success/failed/skipped

callbackMessage
string

Callback result message

finishedAt
string<date-time>

Completion time

extra
object

Extended data (passed through)

ticketId
string

Associated ticket ID

ticketTitle
string

Ticket title (usable for platform search)

auditId
string

Associated audit ID

workspaceInfo
object

Workspace information

env
string

Environment information

orgInfo
object

Organization information

ruleTemplateInfo
object

Rule template information

operatorEmail
string

Operator email

enableIndexRecommendation
boolean

Whether to run index recommendation