openapi: 3.0.1
info:
  title: 易企办 Open API
  description: |
    # 简介
    ## API 简介
    欢迎使用易企办 Open API.

    该API的是为了让您能够快速、轻松地从任何外部系统访问易企办功能和数据。 API遵循REST语义，接受和响应使用JSON对象。 任何对易企办的API调用都应该在**https://api.yeeoffice.cn/v1** **https://api.yeeoffice.com/v1**基础URL上进行。
    
    我们从经验中了解到，开放的API可以极大地增强您的系统和易企办的能力。 我们正在努力为您带来越来越多的API。 目前，您可以在以下类别中访问易企办资源。
    - [Lists](#tag/Lists)
    - [Users](#tag/Users)
    - [Departments](#tag/Departments)
    - [Locations](#tag/Locations)
    - [Positions](#tag/Positions)
    - [Groups](#tag/Groups)
    - [Service Portal](#tag/ServicePortal)
    - [Workflows](#tag/Workflows)
    - [Agents](#tag/Agents)
    - [Files](#tag/Files)
    - [Webhooks](#tag/Webhooks)

    ## 访问限制
    按照商户账号，对易企办的API访问有配额限制。

    | 产品级别 | 限制 |
    | ----------- | ----------- |
    | 全部 | 最多每秒10个请求 |
    
    ## Errors
    除了标准的HTTP状态码来表示API调用的成功与否，响应的主体对象中会包含具体的错误信息，格式如下：
      ```
      {
        "Status": 0,
        "Data": null,
        "Message": ""  
      }
      ```
    `Status` 具体错误代码，`0`代表成功的请求。
    `Message` 具体错误信息。

  contact:
    name: E-mail
    email: support@yeeoffice.com
  version: v1
servers:
  - url: https://api.yeeoffice.cn/v1
  - url: https://api.yeeoffice.com/v1
paths:
  '/lists/{appID}/{listID}':
    get:
      tags:
        - Lists
      summary: 查询列表信息
      description: |
        获取一个列表的基础信息。
        
        如果需要查询列表的字段定义，请使用 [查询列表字段](#tag/Lists/paths/~1_api~1v1~1lists~1{appID}~1{listID}~1fields/get) API.
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListsResponseResponseMessage'
  '/lists/{appID}/{listID}/fields':
    get:
      tags:
        - Lists
      summary: 查询列表字段
      description: |
        查询列表字段，包括系统默认字段和自定义字段。
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListsFieldResponseIEnumerableResponseMessage'
  '/lists/{appID}/{listID}/items':
    post:
      tags:
        - Lists
      summary: 添加列表记录
      description: |
        发送`POST`请求到API创建一个列表记录。

        请求内容的`Data`属性包括一个JSON对象，键值对是**字段名称**和对应的值。详情可以查看 [字段和值](#section/Field-values).
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListItemAddReq'
            examples:
              Add:
                summary: Add item sample
                value:
                  Data:
                    Title: "Hello World"
                    Text1: "Field 1"
                    Text2: "1169076697702731776"
                    Text3: "[\"Option1\", \"Option2\"]"
                    Bit1: "true"
                    Decimal1: "3.14"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/lists/{appID}/{listID}/items/batch':
    post:
      tags:
        - Lists
      summary: 添加多个列表记录
      description: |
        发送`POST`请求到API创建多个列表记录。

        请求内容的`Items`属性包括一个JSON数组，数组中元素是JSON对象。键值对是**字段名称**和对应的值。详情可以查看 [字段和值](#section/Field-values).
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表的ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                Items:
                  type: array
                  items:
                    type: object
                    description: |
                      [Field values](#section/Field-values)
                    additionalProperties:
                      type: string
                TriggerFlow:
                  type: boolean
                  description: |
                    如果为 true，则添加项目后触发工作流

                    如果为 false，则添加项目后不触发工作流

                    默认为 false
              additionalProperties: false
            examples:
              Add:
                summary: 添加记录示例
                value:
                  Items:
                    - Title: "Hello World"
                      Text1: "Field 1"
                      Text2: "1169076697702731776"
                      Text3: "[\"Option1\", \"Option2\"]"
                      Bit1: "true"
                      Decimal1: "3.14"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringListResponseMessage'
    patch:
      tags:
        - Lists
      summary: 更新多个列表记录
      description: |
        通过向批量项目端点发出 PATCH 请求来更新列表中的多个项目。

        此 API 是一个 PATCH 请求，它只会更新您指定的字段，其余字段保持不变。
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                Items:
                  type: array
                  items:
                    type: object
                    properties:
                      ListDataID:
                        type: integer
                        format: int64
                        description: |
                          **列表记录ID**
                      RowVersion:
                        type: integer
                        format: int32
                        description: |
                          **RowVersion** 是执行 PUT 或 PATCH 请求时用于检查项目版本的参数。如果您在请求中指定的 **RowVersion** 与服务器上该项目的 **RowVersion** 不匹配，API 将返回错误。
                          - 如果您未指定 **RowVersion** 或将**RowVersion** 设置为 0，则服务器将覆盖该项目（无论版本如何）。
                      Fields:
                        type: object
                        description: |
                          [Field values](#section/Field-values)
                        additionalProperties:
                          type: string
                        nullable: true
                TriggerFlow:
                  type: boolean
                  description: |
                    如果为 true，则添加项目后触发工作流

                    如果为 false，则添加项目后不触发工作流

                    默认为 false
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringListResponseMessage'
  '/lists/{appID}/{listID}/items:batchDelete':
    post:
      tags:
        - Lists
      summary: 删除列表多个记录
      description: |
        通过列表记录ID数组删除多个记录
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
                description: Item ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/lists/{appID}/{listID}/items/{id}':
    patch:
      tags:
        - Lists
      summary: 更新一个列表记录
      description: 这个API是一个`PATCH`请求，只会更新传值的字段，请求中没有包含的字段值不会发生变更。
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: id
          in: path
          description: 记录ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListItemEditReq'
            examples:
              patch:
                summary: Update item sample
                value:
                  RowVersion: 0
                  Data:
                    Title: "Hello World"
                    Text1: "Field 1"
                    Text2: "1169076697702731776"
                    Text3: "[\"Option1\", \"Option2\"]"
                    Bit1: "true"
                    Decimal1: "3.14"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    delete:
      tags:
        - Lists
      summary: 删除记录
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: id
          in: path
          description: 记录ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    get:
      tags:
        - Lists
      summary: 根据ID查询记录
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: id
          in: path
          description: 记录ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: fields
          in: query
          description: |            
            有些情况下，你不需要返回所有的字段值，可以通过这个参数决定具体需要返回的字段。参数格式为英文逗号分隔的字段名称。

            如果不传该参数，服务器会返回这条记录的所有字段值。

            示例：
              ```
              ?fields=fieldName1%2CfieldName2%2CfieldName3
              ```
          schema:
            type: string
            nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringStringDictionaryResponseMessage'
  '/lists/{appID}/{listID}/items/query':
    post:
      tags:
        - Lists
      summary: 查询列表记录
      description: |
        获取列表的记录。你可以进行条件过滤，排序和指定返回的字段。如果匹配的结果数量超过`PageSize`限制，你需要通过`PageIndex`参数逐页的获取全部数据。
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListItemsQueryRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringStringDictionaryListResponseMessage'
  '/lists/{appID}/{listID}/items/{id}/files':
    post:
      tags:
        - Lists
      summary: 列表记录添加文件
      description: |
        添加文件到列表记录指定的附件列。如果该列不允许多文件，则现有的文件将会被覆盖。
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: id
          in: path
          description: 记录ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - in: query
          name: fieldID
          type: string
          description: 附件字段ID
        - in: query
          name: fileName
          type: string
          required: true
          description: 文件名称
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
              description: 文件内容
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/lists/{appID}/{listID}/library':
    post:
      tags:
        - Lists
      summary: 添加文件到文档库
      description: |
        添加文件到文档库。
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: path
          in: path
          description: 文件需要被创建到文档库根目录的相对路径。如果目录不存在将会被创建。
          required: false
          type: string
        - in: query
          name: fileName
          type: string
          required: true
          description: 文件名称
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
              description: 文件内容
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/lists/{appID}/{listID}/library/{id}/content':
    get:
      tags:
        - Lists
      summary: 从文档库获取文件内容
      description: |
        从文档库获取文件内容。
      parameters:
        - name: appID
          in: path
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: listID
          in: path
          description: |
            [列表ID](#defListID)
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: id
          in: path
          description: 记录ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: 文件内容
  '/users':
    post:
      tags:
        - Users
      summary: 添加用户
      description: |
        添加用户到系统中，并初始化一些基本信息。如下是一些添加用户的错误信息参考:

        | 代码 | 说明 |
        | -- | -- |
        | 530001 | 用户账号已存在 |
        | 530108 | 商户的License授权不够 |

      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                LoginAccount:
                  type: string
                  required: true
                  description: 用户登录账号（通常是用户邮箱）
                Name:
                  type: string
                  required: true
                  description: 用户名称
                Email:
                  type: string
                  required: true
                  description: 用户邮箱（用于系统通知）
                DepartmentID:
                  type: integer
                  required: true
                  description: 用户被加入的组织ID 
                  format: int64
                LineManager:
                  type: integer
                  description: 用户的直接上级ID
                IsSendMail:
                  type: boolean
                  description: 账号添加成功后，是否发送通知邮件给被添加的用户
                Attrs:
                  type: object
                  description: |
                    [Field values](#section/Field-values)
                  additionalProperties:
                    type: string
                  nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    get:
      tags:
        - Users
      summary: 根据账号ID查询用户
      parameters:
        - name: account
          in: query
          description: '账号ID'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInfoResponse'
  /users/search:
    post:
      tags:
        - Users
      summary: 搜索用户
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchUsersRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInfoListResponse'
  '/users/{id}':
    get:
      tags:
        - Users
      summary: 根据用户ID查询
      parameters:
        - name: id
          in: path
          description: '用户ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInfoResponse'
    put:
      tags:
        - Users
      summary: 根据用户ID更新
      parameters:
        - name: id
          in: path
          description: '用户ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: '只设置需要更新的属性'
        content:
          application/json:
            schema:
              type: object
              properties:
                Name:
                  type: string
                  nullable: true
                  description: 用户名
                Email:
                  type: string
                  nullable: true
                  description: 用户邮箱
                DepartmentID:
                  type: integer
                  nullable: true
                  description: 部门ID 
                  format: int64
                LineManager:
                  type: integer
                  nullable: true
                  description: 直接上级ID
                Attrs:
                  type: object
                  description: |
                    [Field values](#section/Field-values)
                  additionalProperties:
                    type: string
                  nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    delete:
      tags:
        - Users
      summary: 删除一个用户
      parameters:
        - name: id
          in: path
          description: 用户ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/users/{id}/enable':
    put:
      tags:
        - Users
      summary: 激活一个用户
      parameters:
        - name: id
          in: path
          description: 用户ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/users/{id}/disable':
    put:
      tags:
        - Users
      summary: 禁用一个用户
      parameters:
        - name: id
          in: path
          description: 用户ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  /departments:
    get:
      tags:
        - Departments
      summary: 获取组织数据
      parameters:
        - name: parentId
          in: query
          schema:
            type: integer
            format: int64
            default: 0
          description: 上级组织ID。传0返回所有组织。
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepartmentListResponse'
    post:
      tags:
        - Departments
      summary: 添加一个组织
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                Name:
                  type: string
                  required: true
                ParentID:
                  type: integer
                  format: int64
                  description: 上级组织的ID。传0添加组织到根节点。
                Type:
                  type: string
                  required: true
                Code:
                  type: string
                  description: 组织编号
                Manager:
                  type: integer
                  format: int64
                  description: 组织负责人的用户ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/departments/{id}':
    put:
      tags:
        - Departments
      summary: 修改组织信息
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                Name:
                  type: string
                ParentID:
                  type: integer
                  format: int64
                  description: 上级组织ID
                Type:
                  type: string
                Code:
                  type: string
                  descrtiption: 组织编号
                Manager:
                  type: integer
                  format: int64
                  description: 组织负责人的用户ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    delete:
      tags:
        - Departments
      summary: 通过ID删除组织
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/locations':
    get:
      tags:
        - Locations
      summary: 获取所有地点
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationModelListResponseMessage'
    post:
      tags:
        - Locations
      summary: 添加一个地点
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/locations/{id}':
    get:
      tags:
        - Locations
      summary: 根据ID获取地点
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationModelResponseMessage'
    put:
      tags:
        - Locations
      summary: 更新地点信息
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    delete:
      tags:
        - Locations
      summary: 删除一个地点
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/groups':
    get:
      tags:
        - Groups
      summary: 查询组
      parameters:
        - name: keywords
          in: query
          description: 用来过滤组关键字
        - name: pageIndex
          in: query
          description: 返回结果的页码数
        - name: pageSize
          in: query
          description: 一次请求返回的结果数。默认20最大1000。
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupInfoListResponse'
    post:
      tags:
        - Groups
      summary: 添加一个组
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/groups/{id}':
    put:
      tags:
        - Groups
      summary: 更新一个组
      parameters:
        - name: id
          in: path
          description: 'Group ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    delete:
      tags:
        - Groups
      summary: 删除一个组
      parameters:
        - name: id
          in: path
          description: 'Group ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/groups/{id}/users':
    post:
      tags:
        - Groups
      summary: 添加用户到组
      parameters:
        - name: id
          in: path
          description: 'Group ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: 用户ID数组
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
                format: int64
              description: 用户ID数组
              nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    get:
      tags:
        - Groups
      summary: 获取组的用户列表
      parameters:
        - name: id
          in: path
          description: 'Group ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: keywords
          in: query
          description: 用来过滤用户的关键字
        - name: pageIndex
          in: query
          description: 返回结果的页码数
        - name: pageSize
          in: query
          description: 一次请求返回的结果数。默认20最大1000。
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInfoListResponse'
  '/groups/{id}/users/remove':
    post:
      tags:
        - Groups
      summary: 从组中移除用户
      parameters:
        - name: id
          in: path
          description: 'Group ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: 用户ID数组
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
                format: int64
              description: 用户ID数组
              nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  /positions:
    post:
      tags:
        - Positions
      summary: 添加一个岗位
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PositionRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    get:
      tags:
        - Positions
      summary: 获取岗位列表
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionModelListResponse'
  '/positions/{id}':
    put:
      tags:
        - Positions
      summary: 更新岗位信息
      parameters:
        - name: id
          in: path
          description: 'Position ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PositionRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    delete:
      tags:
        - Positions
      summary: 删除一个岗位
      parameters:
        - name: id
          in: path
          description: 'Position ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/positions/{id}/users':
    post:
      tags:
        - Positions
      summary: 分配用户到一个岗位
      description: 岗位可以绑定到组织或地点。根据BindingType，用户可以被分配到岗位自身，或者到组织岗位，或者地点岗位。
      parameters:
        - name: id
          in: path
          description: '岗位ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PositionUsersRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    get:
      tags:
        - Positions
      summary: 获取岗位分配明细
      description: 可以根据用户或者绑定的对象过滤岗位分配明细
      parameters:
        - name: id
          in: path
          description: '岗位ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
        - name: userID
          in: query
          description: 用户ID
          schema:
            type: integer
            description: ''
            format: int64
            default: 0
        - name: bindingType
          in: query
          description: 绑定类型
          schema:
            $ref: '#/components/schemas/PositionBindingType'
        - name: targetID
          in: query
          description: |
            根据绑定类型，
            如果是类型是2，这里是组织ID；
            如果类型是3，这里是地点ID；
            如果类型是1，这里留空或者0。
          schema:
            type: integer
            description: ''
            format: int64
            default: 0
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PositionAssignmentResponse
  '/positions/{id}/users/remove':
    post:
      tags:
        - Positions
      summary: 从岗位移除用户
      parameters:
        - name: id
          in: path
          description: '岗位ID'
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PositionUsersRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/workflow/forms/start':
    post:
      tags:
        - Workflows
      summary: 启动流程
      description: 通过流程标识和变量启动工作流。ApplicantID 为可选参数，用于代表指定用户提交申请。
      parameters:
        - name: key
          in: query
          description: 流程标识
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ApplicantID:
                  type: string
                  description: 申请人ID
                Variables:
                  type: object
                  additionalProperties:
                    type: string
                  description: 变量ID和值
                  nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: object
                    properties:
                      ApplicationID:
                        type: string
                        description: 流程实例ID
                      FlowNo:
                        type: string
                        description: 流程编号
                  Status:
                      $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
  '/workflow/tasks/todo':
    get:
      tags:
        - Workflows
      summary: 获取代办任务
      parameters:
        - name: assigneeID
          in: query
          description: 任务经办人ID
          schema:
            type: integer
            description: ''
            format: int64
            nullable: true
        - name: start
          in: query
          description: 根据任务创建时间的时间范围搜索，起始时间
          schema:
            type: string
            description: ''
            format: date-time
            nullable: true
        - name: end
          in: query
          description: 根据任务创建时间的时间范围搜索，结束时间
          schema:
            type: string
            description: ''
            format: date-time
            nullable: true
        - name: trackingNo
          in: query
          description: 匹配流程编号的开始字符
          schema:
            type: string
            nullable: true
        - name: pageIndex
          in: query
          description: 返回结果的页码数
        - name: pageSize
          in: query
          description: 一次请求返回的结果数。默认20最大1000。
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: array
                      items:
                        $ref: '#/components/schemas/TaskModel'
                      description: 任务数组
                      nullable: true
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/workflow/tasks/{id}/variables':
    get:
      tags:
        - Workflows
      summary: 获取任务的变量和值
      parameters:
        - name: id
          in: path
          description: 任务ID
          schema:
            type: integer
            description: ''
            format: int64
            nullable: true
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: object
                      additionalProperties:
                        type: string
                      description: 变量ID和值的键值对
                      nullable: true
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/workflow/tasks/{id}/handle':
    put:
      tags:
        - Workflows
      summary: 处理任务
      parameters:
        - name: id
          in: path
          description: 任务ID
          schema:
            type: integer
            description: ''
            format: int64
            nullable: false
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              required:
                - Outcome
              type: object
              properties:
                Outcome:
                  type: string
                  description: |
                    "SaveVariable": 更新流程变量，不改变任务状态
                    "Completed": "完成任务" 使用
                    "Approved" and "Rejected": "审批任务" 使用
                Comments:
                  type: string
                  description: 审批备注
                Variables:
                  type: object
                  description: 变量ID的键值对，同 [字段值](#section/Field-values)
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: string
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/workflow/delegates':
    get:
      tags:
        - Workflows
      summary: 查询代理记录
      parameters:
        - name: ownerID
          in: query
          description: 代理所有者的ID
          schema:
            type: integer
            description: ''
            format: int64
            nullable: true
        - name: pageIndex
          in: query
          description: 返回结果的页码数
        - name: pageSize
          in: query
          description: 一次请求返回的结果数。默认20最大1000。
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: array
                      items:
                        $ref: '#/components/schemas/DelegationModel'
                      description: 代理记录数组
                      nullable: true
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
    post:
      tags:
        - Workflows
      summary: 添加一个代理
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DelegationAddModel'
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: string
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/workflow/delegates/{id}':
    get:
      tags:
        - Workflows
      summary: 根据ID获取代理
      parameters:
        - name: id
          in: path
          description: 代理ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      $ref: '#/components/schemas/DelegationModel'
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
    put:
      tags:
        - Workflows
      summary: 修改一个代理
      parameters:
        - name: id
          in: path
          description: 代理ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DelegationModel'
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: string
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
    delete:
      tags:
        - Workflows
      summary: 删除一个代理
      parameters:
        - name: id
          in: path
          description: 代理ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: string
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/workflow/delegates/{id}/enable':
    put:
      tags:
        - Workflows
      summary: 启用一个代理
      parameters:
        - name: id
          in: path
          description: 代理ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: string
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/workflow/delegates/{id}/disable':
    put:
      tags:
        - Workflows
      summary: 禁用一个代理
      parameters:
        - name: id
          in: path
          description: 代理ID
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: string
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/workflow/forms/{id}/variables':
    get:
      tags:
        - Workflows
      summary: 获取表单变量
      parameters:
        - name: id
          in: path
          description: 表单标识
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: object
                      additionalProperties:
                        type: string
                      description: 变量ID和值的键值对
                      nullable: true
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
    put:
      tags:
        - Workflows
      summary: 更新表单变量
      parameters:
        - name: id
          in: path
          description: 表单标识
          required: true
          schema:
            type: integer
            description: ''
            format: int64
      requestBody:
        description: 'JSON对象：变量ID和值的键值对'
        content:
          application/json:
            schema:
              type: object
      responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    Data:
                      type: boolean
                    Status:
                      $ref: '#/components/schemas/Status'
                    Message:
                      $ref: '#/components/schemas/Message'
                    TotalCount:
                      $ref: '#/components/schemas/TotalCount'
                  additionalProperties: false
  '/ServicePortal/{portalid}/users':
    post:
      tags:
        - ServicePortal
      summary: 创建用户
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServicePortalUserRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/ServicePortal/{portalid}/users/search':
    get:
      tags:
        - ServicePortal
      summary: 查询用户
      parameters:
        - name: keywords
          in: query
          description: 用来过滤用户的关键字
        - name: pageIndex
          in: query
          description: 返回结果的页码数
        - name: pageSize
          in: query
          description: 一次请求返回的结果数。默认20最大1000。
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServicePortalUserInfoListResponse'
  '/ServicePortal/{portalid}/users/{id}':
    delete:
      tags:
        - ServicePortal
      summary: 删除用户
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
        - name: userid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/UserID'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/ServicePortal/{portalid}/users/{userid}/resetpwd':
    post:
      tags:
        - ServicePortal
      summary: 设置用户密码
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
        - name: userid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/UserID'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              required:
                - Password
              type: object
              properties:
                Password:
                  type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  # '/ServicePortal/{portalid}/users/{userid}/groups':
  #   get:
  #     tags:
  #       - ServicePortal
  #     summary: 获取组用户列表
  #     parameters:
  #       - name: portalid
  #         in: path
  #         required: true
  #         schema:
  #           $ref: '#/components/schemas/PortalID'
  #       - name: userid
  #         in: path
  #         required: true
  #         schema:
  #           $ref: '#/components/schemas/UserID'
  #     responses:
  #       '200':
  #         description: Success
  #         content:
  #           application/json:
  #             schema:
  #               $ref: '#/components/schemas/ServicePortalGroupListResponse'
  '/ServicePortal/{portalid}/groups':
    get:
      tags:
        - ServicePortal
      summary: 获取组列表
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupInfoListResponse'
    post:
      tags:
        - ServicePortal
      summary: 创建组
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServicePortalGroupRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/ServicePortal/{portalid}/groups/{id}':
    put:
      tags:
        - ServicePortal
      summary: 更新组
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/GroupID'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServicePortalGroupRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
    delete:
      tags:
        - ServicePortal
      summary: 删除组
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/GroupID'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/ServicePortal/{portalid}/groups/{id}/users/count':
    get:
      tags:
        - ServicePortal
      summary: 获取组用户数量
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/GroupID'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Int32ResponseMessage'
  '/ServicePortal/{portalid}/groups/{id}/users':
    post:
      tags:
        - ServicePortal
      summary: 添加用户到组
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/GroupID'
      requestBody:
        description: 'Array of User ID'
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
                format: int64
              description: ''
              nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/ServicePortal/{portalid}/groups/{id}/users/remove':
    post:
      tags:
        - ServicePortal
      summary: 从组移除用户
      parameters:
        - name: portalid
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/PortalID'
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/GroupID'
      requestBody:
        description: Array of User ID
        content:
          application/json:
            schema:
              type: array
              items:
                type: integer
                format: int64
              description: User ID
              nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringResponseMessage'
  '/applications/{listID}/agents':
    get:
      tags:
        - Agents
      summary: 获取应用下的AI智能体
      description: 获取应用下的AI智能体
      parameters:
        - name: listID
          in: path
          required: true
          schema:
            type: string
          description: 应用ID
        - name: appID
          in: query
          description: |
            [appID](#defAppID)
          required: true
          schema:
            type: integer
            description: ''
            format: int32
        - name: pageIndex
          in: query
          description: 返回结果的页码数
        - name: pageSize
          in: query
          description: 一次请求返回的结果数。默认20最大1000。
      responses:
        '200':
          description: default
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: array
                    items:
                      type: object
                      properties:
                        Id:
                          type: string
                          description: 智能体 ID
                        Name:
                          type: string
                          description: 智能体名称
                        Description:
                          type: string
                          description: 说明
                    description: Data
                  Status:
                      $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
                additionalProperties: false
  '/agents/{agentID}':
    get:
      tags:
        - Agents
      summary: 获取智能体定义
      description: 通过ID获取智能体定义，包含说明和输入输出参数的定义。
      parameters:
        - name: agentID
          in: path
          description: 智能体ID
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: object
                    properties:
                      Id:
                        type: string
                        description: 智能体 ID
                      Name:
                        type: string
                        description: 智能体名称
                      Description:
                        type: string
                        description: 说明
                      InputVariables:
                        type: array
                        items:
                          type: object
                          properties:
                            Id:
                              type: string
                              description: 变量ID
                            Type:
                              type: string
                              description: 变量类型
                            Description:
                              type: string
                              description: 说明
                        description: 输入变量
                      OutputVariables:
                        type: array
                        items:
                          type: object
                          properties:
                            Id:
                              type: string
                              description: 变量ID
                            Type:
                              type: string
                              description: 变量类型
                            Description:
                              type: string
                              description: 说明
                        description: 输出变量
                    description: Data
                  Status:
                    $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
                  TotalCount:
                    $ref: '#/components/schemas/TotalCount'
                additionalProperties: false
  '/agents/{agentID}/run':
    post:
      tags:
        - Agents
      summary: 执行AI智能体
      description: 通过智能体ID和所需的输入参数执行AI代理。
      parameters:
        - name: agentID
          in: path
          description: 智能体ID
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: string
              description: 变量ID和值的键值对
              nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: object
                    additionalProperties:
                      type: string
                    description: 变量ID和值的键值对
                    nullable: true
                  Status:
                        $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
                additionalProperties: false
  '/files':
    post:
      tags:
        - Files
      summary: 上传文件
      description: 上传临时文件。返回的文件对象可用于创建列表项、启动流程并将其提交给代理。（未引用的临时文件将在一段时间后被删除。）
      parameters:
        - name: FileName
          in: query
          required: true
          schema:
            type: string
          description: 文件名称（包括后缀）
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: 文件标示
                      name:
                        type: string
                        description: 文件名称
                      fileSize:
                        type: integer
                        description: 文件大小
                    description: File object
                  Status:
                      $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
                additionalProperties: false
  '/files/{id}/content':
    get:
      tags:
        - Files
      summary: 通过文件ID获取文件内容
      description: |
        附件字段存储的是文件对象或者文件对象数组的序列化文本。文件对象如下：
          ```
          {
            "id":string,
            "name":string,
            "fileSize":number
          }
          ```
        文件对象中的“id"属性就是用来获取文件内容的主键。
        
        _注释：如果发现文件对象不是该结构，说明是旧格式的附件定义，请反馈给我们，我们会为您的商户安排数据升级。_
      parameters:
        - name: id
          in: path
          description: 文件ID
          required: false
          type: string
      responses:
        '200':
          description: Success
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: 文件内容
  '/hooks':
    post:
      tags:
        - Webhooks
      summary: 创建一个webhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookModel'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: object
                    properties:
                      UnSubscribe:
                        type: string
                        description: 取消订阅地址
                      ID:
                        type: string
                        description: Webhook的ID
                    nullable: true
                  Status:
                    $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
  '/hooks/{id}':
    get:
      tags:
        - Webhooks
      summary: 根据ID获取Webhook
      parameters:
        - name: id
          in: path
          description: Webhook ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    $ref: '#/components/schemas/WebhookModel'
                  Status:
                    $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
    delete:
      tags:
        - Webhooks
      summary: 删除Webhook
      parameters:
        - name: id
          in: path
          description: Webhook ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: string
                  Status:
                    $ref: '#/components/schemas/Status'
                  Message:
                    $ref: '#/components/schemas/Message'
components:
  schemas:
    WebhookModel:
      type: object
      properties:
        Resource:
          type: string
          description: |
            [Resource and Type](#section/Resource-and-Type)
        Channel:
          type: string
          nullable: false
          description: 提供给调用者来区分Webhook的渠道
        Type:
          type: integer
          format: int32
          description: |
            [Resource and Type](#section/Resource-and-Type)
        Settings:
          type: object
          nullable: false
          properties:
            callbackUrl:
              type: string
              description: 事件回调地址
      nullable: false
    UserSearchStatus:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 8
      type: integer
      format: int32
      description: |
        * `1` - 活动
        * `2` - 非活动
        * `3` - 未删除 (包含活动和非活动)
        * `4` - 已删除
        * `8` - 等待加入
    PageIndex:
      type: integer
      format: int32
      description: 返回结果的页码数
    PageSize:
      type: integer
      format: int32
      description: 一次请求返回的结果数。默认20最大1000。
    Status:
      type: integer
      description: |
        [Status code](#section/简介/Errors)
      format: int32
    Message:
      type: string
      description: 错误消息
      nullable: true
    TotalCount:
      type: integer
      description: 匹配查询条件的记录总数。如果是分页查询，不是当前结果集的数量。
      format: int32
      nullable: true
    Created:
      type: string
      description: 创建时间
      format: date-time
    Modified:
      type: string
      description: 上次修改时间
      format: date-time
    CreatedBy:
      type: string
      description: 创建人ID
      nullable: true
    ModifiedBy:
      type: string
      description: 上次修改人ID
      nullable: true
    ListsResponse:
      type: object
      properties:
        AppID:
          type: integer
          description: 列表的AppID
          format: int32
        ListID:
          type: string
          description: 列表ID
          nullable: true
        Title:
          type: string
          description: 标题
          nullable: true
        Description:
          type: string
          description: 描述
          nullable: true
        IsVerRecord:
          type: boolean
          description: 是否开启了版本
        IconUrl:
          type: string
          description: 列表图标
          nullable: true
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
        WorkspaceID:
          type: string
          description: 列表所属的工作区ID
          nullable: true
      additionalProperties: false
    ListsResponseResponseMessage:
      type: object
      properties:
        Data:
          $ref: '#/components/schemas/ListsResponse'
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    ListsFieldResponse:
      type: object
      properties:
        FieldID:
          type: integer
          description: 字段ID
          format: int64
        FieldName:
          type: string
          description: 字段名称
          nullable: true
        DisplayName:
          type: string
          description: 字段显示名
          nullable: true
        InternalName:
          type: string
          description: 字段内部名称
          nullable: true
        Type:
          type: string
          description: |
            [Field type](#section/Field-types)
          nullable: true
        DefaultValue:
          type: string
          description: 字段默认值
          nullable: true
        Rules:
          type: string
          description: 字段的额外设置
          nullable: true
        IsSort:
          type: boolean
          description: 字段是否允许排序
        IsIndex:
          type: boolean
          description: 字段是否被索引
        IsSystem:
          type: boolean
          description: 是否系统内部字段
        IsUnique:
          type: boolean
          description: 如果唯一，字段的值不可以重复
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
      additionalProperties: false
    ListsFieldResponseIEnumerableResponseMessage:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/ListsFieldResponse'
          description: 字段信息数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    ColumnTypeEnum:
      enum:
        - 0
        - 1
      type: integer
      format: int32
    ListItemAddReq:
      type: object
      properties:
        Data:
          type: object
          description: |
            [Field values](#section/Field-values)
          additionalProperties:
            type: string
          nullable: true
      additionalProperties: false
    StringResponseMessage:
      type: object
      properties:
        Data:
          type: string
          description: API处理的记录ID
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    StringListResponseMessage:
      type: object
      properties:
        Data:
          type: array
          items:
            type: string
          description: 记录ID数组
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    ListItemEditReq:
      type: object
      properties:
        RowVersion:
          type: integer
          format: int32
          description: |
            **RowVersion**是用来检测对比通过PUT或PATCH操作记录的版本。如果传的**RowVersion**和服务器版本不一致，操作不生效，接口返回错误信息。
            - 设置**RowVersion**为0，可以忽略记录版本并强制更新
            - 如果没有提供**RowVersion**参数，服务器忽略记录版本并强制更新
        Data:
          type: object
          description: |
            [Field values](#section/Field-values)
          additionalProperties:
            type: string
          nullable: true
      additionalProperties: false
    StringStringDictionaryResponseMessage:
      type: object
      properties:
        Data:
          type: object
          additionalProperties:
            type: string
          description: |
            [Field values](#section/Field-values)
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    ListDataWhereRequest:
      type: object
      properties:
        Field:
          type: string
          nullable: true
          description: 字段名称
        Value:
          type: string
          nullable: true
          description: 值
        Type:
          type: integer
          format: int32
          description: |
            [Filter types](#defFilterTypes)
        Pre:
          type: string
          nullable: true
          description: and/or
        Child:
          type: array
          items:
            $ref: '#/components/schemas/ListDataWhereRequest'
          nullable: true
          description: 嵌套的过滤对象数组
      additionalProperties: false
    ListDataSortRequest:
      type: object
      properties:
        Field:
          type: string
          nullable: true
          description: 记录名称
        Desc:
          type: boolean
          description: |
            true 降序
            
            false 升序
      additionalProperties: false
    ListItemsQueryRequest:
      type: object
      properties:
        Fields:
          type: array
          description: |
            定义需要返回值的列。如果你不需要记录的所有字段值，你可以通过这个参数降低传输的数据量，提高请求效率。

            如果没有传递该参数，服务器返回所有的字段值。

            示例：
              ```
              ["Title", "Text1", "Text2", "Text3", "Bit1"]
              ```
          items:
            type: string
          nullable: true
        Filters:
          type: array
          items:
            $ref: '#/components/schemas/ListDataWhereRequest'
          nullable: true
          description: |
            过滤对象数组。**Filters**参数会转成表达式在记录上执行，只有匹配条件的记录会被返回。如果该参数没有传值，服务器会返回请求列表的所有数据。

            ### <a id="defFilterObject" class="defAnchor">Filter Object</a>
            过滤对象包含5个属性：
            
            `Field`

            字段名称

            **Note**: 只有索引过的字段可以在过滤中使用
            
            `Type`

            字段和值的条件比较操作符类型。请参看 [Filter types](#defFilterTypes)。
            
            `Value`

            表达式中用来比较的值。如果值是一个数组，需要转成JSON字符串。
            
            `Pre`

            和前一个过滤对象的关系，值为"and" 或 "or"
            
            `Child`

            嵌套的过滤对象数组，可以实现括号等复杂的条件组合。

            ### <a id="defFilterTypes" class="defAnchor">Filter types</a>
            | 名称 | 值 | 适用字段类型 |
            | -- | -- | -- |
            | Equal | 0 | All field types |
            | Less than or equal | 1 | input_number, currency, datepicker, time |
            | Great than or equal | 2 | input_number, currency, datepicker, time |
            | Great than | 3 | input_number, currency, datepicker, time |
            | Less than | 4 | input_number, currency, datepicker, time |
            | Not equal | 5 | All field types |
            | Null | 6 | All field types |
            | Not null | 7 | All field types |
            | Starts with | 8 | text |
            | In | 9 | All field types |
            | Contains | 10 | identity-picker, organization-picker, cost-center-picker, tag |
            
            例如，你可以查询满足以下条件的记录：
            > (Number1 = 1 or Number2 = 1) and Created > "2000-01-01"
            ```
            [
              { 
                "Child": [
                  { 
                    "Field": "Number1",
                    "Type": 0,
                    "Value": "1"
                  },
                  { 
                    "Pre": "or",
                    "Field": "Number2",
                    "Type": 0,
                    "Value": "1"
                  }
                ]
              },
              {
                "Pre": "and",
                "Field": "Created",
                "Type": 3,
                "Value": "2000-01-01"
              },
            ]
            ```

        Sorts:
          type: array
          items:
            $ref: '#/components/schemas/ListDataSortRequest'
          nullable: true
          description: |
            排序对象数组决定返回结果的顺序。排序对象包括字段和排序方式。

            例如，需要根据Title降序和Decimal1升序：
            ```
              [
                {
                  "Field": "Title",
                  "Desc": true
                },
                {
                  "Field": "Decimal1",
                  "Desc": false
                }
              ]
            ```
            **Note**: 只有开启索引的字段可以用来排序。
        PageIndex:
          $ref: '#/components/schemas/PageIndex'
        PageSize:
          $ref: '#/components/schemas/PageSize'
      additionalProperties: false
    StringStringDictionaryListResponseMessage:
      type: object
      properties:
        Data:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
          description: 记录数组 - [Field values](#section/Field-values)
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    DelegationAddModel:
      type: object
      properties:
        OwnerID:
          type: integer
          format: int64
          description: 代理规则所有者 ID
        DelegateTo:
          type: integer
          format: int64
          description: 代理对象用户ID
        IsEnabled:
          type: boolean
          description: 代理规则是否生效？
        NotifyMe:
          type: boolean
          description: 当任务被代理时，是否发送通知给原任务所有者？
        StartDate:
          type: string
          description: 代理规则生效开始时间
          format: date-time
        EndDate:
          type: string
          description: 代理规则生效结束时间
          format: date-time
        Description:
          type: string
          description: 代理规则备注
        ApplyToAll:
          type: boolean
          description: 是否应用代理规则到所有的流程？
        WorkflowIDs:
          type: array
          items:
            type: string
          description: 代理规则应用的流程ID数组。只有当“ApplyToAll”为假的时候才需要。
          nullable: true
    DelegationModel:
      type: object
      properties:
        ID:
          type: integer
          format: int64
          description: 代理规则 ID
        OwnerID:
          type: integer
          format: int64
          description: 代理规则所有者 ID
        DelegateTo:
          type: integer
          format: int64
          description: 代理对象用户ID
        IsEnabled:
          type: boolean
          description: 代理规则是否生效？
        NotifyMe:
          type: boolean
          description: 当任务被代理时，是否发送通知给原任务所有者？
        StartDate:
          type: string
          description: 代理规则生效开始时间
          format: date-time
        EndDate:
          type: string
          description: 代理规则生效结束时间
          format: date-time
        Description:
          type: string
          description: 代理规则备注
        ApplyToAll:
          type: boolean
          description: 是否应用代理规则到所有的流程？
        WorkflowIDs:
          type: array
          items:
            type: string
          description: 代理规则应用的流程ID数组。只有当“ApplyToAll”为假的时候才需要。
          nullable: true
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
    TaskModel:
      type: object
      properties:
        ID:
          type: integer
          format: int64
          description: 任务ID
        Name:
          type: string
          description: 任务名称
        Url:
          type: string
          description: 任务URL
        IsCompleteTask:
          type: boolean
          description: 是否是"完成任务"，不然是"审批任务"。
        AssigneeID:
          type: integer
          format: int64
          description: 任务经办人ID
        OriginalID:
          type: integer
          format: int64
          description: 任务原经办人ID
        ApplicantID:
          type: integer
          format: int64
          description: 申请人ID
        DueDate:
          type: string
          description: 任务过期日
          format: date-time
        Outcome:
          type: string
          description: 任务处理结果， Approved/Rejected/Completed/Cancelled/Revoked
        Comments:
          type: string
          description: 任务处理备注
        TrackingNo:
          type: string
          description: 申请单编号
        WorkflowID:
          type: string
          description: 流程ID
        WorkflowName:
          type: string
          description: 流程名称
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
    UserInfoListResponse:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/UserInfoModel'
          description: 用户数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    UserInfoResponse:
      type: object
      properties:
        Data:
          $ref: '#/components/schemas/UserInfoModel'
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
    UserInfoModel:
      type: object
      properties:
        AccountID:
          type: integer
          format: int64
          description: User ID
        Name:
          type: string
          nullable: true
          description: User name
        Email:
          type: string
          nullable: true
        DepartmentID:
          type: integer
          format: int64
        LineManager:
          type: integer
          format: int64
        LocationID:
          type: integer
          format: int64
        EmployeeNo:
          type: string
          nullable: true
        Deleted:
          type: boolean
        IsAdmin:
          type: boolean
        Mobile:
          type: string
          nullable: true
        SPAccount:
          type: string
          nullable: true
        Photo:
          type: string
          nullable: true
        JobTitle:
          type: string
          nullable: true
        Telephone:
          type: string
          nullable: true
        OfficeAddress:
          type: string
          nullable: true
        Phone:
          type: string
          nullable: true
        Attrs:
          type: object
          description: |
            [Field values](#section/Field-values)
          additionalProperties:
            type: string
          nullable: true
    DepartmentListResponse:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/DepartmentModel'
          description: 组织数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    DepartmentModel:
      type: object
      properties:
        ID:
          type: integer
          format: int64
          description: 组织ID
        Name:
          type: string
        Code:
          type: string
          descrtiption: 组织编号
        ParentID:
          type: integer
          format: int64
          description: 上级组织ID
        Manager:
          type: integer
          format: int64
          description: 组织负责人的用户ID
        Type:
          type: string
        UserCount:
          type: integer
          format: int32
          description: 组织中的用户数量，包括所有下级组织。
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
    LocationModelListResponseMessage:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/LocationModel'
          description: 地点数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    LocationModelResponseMessage:
      type: object
      properties:
        Data:
          $ref: '#/components/schemas/LocationModel'
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
    LocationRequest:
      type: object
      properties:
        Code:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        Manager:
          type: integer
          format: int64
        Phone:
          type: string
          nullable: true
        Address:
          type: string
          nullable: true
    LocationModel:
      type: object
      properties:
        ID:
          type: integer
          format: int64
        Code:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        Manager:
          type: integer
          format: int64
        Phone:
          type: string
          nullable: true
        Address:
          type: string
          nullable: true
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
      additionalProperties: false
    UserGroupRequest:
      type: object
      properties:
        Name:
          type: string
          nullable: true
        Description:
          type: string
          nullable: true
    PositionRequest:
      type: object
      properties:
        Name:
          type: string
          description: 岗位名称
          nullable: true
        UserIDs:
          type: array
          description: 用户ID数组
          items:
            type: integer
            format: int64
          nullable: true
      additionalProperties: false
    PositionModelListResponse:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/PositionModel'
          description: 岗位数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    PositionModel:
      type: object
      properties:
        ID:
          type: integer
          format: int64
        Name:
          type: string
          nullable: true
        IsSystem:
          type: boolean
          description: 是否系统集成岗位
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
      additionalProperties: false
    PositionUsersRequest:
      type: object
      properties:
        UserIDs:
          type: array
          items:
            type: integer
            format: int64
          nullable: true
          description: 用户ID数组
        TargetID:
          type: integer
          format: int64
          description: 根据绑定类型，如果2，是组织ID，如果3，是地点ID。如果1，不填或者0。
        BindingType:
          $ref: '#/components/schemas/PositionBindingType'
      additionalProperties: false
    PositionBindingType:
      enum:
        - 1
        - 2
        - 3
      type: integer
      format: int32
      description: |
        * `1` - 岗位自身
        * `2` - 组织岗位
        * `3` - 地点岗位
    PositionAssignmentResponse:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/PositionAssignmentModel'
          description: 岗位分配数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    PositionAssignmentModel:
      type: object
      properties:
        UserID:
          type: integer
          format: int64
        PositionID:
          type: integer
          format: int64
        TargetID:
          type: integer
          format: int64
        BindingType:
          $ref: '#/components/schemas/PositionBindingType'
      additionalProperties: false
    ServicePortalUserInfo:
      type: object
      properties:
        AccountID:
          type: integer
          format: int64
        Name:
          type: string
        Email:
          type: string
        LastLoginTime:
          type: string
          format: date-time
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
      additionalProperties: false
    ServicePortalUserInfoListResponse:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/ServicePortalUserInfo'
          description: 用户数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    ServicePortalUserRequest:
      required:
        - Email
        - Name
      type: object
      properties:
        Name:
          type: string
        Email:
          type: string
        Password:
          type: string
          nullable: true
        SendInviteMail:
          type: boolean
        GroupIDs:
          type: array
          description: 服务门户的组ID数组
          items:
            type: integer
            format: int64
          nullable: true
      additionalProperties: false
    ServicePortalGroupListResponse:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/IdentityModelResponse'
          description: 组信息数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    IdentityModelResponse:
      type: object
      properties:
        ID:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        Type:
          $ref: '#/components/schemas/IdentityTypeEnum'
        Attr:
          type: object
          additionalProperties:
            type: object
            additionalProperties: false
          nullable: true
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
      additionalProperties: false
    IdentityTypeEnum:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 9
        - 999
      type: integer
      format: int32
      description: |
        * `1` - User 用户
        * `2` - Department 组织
        * `3` - Group 组
        * `4` - Position 岗位
        * `5` - Location 地点
        * `6` - SPSecurityGroup
        * `7` - SPSiteGroup
        * `8` - SPUser
        * `9` - CostCenter
        * `10` - Project
    GroupInfoListResponse:
      type: object
      properties:
        Data:
          type: array
          items:
            $ref: '#/components/schemas/GroupInfo'
          description: 组信息数组
          nullable: true
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
        TotalCount:
          $ref: '#/components/schemas/TotalCount'
      additionalProperties: false
    GroupInfo:
      type: object
      properties:
        ID:
          type: integer
          format: int64
        Name:
          type: string
          nullable: true
        Description:
          type: string
          nullable: true
        Created:
          $ref: '#/components/schemas/Created'
        Modified:
          $ref: '#/components/schemas/Modified'
        CreatedBy:
          $ref: '#/components/schemas/CreatedBy'
        ModifiedBy:
          $ref: '#/components/schemas/ModifiedBy'
      additionalProperties: false
    ServicePortalGroupRequest:
      required:
        - Name
      type: object
      properties:
        Name:
          maxLength: 100
          minLength: 1
          type: string
        Description:
          type: string
          nullable: true
      additionalProperties: false
    Int32ResponseMessage:
      type: object
      properties:
        Data:
          type: integer
          description: 数字
          format: int32
        Status:
          $ref: '#/components/schemas/Status'
        Message:
          $ref: '#/components/schemas/Message'
      additionalProperties: false
    PortalID:
      type: integer
      format: int32
      description: 服务门户ID
    GroupID:
      type: integer
      format: int64
      description: 组ID
    UserID:
      type: integer
      format: int64
      description: 用户ID
    SearchUsersRequest:
      type: object
      properties:
        PageIndex:
          $ref: '#/components/schemas/PageIndex'
        PageSize:
          $ref: '#/components/schemas/PageSize'
        SearchKey:
          type: string
          nullable: true
        OrgID:
          type: integer
          format: int64
          description: 组织ID
        Sorts:
          type: array
          items:
            $ref: '#/components/schemas/ListDataSortRequest'
          nullable: true
        Status:
          $ref: '#/components/schemas/UserSearchStatus'
        Wheres:
          type: array
          items:
            $ref: '#/components/schemas/ListDataWhereRequest'
          nullable: true
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      description: |
        API key是开放接口用来认证身份的秘钥。请通过**系统设置** -> **集成** -> **API key**获取您的专属秘钥。        
        
        您可以通过两种方式使用apiKey：
        1. 在请求的头中设置参数`apiKey`
        2. 在请求的URL中附加apiKey。例如：/lists/{appID}/{listID}?apiKey={秘钥}

        在页面的自定义代码中使用Open API时，您不需要使用apiKey，页面会使用当前用户的身份请求接口。

        **注意**: apiKey可以用来访问您在易企办中的所有数据，请确保安全保管和使用它。如果您怀疑当前的秘钥有泄露风险，可以通过更新秘钥的功能产生一个新的秘钥并作废当前的。 我们同样不建议您在客户端程序（如JavaScript代码）中直接使用apiKey，因为这样会直接暴露给使用程序的用户。
      type: apiKey
      name: apiKey
      in: header
security:
  - ApiKeyAuth: []
tags:
  - name: Lists
    description: |
      列表是一个类似于数据库的存储空间，可以让您方便的管理业务数据。通过列表接口，您可以查询、添加、修改、删除列表记录。

      试用列表接口时，您会需要`appID`和`listID`。请参看如下的说明来了解如何获取对应的值：
      
      <a id="defAppID" class="defAnchor"></a> `appID`
      
      大多数情况值是 **30**。 流程中心中的列表使用 **41**。
      
      <a id="defListID" class="defAnchor"></a> `listID`
      
      列表ID，你可以在列表的URL中找到。
      
      示例URL, https://{SITE PATH}#/list-set/**30**/1278240778307637248/**1278240778311831552**
      
      其中，`30`是appID `1278240778311831552`是列表ID。

      ## Field types

      易企办的字段（列）有不同的类型，可以让您存储不同的数据在记录中。比如，列表可以包含附件、富文本、多选、查阅项等不同的字段。 下表列举了列表中可能的字段类型。

      | 类型 | 说明 | 示例 |
      | -- | -- | -- |
      | text | 单行文本 | "Prject A" |
      | textarea | 多行文本 | "This is a project.\nHello World!" |
      | richtext | 富文本 | "\<h1\>Hello World\</h1\>" |
      | input_number | 数字 | "3.14" |
      | currency | 货币 | "3.14" |
      | select | 下拉菜单 | "Option 1" |
      | metadata | 元数据 | "1169076697702731776" |
      | mutiple-metadata | 多选元数据，ID数组的JSON字符串 | "["1169076697702731776", "1169076697702731777"]" |
      | switch | 1 为选中或正确, 0 和空为未选中或错误 | "1" |
      | radio | 单选 | "Option 1" |
      | checkbox | 多选，值数组的JSON字符串 | "[\"Option 1\", \"Option 2\"]" |
      | datepicker | 日期字符串 | "2019-11-26 14:26:22" |
      | time | 时间字符串 | "14:26:22" |
      | identity-picker | 用户ID或用户ID数组的JSON字符串 | "1169076697702731776" |
      | department-picker | 组织ID或组织ID数组的JSON字符串 | "1169076697702731776" |
      | location-picker | 地点ID | "1169076697702731776" |
      | cost-center-picker | 成本中心ID或成本中心数据的JSON字符串 | "1169076697702731776" |
      | file-upload\|file-upload-merge  | 附件，附件对象或数组的JSON字符串 | "{"fileKey":"","fileSize":28236,"fileName":"","status":"done","fileInfo":{"FileKey":"","Url":""},"uid":""}" |
      | icon-upload | 图片的URI | "" |
      | lookup | 关联的记录ID | "1169076697702731776" |
      | hyperlink | URL | "https://www.abc.com" |
      | calculated-column | 计算字段 | "1000.0" |
      | tag | 标签数组的JSON字符串 | "[{"TagID":"","TagName":"","Status":1}]" |

      ## Field values
      添加、修改、查询列表记录时，需要传递或获取字段键值对。键值对存储在JSON对象中，字段名称和值分别对应key和value。
      
      字段的值必须是一个JSON字符串。你可以使用类似JavaScript中的`JSON.stringfy`方法将复杂对象转化成字符串。例如：
      ```
      {
        "Title": "Hello World",
        "Text1": "Field 1",
        "Text2": "1169076697702731776",
        "Text3": "[\"Option1\", \"Option2\"]",
        "Bit1": "true",
        "Decimal1": "3.14"
      }
      ```
  - name: Users
    description: |
      系统用户也是一个列表，你可以使用列表的API来查询或更新一个系统用户。 但是你可以对系统用户进行一些特殊的操作，在本节中列出。
  - name: Departments
    description: |
      查询、增加、修改、删除组织信息。
  - name: Locations
    description: |
      查询、增加、修改、删除地点信息。
  - name: Positions
    description: |
      查询、增加、修改、删除岗位信息。
  - name: Groups
    description: |
      查询、增加、修改、删除组信息。
  - name: ServicePortal
    description: |
      服务门户相关的API操作

      当访问服务门户API是，需要提供`Portal ID`。你可以通过服务门户设置首页中找到它：
      
      [门户名称] (ID:`Portal ID`)
  - name: Workflows
    description: |
      流程相关的API接口，包括了任务的处理和代理的设置等。
  - name: Agents
    description: |
      智能体相关API操作
  - name: Files
    description: |
      文件相关API操作
  - name: Webhooks
    description: |
      通过Webhooks可以订阅对象的变更事件。
      
      订阅时需提供回调地址。订阅的事件发生后，系统会将事件主体对象通过POST方法提交到回调地址，超时时长为120秒。事件回调失败后系统将重试2次。

      ## 回调
      **Method**

        POST

      **Header**

        Channel: webhook的Channel属性

        Type: 事件类型

      **Body**

        content: application/json

        schema: 依赖Resource订阅的对象

      ## Resource and Type
      | Resource | Type | 说明 |
      | ---- | ---- | ---- |
      | workflow/tasks | 1 | 任务创建事件 |
      | workflow/tasks | 2 | 任务更新事件 |
      | workflow/tasks | 4 | 任务删除事件 |

      *备注：同时订阅一个Resource的多个Type，可以将Type的值二进制或在一起，比如订阅任务创建和修改事件，Type传3 （1|2)*