openapi: 3.0.0
info:
  version: 2.9.3
  title: Gitee Team
  description: >
    This is the API Specification from Gitee Team.


    # Introduction

    The Gitee Team **OpenAPI** can be used by 3rd party Applications and System
    Integrations.


    # Cross-Origin Resource Sharing

    This API features Cross-Origin Resource Sharing (CORS) implemented in
    compliance with  [W3C spec](https://www.w3.org/TR/cors/).

    And that allows cross-domain communication from the browser.

    All responses have a wildcard same-origin which makes them completely public
    and accessible to everyone, including any code on any site.


    # Authentication

    Gitee Team offers two forms of authentication:
      - API Token
      - Session Token

    <SecurityDefinitions />
  contact:
    email: yezhiming@oschina.cn
servers:
  - url: https://ru.gitee.work/project/api/parse/
    description: Ru server
tags:
  - name: workspace
    description: Workspace related APIs
    x-displayName: Workspace
  - name: search
    description: Item search apis
    x-displayName: Search
  - name: item
    description: Item related apis
    x-displayName: Item
  - name: workflow
    description: Workflow
    x-displayName: Workflow
  - name: security-level
    description: Item security level
  - name: user
    description: User related
  - name: permission
    description: Permissions
  - name: field-behavior
    description: Field behavior
  - name: export
    description: Export item
  - name: board
    description: Board
  - name: app
    description: App
  - name: report
    description: Report
  - name: automation
    description: Automation
  - name: system
    description: System
security:
  - X-Proxima-API-Token: []
  - X-Parse-Session-Token: []
components:
  securitySchemes:
    X-Parse-Session-Token:
      type: apiKey
      name: X-Parse-Session-Token
      in: header
      description: Session Token for frontend usage
    X-Proxima-API-Token:
      type: apiKey
      name: X-Proxima-API-Token
      in: header
      description: API Token for 3rd party development
  parameters:
    TenantKey:
      name: X-Parse-Application-Id
      in: header
      description: Tenant key
      required: true
      schema:
        type: string
    IdOrKey:
      name: idOrKey
      in: path
      description: Object Id or Key
      required: true
      schema:
        type: string
  schemas:
    IQLRequest:
      type: object
      required:
        - iql
        - from
        - size
      properties:
        iql:
          type: string
          description: IQL query string
          example: order by createdAt
        from:
          type: number
          description: skip size for pagination
        size:
          type: number
          description: fetch size
          example: 20
    IQLResponse:
      type: object
      properties:
        payload:
          type: object
          properties:
            count:
              type: number
            items:
              type: array
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: number
        error:
          type: string
          description: The error message
    Pointer:
      type: object
      required:
        - __type
        - className
        - objectId
      properties:
        __type:
          type: string
          enum:
            - Pointer
        objectId:
          type: string
        className:
          type: string
    ItemObject:
      type: object
      required:
        - workspace
        - itemType
      properties:
        name:
          type: string
        ancestors:
          type: array
          items:
            type: string
        workspace:
          allOf:
            - $ref: '#/components/schemas/Pointer'
            - type: object
              properties:
                className:
                  type: string
                  enum:
                    - Workspace
        itemType:
          allOf:
            - $ref: '#/components/schemas/Pointer'
            - type: object
              properties:
                className:
                  type: string
                  enum:
                    - ItemType
        itemGroup:
          allOf:
            - $ref: '#/components/schemas/Pointer'
            - type: object
              properties:
                className:
                  type: string
                  enum:
                    - ItemGroup
        values:
          type: object
    workspacePages:
      type: array
      items:
        type: object
        properties:
          title:
            type: string
          key:
            type: string
          boardKey:
            type: string
          icon:
            type: string
    workspaceDetail:
      type: object
      properties:
        boardGroups:
          type: array
        itemTypes:
          type: array
        workspace:
          type: object
        workspaceAuth:
          type: object
          properties:
            hasMemberAuth:
              type: boolean
            hasManageAuth:
              type: boolean
    StructureRequest:
      type: object
      properties:
        iql:
          type: string
        from:
          type: number
        size:
          type: number
        isShowAncestors:
          type: boolean
        isShowDescendants:
          type: boolean
        workspaceIdOrFilterId:
          type: string
    StructureResponse:
      type: object
      properties:
        depths:
          type: array
        hitIds:
          type: array
        rows:
          type: array
paths:
  /api/menu/:workspaceKey/workspacePage:
    get:
      tags:
        - workspace
      summary: Get workspacePages of a workspace as menu
      responses:
        '200':
          description: Return an array of workspacePages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workspacePages'
  /api/workspaces/:workspaceKey:
    get:
      tags:
        - workspace
      summary: Get workspace detail by workspaceKey
      responses:
        '200':
          description: Return an object describes the workspace configurations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workspaceDetail'
  /api/search:
    post:
      tags:
        - search
      summary: Search Item by IQL(Item Query Language)
      parameters:
        - $ref: '#/components/parameters/TenantKey'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IQLRequest'
      responses:
        '200':
          description: Return query results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IQLResponse'
  /api/search/hierarchy:
    post:
      tags:
        - search
      summary: Search Item by IQL with hierarchy
  /api/search/structure:
    post:
      tags:
        - search
      summary: Search Item by IQL with infinite hierarchy
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StructureRequest'
      responses:
        '200':
          description: Return structure results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructureResponse'
  /api/autocompletedata:
    get:
      tags:
        - search
      summary: Get autocomplete data
  /api/autocompletedata/suggestions:
    get:
      tags:
        - search
      summary: Get autocomplete suggestions
  /api/items/:id:
    get:
      tags:
        - item
      summary: Get item
    put:
      tags:
        - item
      summary: Edit item
  /api/items:
    post:
      tags:
        - item
      summary: Create an item
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemObject'
      responses:
        '201':
          description: Creation of an Item successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemObject'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /api/items/clone:
    post:
      tags:
        - item
      summary: Clone item
  /api/items/updateAncestor:
    post:
      tags:
        - item
      summary: Update item ancestor
  /api/items/:id/quickEdit:
    put:
      tags:
        - item
      summary: Quick edit item
  /api/items/bulk:
    post:
      tags:
        - item
      summary: Bulk create item
    delete:
      tags:
        - item
      summary: Bulk delete item
  /api/items/transition:
    post:
      tags:
        - workflow
      summary: Bulk item transition
  /api/items/{key}/watchers:
    post:
      tags:
        - item
      summary: Watch item
      parameters:
        - $ref: '#/components/parameters/IdOrKey'
    delete:
      tags:
        - item
      summary: UnWatch item
      parameters:
        - $ref: '#/components/parameters/IdOrKey'
  /api/securityLevel/scheme/{schemeId}:
    get:
      tags:
        - security-level
      summary: Get workspace list
  /api/securityLevel/workspace/{workspaceId}:
    get:
      tags:
        - security-level
      summary: Get workspace securityLevel
  /api/securityLevel:
    post:
      tags:
        - security-level
      summary: Create securityLevel
  /api/securityLevel/:objectId:
    get:
      tags:
        - security-level
      summary: Get securityLevel
    put:
      tags:
        - security-level
      summary: Update securityLevel
    delete:
      tags:
        - security-level
      summary: Delete securityLevel
  /api/securityLevelScheme:
    post:
      tags:
        - security-level
      summary: Get securityLevelScheme
  /api/securityLevelScheme/:objectId:
    put:
      tags:
        - security-level
      summary: Update securityLevelScheme
    delete:
      tags:
        - security-level
      summary: Delete securityLevelScheme
  /api/securityLevelSchemes:
    get:
      tags:
        - security-level
      summary: Get securityLevelScheme list
  /api/screen:
    get:
      tags:
        - screen
      summary: Get screen by workspace and itemType
  /api/screen/ids:
    get:
      tags:
        - screen
      summary: Get screen Id list by workspace and itemType
  /api/screens:
    get:
      tags:
        - screen
      summary: Get screens
  /api/screen/fields:
    get:
      tags:
        - screen
      summary: Get screen customFields
  /api/workflows:
    post:
      tags:
        - workflow
      summary: get workflows by item list
  /api/workflows/:workflowIdOrName:
    get:
      tags:
        - workflow
      summary: Get workflow by id or key
      parameters:
        - $ref: '#/components/parameters/IdOrKey'
  /api/workflows/:itemId/available-executers:
    get:
      tags:
        - workflow
      summary: Get available executers
      parameters:
        - $ref: '#/components/parameters/IdOrKey'
  /api/workflows/:itemId/available-users:
    get:
      tags:
        - workflow
      summary: Get available user/group/role
      parameters:
        - $ref: '#/components/parameters/IdOrKey'
  /api/permissions/schemes:
    get:
      tags:
        - permission
      summary: Get permission schemes
  /api/permissions/scheme/change:
    post:
      tags:
        - permission
      summary: Change permission schemes
  /api/permissions/scheme/copy:
    post:
      tags:
        - permission
      summary: Copy permission schemes
  /api/permissions/scheme/:schemeId:
    get:
      tags:
        - permission
      summary: Find permission scheme privileges
  /api/permissions/privileges:
    get:
      tags:
        - permission
      summary: Find privileges
    post:
      tags:
        - permission
      summary: Grant privileges
  /api/permissions/privilege/cancel:
    post:
      tags:
        - permission
      summary: Cancel privileges
  /api/permissions/privilege/remove:
    post:
      tags:
        - permission
      summary: Remove privileges
  /api/permissions/keys:
    post:
      tags:
        - permission
      summary: Permission keys
  /api/permissions/current/:workspaceId:
    get:
      tags:
        - permission
      summary: Get user privilege for a workspace
  /api/permissionSchemes:
    get:
      tags:
        - permission
      summary: Get permission schemes
  /api/forest:
    get:
      tags:
        - item
      summary: Get item forest
    post:
      tags:
        - item
      summary: Create item forest
    put:
      tags:
        - item
      summary: Update item forest
  /api/forest/refresh:
    put:
      tags:
        - item
      summary: Refresh item forest
  /api/forest/clean:
    delete:
      tags:
        - item
      summary: Delete item forest
  /api/forest/:objectId:
    put:
      tags:
        - item
      summary: Update forest item
  /api/fieldBehavior/configFields:
    get:
      tags:
        - field-behavior
      summary: configFields
  /api/fieldBehavior/conditionFields:
    get:
      tags:
        - field-behavior
      summary: conditionFields
  /api/fieldBehavior/:fieldBehaviorId:
    put:
      tags:
        - field-behavior
      summary: Create field behavior
  /api/fieldBehavior/itemType/:itemTypeId:
    get:
      tags:
        - field-behavior
      summary: c
  /api/fieldBehavior/:fieldBehaviorId/fields:
    get:
      tags:
        - field-behavior
      summary: c
  /api/fieldBehaviorSetting/:fieldBehaviorSettingId/field:
    get:
      tags:
        - field-behavior
      summary: c
  /api/export/excel:
    post:
      tags:
        - export
      summary: Export Excel
  /api/board/{idOrKey}:
    get:
      tags:
        - board
      summary: Get board
      parameters:
        - $ref: '#/components/parameters/IdOrKey'
      responses:
        '200':
          description: success
  /api/board/privileges/:workspace:
    get:
      tags:
        - board
      summary: get view privilege
  /api/board/privilege/browser:
    post:
      tags:
        - board
      summary: get browser privilege
  /api/board/:board/privilege:
    post:
      tags:
        - board
      summary: grant board privilege
  /api/board/:board/cancelPrivilege:
    post:
      tags:
        - board
      summary: cancel board privilege
  /api/board/:board/removePrivilege:
    post:
      tags:
        - board
      summary: remove board privilege
  /api/board/:board/privileges:
    get:
      tags:
        - board
      summary: fetch board privileges
  /api/board/policies/{workspace}:
    get:
      tags:
        - board
      summary: fetch board policies for workspace
  /api/board/policy:
    post:
      tags:
        - board
      summary: add board policy
    delete:
      tags:
        - board
      summary: delete board policy
  /api/boardGroups:
    get:
      tags:
        - board
      summary: fetch board groups
  /api/apps/{appId}:
    post:
      tags:
        - app
      summary: Update Application
      parameters:
        - $ref: '#/components/parameters/IdOrKey'
      responses:
        '200':
          description: success
  /api/apps/modules/{moduleKey}:
    get:
      tags:
        - app
      summary: Get Module Manifest
  /api/apps/{workspaceKey}/modules/{moduleKey}:
    get:
      tags:
        - app
      summary: Get Workspace Modules
  /api/apps/{appKey}/webhooks/{webTriggerKey}:
    get:
      tags:
        - app
      summary: Get web-trigger by key
  /api/apps/uninstall/{appKey}:
    get:
      tags:
        - app
      summary: Uninstall Application
  /api/attachments/:attachmentId:
    get:
      tags:
        - attachment
      summary: Uninstall Application
  /login:
    post:
      tags:
        - user
      summary: User login
  /code:
    get:
      tags:
        - user
      summary: User login captcha
  /register:
    post:
      tags:
        - user
      summary: User register
  /setPassword:
    post:
      tags:
        - user
      summary: Reset password
  /api/roles:
    get:
      tags:
        - user
      summary: Get roles
  /api/roles/tree:
    get:
      tags:
        - user
      summary: Get user roles as tree
  /api/roles/user/:userId:
    get:
      tags:
        - user
      summary: Get user roles
  /api/groups:
    get:
      tags:
        - user
      summary: Get all user groups
    post:
      tags:
        - user
      summary: create user group
  /api/groups/getUsersByGroups:
    post:
      tags:
        - user
      summary: getUsersByGroups
  /api/groups/tree:
    get:
      tags:
        - user
      summary: Fetch user group as tree format
  /api/groups/:userId:
    get:
      tags:
        - user
      summary: Fetch groups for a user
  /api/workspaceRoles:
    get:
      tags:
        - workspace role
      summary: Fetch workspace role
    post:
      tags:
        - workspace role
      summary: Create workspace role
  /api/workspaceRoles/viewRoles:
    get:
      tags:
        - workspace role
      summary: Fetch view role
  /api/workspaceRoles/:workspaceId:
    get:
      tags:
        - workspace role
      summary: Find workspace role by workspace
  /api/chartGroup:
    post:
      tags:
        - report
      summary: create report chart
    get:
      tags:
        - report
      summary: query report chart list
  /api/chartGroup/:chartGroupId:
    put:
      tags:
        - report
      summary: update
  /api/chartGroup/:chartGroupId/duplicate:
    post:
      tags:
        - report
      summary: duplicate report
  /api/chartGroup/:chartGroupId/access:
    get:
      tags:
        - report
      summary: query dashboard
  /api/automation/running/logs:
    get:
      tags:
        - automation
      summary: Get Automation Logs
  /api/automation/running/logs/{id}:
    get:
      tags:
        - automation
      summary: Get Automation Log Item
  /api/automation/scenes/{id}:
    delete:
      tags:
        - automation
      summary: Delete automation scenes
  /api/automation/{id}/moveScenes/{scenes}:
    put:
      tags:
        - automation
      summary: Move automation scenes
  /api/automation/scenes/{id}/toggle/{enabled}:
    post:
      tags:
        - automation
      summary: Enable/disable scenes
  /api/reindexing/refreshIndex:
    post:
      tags:
        - system
      summary: Refresh item index
  /api/system/engine:
    get:
      tags:
        - system
      summary: Get system entity engine version
  /api/system/version:
    get:
      tags:
        - system
      summary: Get system version info
