---
title: "创建Sql扫描任务并提交审核"
method: POST
path: "/v1/projects/{project_name}/tasks/audits"
tags: ["task"]
---

# 创建Sql扫描任务并提交审核

`POST /v1/projects/{project_name}/tasks/audits`

create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective.
1. formData[sql]: sql content;
2. file[input_sql_file]: it is a sql file;
3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it.

## Path parameters

- `project_name` string, required

## Response `200`

OK

- V1GetAuditTaskResV1
  - `code` integer
  - `data` V1AuditTaskResV1
    - `audit_files` V1AuditFileResp[]
      - `file_name` string
    - `audit_level` 'normal' | 'notice' | 'warn' | 'error' | ''
    - `backup_conflict_with_instance` boolean — 当数据源备份开启，工单备份关闭，则需要提示审核人工单备份策略与数据源备份策略不一致
    - `backup_max_rows` integer
    - `enable_backup` boolean
    - `exec_end_time` string
    - `exec_fail_reason` string
    - `exec_fail_sql_count` integer
    - `exec_fail_sql_id` integer
    - `exec_fail_sql_number` integer
    - `exec_fail_stage` string
    - `exec_mode` string
    - `exec_start_time` string
    - `file_order_method` string
    - `instance_db_type` string
    - `instance_name` string
    - `instance_schema` string
    - `pass_rate` number
    - `score` integer
    - `sql_source` 'form_data' | 'sql_file' | 'mybatis_xml_file' | 'audit_plan' | 'zip_file' | 'git_repository'
    - `status` 'initialized' | 'audited' | 'executing' | 'exec_success' | 'exec_failed' | 'manually_executed'
    - `task_id` integer
  - `message` string

---

[API](https://skmtc.dev/actiontech/apis/sqle-api-docs.md) · [All operations](https://skmtc.dev/actiontech/apis/sqle-api-docs/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/actiontech/sqle-api-docs/revisions/3e36a0067703/schema)
