> ## Documentation Index
> Fetch the complete documentation index at: https://docs-docflow.textin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建审核规则

> 创建审核规则



## OpenAPI

````yaml /docflow/cn/rest-api/openapi.bundle.yaml post /api/app-api/sip/platform/v2/review/rule/create
openapi: 3.0.0
info:
  title: DocFlow API
  description: DocFlow REST API，提供文件上传和获取文件处理结果能力
  version: 2.8.4
servers:
  - url: https://docflow.textin.com
security:
  - ApiId: []
    SecretCode: []
paths:
  /api/app-api/sip/platform/v2/review/rule/create:
    post:
      tags:
        - 智能审核
      summary: 创建审核规则
      description: 创建审核规则
      operationId: createReviewRule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/ReviewRuleProperties'
                - type: object
                  properties:
                    workspace_id:
                      type: string
                      description: 空间ID
                      example: '1234567890'
                    repo_id:
                      type: integer
                      description: 审核规则库ID
                      example: '31415926'
                  required:
                    - workspace_id
                    - repo_id
      responses:
        '200':
          description: 成功创建审核规则
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      result:
                        type: object
                        properties:
                          rule_id:
                            type: string
                            description: 审核规则ID
                            example: '31415926'
                  - $ref: '#/components/schemas/CodeMessage'
components:
  schemas:
    ReviewRuleProperties:
      type: object
      properties:
        group_id:
          type: string
          description: 审核规则组ID
          example: '31415926'
        name:
          type: string
          description: 规则名称
          example: 审核规则1
        prompt:
          type: string
          description: 规则提示词
          example: 审核规则提示词
        category_ids:
          type: array
          items:
            type: string
            description: 分类ID
            example: '1234567890'
        risk_level:
          $ref: '#/components/schemas/RiskLevel'
        referenced_fields:
          type: array
          items:
            $ref: '#/components/schemas/ReviewRuleReferencedField'
    CodeMessage:
      type: object
      properties:
        code:
          type: integer
          description: 状态码
          example: 200
        msg:
          type: string
          description: 状态描述
      required:
        - code
        - msg
    RiskLevel:
      type: integer
      description: |
        风险等级
        - 10: 高风险
        - 20: 中风险
        - 30: 低风险
      enum:
        - 10
        - 20
        - 30
    ReviewRuleReferencedField:
      type: object
      properties:
        category_id:
          type: string
          description: 分类ID
          example: '1234567890'
        category_name:
          type: string
          description: 分类名称
          example: 发票
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ReviewRuleField'
        tables:
          type: array
          items:
            type: object
            properties:
              table_id:
                type: string
                description: 表格ID
                example: '1234567890'
              table_name:
                type: string
                description: 表格名称
                example: 发票表格
              fields:
                type: array
                items:
                  $ref: '#/components/schemas/ReviewRuleField'
    ReviewRuleField:
      type: object
      properties:
        field_id:
          type: string
          description: 字段ID
          example: '1234567890'
        field_name:
          type: string
          description: 字段名称
          example: 发票代码
  securitySchemes:
    ApiId:
      type: apiKey
      in: header
      name: x-ti-app-id
    SecretCode:
      type: apiKey
      in: header
      name: x-ti-secret-code

````