openapi: 3.0.3
info:
  title: Egnyte Public API Reference
  description: Complete reference for all Egnyte public APIs, grouped by domain.
  version: 1.3.2
  contact:
    name: Egnyte Support
    url: https://helpdesk.egnyte.com/hc/en-us/requests/new
    email: api-support@egnyte.com
servers:
  - url: https://{domain}.egnyte.com/pubapi
    variables:
      domain:
        default: apidemo
        description: Your Egnyte domain
security:
  - BearerAuth: []
paths:
  /v1/ai/agents/list:
    get:
      summary: List agents
      description: Returns all available AI agents configured in the domain.
      operationId: list-agents
      tags:
        - agents
      parameters:
        - name: sortBy
          in: query
          description: Field to sort results by.
          required: false
          schema:
            type: string
            enum:
              - name
              - createdOn
            default: name
        - name: sortOrder
          in: query
          description: Sort direction.
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
      responses:
        '200':
          description: Array of agent objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-agentsResponse200'
              example:
                - agentId: f52a1253-0b4c-4b1f-a1a6-9dafdd3f3097
                  name: llm agent
                  description: llm details
                  status: ACTIVE
                  subType: USER_DEFINED
                  category: GENERIC
                  instruction: llm details
                  createdBy: John Millar
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
        '403':
          description: Forbidden – Agents feature not enabled for this domain.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited – too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/ai/agents/{agentId}/ask:
    post:
      summary: Ask a question to an agent
      description: Submits a question to a specific agent. Returns a requestId to poll for the response. The question field is required; all other fields are optional. Maximum question length is 35,000 characters.
      operationId: ask-agent
      tags:
        - agents
      parameters:
        - name: agentId
          in: path
          description: Unique identifier of the agent.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskRequest'
            example:
              question: Perform the data analysis and prepare a report
      responses:
        '200':
          description: Question submitted. Returns identifiers for polling.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AskResponse'
              example:
                requestId: 12c02713-7e79-4a9a-8802-908d93feaa9d
                conversationId: b5ec8d41-fc7e-4b20-b913-c84614db6a28
        '400':
          description: Bad request – question is missing or too long.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errorMessage: Question is mandatory
                errorCode: QUESTION_MANDATORY
        '401':
          description: Unauthorized – invalid or missing access token.
        '403':
          description: Forbidden – Agents feature not enabled for this domain.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – the specified agentId does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited – too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errorMessage: An unexpected error occurred. Please try again later.
                errorCode: INTERNAL_SERVER_ERROR
  /v1/ai/agents/{agentId}/ask/{requestId}/status:
    get:
      summary: Get agent execution status
      description: Retrieves the status and response of a previously submitted agent question. Poll this endpoint until status is COMPLETED or FAILED.
      operationId: get-agent-ask-status
      tags:
        - agents
      parameters:
        - name: agentId
          in: path
          description: Unique identifier of the agent.
          required: true
          schema:
            type: string
        - name: requestId
          in: path
          description: Unique identifier of the execution request returned by the ask endpoint.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Execution status and optional response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStatusResponse'
              example:
                status: COMPLETED
                responseText: Large Language Models (LLMs) are a type of artificial intelligence...
                citations:
                  - previewUrl: https://www.cloudflare.com/learning/ai/what-is-large-language-model/
                    type: WEB_SEARCH
                lastUpdated: '2025-09-18T10:24:59Z'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
        '403':
          description: Forbidden – Agents feature not enabled for this domain.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – invalid agentId or requestId.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limited – too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/ai/document/{entry-id}/ask:
    post:
      summary: Ask a question about a document
      description: Generates an answer to a question based on the contents of a specific document version.  The `entry-id` in the path identifies the document version.  The request body must include a `question` string and may include an optional `includeCitations` boolean and a `chatHistory` object representing previous messages.
      operationId: ask-document
      tags:
        - ai
      parameters:
        - name: entry-id
          in: path
          description: Unique identifier of the document version
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ask-documentRequest'
            example:
              question: What is the date of Christmas Day in the US in 2025?
              includeCitations: true
              chatHistory:
                messages: []
      responses:
        '200':
          description: AI response with optional citations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AskDocumentResponse'
              example:
                response:
                  text: The provided document.
                citations:
                  - filename: Policy.pdf
                    entryId: 535083b1-383a-4352-b993-77900bf5d98a
                    chunks:
                      - chunkId: '0'
                        text: Policy Renewal Migration Portability
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Document not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/ai/document/{entry-id}/summary:
    post:
      summary: Summarize a document
      description: Generates a concise summary of a document's contents.  The `entry-id` identifies the document version.  The request body may include an optional `chatHistory` object to provide context.
      operationId: summarize-document
      tags:
        - ai
      parameters:
        - name: entry-id
          in: path
          description: Unique identifier of the document version
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/summarize-documentRequest'
            example:
              chatHistory:
                messages: []
      responses:
        '200':
          description: AI generated summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SummaryResponse'
              example:
                response:
                  text: Summary of the document is here
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Document not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/ai/assistant/ask:
    post:
      summary: Ask AI Assistant a question (async)
      description: Sends a question to AI Assistant and immediately returns an executionId. Poll GET /v1/ai/assistant/{executionId}/status to retrieve the answer once processing is complete. The request body must include a question and may optionally include selectedItems, chatHistory, includeCitations, conversationId, mcpSelectionId, and modelDetails. AI Assistant replaces the deprecated /v1/ai/copilot/ask endpoint; note that the response format has changed — the ask response is now asynchronous.
      operationId: ask-assistant
      tags:
        - ai
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ask-assistantRequest'
            example:
              question: Describe the file
              chatHistory:
                messages: []
              selectedItems:
                folders:
                  - id: d57858be-f45b-4ff8-a27b-fc7be30b32f9
                files:
                  - entryId: 308314dd-caff-4eb2-889f-8b3babe420a1
              includeCitations: true
      responses:
        '200':
          description: Async submission accepted — use executionId to poll for the result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssistantAskResponse'
              example:
                conversationId: 2862a232-20ac-4244-8c1e-871b7a539ae2
                executionId: 10cd770f-8b8f-4a76-bf0a-7418dd910fb7
                executionStatus: IN_PROGRESS
                truncated: false
                actions: []
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/ai/assistant/{executionId}/status:
    get:
      summary: Get AI Assistant execution status
      description: Polls for the result of an async AI Assistant request. Call this endpoint after POST /v1/ai/assistant/ask until status is no longer IN_PROGRESS. Returns the answer text, citations, tool calls, and other execution details once complete.
      operationId: get-assistant-status
      tags:
        - ai
      parameters:
        - name: executionId
          in: path
          description: The executionId returned by POST /v1/ai/assistant/ask
          required: true
          schema:
            type: string
        - name: includeCitations
          in: query
          description: Whether to include citations in the response
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: Current execution status and result (if complete)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssistantStatusResponse'
              example:
                status: COMPLETED
                responseText: The provided document shows several premium examples
                thoughts: []
                citations:
                  - filename: Policy.pdf
                    entryId: 535083b1-383a-4352-b993-77900bf5d98a
                    objectId: 52.1e0bffbc-500d-4669-82f9-c984a33813e5
                    previewUrl: /navigate/file/3bf2374e-49ac-45b2-b3b3-b44e0da88597
                    chunks:
                      - chunkId: c590a032-9ac6-467a-aa65-9b58e30bff5b
                        sourceText: Text
                intent: qna
                lastUpdated: 1780660757000
                numToolCalls: 1
                pendingActions: []
                toolCalls:
                  call_abc123:
                    name: search_documents
                    sourceDisplayName: Egnyte
                    toolDisplayName: Document Search
                    thought: Searching for relevant documents
                    input:
                      query: premium examples
                    output: Found 3 relevant documents
                    status: success
                    timestamp: '2025-06-05T10:00:00Z'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Execution not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/ai/copilot/ask:
    post:
      summary: Ask Copilot a question (deprecated)
      description: |-
        **Deprecated.** This endpoint is deprecated and will be removed on September 30, 2026. Use `POST /v1/ai/assistant/ask` instead. Note: the replacement endpoint is **asynchronous** — POST `/assistant/ask` returns an `executionId`, and you must poll `GET /assistant/{executionId}/status` to retrieve the answer, whereas `/copilot/ask` returns the answer synchronously. Until then, `/copilot/ask` remains fully supported for backward compatibility.

        Sends a question to the Egnyte Copilot, which can search across the caller's domain or within selected files and folders.  The request body must include a `question` and may include `selectedItems` (lists of folder IDs and file entry IDs), a `chatHistory` object and an `includeCitations` flag.
      operationId: ask-copilot
      deprecated: true
      tags:
        - ai
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ask-copilotRequest'
            example:
              question: Describe the file
              chatHistory:
                messages: []
              selectedItems:
                folders:
                  - id: d57858be-f45b-4ff8-a27b-fc7be30b32f9
                files:
                  - entryId: 308314dd-caff-4eb2-889f-8b3babe420a1
              includeCitations: true
      responses:
        '200':
          description: AI response with optional citations and conversation id
          headers:
            Deprecation:
              description: Signals that this endpoint is deprecated (RFC 8594)
              schema:
                type: string
                example: 'true'
            Sunset:
              description: Date when this endpoint will be removed (RFC 8594)
              schema:
                type: string
                example: Wed, 30 Sep 2026 00:00:00 GMT
            Link:
              description: URL of the replacement endpoint (RFC 8288)
              schema:
                type: string
                example: </pubapi/v1/ai/assistant/ask>; rel="successor-version"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CopilotAskResponse'
              example:
                response:
                  text: The provided document shows several premium examples
                citations:
                  - filename: Policy.pdf
                    entryId: 535083b1-383a-4352-b993-77900bf5d98a
                    objectId: 52.1e0bffbc-500d-4669-82f9-c984a33813e5
                    previewUrl: /navigate/file/3bf2374e-49ac-45b2-b3b3-b44e0da88597
                    chunks:
                      - chunkId: c590a032-9ac6-467a-aa65-9b58e30bff5b
                        text: Text
                conversationId: c655a318-268c-47d2-b6e0-d53dedd117ef
                deprecationNotice: 'This endpoint is deprecated and will be removed on September 30, 2026. Use POST /pubapi/v1/ai/assistant/ask instead. Note - the replacement endpoint is asynchronous: POST /assistant/ask returns an executionId; poll GET /assistant/{executionId}/status to retrieve the response.'
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/ai/kb/list:
    post:
      summary: List knowledge bases
      description: Returns a paginated list of knowledge bases in the caller's domain.  Sort by `createdOn` or `name` and specify filter criteria such as status (ACTIVE, DELETED or CREATED), createdBy, createdAfter, createdBefore, and flags to include placeholder data, processing statistics and prompts.
      operationId: list-kb
      tags:
        - ai
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/list-kbRequest'
            example:
              sortBy:
                - name
              sortDirection:
                - ASC
              status:
                - ACTIVE
              includePlaceholderData: false
              includeProcessingStatistics: false
              includePrompts: false
      responses:
        '200':
          description: Paginated list of knowledge bases
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KbListResponse'
              example:
                content:
                  - id: a691dcbf-2d97-4420-8b08-720c88809a9e
                    name: KB
                    description: KB description
                    paths:
                      - id: 8804124f-5fb7-476c-846d-10d6c94f7c33
                        folderId: 0f53980d-7a3b-44d7-ae15-42048bacf993
                        path: /Shared/Documents
                        permission: Owner
                        status: ACTIVE
                    status: ACTIVE
                    type: KBA
                    createdBy: Ankesh Katiyar
                    createdByUser:
                      firstName: Ankesh
                      lastName: Katiyar
                      userName: akatiyar@akatiyar
                      userId: 1
                      avatarEosObjectId: ''
                    createdOn: 1738570114257
                    noResponseMessage: ''
                    iconName: add
                    subType: USER_DEFINED
                    progress: 100
                    lastProcessedAt: 1738570336155
                    pathCount: 1
                    prompts: []
                    subStatus: WITHIN_LIMIT
                number: 0
                size: 200
                first: true
                last: true
                empty: false
                numberOfElements: 1
                totalElements: 1
                totalPages: 1
                fileLimit: 10000
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/ai/kb/{kb-id}/ask:
    post:
      summary: Ask a question about a knowledge base
      description: Generates an answer based on the contents of a specific knowledge base.  Provide the KB identifier in the path and a `question` in the request body along with optional `includeCitations` and `chatHistory` fields.
      operationId: ask-kb
      tags:
        - ai
      parameters:
        - name: kb-id
          in: path
          description: Identifier of the knowledge base
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ask-kbRequest'
            example:
              question: How many documents are stored in this KB?
              includeCitations: false
              chatHistory:
                messages: []
      responses:
        '200':
          description: AI response based on the KB
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KbAskResponse'
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Knowledge base not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/hybrid-search:
    post:
      summary: Hybrid semantic and keyword search
      description: Performs a hybrid search combining semantic (vector) and keyword-based retrieval across the caller's domain. Supports filtering by folder path, file types, date ranges, creator, and pagination.
      operationId: hybrid-search
      tags:
        - ai
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/hybrid-searchRequest'
            example:
              query: quarterly revenue report
              semanticWeight: 0.7
              folderPath: /Shared/Finance
              limit: 10
              fileTypes:
                - pdf
                - xlsx
              dateFrom: '2024-01-01'
              dateTo: '2024-12-31'
              page: 0
              size: 20
      responses:
        '200':
          description: Hybrid search results with ranked chunks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HybridSearchResponse'
              example:
                results:
                  - filename: Q4-Revenue.pdf
                    entryId: 535083b1-383a-4352-b993-77900bf5d98a
                    objectId: 52.1e0bffbc-500d-4669-82f9-c984a33813e5
                    chunks:
                      - chunkId: abc123
                        score: 0.95
                        text: Total Q4 revenue was $4.2M
                totalElements: 42
                totalPages: 3
                number: 0
                size: 20
                first: true
                last: false
        '400':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Internal server error
  /v1/audit/logins:
    post:
      summary: Create Login Audit Report
      description: Generates a login audit report for a given date range.
      operationId: createLoginAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginAuditReportRequest'
            example:
              format: json
              date_start: '2019-05-01'
              date_end: '2019-05-20'
              events:
                - logins
                - failed_attempts
              access_points:
                - Web
              users:
                - jsmith
                - kjohnson
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/files:
    post:
      summary: Create File Audit Report
      description: Generates a file audit report for a specified date range. Either `folders` or `file` must be specified.
      operationId: createFileAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileAuditReportRequest'
            example:
              format: json
              date_start: '2019-05-01'
              date_end: '2019-05-20'
              folders:
                - /Shared/Marketing
              transaction_type:
                - download
                - upload
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/permissions:
    post:
      summary: Create Permissions Audit Report
      description: Generates a permissions audit report for specified folders over a date range.
      operationId: createPermissionsAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PermissionsAuditReportRequest'
            example:
              format: json
              date_start: '2019-05-01'
              date_end: '2019-05-20'
              folders:
                - /Shared/Marketing
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/users:
    post:
      summary: Create User Provisioning Audit Report
      description: Generates a user provisioning audit report for specified users and actions within a date range.
      operationId: createUserProvisioningAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              action_type:
                - CREATE
                - PASSWORD_RESET
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/groups:
    post:
      summary: Create Group Provisioning Audit Report
      description: Generates a group provisioning audit report for specified groups and actions within a date range.
      operationId: createGroupProvisioningAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              action_type:
                - CREATE
                - ADD_USERS
              groups:
                - ProjectManagers
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/workgroup-settings:
    post:
      summary: Create Configuration Settings Audit Report
      description: Generates a configuration settings audit report for specified users within a date range.
      operationId: createConfigurationSettingsAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkgroupSettingsAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/workflows:
    post:
      summary: Create Workflow Audit Report
      description: Generates a report on workflow activity including creation, completion, cancellation, step transitions, and task actions.
      operationId: createWorkflowAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              workflow_actions:
                - WORKFLOW_CREATED
                - WORKFLOW_COMPLETED
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/workflow-templates:
    post:
      summary: Create Workflow Templates Audit Report
      description: Generates a report on workflow template changes including creation, editing, and status changes.
      operationId: createWorkflowTemplatesAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowTemplatesAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              workflow_template_actions:
                - TEMPLATE_CREATED
                - TEMPLATE_EDITED
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/quality-docs:
    post:
      summary: Create Quality Docs Audit Report
      description: Generates a report on Quality Docs activity including document actions, training assignments, and status changes.
      operationId: createQualityDocsAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualityDocsAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              quality_docs_actions:
                - DOCUMENT_ADDED
                - DOCUMENT_MODIFIED
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/quality-docs-categories:
    post:
      summary: Create Quality Docs Categories Audit Report
      description: Generates a report on Quality Docs category and subcategory changes.
      operationId: createQualityDocsCategoriesAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualityDocsCategoriesAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              quality_docs_categories_actions:
                - CATEGORY_ADDED
                - CATEGORY_MODIFIED
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/quality-docs-courses:
    post:
      summary: Create Quality Docs Courses Audit Report
      description: Generates a report on Quality Docs training course activity.
      operationId: createQualityDocsCoursesAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualityDocsCoursesAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              quality_docs_courses_actions:
                - COURSE_CREATED
                - COURSE_MODIFIED
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/etmf:
    post:
      summary: Create eTMF Audit Report
      description: Generates a report on electronic Trial Master File (eTMF) activity.
      operationId: createEtmfAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EtmfAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
              etmf_actions:
                - STUDY_CREATED
                - DOCUMENT_ADDED
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/snapshot-restore:
    post:
      summary: Create Snapshot Restore Audit Report
      description: Generates a report on snapshot restore activity including mounting, unmounting, previewing, and restoring snapshots.
      operationId: createSnapshotRestoreAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SnapshotRestoreAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/upload-requests:
    post:
      summary: Create Upload Requests Audit Report
      description: Generates a report on upload request activity including request creation, file uploads, document submissions, and approvals.
      operationId: createUploadRequestsAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadRequestsAuditReportRequest'
            example:
              format: json
              date_start: '2019-08-01'
              date_end: '2019-08-15'
      responses:
        '202':
          description: Report generation initiated successfully.
          headers:
            Location:
              description: URL to poll for job status
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobResponse'
              example:
                id: '12345678'
        '400':
          description: Bad request — missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to run reports.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/jobs/{id}:
    get:
      summary: Check Audit Report Generation Status
      description: |
        Returns the status of an audit report generation job. Poll this endpoint with the job identifier returned when a report is created. Returns HTTP 200 with status "running" while generating; returns HTTP 303 redirect when complete. Poll no more than once every 2 minutes.
      operationId: checkAuditReportStatus
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          description: Job ID returned when creating the report.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Report generation is still in progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobStatusResponse'
              example:
                status: running
        '303':
          description: Report generation complete; the Location header points to the final report.
          headers:
            Location:
              description: URL to retrieve the completed report
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditJobStatusResponse'
              example:
                status: completed
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Job not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/audit/{type}/{id}:
    get:
      summary: Retrieve Audit Report
      description: |
        Downloads a completed audit report of the specified type using the report ID. When the report format is JSON, the offset and count query parameters can be used to paginate events.
      operationId: retrieveAuditReport
      tags:
        - v1-reports
      security:
        - BearerAuth: []
      parameters:
        - name: type
          in: path
          description: |
            Type of audit report to retrieve. One of: logins, files, permissions, users, groups, workgroup-settings, workflows, workflow-templates, quality-docs, quality-docs-categories, quality-docs-courses, etmf, snapshot-restore, upload-requests.
          required: true
          schema:
            type: string
            enum:
              - logins
              - files
              - permissions
              - users
              - groups
              - workgroup-settings
              - workflows
              - workflow-templates
              - quality-docs
              - quality-docs-categories
              - quality-docs-courses
              - etmf
              - snapshot-restore
              - upload-requests
        - name: id
          in: path
          description: Report ID returned when creating the report.
          required: true
          schema:
            type: string
        - name: offset
          in: query
          description: Starting event index (0-based). Applies only to JSON-format reports.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          description: Number of events to return. Applies only to JSON-format reports.
          required: false
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: Audit report retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditReportResponse'
            text/csv:
              schema:
                type: string
                description: CSV-formatted audit report data
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission to retrieve this report.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Report not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v2/audit/stream:
    get:
      summary: Retrieve Audit Events (stream via GET)
      description: |
        Retrieves a stream of audit events occurring within the last seven days. Either startDate or nextCursor is required, but not both. Returns up to 5,000 events and a nextCursor for subsequent requests. Rate limited to 10 requests per minute and 100 requests per hour.
      operationId: streamAuditEventsGet
      tags:
        - v2-stream
      security:
        - BearerAuth: []
      parameters:
        - name: startDate
          in: query
          description: |
            Start of date range. Format: YYYY-MM-DD or ISO 8601 YYYY-MM-DDTHH:MM:SSZ. Must be within the last 7 days. Required if nextCursor is not provided.
          required: false
          schema:
            type: string
        - name: endDate
          in: query
          description: |
            End of date range in YYYY-MM-DD or ISO 8601 YYYY-MM-DDTHH:MM:SSZ format.
          required: false
          schema:
            type: string
        - name: nextCursor
          in: query
          description: Cursor from the previous response. Required if startDate is not provided.
          required: false
          schema:
            type: string
        - name: auditType
          in: query
          description: |
            Filter events by type. Repeat the parameter for multiple types. Defaults to ANY if omitted.
          required: false
          schema:
            type: string
            enum:
              - FILE_AUDIT
              - LOGIN_AUDIT
              - PERMISSION_AUDIT
              - USER_AUDIT
              - GROUP_AUDIT
              - WG_SETTINGS_AUDIT
              - WORKFLOW_AUDIT
              - WORKFLOW_TEMPLATES_AUDIT
              - QUALITY_DOCS_AUDIT
              - QUALITY_DOCS_CATEGORIES_AUDIT
              - QUALITY_DOCS_COURSES_AUDIT
              - ETMF_AUDIT
              - SNAPSHOT_RESTORE_AUDIT
              - ESIGNATURE_AUDIT
              - UPLOAD_REQUESTS_AUDIT
              - AI_SAFEGUARDS_ENTRY_ALLOWED_AUDIT
              - AI_SAFEGUARDS_ENTRY_REJECTED_AUDIT
              - AI_SAFEGUARDS_ENTRY_REPORTED_AUDIT
              - ANY
      responses:
        '200':
          description: Audit events retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditStreamResponse'
              example:
                nextCursor: QmlnVGFibGVLZXk=
                moreEvents: true
                events:
                  - date: 1638921600000
                    auditSource: FILE_AUDIT
                    sourcePath: /Shared/document.pdf
                    user: Jane Smith (jsmith@example.com)
                    action: Download
        '400':
          description: Bad request — invalid or missing startDate/nextCursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission or domain plan does not include audit reporting.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded (10 req/min, 100 req/hr).
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
    post:
      summary: Retrieve Audit Events (stream via POST)
      description: |
        Retrieves a stream of audit events by sending parameters in the request body. Either startDate or nextCursor is required, but not both. Returns up to 5,000 events and a nextCursor for subsequent requests. Rate limited to 10 requests per minute and 100 requests per hour.
      operationId: streamAuditEventsPost
      tags:
        - v2-stream
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuditStreamRequest'
            examples:
              withStartDate:
                summary: Initial request with startDate
                value:
                  startDate: '2021-12-08'
                  endDate: '2021-12-10'
                  auditType:
                    - FILE_AUDIT
                    - LOGIN_AUDIT
              withCursor:
                summary: Subsequent request with cursor
                value:
                  nextCursor: QmlnVGFibGVLZXk=
      responses:
        '200':
          description: Audit events retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditStreamResponse'
              example:
                nextCursor: QmlnVGFibGVLZXk=
                moreEvents: false
                events: []
        '400':
          description: Bad request — invalid or missing startDate/nextCursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — user lacks permission or domain plan does not include audit reporting.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded (10 req/min, 100 req/hr).
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/bookmarks:
    post:
      summary: Create Bookmark
      description: Creates a new bookmark on a folder. Supply either path to the folder to be bookmarked or folder_id (UUID).
      operationId: createBookmark
      requestBody:
        description: JSON object with either path or folder_id.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createBookmarkRequest'
            examples:
              byPath:
                value:
                  path: /Shared/Documents/MyPictures
              byFolderId:
                value:
                  folder_id: FOLDER_UUID
      responses:
        '200':
          description: Bookmark created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookmarkObject'
              example:
                id: 5468
                path: /Shared/Documents/MyPictures
                folder_id: 3edcb54a-93d4-4c31-9f39-4607721d0e12
                creation_date: 2016-06-02T11:36:01.000+0000
        '400':
          description: 'Invalid request: provide either path or folder_id, not both.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Folder does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
      tags:
        - bookmarks
    get:
      summary: List Bookmarks
      description: Lists all bookmarks for the authenticated user. Optional query parameters offset and count may be used for pagination.
      operationId: listBookmarks
      parameters:
        - name: offset
          in: query
          description: Start listing with the nth bookmark.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          description: Limit the number of bookmarks returned.
          required: false
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: A list of bookmarks is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookmarkListResponse'
              example:
                offset: 0
                count: 2
                bookmarks:
                  - id: 14455
                    path: /Shared/My Folder/Pictures
                    folder_id: 0344c35b-1341-4b78-8b85-602d9737dba78
                    creation_date: 2016-06-06T17:47:30.000+0000
                  - id: 14453
                    path: /Shared/MyDocuments
                    folder_id: ff004fae-f861-419d-a283-97e6d3b5da0b
                    creation_date: 2016-06-06T17:45:59.000+0000
        '400':
          description: Bad request – invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Developer inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
      tags:
        - bookmarks
  /v1/bookmarks/{id}:
    get:
      summary: Get Bookmark by ID
      description: Retrieves the details for a specific bookmark.
      operationId: getBookmark
      parameters:
        - name: id
          in: path
          description: The bookmark identifier.
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Bookmark details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookmarkObject'
              example:
                id: 14455
                path: /Shared/My Folder/Pictures
                folder_id: 0344c35b-1341-4b78-8b85-602d9737dba78
                creation_date: 2016-06-06T17:47:30.000+0000
        '400':
          description: Bad request – invalid ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Bookmark not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
      tags:
        - bookmarks
    delete:
      summary: Delete Bookmark
      description: Deletes a bookmark by id.
      operationId: deleteBookmark
      parameters:
        - name: id
          in: path
          description: The identification tag for the bookmark that should be deleted.
          required: true
          schema:
            type: integer
      responses:
        '204':
          description: Bookmark deleted successfully.
        '400':
          description: Bad request – invalid ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Bookmark not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
      tags:
        - bookmarks
  /v1/notes:
    post:
      summary: Add Comment
      description: Creates a new comment on a file or folder. Requires path and body in the request.
      operationId: addComment
      requestBody:
        description: JSON payload specifying the path to the file or folder and the text of the comment.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/addCommentRequest'
            example:
              path: /Shared/Documents/form.docx
              body: Test comment
      responses:
        '200':
          description: Comment created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteObject'
              example:
                id: 4fbba2ef-fb2f-4c54-9392-116f07e39b97
                message: Test comment
                username: asmith
                can_delete: true
                creation_time: 2016-05-18T17:56:39.975+0000
                formatted_name: Anna Smith
                file_path: /Shared/Documents/testdoc.docx
                group_id: 628ceb16-b9a0-49f8-a0e4-72b72970f871
        '400':
          description: Unparsable JSON or unsupported property.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Developer inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: User does not have sufficient privileges or the file does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error.
      tags:
        - comments
    get:
      summary: List Comments
      description: Lists all comments for a given file or, if file is omitted and the caller is an admin, lists all comments for the domain.
      operationId: listComments
      parameters:
        - name: file
          in: query
          description: URL encoded path to the item for which you want to see the comments. If omitted, all comments for the domain are returned (admin only).
          required: false
          schema:
            type: string
        - name: start_time
          in: query
          description: Return comments after this ISO 8601 timestamp.
          required: false
          schema:
            type: string
        - name: end_time
          in: query
          description: Return comments before this ISO 8601 timestamp.
          required: false
          schema:
            type: string
        - name: count
          in: query
          description: Number of results to return. Maximum 100; defaults to 25.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: offset
          in: query
          description: Zero-based index used to paginate the list of comments. Defaults to 0.
          required: false
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: A list of comments is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteListResponse'
              example:
                total_results: 2
                count: 2
                offset: 0
                notes:
                  - id: 4fbba2ef-fb2f-4c54-9392-116f07e39b97
                    message: Test comment
                    username: asmith
                    can_delete: true
                    creation_time: 2016-05-18T17:56:39.975+0000
                    formatted_name: Anna Smith
                    file_path: /Shared/Documents/testdoc.docx
                    group_id: 628ceb16-b9a0-49f8-a0e4-72b72970f871
        '400':
          description: Bad request – invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Developer inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error.
      tags:
        - comments
  /v1/notes/{UUID}:
    get:
      summary: Show Comment
      description: Retrieves the details for a specific comment.
      operationId: getComment
      parameters:
        - name: UUID
          in: path
          description: The ID for the desired comment.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Comment details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteObject'
              example:
                id: a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8
                message: Test comment 2
                username: asmith
                can_delete: true
                creation_time: 2016-05-18T18:06:26.000+0000
                formatted_name: Anna Smith
                file_path: /Shared/Documents/testdoc.docx
                group_id: 628ceb16-b9a0-49f8-a0e4-72b72970f871
        '400':
          description: Bad request – invalid UUID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Developer inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: User does not have sufficient privileges or the comment does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Comment not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error.
      tags:
        - comments
    delete:
      summary: Delete Comment
      description: Deletes a specific comment by UUID.
      operationId: deleteComment
      parameters:
        - name: UUID
          in: path
          description: The identification tag for the comment that should be deleted.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Comment deleted successfully.
        '400':
          description: Bad request – invalid UUID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Developer inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: User does not have sufficient privileges or the comment does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Comment not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error.
      tags:
        - comments
  /pubapi/v1/controlled-docs/documents/import:
    post:
      summary: Import a Document
      description: |
        Import a new document or a new version of an existing document into the Controlled Document Management app. Requires Admin or Category Manager role.
      operationId: importDocument
      tags:
        - Documents
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportDocumentRequest'
            example:
              docId: SOP-1
              name: Change Management SOP
              isDraft: false
              version: '1.0'
              entryId: f450227d-044c-45b5-9dbb-c1120a856b81
              responsibleDepartment: Clinical
              effectiveFromDate: '2023-01-22'
              effectiveToDate: '2024-01-21'
              approvedOn: '2022-12-17'
      responses:
        '201':
          description: Document imported successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResponse'
              example:
                id: f450227d-044c-45b5-9dbb-c1120a856b81
        '400':
          description: Bad request — validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — caller lacks permission for this category
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — entryId does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict — document version or identifier already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /pubapi/v1/controlled-docs/assignments/import:
    post:
      summary: Import Training Assignments
      description: |
        Import training assignment records into the Controlled Document Management app. The system automatically calculates the training assignment status based on dueDate, completedDate, and canceledDate. Requires Admin or Category Manager role.
      operationId: importTrainingAssignment
      tags:
        - Assignments
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportAssignmentRequest'
            example:
              assigneeId: 11
              docId: SOP-1
              version: '1.0'
              assignedDate: '2023-01-22T14:00:00Z'
              dueDate: '2023-02-22'
              completedDate: '2023-01-27T16:22:07Z'
              assignedById: 22
      responses:
        '201':
          description: Training assignment imported successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResponse'
              example:
                id: e250227d-044c-45b5-9dbb-c1120a856b84
        '400':
          description: Bad request — validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — caller lacks permission for this category
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — referenced document not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict — operation not allowed (e.g. obsolete document)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /pubapi/v1/document-portal/workspaces:
    get:
      summary: List Workspaces
      description: |
        Retrieve a list of all workspaces in your Egnyte domain. Requires the `Egnyte.documentportal` OAuth scope.
      operationId: listWorkspaces
      tags:
        - Workspaces
      security:
        - BearerAuth: []
      responses:
        '200':
          description: List of workspaces returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspacesListResponse'
              example:
                count: 1
                results:
                  - id: ae898c78-c1e8-4d99-aea0-f7538d085ae4
                    name: Acme Enterprises
                    type: Client
                    status: ACTIVE
                    taskCount: 0
                    creator:
                      id: 1
                      username: jsmith
                      email: jsmith@example.com
                      firstName: Jane
                      lastName: Smith
        '400':
          description: Bad request — invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.documentportal scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
    post:
      summary: Create Workspace
      description: |
        Create a new workspace from an existing folder, from a template, or as a blank workspace. Requires the `Egnyte.documentportal` OAuth scope.
        Exactly one of the following field combinations is required in the request body:
        - **From existing folder**: `workspaceFolderId` - **Blank workspace**: `workspaceParentFolderId` - **From template**: `workspaceParentFolderId` + `workspaceTemplateId` (optionally with `variables`)
      operationId: createWorkspace
      tags:
        - Workspaces
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceRequest'
            examples:
              fromExistingFolder:
                summary: Create from existing folder
                value:
                  name: Acme Enterprises
                  status: ACTIVE
                  type: Client
                  workspaceFolderId: 21dd19b3-8c28-4229-88a7-eae44f8768f5
              blankWorkspace:
                summary: Create blank workspace
                value:
                  name: Acme Enterprises
                  status: ACTIVE
                  type: Client
                  workspaceParentFolderId: 4e6173b7-fe20-411d-ba2a-a005d58154c8
              fromTemplate:
                summary: Create from template with variables
                value:
                  name: Acme Enterprises
                  status: ACTIVE
                  type: Client
                  workspaceParentFolderId: 4e6173b7-fe20-411d-ba2a-a005d58154c8
                  workspaceTemplateId: 0ee1f7ff-39cc-44ea-a12d-3c8477736d93
                  variables:
                    - name: Account Manager
                      value:
                        - 123
                    - name: Clients
                      value:
                        - 234
                        - 235
      responses:
        '201':
          description: Workspace created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWorkspaceResponse'
              example:
                id: e250227d-044c-45b5-9dbb-c1120a856b84
        '400':
          description: Bad request — missing required fields or invalid field combination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.documentportal scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — specified folder ID, template ID, or workspace does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /pubapi/v1/document-portal/settings:
    get:
      summary: Get Document Portal Settings
      description: |
        Retrieve Document Portal configuration settings, including available workspace types. Requires the `Egnyte.documentportal` OAuth scope.
      operationId: getSettings
      tags:
        - Settings
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Document Portal settings returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsResponse'
              example:
                workspaceTypes:
                  - Client
                  - Vendor
                  - Partner
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.documentportal scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v2/navigate:
    post:
      summary: Launch a Navigate session (v2)
      description: Generates a one‑time URL that loads either the full Egnyte Web UI or an embedded view. The URL is valid for a single use and will return 404 if reused.
      operationId: navigate-post-v2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/navigate-post-v2Request'
            example:
              embedded: true
              path: /Shared/Projects/Project Alpha
      responses:
        '200':
          description: Redirect URL returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NavigateResponse'
              example:
                redirect: https://apidemo.egnyte.com/navigate/temp/2c7e1b8b-d6bf-46f3-b8f1-96a937555099
        '400':
          description: Bad request – invalid path or missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the token does not have the Egnyte.launchwebsession scope, or the authenticated user does not have permission to access the specified path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - navigate
  /v1/navigate/embedded/{scope}:
    post:
      summary: Launch a Navigate session (v1 – deprecated)
      description: Generates a one‑time redirect URL via an HTTP 303 response. The URL is returned in the `Location` header of the response. The client must not follow redirects automatically.
      operationId: navigate-post-v1
      parameters:
        - name: scope
          in: path
          description: Scope of the resources to open, such as `home` or `folder/Shared/test`.
          required: true
          schema:
            type: string
      responses:
        '303':
          description: See Other – the response contains a `Location` header with a one‑time redirect URL.
          headers:
            Location:
              description: One-time redirect URL for the Egnyte Web UI session
              schema:
                type: string
                format: uri
        '400':
          description: Bad request – invalid scope or path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the token does not have the Egnyte.launchwebsession scope, or the authenticated user does not have permission to access the specified path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - navigate
  /v1/etmf/studies:
    get:
      summary: List Studies
      description: Returns a list of studies the current user has access to. Requires the `Egnyte.etmf` OAuth scope.
      operationId: listStudies
      security:
        - BearerAuth: []
      responses:
        '200':
          description: A list of studies is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudiesResponse'
              example:
                studies:
                  - systemId: eee92526-53ce-45be-bdce-7263567c9e78
                    id: DEM-81
                    name: Demo 81 Study
                    description: Acme Tx is conducting a study to evaluate the impact of DEM-81 on...
                    status: ACTIVE
        '400':
          description: Invalid request or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.etmf scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
      tags:
        - etmf
  /v1/etmf/studies/{studyId}/filing-levels:
    get:
      summary: List Filing Levels
      description: Returns a list of filing levels the current user has access to for a given study. Requires the `Egnyte.etmf` OAuth scope.
      operationId: listFilingLevels
      security:
        - BearerAuth: []
      parameters:
        - name: studyId
          in: path
          description: The system ID of the study.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Filing levels returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilingLevelsResponse'
              example:
                trial:
                  systemId: 2f47005e-76d1-42e7-857c-926ca5723e18
                  status: ACTIVE
                  countries:
                    - systemId: 5ccfd52a-75f9-49c5-b2e0-177862699ed0
                      code: POL
                      status: ACTIVE
                      sites:
                        - systemId: ab650679-ac09-4e1e-afd9-13de225ec4af
                          id: WAW_01
                          status: ACTIVE
        '400':
          description: Invalid request or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.etmf scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Study not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
      tags:
        - etmf
  /v1/etmf/studies/{studyId}/artifacts:
    get:
      summary: List Artifacts and Milestones
      description: Returns a list of artifacts and milestones for a specific filing level. Requires the `Egnyte.etmf` OAuth scope.
      operationId: listArtifacts
      security:
        - BearerAuth: []
      parameters:
        - name: studyId
          in: path
          description: The system ID of the study.
          required: true
          schema:
            type: string
        - name: filingLevel
          in: query
          description: The type of filing level (trial, country or site).
          required: true
          schema:
            type: string
            enum:
              - trial
              - country
              - site
        - name: filingLevelId
          in: query
          description: The system ID of the filing level.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Artifacts and milestones returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactsResponse'
              example:
                artifacts:
                  - referenceModelArtifactId: '001'
                    number: 01.01.01
                    name: Trial Master File Plan
                    isUnblinded: false
                    milestoneNumber: 2
                milestones:
                  - id: aa9b50b7-f8ad-4cdd-a401-a6d23ee06568
                    name: Clinical Infrastructure Ready
                    number: 2
                    status: ACTIVE
        '400':
          description: Invalid request or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.etmf scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Study or filing level not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
      tags:
        - etmf
  /v1/etmf/studies/{studyId}/documents/listing:
    post:
      summary: List Documents
      description: Returns a list of documents for a specific filing level. Requires the `Egnyte.etmf` OAuth scope.
      operationId: listDocuments
      security:
        - BearerAuth: []
      parameters:
        - name: studyId
          in: path
          description: The system ID of the study.
          required: true
          schema:
            type: string
        - name: filingLevel
          in: query
          description: |
            The type of filing level (TRIAL, COUNTRY or SITE). Deprecated as a query parameter — use the request body `filingLevel.type` field instead. If both are provided, the request body value takes precedence.
          required: false
          schema:
            type: string
            enum:
              - TRIAL
              - COUNTRY
              - SITE
        - name: filingLevelId
          in: query
          description: |
            The system ID of the filing level. Deprecated as a query parameter — use the request body `filingLevel.systemId` field instead. If both are provided, the request body value takes precedence.
          required: false
          schema:
            type: string
        - name: zone
          in: query
          description: |
            Filter by zone number and name (e.g., `02 Central Trial Documents`). If also provided in the request body, the request body value takes precedence.
          required: false
          schema:
            type: string
        - name: artifact
          in: query
          description: |
            Filter by artifact number and name (e.g., `02.01.01 Investigator's Brochure`). If also provided in the request body, the request body value takes precedence.
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: |
            Filter by document status. If also provided in the request body, the request body value takes precedence.
          required: false
          schema:
            type: string
            enum:
              - DRAFT
              - IN_QC
              - APPROVED
              - REJECTED
        - name: limit
          in: query
          description: |
            Maximum number of documents returned (default 20, max 200). If also provided in the request body, the request body value takes precedence.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 20
        - name: offset
          in: query
          description: |
            Zero-based index of the first document returned. If also provided in the request body, the request body value takes precedence.
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
      requestBody:
        description: JSON payload specifying the filing level and optional filters.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListDocumentsRequest'
            example:
              filingLevel:
                type: SITE
                systemId: b53884cf-2bc0-4830-abba-a54c67c25a65
              zone: 02 Central Trial Documents
              artifact: 02.01.01 Investigator's Brochure
              status: DRAFT
              limit: 100
              offset: 0
      responses:
        '200':
          description: Documents returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsListResponse'
              example:
                documents:
                  - studyId: ab650679-ac09-4e1e-afd9-13de225ec4af
                    id: ab650679-ac09-4e1e-afd9-13de225ec4af
                    artifact:
                      artifactNumber: 02.01.01
                      artifactName: Investigator's Brochure
                      sectionNumber: '02.01'
                      sectionName: Product and Trial Documentation
                      zoneNumber: '02'
                      zone: Central Trial Documents
                      referenceModelArtifactId: '31'
                      isUnblinded: false
                    milestone:
                      name: Clinical Infrastructure Ready
                      number: 2
                      id: 45f8cb40-0d8e-4f82-89c3-3708e4b0210d
                    filingLevel:
                      type: TRIAL
                    file:
                      name: Investigator Brochure v1 - 2024-02-14.docx
                      entryId: 17c79408-6faf-4ba4-8be1-0b77a7511e60
                      groupId: aa5f47a4-4a02-425b-88ec-dcbe7fa7c2c2
                    qualityControl:
                      dueOn: '2025-04-12T14:08:14.812Z'
                      status: DRAFT
                offset: 0
                hasMore: true
        '400':
          description: Invalid request or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.etmf scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Study or filing level not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
      tags:
        - etmf
  /v1/etmf/studies/{studyId}/documents:
    post:
      summary: Add Documents
      description: Adds a document to a study. The document must already exist in the Egnyte file system. Requires the `Egnyte.etmf` OAuth scope.
      operationId: addDocument
      security:
        - BearerAuth: []
      parameters:
        - name: studyId
          in: path
          description: The system ID of the study.
          required: true
          schema:
            type: string
        - name: filingLevel.type
          in: query
          description: The type of filing level (TRIAL, COUNTRY or SITE).
          required: true
          schema:
            type: string
            enum:
              - TRIAL
              - COUNTRY
              - SITE
        - name: filingLevel.systemId
          in: query
          description: The system ID of the filing level the document should be added to.
          required: true
          schema:
            type: string
      requestBody:
        description: JSON payload specifying the classification of the document and the source file.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddDocumentRequest'
            example:
              filingLevel:
                systemId: aa9b50b7-f8ad-4cdd-a401-a6d23ee06568
                type: TRIAL
              classification:
                referenceModelArtifactId: '001'
                milestoneId: c8cfa0dd-dda3-4089-962d-3d33bb6ae448
              sourceFile:
                groupId: 35ed2e11-35e8-4712-b78f-98aceb780ef8
      responses:
        '200':
          description: Document added successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDocumentResponse'
              example:
                id: aa9b50b7-f8ad-4cdd-a401-a6d23ee06568
                file:
                  groupId: 35ed2e11-35e8-4712-b78f-98aceb780ef8
                  entryId: 5c8598b6-1ab4-45e5-b534-4b60caeddabd
                  path: /Shared/__eTMF__/STD-001_STAGING/Trial Binder/Artifacts/01 First Country RA Approval/02 Central Trial Documents/02.01 Product and Trial Documentation/02.01.01 Investigator's Brochure/example.pdf
        '400':
          description: Invalid request or missing required parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.etmf scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Study or filing level not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
      tags:
        - etmf
  /v1/events/cursor:
    get:
      summary: Get a cursor for the events stream
      description: |-
        Returns the latest and oldest event identifiers along with a timestamp.
        Clients should call this endpoint once to establish a starting cursor before polling for events.
      operationId: portal-prod-get-events-cursor-v1
      parameters: []
      responses:
        '200':
          description: Successful response containing the latest and oldest event IDs and timestamp.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CursorResponse'
              example:
                latest_event_id: 16342
                oldest_event_id: 16321
                timestamp: '2025-05-28T11:41:12.000Z'
        '400':
          description: Bad Request – malformed request parameters.
        '401':
          description: Unauthorized – invalid or missing access token.
        '403':
          description: Forbidden – the authenticated user does not have access to events.
        '429':
          description: Too Many Requests – rate limit exceeded.
        '500':
          description: Server error.
      tags:
        - events
  /v1/events:
    get:
      summary: "List events (version\_1)"
      description: Retrieves a list of events that have occurred after the event associated with the specified cursor. Use the `id` parameter to supply the cursor obtained from the cursor endpoint. Optional parameters allow filtering by folder, event type, and other criteria. If there are no events after the provided cursor the endpoint returns 204.
      operationId: portal-prod-get-events-v1
      parameters:
        - name: id
          in: query
          description: Cursor ID. Use the `latest_event_id` or `oldest_event_id` returned from the cursor endpoint to start polling.
          required: true
          schema:
            type: integer
        - name: folder
          in: query
          description: Optional folder path to scope results. When specified, only events that occurred in this folder (and its subfolders) are returned.
          required: false
          schema:
            type: string
        - name: suppress
          in: query
          description: 'Suppress events generated by the current application (`app`) or current user (`user`). Omit this parameter entirely to return all events with no suppression. Note: `none` is not a valid value and will be rejected by the API.'
          required: false
          schema:
            type: string
            enum:
              - app
              - user
        - name: type
          in: query
          description: Filter to specific event types. Use a pipe (`|`) to request multiple types.
          required: false
          schema:
            type: string
            enum:
              - file_system
              - note
            default: file_system
        - name: count
          in: query
          description: Maximum number of events to return (min 1, default 50, max 100).
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: reverse
          in: query
          description: Set to `1` to traverse events in reverse order (returns events from `(id - count + 1)` to `id`). Default is `0` (ascending order).
          required: false
          schema:
            type: string
            enum:
              - '0'
              - '1'
            default: '0'
      responses:
        '200':
          description: Successful response containing a list of events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventListResponse'
              example:
                latest_id: 16342
                oldest_id: 16342
                count: 1
                events:
                  - id: 16342
                    timestamp: '2025-05-28T11:41:12.000Z'
                    action_source: WebUI
                    actor: 1
                    type: file_system
                    action: copy
                    data:
                      target_path: /Shared/Documents/My Contract.docx
                      target_id: 89b1e9d9-8a04-4277-807c-d68107796c76
                      target_group_id: 48f2dade-cd0a-472e-ab81-ab4b78135328
                      source_path: /Shared/Contracts/My Contract.docx
                      source_id: 85756cb4-7d82-439c-9ea4-be80eaebaecf
                      source_group_id: 19f157de-267a-45e9-903a-a34fdf3a3e4e
                      is_folder: false
        '204':
          description: No content – there are no events after the supplied cursor.
        '400':
          description: Bad Request – invalid cursor ID or malformed parameters.
        '401':
          description: Unauthorized – invalid or missing access token.
        '403':
          description: Forbidden – the authenticated user does not have access to events.
        '404':
          description: Not found – invalid cursor.
        '429':
          description: Too Many Requests – rate limit exceeded. Wait at least 5 minutes between polling requests.
        '500':
          description: Server error.
      tags:
        - events
  /v2/events:
    get:
      summary: "List events (version\_2)"
      description: 'Retrieves events in the same way as the v1 endpoint but also includes permission change events. By default this endpoint returns all event types: `file_system`, `note`, and `permission_change`. Use the `type` query parameter to filter the set returned.'
      operationId: portal-prod-get-events-v2
      parameters:
        - name: id
          in: query
          description: Cursor ID. Use the latest or oldest event ID returned from the cursor endpoint to start polling.
          required: true
          schema:
            type: integer
        - name: folder
          in: query
          description: Optional folder path to scope results. When specified, only events that occurred in this folder (and its subfolders) are returned.
          required: false
          schema:
            type: string
        - name: suppress
          in: query
          description: 'Suppress events generated by the current application (`app`) or current user (`user`). Omit this parameter entirely to return all events with no suppression. Note: `none` is not a valid value and will be rejected by the API.'
          required: false
          schema:
            type: string
            enum:
              - app
              - user
        - name: type
          in: query
          description: Filter to specific event types. Use a pipe (`|`) to request multiple types.
          required: false
          schema:
            type: string
            enum:
              - file_system
              - note
              - permission_change
        - name: count
          in: query
          description: Maximum number of events to return (min 1, default 50, max 100).
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: reverse
          in: query
          description: Set to `1` to traverse events in reverse order (returns events from `(id - count + 1)` to `id`). Default is `0` (ascending order).
          required: false
          schema:
            type: string
            enum:
              - '0'
              - '1'
            default: '0'
      responses:
        '200':
          description: Successful response containing a list of events including permission_change events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventListResponse'
              example:
                latest_id: 16321
                oldest_id: 16321
                count: 1
                events:
                  - id: 16321
                    timestamp: '2024-10-21T05:10:53.000Z'
                    action_source: WebUI
                    actor: 1
                    type: permission_change
                    action: permission_change
                    data:
                      target_path: /Shared/Permission Test/Viewer
                      is_folder: false
                    eventTypeSpecificAttributes:
                      changeGroupEvents: []
                      changePermissionEvent:
                        changedPermissions:
                          - action: ADD
                            entry:
                              subject: /user/6
                              priv: READ
                          - action: DELETE
                            entry:
                              subject: /user/6
                              priv: NONE
                      changeContext: null
                      targetFolderId: dd3b7523-6851-4977-97a5-265e45004882
                      groupChange: false
        '204':
          description: No content – there are no events after the supplied cursor.
        '400':
          description: Bad Request – invalid cursor ID or malformed parameters.
        '401':
          description: Unauthorized – invalid or missing access token.
        '403':
          description: Forbidden – the authenticated user does not have access to events.
        '404':
          description: Not found – invalid cursor.
        '429':
          description: Too Many Requests – rate limit exceeded. Wait at least 5 minutes between polling requests.
        '500':
          description: Server error.
      tags:
        - events
  /v1/fs/{path}:
    patch:
      summary: Modify folder options
      description: |
        Update configuration options for a folder, including description, link sharing permissions, move/delete restrictions, and email preferences. At least one field must be included in the request body.
        Note: email_preferences (notification settings) are write-only — they are not included in the response.
      operationId: portal-prod-patch-folder-options-v1
      parameters:
        - name: path
          in: path
          required: true
          description: |
            Full path to the folder (e.g. Shared/Contracts). Each segment must be URL-encoded separately. Do not encode forward slashes.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-patch-folder-options-v1Request'
            example:
              folder_description: This folder contains all of the contracts for our construction projects.
              public_links: files_folders
              move_delete_folder_restriction: admins_or_owners
              allow_upload_links: true
              inheritance_rule: this_folder_and_subfolders_until_overridden
      responses:
        '200':
          description: Folder options updated successfully. Returns updated folder metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/portal-prod-patch-folder-options-v1Response200'
              example:
                name: Contracts
                lastModified: 1464285110000
                uploaded: 1464285110000
                path: /Shared/Contracts
                folder_id: b6f42a4b-45f2-4e21-bab0-71f5b043f24d
                parent_id: a1e23b4c-56d7-8e90-fa12-34b5c6d7e8f9
                folder_description: This folder contains all of the contracts for our construction projects.
                is_folder: true
                allow_links: true
                allow_upload_links: true
                allowed_file_link_types:
                  - domain
                  - anyone
                allowed_folder_link_types:
                  - domain
                  - anyone
                public_links: files_folders
                restrict_move_delete: true
                move_delete_folder_restriction: admins_or_owners
        '400':
          description: |
            Bad request. Possible causes: folder_description exceeds 200 characters, invalid enum value for public_links/move_delete_folder_restriction/inheritance_rule, restrict_move_delete applied to a top-level folder, or content_accessed set in email_preferences by a Standard User.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing authentication token. Ensure token includes Egnyte.launch scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: |
            Forbidden — insufficient permissions to modify folder settings. Verify the user has Admin or Modify permissions for this folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — folder does not exist at the specified path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          headers:
            Retry-After:
              schema:
                type: integer
              description: Number of seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    get:
      summary: Retrieve file or folder metadata
      description: Returns metadata for the specified file or folder. When the `list_content` query parameter is set to `true` and the path refers to a folder, the contents of the folder are included in the response. Additional query parameters allow paging, sorting and inclusion of permissions or custom metadata.
      operationId: portal-prod-get-fs-v1
      parameters:
        - name: path
          in: path
          description: Full path to the file or folder (e.g. `/Shared/Documents`). Slashes must be URL-encoded.
          required: true
          schema:
            type: string
        - name: list_content
          in: query
          description: Set to `true` to list contents of the folder; ignored when the path refers to a file.
          required: false
          schema:
            type: boolean
        - name: count
          in: query
          description: Number of items to return when listing folder contents (default 100, max 1000).
          required: false
          schema:
            type: integer
            minimum: 1
        - name: offset
          in: query
          description: Zero-based index at which to begin returning folder contents.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: sort_by
          in: query
          description: Field to sort by when listing folder contents.
          required: false
          schema:
            type: string
            enum:
              - name
              - last_modified
              - uploaded_by
              - custom_metadata
        - name: sort_direction
          in: query
          description: 'Direction of sort: `ascending` (default) or `descending`.'
          required: false
          schema:
            type: string
            enum:
              - ascending
              - descending
        - name: perms
          in: query
          description: If set to `true`, returns which users and groups have permissions on the folder. Requires admin token.
          required: false
          schema:
            type: boolean
        - name: include_perm
          in: query
          description: If set to `true`, includes permission information for the file or folder in the response.
          required: false
          schema:
            type: boolean
        - name: include_locks
          in: query
          description: If set to `true`, includes locking information for files in the response.
          required: false
          schema:
            type: boolean
        - name: include_collaboration
          in: query
          description: If set to `true`, includes collaboration metadata in the response.
          required: false
          schema:
            type: boolean
        - name: allowed_link_types
          in: query
          description: If set to `true`, includes information about allowed link types.
          required: false
          schema:
            type: boolean
        - name: key
          in: query
          description: Retrieve a specific version of the file by its entry ID (UUID).
          required: false
          schema:
            type: string
        - name: list_custom_metadata
          in: query
          description: If set to `true`, custom metadata attached to files and folders will be included in the response.
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Metadata successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FsMetadataResponse'
        '400':
          description: Bad request – invalid path or query parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to view the file or folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no file or folder exists at the specified path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
    post:
      summary: Perform a file or folder operation
      description: |-
        Creates a new folder, moves or copies an item, renames an item, or locks/unlocks a file. The desired operation is specified by the `action` field in the request body.

        * `add_folder` – create a new folder at the specified path.
        * `move` – move the target to the destination path.
        * `copy` – copy the target to the destination path.
        * `rename` – rename the target; provide the new name in the `new_name` field.
        * `lock` – lock the file to prevent modifications. Optional fields: `lock_token`, `lock_timeout`, `collaboration`.
        * `unlock` – unlock a previously locked file. Requires the `lock_token` used when locking.
      operationId: portal-prod-post-fs-v1
      parameters:
        - name: path
          in: path
          description: Full path to the file or folder that is the subject of the operation.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-fs-v1Request'
            example:
              action: add_folder
      responses:
        '200':
          description: Operation completed successfully.
        '201':
          description: Folder created successfully (for add_folder).
        '400':
          description: Bad request – invalid action or missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to perform the operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – the source path or destination does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict – a file or folder already exists at the destination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
    delete:
      summary: Delete a file or folder
      description: Deletes the file or folder at the specified path. Returns the parent folder path of the deleted item.
      operationId: portal-prod-delete-fs-v1
      parameters:
        - name: path
          in: path
          description: Full path to the file or folder to delete.
          required: true
          schema:
            type: string
        - name: entry_id
          in: query
          description: Optional file version identifier. When provided, only that specific version of the file will be deleted.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Item deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
              example:
                parent_folder_path: /Shared/test
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to delete the item or the folder is not empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – the file or folder does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
  /v2/fs/{path}:
    get:
      summary: Retrieve file or folder metadata (v2)
      description: Functions the same as the v1 endpoint but may include additional metadata fields.
      operationId: portal-prod-get-fs-v2
      parameters:
        - name: path
          in: path
          required: true
          description: Full path to the file or folder (URL-encoded).
          schema:
            type: string
        - name: list_content
          in: query
          required: false
          schema:
            type: boolean
        - name: count
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - name
              - last_modified
              - uploaded_by
              - custom_metadata
        - name: sort_direction
          in: query
          required: false
          schema:
            type: string
            enum:
              - ascending
              - descending
        - name: perms
          in: query
          required: false
          schema:
            type: boolean
        - name: include_perm
          in: query
          required: false
          schema:
            type: boolean
        - name: include_locks
          in: query
          required: false
          schema:
            type: boolean
        - name: include_collaboration
          in: query
          required: false
          schema:
            type: boolean
        - name: allowed_link_types
          in: query
          required: false
          schema:
            type: boolean
        - name: key
          in: query
          required: false
          schema:
            type: string
        - name: list_custom_metadata
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Metadata successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FsMetadataResponse'
        '400':
          description: Bad request – invalid path or query parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
    post:
      summary: Perform a file or folder operation (v2)
      description: Same functionality as the v1 POST endpoint, with support for additional v2 features such as advanced permission handling.
      operationId: portal-prod-post-fs-v2
      parameters:
        - name: path
          in: path
          required: true
          description: Full path to the file or folder.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-fs-v2Request'
            example:
              action: rename
              new_name: NewReport.docx
      responses:
        '200':
          description: Operation completed successfully.
        '201':
          description: Folder created successfully.
        '400':
          description: Bad request – invalid action or missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict – an item already exists at the destination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
    delete:
      summary: Delete a file or folder (v2)
      description: Deletes the specified file or folder. Returns the parent folder path of the deleted item.
      operationId: portal-prod-delete-fs-v2
      parameters:
        - name: path
          in: path
          required: true
          description: Full path to the file or folder to delete.
          schema:
            type: string
        - name: entry_id
          in: query
          required: false
          description: Optional file version identifier. When provided, only that specific version of the file will be deleted.
          schema:
            type: string
      responses:
        '200':
          description: Item deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – the file or folder does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
  /v1/fs/ids/{type}/{id}:
    get:
      summary: Retrieve file or folder metadata by ID
      description: Returns metadata for the file or folder identified by its unique ID. Use `group_id` for files and `folder_id` for folders. Supports the same query parameters as the path-based GET endpoint.
      operationId: portal-prod-get-fs-by-id-v1
      parameters:
        - name: type
          in: path
          description: Literal string `file` or `folder`.
          required: true
          schema:
            type: string
            enum:
              - file
              - folder
        - name: id
          in: path
          description: Unique ID of the file (`group_id`) or folder (`folder_id`).
          required: true
          schema:
            type: string
        - name: list_content
          in: query
          required: false
          schema:
            type: boolean
        - name: count
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - name
              - last_modified
              - uploaded_by
              - custom_metadata
        - name: sort_direction
          in: query
          required: false
          schema:
            type: string
            enum:
              - ascending
              - descending
        - name: perms
          in: query
          required: false
          schema:
            type: boolean
        - name: include_perm
          in: query
          required: false
          schema:
            type: boolean
        - name: include_locks
          in: query
          required: false
          schema:
            type: boolean
        - name: include_collaboration
          in: query
          required: false
          schema:
            type: boolean
        - name: allowed_link_types
          in: query
          required: false
          schema:
            type: boolean
        - name: key
          in: query
          required: false
          schema:
            type: string
        - name: list_custom_metadata
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Metadata successfully returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FsMetadataResponse'
        '400':
          description: Bad request – invalid ID or query parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to view the item.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no file or folder exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
    post:
      summary: Perform a file or folder operation by ID
      description: |-
        Moves, copies, locks, or unlocks a file or folder identified by its unique ID. The desired operation is specified by the `action` field in the request body.

        * `move` – move the item to the destination.
        * `copy` – copy the item to the destination.
        * `lock` – lock the file to prevent modifications.
        * `unlock` – unlock a previously locked file.
      operationId: portal-prod-post-fs-by-id-v1
      parameters:
        - name: type
          in: path
          description: Literal string `file` or `folder`.
          required: true
          schema:
            type: string
            enum:
              - file
              - folder
        - name: id
          in: path
          description: Unique ID of the file (`group_id`) or folder (`folder_id`).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-fs-by-id-v1Request'
      responses:
        '200':
          description: Operation completed successfully.
        '400':
          description: Bad request – invalid action or missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to perform the operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no file or folder exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict – an item already exists at the destination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
    delete:
      summary: Delete a file or folder by ID
      description: Deletes the file or folder identified by its unique ID. Returns the parent folder path of the deleted item.
      operationId: portal-prod-delete-fs-by-id-v1
      parameters:
        - name: type
          in: path
          description: Literal string `file` or `folder`.
          required: true
          schema:
            type: string
            enum:
              - file
              - folder
        - name: id
          in: path
          description: Unique ID of the file (`group_id`) or folder (`folder_id`).
          required: true
          schema:
            type: string
        - name: entry_id
          in: query
          description: Optional file version identifier. When provided, only that specific version of the file will be deleted.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Item deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to delete the item.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no file or folder exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
  /v1/fs/ids/folder/{folder_id}/stats:
    get:
      summary: Get folder statistics by ID
      description: Retrieves size and item count statistics for the folder identified by its unique ID, including all files and subfolders recursively.
      operationId: portal-prod-get-fs-folder-stats-v1
      parameters:
        - name: folder_id
          in: path
          description: Unique ID of the folder.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Folder statistics returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderStatsResponse'
              example:
                allVersionsSize: 1732505
                allFilesSize: 1721488
                filesCount: 10
                fileVersionsCount: 12
                foldersCount: 9
                allVersionsSizeInKB: 1691
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to view the folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no folder exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs
  /v1/fs-content/{path}:
    get:
      summary: Download file content by path
      description: Returns the raw contents of a file at the specified path. Optionally specify the `entry_id` query parameter to retrieve a specific revision of the file. Range requests are supported for partial content retrieval.
      operationId: portal-prod-get-fs-content-by-path-v1
      parameters:
        - name: path
          in: path
          description: Full path to the file to download (e.g. `/Shared/Documents/report.pdf`). Slashes must be URL-encoded.
          required: true
          schema:
            type: string
        - name: entry_id
          in: query
          description: Optional file version identifier. When provided, the specified revision of the file will be returned instead of the latest.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: File content returned successfully.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '206':
          description: Partial content returned for range request.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request – invalid path or query parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to read the file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – the file does not exist at the specified path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs_content
    post:
      summary: Upload file content by path
      description: |-
        Uploads a file to the specified path. If the file already exists it will be overwritten; otherwise it will be created. The request must be sent as `multipart/form-data` with a single part named `file` containing the file bytes.

        For files larger than 100 MB, use the chunked upload endpoint (`POST /v1/fs-content/ids/file/{id}`) instead.
      operationId: portal-prod-post-fs-content-by-path-v1
      parameters:
        - name: path
          in: path
          description: Full path where the file will be stored.
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/portal-prod-post-fs-content-by-path-v1Request'
      responses:
        '200':
          description: File updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '201':
          description: File created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '400':
          description: Bad request – invalid path or missing file part.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to write to the path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict – a directory exists at the specified path or intermediate folders are missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs_content
  /v1/fs-content/ids/file/{id}:
    get:
      summary: Download file content by file ID
      description: Returns the raw contents of a file identified by its file system ID. Optionally specify the `entry_id` query parameter to retrieve a specific revision of the file. Range requests are supported for partial content retrieval.
      operationId: portal-prod-get-fs-content-by-id-v1
      parameters:
        - name: id
          in: path
          description: The unique file system ID (`group_id`) of the file to download.
          required: true
          schema:
            type: string
        - name: entry_id
          in: query
          description: Optional file version identifier. When provided, the specified revision of the file will be returned instead of the latest.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: File content returned successfully.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '206':
          description: Partial content returned for range request.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Bad request – invalid ID or query parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to read the file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no file exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs_content
    post:
      summary: Chunked upload by file ID
      description: |-
        Uploads a large file in chunks to the location identified by its file system ID. Recommended for files larger than 100 MB.

        **Chunked Upload Process:**
        1. Split the file into chunks (recommended size: 100 MB; min: 10 MB; max: 1 GB). All chunks must be the same size except the last.
        2. Upload the first chunk with `X-Egnyte-Chunk-Num: 1` and `X-Egnyte-Chunk-Sha512-Checksum`. Save `X-Egnyte-Upload-Id` from the response.
        3. Upload remaining chunks (except last) with `X-Egnyte-Upload-Id`, `X-Egnyte-Chunk-Num`, and `X-Egnyte-Chunk-Sha512-Checksum`.
        4. Upload the final chunk with `X-Egnyte-Last-Chunk: true` and `X-Sha512-Checksum` (hash of entire file).
        5. Chunks expire 24 hours after the first chunk upload.
      operationId: portal-prod-post-fs-content-chunked-by-id-v1
      parameters:
        - name: id
          in: path
          description: The unique file system ID (`group_id`) of the file.
          required: true
          schema:
            type: string
        - name: X-Egnyte-Chunk-Num
          in: header
          description: Chunk number starting at 1.
          required: true
          schema:
            type: integer
        - name: X-Egnyte-Chunk-Sha512-Checksum
          in: header
          description: SHA512 hash of the chunk data.
          required: true
          schema:
            type: string
        - name: X-Egnyte-Upload-Id
          in: header
          description: Upload ID returned from the first chunk. Required for all chunks after the first.
          required: false
          schema:
            type: string
        - name: X-Egnyte-Last-Chunk
          in: header
          description: Set to `true` for the final chunk.
          required: false
          schema:
            type: boolean
        - name: X-Sha512-Checksum
          in: header
          description: SHA512 hash of the entire file. Required on the final chunk.
          required: false
          schema:
            type: string
        - name: Last-Modified
          in: header
          description: Optional last-modified timestamp for the file.
          required: false
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/portal-prod-post-fs-content-chunked-by-id-v1Request'
      responses:
        '200':
          description: File updated successfully (final chunk processed).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '201':
          description: File created successfully (final chunk processed).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
        '400':
          description: Bad request – invalid ID, missing required headers, or chunk out of sequence.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to write to this file.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no file exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - fs_content
  /v2/groups:
    get:
      summary: List groups
      description: Returns a paginated list of custom groups. You can use query parameters to control the starting index, the number of results returned, and to filter by display name.
      operationId: portal-prod-get-groups-v2
      parameters:
        - name: startIndex
          in: query
          description: The 1‑based index of the first result to return (default is 1).
          required: false
          schema:
            type: integer
            minimum: 1
        - name: count
          in: query
          description: Maximum number of groups to return (default is 100).
          required: false
          schema:
            type: integer
            minimum: 1
        - name: filter
          in: query
          description: Filter expression for display name. Use SCIM filter syntax, e.g. `displayName sw "Mar"` to list groups whose names start with 'Mar'.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response containing a list of groups.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupListResponse'
              example:
                totalResults: 2
                itemsPerPage: 2
                startIndex: 1
                resources:
                  - id: c8aa533b-0878-4ccb-b729-fb69b4f2ecb8
                    displayName: Marketing Team
                    members: []
                  - id: 38d6b4c0-4299-4b51-af7a-8f0c7bcb5322
                    displayName: Engineering
                    members:
                      - value: 17d2ea40-fcb8-4f0e-bad0-4e0b986d5dce
                        display: alice
        '400':
          description: Bad request – invalid filter or paging parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to view groups.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - groups
    post:
      summary: Create a group
      description: Creates a new group with the specified display name and optional members. Members should be supplied as an array of user IDs.
      operationId: portal-prod-post-groups-v2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-groups-v2Request'
            example:
              displayName: Project Contributors
              members: []
      responses:
        '201':
          description: Group created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResource'
              example:
                id: 5451f218-8882-4ae7-8125-1b6d070e3f64
                displayName: Project Contributors
                members: []
        '400':
          description: Bad request – missing or invalid display name, or invalid members.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to create groups.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict – a group with the specified name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - groups
  /v2/groups/{groupId}:
    get:
      summary: Get group details
      description: Retrieves details of a specific group by its ID.
      operationId: portal-prod-get-groups-by-id-v2
      parameters:
        - name: groupId
          in: path
          description: The unique identifier of the group.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Group details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResource'
              example:
                id: 38d6b4c0-4299-4b51-af7a-8f0c7bcb5322
                displayName: Engineering
                members:
                  - value: 17d2ea40-fcb8-4f0e-bad0-4e0b986d5dce
                    display: alice
        '400':
          description: Bad request – invalid group ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to view the group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no group exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - groups
    put:
      summary: Update a group
      description: Replaces the group's display name and membership. A complete set of members must be provided; omissions will remove members.
      operationId: portal-prod-put-groups-by-id-v2
      parameters:
        - name: groupId
          in: path
          required: true
          description: Group ID.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-put-groups-by-id-v2Request'
            example:
              displayName: Engineering Team
              members:
                - 17d2ea40-fcb8-4f0e-bad0-4e0b986d5dce
      responses:
        '200':
          description: Group updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResource'
              example:
                id: 38d6b4c0-4299-4b51-af7a-8f0c7bcb5322
                displayName: Engineering Team
                members:
                  - value: 17d2ea40-fcb8-4f0e-bad0-4e0b986d5dce
                    display: alice
        '400':
          description: Bad request – missing display name or invalid members.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to update the group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no group exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - groups
    patch:
      summary: Partially update a group
      description: Performs a partial update on a group using the SCIM 2.0 PatchOp format. This can be used to rename the group or add/remove members without supplying the full membership.
      operationId: portal-prod-patch-groups-by-id-v2
      parameters:
        - name: groupId
          in: path
          required: true
          description: Group ID.
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-patch-groups-by-id-v2Request'
            example:
              schemas:
                - urn:ietf:params:scim:api:messages:2.0:PatchOp
              Operations:
                - op: replace
                  path: displayName
                  value: Engineering
      responses:
        '200':
          description: Group patched successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResource'
        '400':
          description: Bad request – invalid patch syntax.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to modify the group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no group exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - groups
    delete:
      summary: Delete a group
      description: Deletes the specified group. All membership associations will be removed.
      operationId: portal-prod-delete-groups-by-id-v2
      parameters:
        - name: groupId
          in: path
          required: true
          description: Group ID.
          schema:
            type: string
      responses:
        '204':
          description: Group deleted successfully.
        '400':
          description: Bad request – invalid group ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to delete the group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no group exists with the specified ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - groups
  /v1/insights/files:
    get:
      summary: List recently accessed files
      description: Returns a list of up to 10 files that the authenticated user has recently accessed. No parameters are required.
      operationId: portal-prod-get-insights-files-v1
      parameters:
        - name: folder_path
          in: query
          required: false
          description: Restricts results to files within the specified folder path.
          schema:
            type: string
            default: /
      responses:
        '200':
          description: Successful response containing recent file details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/portal-prod-get-insights-files-v1Response200'
              example:
                recentFiles:
                  - name: Outline.docx
                    path: /Private/johndoe/Drafts/Outline.docx
                    size: 307951
                    entry_id: cba6286d-bad8-43c8-8176-07bb21ef209f
                    group_id: 84792f80-2f1e-416d-a6c0-ba6fd1855dbb
                    uploaded_by: John Doe
                    num_versions: 2
                    last_modified: 1542833068000
                    last_accessed: 1542945701862
                    recommendation_type: recent
                  - name: Presentation1.pptx
                    path: /Shared/Documents/Presentation1.pptx
                    size: 175352
                    entry_id: b0b17eaf-2068-49bd-85e7-fc60cad58d58
                    group_id: 31b9bbbf-5132-4d8d-867b-3e8657de70b8
                    uploaded_by: Chelsea Sutton
                    num_versions: 0
                    last_modified: 1533162184000
                    last_accessed: 1541529105667
                    recommendation_type: recent
        '400':
          description: Bad request – invalid query parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to access insights.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          headers:
            Retry-After:
              schema:
                type: integer
              description: Number of seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
        - insights
  /v1/links:
    get:
      summary: List links
      description: Returns a list of link IDs created in the domain. Administrators will see all links; other users will see only links they created. Optional query parameters allow filtering the results.
      operationId: portal-prod-get-links-v1
      parameters:
        - name: path
          in: query
          description: Return only links that point to this file or folder path.
          required: false
          schema:
            type: string
        - name: username
          in: query
          description: Return only links created by this username.
          required: false
          schema:
            type: string
        - name: created_before
          in: query
          description: Return only links created before this ISO‑8601 date.
          required: false
          schema:
            type: string
        - name: created_after
          in: query
          description: Return only links created after this ISO‑8601 date.
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: 'Filter by link type: `file` or `folder`.'
          required: false
          schema:
            type: string
            enum:
              - file
              - folder
        - name: accessibility
          in: query
          description: 'Filter by accessibility: `anyone`, `password`, `domain`, or `recipients`.'
          required: false
          schema:
            type: string
            enum:
              - anyone
              - password
              - domain
              - recipients
        - name: offset
          in: query
          description: Zero‑based index of the first link to return.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          description: Maximum number of links to return (default and max 500).
          required: false
          schema:
            type: integer
            minimum: 1
      responses:
        '200':
          description: List of link IDs returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkListV1Response'
              example:
                ids:
                  - owTMm8H8Sg
                  - KsiryUUgEo
                offset: 0
                count: 0
                total_count: 5
        '400':
          description: Bad request – invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to list links.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
    post:
      summary: Create a link
      description: Creates a new link for a file or folder. Specify the path to the item and set additional options such as link type, accessibility, expiration date, and notification preferences.
      operationId: portal-prod-post-links-v1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-links-v1Request'
            example:
              path: /Shared/Documents/Report.pdf
              type: file
              accessibility: anyone
              notify: false
      responses:
        '201':
          description: Link created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateLinkResponse'
              example:
                links:
                  - id: 5a123b4cde
                    url: https://apidemo.egnyte.com/dl/5a123b4cde
                    recipients: []
                path: /Shared/Documents/Report.pdf
                type: file
                accessibility: anyone
                creation_date: 2025-07-01T12:00:00+0000
                created_by: jane.doe
        '400':
          description: Bad request – missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to create links for the specified path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – the specified path does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict – a link already exists for the specified path with identical settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
  /v1/links/{linkId}:
    get:
      summary: Get link details
      description: Returns details of a specific link. Only administrators or the user who created the link can retrieve its details.
      operationId: portal-prod-get-links-by-id-v1
      parameters:
        - name: linkId
          in: path
          description: The unique identifier of the link.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Link details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkObject'
              example:
                id: 5a123b4cde
                path: /Shared/Documents/Report.pdf
                type: file
                url: https://apidemo.egnyte.com/dl/5a123b4cde
                created_by: jane.doe
                creation_date: 2025-07-01T12:00:00+0000
                accessibility: anyone
                notify: false
                link_to_current: false
                protection: NONE
                recipients: []
        '400':
          description: Bad request – invalid link ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to view this link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no link exists with the specified ID or you do not have permission to view it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
    delete:
      summary: Delete a link
      description: Deletes a specific link. Only administrators or the user who created the link can delete it.
      operationId: portal-prod-delete-links-by-id-v1
      parameters:
        - name: linkId
          in: path
          description: The unique identifier of the link.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Link deleted successfully.
        '400':
          description: Bad request – invalid link ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to delete this link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no link exists with the specified ID or you do not have permission to delete it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
  /v2/links:
    get:
      summary: List links (v2)
      description: Returns a list of links with full details in a single response. Non-admin users can only see links they created.
      operationId: portal-prod-get-links-v2
      parameters:
        - name: path
          in: query
          required: false
          schema:
            type: string
        - name: username
          in: query
          required: false
          schema:
            type: string
        - name: created_before
          in: query
          required: false
          schema:
            type: string
        - name: created_after
          in: query
          required: false
          schema:
            type: string
        - name: type
          in: query
          required: false
          schema:
            type: string
            enum:
              - file
              - folder
        - name: accessibility
          in: query
          required: false
          schema:
            type: string
            enum:
              - anyone
              - password
              - domain
              - recipients
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
      responses:
        '200':
          description: List of links returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkListV2Response'
        '400':
          description: Bad request – invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to list links.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
    post:
      summary: Create a link (v2)
      description: Same functionality as the v1 endpoint but may support additional fields or validations.
      operationId: portal-prod-post-links-v2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-links-v2Request'
            example:
              path: /Shared/Projects/Alpha
              type: folder
              accessibility: domain
              notify: true
      responses:
        '201':
          description: Link created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateLinkResponse'
        '400':
          description: Bad request – missing required fields or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to create links for the specified path.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – the specified path does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Conflict – a link already exists for the specified path with identical settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
  /v2/links/{linkId}:
    get:
      summary: Get link details (v2)
      description: Returns details of a specific link. Same as the v1 endpoint but may include additional attributes.
      operationId: portal-prod-get-links-by-id-v2
      parameters:
        - name: linkId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Link details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkObject'
        '400':
          description: Bad request – invalid link ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to view this link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no link exists with the specified ID or you do not have permission to view it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
    delete:
      summary: Delete a link (v2)
      description: Deletes a specific link. Same rules as the v1 endpoint.
      operationId: portal-prod-delete-links-by-id-v2
      parameters:
        - name: linkId
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Link deleted successfully.
        '400':
          description: Bad request – invalid link ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the authenticated user does not have permission to delete this link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – no link exists with the specified ID or you do not have permission to delete it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - links
  /v1/properties/namespace:
    get:
      summary: List namespaces
      description: Lists all custom metadata namespaces defined in the domain.
      operationId: portal-prod-get-namespaces-v1
      parameters:
        - name: includeFolderAssociations
          in: query
          required: false
          description: Include folder association details in the response.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Namespaces returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/portal-prod-get-namespaces-v1Response200'
              example:
                - name: public-global-all-data-types
                  displayName: public-global-all-data-types
                  priority: 0
                  scope: public
                  schemaSystemGenerated: false
                  inheritable: false
                  metadataScopeType: GLOBAL
                  keys:
                    string-key:
                      displayName: string-key
                      helpText: ''
                      priority: 5
                      type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
    post:
      summary: Create a namespace
      description: Creates a new namespace with custom metadata keys. The request body defines the namespace name, scope, display name, and the key definitions.
      operationId: portal-prod-post-namespace-v1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-namespace-v1Request'
            example:
              name: namespace1
              scope: public
              displayName: My first namespace
              inheritable: false
              metadataScopeType: GLOBAL
              keys:
                int-key:
                  type: integer
                  priority: 5
                  displayName: My integer key
                enum-key:
                  type: enum
                  data:
                    - red
                    - green
                    - blue
                  displayName: Color
                  priority: 3
      responses:
        '204':
          description: Namespace created successfully.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: Conflict – a namespace with the specified name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
  /v1/properties/namespace/{namespaceName}:
    get:
      summary: Get namespace keys
      description: Returns all custom metadata keys within the specified namespace.
      operationId: portal-prod-get-namespace-v1
      parameters:
        - name: namespaceName
          in: path
          description: The namespace identifier.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Namespace keys returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespaceObject'
              example:
                name: namespace1
                displayName: My first namespace
                scope: public
                priority: 0
                inheritable: false
                schemaSystemGenerated: false
                metadataScopeType: GLOBAL
                keys:
                  int-key:
                    type: integer
                    priority: 5
                    displayName: My integer key
                  enum-key:
                    type: enum
                    priority: 3
                    displayName: Color
                    data:
                      - red
                      - green
                      - blue
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
    patch:
      summary: Update namespace attributes
      description: |
        Updates the display name, key priorities, folder associations, or document type associations of a namespace. Only include folderAssociation or documentTypeAssociation in a single request, not both.
      operationId: portal-prod-patch-namespace-v1
      parameters:
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-patch-namespace-v1Request'
            example:
              displayName: Updated namespace name
              priorities:
                int-key: 10
                enum-key: 5
      responses:
        '200':
          description: Namespace updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespaceObject'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
    delete:
      summary: Delete a namespace
      description: Deletes the specified namespace. If the namespace or its keys are in use, a 403 error will be returned unless the request includes the `X-Egnyte-Force-Delete` header set to `Yes`.
      operationId: portal-prod-delete-namespace-v1
      parameters:
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
        - name: X-Egnyte-Force-Delete
          in: header
          required: false
          description: Set to `Yes` to force delete a namespace that is in use.
          schema:
            type: string
            enum:
              - 'Yes'
      responses:
        '204':
          description: Namespace deleted successfully.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
  /v1/properties/namespace/{namespaceName}/keys:
    post:
      summary: Create a metadata key
      description: Adds a new key to an existing namespace.
      operationId: portal-prod-post-metadata-key-v1
      parameters:
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-post-metadata-key-v1Request'
            example:
              key: new-enum-key
              type: enum
              data:
                - red
                - green
                - blue
              displayName: Color
              priority: 7
              helpText: Use this key to tag files with color values
      responses:
        '204':
          description: Key created successfully.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Conflict – a key with that name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
  /v1/properties/namespace/{namespaceName}/keys/{keyName}:
    patch:
      summary: Update a metadata key
      description: Updates attributes of a key within a namespace. You can change the display name, help text, priority and, in some cases, the type (to a broader type).
      operationId: portal-prod-patch-metadata-key-v1
      parameters:
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
        - name: keyName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-patch-metadata-key-v1Request'
            example:
              displayName: Updated display name
              helpText: Use this key wisely.
              priority: 10
              type: enum
              data:
                - red
                - green
                - blue
                - yellow
      responses:
        '204':
          description: Key updated successfully.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
    delete:
      summary: Delete a metadata key
      description: Deletes a key from a namespace. If the key is in use, a 403 error will be returned unless the request includes the `X-Egnyte-Force-Delete` header set to `Yes`.
      operationId: portal-prod-delete-metadata-key-v1
      parameters:
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
        - name: keyName
          in: path
          required: true
          schema:
            type: string
        - name: X-Egnyte-Force-Delete
          in: header
          required: false
          description: Set to `Yes` to force delete a key that is in use.
          schema:
            type: string
            enum:
              - 'Yes'
      responses:
        '204':
          description: Key deleted successfully.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
  /v1/fs/ids/file/{id}/properties/{namespaceName}:
    put:
      summary: Set metadata values on a file or file version
      description: Sets values for multiple keys in the specified namespace on a file or file version. Use a group ID to set metadata on the latest version, or an entry ID to target a specific version.
      operationId: portal-prod-put-file-metadata-v1
      parameters:
        - name: id
          in: path
          required: true
          description: The file group ID or entry ID.
          schema:
            type: string
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-put-file-metadata-v1Request'
            example:
              string-key: abc
              int-key: '10'
              date-key: '1465413843995'
      responses:
        '204':
          description: Metadata values set successfully.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
    get:
      summary: Get metadata values for a file or file version
      description: Returns the metadata values for the specified namespace on a file or file version identified by its group ID or entry ID.
      operationId: portal-prod-get-file-metadata-v1
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Metadata values returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetadataValuesResponse'
              example:
                results:
                  - workspace:
                      string-key: abc
                      int-key: 10
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
  /v1/fs/ids/folder/{id}/properties/{namespaceName}:
    put:
      summary: Set metadata values on a folder
      description: Sets values for multiple keys in the specified namespace on a folder.
      operationId: portal-prod-put-folder-metadata-v1
      parameters:
        - name: id
          in: path
          required: true
          description: Folder ID.
          schema:
            type: string
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-put-folder-metadata-v1Request'
            example:
              project-code: X123
              status: in progress
      responses:
        '204':
          description: Metadata values set successfully.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
    get:
      summary: Get metadata values for a folder
      description: Returns the metadata values for the specified namespace on a folder identified by its ID.
      operationId: portal-prod-get-folder-metadata-v1
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: namespaceName
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Metadata values returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetadataValuesResponse'
              example:
                results:
                  - my-namespace:
                      project-code: X123
                      status: in progress
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - metadata
  /v1/msp/webhooks:
    get:
      summary: List Webhooks
      description: Returns all webhooks registered by the MSP for its domains.
      operationId: listMspWebhooks
      tags:
        - Webhooks
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Webhooks returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookListResponse'
              example:
                webhooks:
                  - webhook_id: '12345'
                    status: active
                    event_types:
                      - domain_created
                      - license_allocated
                    webhook_url: https://example.com/webhook
                  - webhook_id: '67890'
                    status: inactive
                    event_types:
                      - user_created
                    webhook_url: https://another.example.com/webhook
        '400':
          description: Bad request — invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — the authenticated user does not have the Egnyte.msp scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      summary: Register a Webhook
      description: Creates a new webhook and returns its ID. Specify the event types to subscribe to, the callback URL and optional authentication headers.
      operationId: createMspWebhook
      tags:
        - Webhooks
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
            example:
              event_types:
                - user_created
                - license_allocated
              webhook_url: https://example.com/egnyte/webhook
              auth_header: Authorization
              auth_header_value: Bearer secret-token
      responses:
        '201':
          description: Webhook registered successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebhookResponse'
              example:
                webhook_id: '12345'
                status: active
        '400':
          description: Bad request — invalid event types or missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — the authenticated user does not have the Egnyte.msp scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/msp/webhooks/{webhookId}:
    get:
      summary: Get Webhook Details
      description: Returns detailed information about a webhook, including the subscribed event types and callback URL.
      operationId: getMspWebhook
      tags:
        - Webhooks
      security:
        - BearerAuth: []
      parameters:
        - name: webhookId
          in: path
          required: true
          description: The unique identifier of the webhook.
          schema:
            type: string
          example: '12345'
      responses:
        '200':
          description: Webhook details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDetail'
              example:
                webhook_id: '12345'
                status: active
                webhook_url: https://example.com/egnyte/webhook
                event_types:
                  - user_created
                  - license_allocated
                auth_header: Authorization
        '400':
          description: Bad request — invalid webhook ID format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — the authenticated user does not have the Egnyte.msp scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — webhook does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    put:
      summary: Update a Webhook
      description: Updates an existing webhook with a new callback URL, event types or authentication header. At least one field must be provided.
      operationId: updateMspWebhook
      tags:
        - Webhooks
      security:
        - BearerAuth: []
      parameters:
        - name: webhookId
          in: path
          required: true
          description: The unique identifier of the webhook to update.
          schema:
            type: string
          example: '12345'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequest'
            example:
              event_types:
                - domain_created
                - user_deleted
              webhook_url: https://example.com/updated/webhook
      responses:
        '200':
          description: Webhook updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDetail'
        '400':
          description: Bad request — no updatable fields provided or invalid event types.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — the authenticated user does not have the Egnyte.msp scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — webhook does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      summary: Unregister a Webhook
      description: Deletes a webhook so that it no longer receives notifications.
      operationId: deleteMspWebhook
      tags:
        - Webhooks
      security:
        - BearerAuth: []
      parameters:
        - name: webhookId
          in: path
          required: true
          description: The unique identifier of the webhook to delete.
          schema:
            type: string
          example: '12345'
      responses:
        '204':
          description: Webhook deleted successfully.
        '400':
          description: Bad request — invalid webhook ID format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — the authenticated user does not have the Egnyte.msp scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — webhook does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/msp/domains:
    get:
      summary: List Managed Domains
      description: Returns a list of domains managed by the MSP along with their subscription plans and license usage.
      operationId: listMspDomains
      tags:
        - Domains
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Domains returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DomainListResponse'
              example:
                domains:
                  - domain: acme
                    plan_id: BUSINESS
                    plan_name: Business Plan
                    status: active
                    created_on: '2024-01-15T10:20:30Z'
                    subscription_date: '2024-02-01T00:00:00Z'
                    available_licenses: 50
                    used_licenses: 30
                    storage_allocated_gb: 200
                    storage_used_gb: 120
                  - domain: beta
                    plan_id: TEAM
                    plan_name: Team Plan
                    status: trial
                    created_on: '2025-06-10T09:00:00Z'
                    subscription_date: null
                    available_licenses: 10
                    used_licenses: 5
                    storage_allocated_gb: 20
                    storage_used_gb: 5
        '400':
          description: Bad request — invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — the authenticated user does not have the Egnyte.msp scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/notes/{noteId}:
    get:
      summary: Get comment details
      description: Returns details of a specific comment identified by its UUID.
      operationId: notes-get-by-id-v1
      parameters:
        - name: noteId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Comment returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NoteObject'
              example:
                id: a7a809d3-1c2f-4dd0-8b65-3f2c78eac4c8
                message: Test comment 2
                username: asmith
                can_delete: true
                creation_time: 2016-05-18T18:06:26.000+0000
                formatted_name: Anna Smith
                file_path: /Shared/Documents/testdoc.docx
                group_id: 628ceb16-b9a0-49f8-a0e4-72b729708f71
        '400':
          description: Bad request – invalid UUID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – user does not have permission or the comment does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – comment does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - notes
    delete:
      summary: Delete a comment
      description: Deletes a specific comment. Only the comment creator or an administrator can delete comments.
      operationId: notes-delete-by-id-v1
      parameters:
        - name: noteId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Comment deleted successfully.
        '400':
          description: Bad request – invalid UUID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – user does not have permission or the comment does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found – comment does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error.
      tags:
        - notes
  /pubapi/v1/perms/user/{username}:
    get:
      operationId: getEffectivePermissionsForUser
      summary: Get Effective Permissions for a User
      description: Retrieves the effective permissions for a specific user on a given folder. Takes into account both direct user permissions and group memberships, along with permission inheritance.
      parameters:
        - name: username
          in: path
          required: true
          description: The username to get effective permissions for.
          schema:
            type: string
        - name: folder
          in: query
          required: true
          description: Absolute path to the folder (e.g., /Shared/Documents).
          schema:
            type: string
      responses:
        '200':
          description: Effective permission level for the user on the specified folder.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getEffectivePermissionsForUserResponse200'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User or folder not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /pubapi/v2/perms/{path}:
    get:
      operationId: getFolderPermissionsV2
      summary: Get Folder Permissions (v2)
      description: Retrieves all user and group permissions set on a specific folder, including permission inheritance status.
      parameters:
        - name: path
          in: path
          required: true
          description: Full path to the folder (e.g., Shared/Documents). Do not include a leading slash. Forward slashes within the value are part of the path.
          schema:
            type: string
          style: simple
          explode: false
      responses:
        '200':
          description: Folder permissions including user and group permission maps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getFolderPermissionsV2Response200'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Folder not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
    post:
      operationId: setFolderPermissionsV2
      summary: Set Folder Permissions (v2)
      description: Sets or updates permissions for users and groups on a folder. This is a delta API — it only modifies the permissions you specify, leaving other permissions unchanged. To remove a permission, set it to None.
      parameters:
        - name: path
          in: path
          required: true
          description: Full path to the folder (e.g., Shared/Documents). Do not include a leading slash. Forward slashes within the value are part of the path.
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/setFolderPermissionsV2Request'
      responses:
        '200':
          description: Permissions updated successfully. Empty response body.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Folder not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /pubapi/v1/perms/folder/{path}:
    get:
      operationId: getFolderPermissionsV1
      summary: Get Folder Permissions (v1, deprecated)
      deprecated: true
      description: 'Deprecated: Use the v2 endpoint instead. Retrieves permissions for specific users and groups on a folder. At least one of the users or groups query parameters must be provided.'
      parameters:
        - name: path
          in: path
          required: true
          description: Full path to the folder (e.g., Shared/MyFolder). Do not include a leading slash.
          schema:
            type: string
        - name: users
          in: query
          required: false
          description: Pipe-separated list of usernames (e.g., jsmith|ajones). At least one of users or groups must be provided.
          schema:
            type: string
        - name: groups
          in: query
          required: false
          description: Pipe-separated list of group names (e.g., All Power Users|Marketing). At least one of users or groups must be provided.
          schema:
            type: string
      responses:
        '200':
          description: Folder permissions for specified users and groups.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getFolderPermissionsV1Response200'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Folder not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
    post:
      operationId: setFolderPermissionsV1
      summary: Set Folder Permissions (v1, deprecated)
      deprecated: true
      description: 'Deprecated: Use the v2 endpoint instead. Sets the same permission level for multiple users or groups on a folder. At least one of users or groups must be provided.'
      parameters:
        - name: path
          in: path
          required: true
          description: Full path to the folder (e.g., Shared/MyFolder). Do not include a leading slash.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/setFolderPermissionsV1Request'
      responses:
        '200':
          description: Permissions updated successfully. Empty response body.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Folder not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/procore/sync:
    get:
      tags:
        - procore
      summary: List synced projects
      description: List synced projects for given domain.
      operationId: listSyncedProjects
      security:
        - CodeGrantAuth:
            - Egnyte.integrations
      responses:
        '200':
          description: List of connected projects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listSyncedProjectsResponse200'
              examples:
                default:
                  summary: Example response
                  value:
                    - id: 11111111-2222-3333-4444-555555555555
                      jobId: 11111111-2222-3333-4444-555555555555
                      folder: /Shared/test
                      procoreFolderPaths: []
                      project: project_name
                      procoreProjectId: 54321
                      serviceAccountName: serviceAccount
                      syncType: 2-way sync
                      lastSuccessTime: '2024-01-15T10:00:00Z'
                      isHealthy: true
                      isHealthyNote: null
                      skipped: []
        '400':
          description: Input Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '401':
          description: Not Authorized (token expired, invalid or missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
              example:
                code: gateway_error_forbidden_not_authorized
                message: API Gateway error - authorization invalid or missing - check the token
        '403':
          description: 'Missing Scope (code: missing_scope_error)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '500':
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
    post:
      tags:
        - procore
      summary: Create sync project
      description: Create sync between egnyte folder and procore project. In order to use the API commands, Egnyte's DMSA key must be verified once per company via setting up a sync in the Egnyte WebUI.
      operationId: createSync
      security:
        - CodeGrantAuth:
            - Egnyte.launchwebsession
            - Egnyte.integrations
      requestBody:
        description: Sync creation parameters.
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/createSyncRequest'
      responses:
        '201':
          description: Sync is created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncFromDB'
              examples:
                SyncFromDB:
                  $ref: '#/components/examples/SyncFromDB'
        '400':
          description: Input Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '401':
          description: Not Authorized (token expired, invalid or missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
              example:
                code: gateway_error_forbidden_not_authorized
                message: API Gateway error - authorization invalid or missing - check the token
        '403':
          description: 'Quota error (code: quota_error)'
          headers:
            retry-after:
              description: Time to the next quota period start or the quota period length - in seconds
              schema:
                type: number
            quota-limit:
              $ref: '#/components/headers/quota-limit'
            quota-period:
              $ref: '#/components/headers/quota-period'
            quota-reset:
              $ref: '#/components/headers/quota-reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '500':
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
  /v1/procore/sync/{syncId}:
    get:
      tags:
        - procore
      summary: Synced project details
      description: Synced project details.
      operationId: syncedProjectsDetails
      security:
        - CodeGrantAuth:
            - Egnyte.integrations
      parameters:
        - name: syncId
          in: path
          required: true
          description: UUID of the synced project (e.g. 11111111-2222-3333-4444-555555555555)
          schema:
            type: string
            example: 11111111-2222-3333-4444-555555555555
      responses:
        '200':
          description: Connected project details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncedProject'
              example:
                id: 11111111-2222-3333-4444-555555555555
                jobId: 11111111-2222-3333-4444-555555555555
                folder: /Shared/test
                procoreFolderPaths: []
                project: Project Name
                procoreProjectId: 54321
                serviceAccountName: serviceAccount
                syncType: 2-way sync
                lastSuccessTime: '2024-01-15T10:00:00Z'
                isHealthy: true
                isHealthyNote: null
                skipped: []
        '400':
          description: Input Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '401':
          description: Not Authorized (token expired, invalid or missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
              example:
                code: gateway_error_forbidden_not_authorized
                message: API Gateway error - authorization invalid or missing - check the token
        '403':
          description: 'Missing Scope (code: missing_scope_error)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '500':
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
    patch:
      tags:
        - procore
      summary: Update sync option
      description: Update sync option between egnyte folder and procore project. In order to use the API commands, Egnyte's DMSA key must be verified once per company via setting up a sync in the Egnyte WebUI.
      operationId: updateSync
      security:
        - CodeGrantAuth:
            - Egnyte.integrations
      parameters:
        - name: syncId
          in: path
          required: true
          description: UUID of the synced project
          schema:
            type: string
            example: 11111111-2222-3333-4444-555555555555
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/updateSyncRequest'
      responses:
        '200':
          description: Sync was updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncFromDB'
              examples:
                SyncFromDB:
                  $ref: '#/components/examples/SyncFromDB'
        '400':
          description: Input Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '401':
          description: Not Authorized (token expired, invalid or missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
              example:
                code: gateway_error_forbidden_not_authorized
                message: API Gateway error - authorization invalid or missing - check the token
        '403':
          description: 'Missing Scope (code: missing_scope_error)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '500':
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
    delete:
      tags:
        - procore
      summary: Remove sync project
      description: Remove sync between egnyte folder and procore project. In order to use the API commands, Egnyte's DMSA key must be verified once per company via setting up a sync in the Egnyte WebUI.
      operationId: removeSync
      security:
        - CodeGrantAuth:
            - Egnyte.integrations
      parameters:
        - name: syncId
          in: path
          required: true
          description: UUID of the synced project
          schema:
            type: string
            example: 11111111-2222-3333-4444-555555555555
      responses:
        '204':
          description: Sync is removed
        '400':
          description: Input Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '401':
          description: Not Authorized (token expired, invalid or missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
              example:
                code: gateway_error_forbidden_not_authorized
                message: API Gateway error - authorization invalid or missing - check the token
        '403':
          description: 'Missing Scope (code: missing_scope_error)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '500':
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
  /v1/procore/company/{companyId}/projects:
    get:
      tags:
        - procore
      summary: List Procore projects
      description: List Procore projects for given company account. In order to use the API commands, Egnyte's DMSA key must be verified once per company via setting up a sync in the Egnyte WebUI.
      operationId: listProcoreProjects
      security:
        - CodeGrantAuth:
            - Egnyte.integrations
      parameters:
        - name: companyId
          in: path
          required: true
          description: Procore company ID
          schema:
            type: string
      responses:
        '200':
          description: List of Procore projects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listProcoreProjectsResponse200'
              example:
                - id: 54321
                  name: My Procore Project
                  isSynced: false
                  companyId: 12345
        '400':
          description: Input Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '401':
          description: Not Authorized (token expired, invalid or missing)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
              example:
                code: gateway_error_forbidden_not_authorized
                message: API Gateway error - authorization invalid or missing - check the token
        '403':
          description: 'Missing Scope (code: missing_scope_error)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
        '500':
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
  /v1/properties/project-tag/custom-fields:
    get:
      summary: List all custom field definitions
      description: Fetch all project custom field definitions for the domain.
      operationId: portal-prod-get-project-custom-fields-v1
      responses:
        '200':
          description: Custom field definitions returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomFieldsListResponse'
              example:
                keys:
                  budget_code:
                    name: budget_code
                    displayName: Budget Code
                    type: string
                    helpText: Enter the project budget code
                    priority: 100
                    createdAt: '2026-03-10T10:30:00Z'
                    updatedAt: '2026-03-10T10:30:00Z'
                  project_category:
                    name: project_category
                    displayName: Project Category
                    type: enum
                    data:
                      - Infrastructure
                      - Development
                      - Research
                      - Operations
                    helpText: Select the project category
                    priority: 150
                    createdAt: '2026-03-10T10:35:00Z'
                    updatedAt: '2026-03-10T10:35:00Z'
                  project_tags:
                    name: project_tags
                    displayName: Project Tags
                    type: labels
                    data:
                      - high-priority
                      - customer-facing
                      - internal
                    helpText: Add relevant tags for this project
                    priority: 200
                    createdAt: '2026-03-10T10:40:00Z'
                    updatedAt: '2026-03-10T11:20:00Z'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - project-custom-fields
    post:
      summary: Create a custom field definition
      description: |-
        Create a new project custom field definition.

        **Validation rules:**
        - `enum` and `multi_value_enum` fields require a non-empty `data` array.
        - `labels` fields accept an optional `data` array.
        - Primitive types (`string`, `integer`, `decimal`, `date`) must not include `data`.
        - `project_status` is a reserved field. New custom status values can be added to it, but its `displayName`, `helpText`, `priority`, and default status cannot be modified.
        - The internal `name` is auto-derived from `displayName` (lowercase, spaces → hyphens). Duplicate names are resolved with numeric suffixes (e.g., `field-1`, `field-2`).
        - The domain's maximum custom fields limit must not be exceeded.
      operationId: portal-prod-post-project-custom-field-v1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldCreateRequest'
            examples:
              labels_field:
                summary: Create a Labels field
                value:
                  displayName: Project Tags
                  type: labels
                  data:
                    - infrastructure
                    - customer-facing
                    - internal
                  helpText: Add relevant tags (you can add custom values)
                  priority: 200
              multi_select_dropdown:
                summary: Create a Multi-Select Dropdown field
                value:
                  displayName: Project Tags
                  type: multi_value_enum
                  data:
                    - infrastructure
                    - customer-facing
                    - internal
                  helpText: Add relevant tags (you can add custom values)
                  priority: 200
      responses:
        '201':
          description: Custom field created successfully (empty body).
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - project-custom-fields
  /v1/properties/project-tag/custom-fields/{field_name}:
    patch:
      summary: Update a custom field definition
      description: |-
        Update an existing custom field definition. All body fields are optional.

        **Behavior by type for `data`:**
        - **Dropdown with single select (`enum`):** New values *replace* existing values.
        - **Dropdown with multi select (`multi_value_enum`) and labels:** New values are *appended* to existing values.
      operationId: portal-prod-patch-project-custom-field-v1
      parameters:
        - $ref: '#/components/parameters/FieldName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomFieldUpdateRequest'
            example:
              displayName: Project Tags (Updated)
              data:
                - architecture
              helpText: Updated help text for project tags
              priority: 150
      responses:
        '204':
          description: Update successful (empty body).
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - project-custom-fields
    delete:
      summary: Delete a custom field definition
      description: |-
        Delete a custom field definition and remove all its values from all existing projects.

        **Warning:** This operation cannot be undone.

        When the field is in use, a `403` error is returned. Set the `X-Egnyte-Force-Delete` header to `Yes` to force deletion.
      operationId: portal-prod-delete-project-custom-field-v1
      parameters:
        - $ref: '#/components/parameters/FieldName'
        - $ref: '#/components/parameters/ForceDelete'
      responses:
        '204':
          description: Field deleted successfully (empty body).
        '403':
          description: 'Field is in use. Set `X-Egnyte-Force-Delete: Yes` to override.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - project-custom-fields
  /v1/properties/project-tag/custom-fields/{field_name}/data:
    patch:
      summary: Delete custom field definition data
      description: |-
        Remove specific predefined values from an `enum`, `labels`, or `multi_value_enum` field and clear their usage from all existing projects.

        **Warning:** This operation cannot be undone.

        When the field data is in use, a `403` error is returned. Set the `X-Egnyte-Force-Delete` header to `Yes` to force deletion.

        The request body is a JSON array of string values to delete.
      operationId: portal-prod-patch-project-custom-field-data-v1
      parameters:
        - $ref: '#/components/parameters/FieldName'
        - $ref: '#/components/parameters/ForceDelete'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal-prod-patch-project-custom-field-data-v1Request'
            example:
              - infrastructure
              - customer-facing
              - internal
      responses:
        '204':
          description: Data deleted successfully (empty body).
        '403':
          description: 'Field data is in use. Set `X-Egnyte-Force-Delete: Yes` to override.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
      tags:
        - project-custom-fields
  /v2/project-folders:
    get:
      summary: List all projects
      description: Lists all project folders in the domain.  The response includes a JSON array of project objects.  Pagination parameters can be supplied via query string to control the number of results returned.
      operationId: listProjectFolders
      parameters:
        - name: startIndex
          in: query
          required: false
          description: The 1‑based index of the first result (pagination)
          schema:
            type: integer
            minimum: 1
        - name: count
          in: query
          required: false
          description: Number of entries per page (max 100)
          schema:
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: List of projects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listProjectFoldersResponse200'
              example:
                itemsPerPage: 2
                totalResults: 2
                startIndex: 1
                resources:
                  - id: a69bd625-1dc3-4dcf-98f5-8e3e3fbb0b29
                    rootFolderId: b133ce0d-2e79-4cf8-bf3a-8758f7b117b3
                    name: Acme Widgets HQ
                    projectId: ABC-123
                    customerName: Acme Widgets
                    status: in-progress
                    startDate: 2022-11-01T00:00:00.000+0000
                    completionDate: null
                  - id: b7c30e681-bf0d-462e-b6cf-7471844962df
                    rootFolderId: 9d3be0f3-8def-4923-8e56-76b4b1e498f2
                    name: Project Beta
                    projectId: XYZ-789
                    customerName: Beta Co
                    status: pending
                    startDate: 2023-03-01T00:00:00.000+0000
                    completionDate: null
        '400':
          description: Bad request
        '401':
          description: Not authorized
        '403':
          description: Forbidden
        '500':
          description: Unexpected server error
      tags:
        - project_folders
  /v1/project-folders:
    post:
      summary: Mark folder as project
      description: Converts an existing folder into a project folder.  Supply the root folder ID, a name for the project and a status.  Optionally include a description and start and completion dates.  If successful, the new project metadata is returned.
      operationId: markFolderAsProject
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/markFolderAsProjectRequest'
            example:
              rootFolderId: 5bd7337c-b303-46a0-938d-0365352a5c74
              name: Egnyte's new project, Mountain View, CA
              description: Project description goes here
              status: pending
              startDate: 2022-05-01T12:37:56.000+0000
              completionDate: 2022-11-05T12:37:56.000+0000
      responses:
        '201':
          description: Project created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/markFolderAsProjectResponse201'
              example:
                id: a69bd625-1dc3-4dcf-98f5-8e3e3fbb0b29
                rootFolderId: 5bd7337c-b303-46a0-938d-0365352a5c74
                name: Egnyte's new project, Mountain View, CA
                description: Project description goes here
                status: pending
                startDate: 2022-05-01T12:37:56.000+0000
                completionDate: 2022-11-05T12:37:56.000+0000
        '400':
          description: Bad request
        '401':
          description: Not authorized
        '403':
          description: Forbidden
        '404':
          description: Folder not found
        '500':
          description: Unexpected server error
      tags:
        - project_folders
  /v2/project-folders/{projectId}:
    get:
      summary: Get project details
      description: Retrieves detailed information about a project folder identified by its project ID.  The response includes metadata such as the root folder ID, project name, projectId, customer name, description, location, status and timestamps.
      operationId: getProjectDetails
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project ID assigned when the project folder was created
          schema:
            type: string
      responses:
        '200':
          description: Project details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getProjectDetailsResponse200'
              example:
                id: a69bd625-1dc3-4dcf-98f5-8e3e3fbb0b29
                rootFolderId: b133ce0d-2e79-4cf8-bf3a-8758f7b117b3
                name: Acme Widgets HQ Redesign
                projectId: ABC-123
                customerName: Acme Widgets Co
                description: Redesigned HQ for Acme Widgets
                location:
                  streetAddress1: 123 Main St.
                  streetAddress2: null
                  city: Anytown
                  state: CA
                  country: USA
                  postalCode: '99999'
                status: in-progress
                startDate: 2022-11-01T00:00:00.000+0000
                createdBy: 4
                lastUpdatedBy: 4
                creationTime: 2022-11-02T19:02:31.000+0000
                lastModifiedTime: 2022-11-02T12:09:50.000+0000
        '400':
          description: Bad request
        '401':
          description: Not authorized
        '404':
          description: Project not found
        '500':
          description: Unexpected server error
      tags:
        - project_folders
  /scim/v2/Users:
    get:
      summary: List users
      description: Returns a paginated list of users.  Query parameters `startIndex` (1‑based) and `count` (max 100) control pagination; `filter` lets you retrieve a subset of users by attributes such as userName or email.
      operationId: listScimUsers
      parameters:
        - name: startIndex
          in: query
          required: false
          description: The 1‑based index of the first result
          schema:
            type: integer
            minimum: 1
        - name: count
          in: query
          required: false
          description: Number of results per page (max 100)
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - name: filter
          in: query
          required: false
          description: SCIM filter expression (e.g., userName eq "john")
          schema:
            type: string
      responses:
        '200':
          description: Paginated list of users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listScimUsersResponse200'
              example:
                schemas:
                  - urn:scim:schemas:core:1.0
                totalResults: 2
                itemsPerPage: 2
                startIndex: 1
                Resources:
                  - id: 12345678
                    userName: jmiller
                    externalId: S-1-5-21-...
                    email: john.miller@example.com
                    name:
                      familyName: Miller
                      givenName: John
                    active: true
                  - id: 87654321
                    userName: adoe
                    email: ann.doe@example.com
                    name:
                      familyName: Doe
                      givenName: Ann
                    active: true
        '400':
          description: Bad request (invalid filter or pagination)
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      tags:
        - scim
    post:
      summary: Create user
      description: Creates a new user in the domain.  The request body must contain a SCIM user object with required attributes `userName` and `name`.  Optional attributes include `emails`, `externalId`, `active` and `groups`.
      operationId: createScimUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
            example:
              userName: jdoe
              externalId: '12345'
              emails:
                - value: jane.doe@example.com
                  type: work
              name:
                givenName: Jane
                familyName: Doe
              active: true
              groups: []
      responses:
        '201':
          description: User created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
              example:
                id: 12345679
                userName: jdoe
                externalId: '12345'
                name:
                  givenName: Jane
                  familyName: Doe
                emails:
                  - value: jane.doe@example.com
                    type: work
                active: true
                groups: []
        '400':
          description: Bad request (missing required attributes)
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      tags:
        - scim
  /scim/v2/Users/{userId}:
    get:
      summary: Get user
      description: Retrieves a single user by their ID.
      operationId: getScimUser
      parameters:
        - name: userId
          in: path
          required: true
          description: User ID
          schema:
            type: string
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          description: User not found
      tags:
        - scim
    put:
      summary: Replace user
      description: Replaces a user’s attributes entirely.  Provide a full SCIM user object.
      operationId: replaceScimUser
      parameters:
        - name: userId
          in: path
          required: true
          description: User ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      responses:
        '200':
          description: User replaced
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          description: User not found
      tags:
        - scim
    patch:
      summary: Update user
      description: "Partially updates a user using a SCIM Patch operation (RFC\_7644).  The request body must contain a list of operations to apply."
      operationId: patchScimUser
      parameters:
        - name: userId
          in: path
          required: true
          description: User ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/patchScimUserRequest'
            example:
              schemas:
                - urn:ietf:params:scim:api:messages:2.0:PatchOp
              Operations:
                - op: replace
                  path: name.familyName
                  value: Smith
                - op: add
                  path: emails
                  value:
                    - value: john.smith@example.com
                      type: work
      responses:
        '200':
          description: User updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          description: User not found
      tags:
        - scim
    delete:
      summary: Delete user
      description: Removes a user from the domain.
      operationId: deleteScimUser
      parameters:
        - name: userId
          in: path
          required: true
          description: User ID
          schema:
            type: string
      responses:
        '204':
          description: User deleted
        '404':
          description: User not found
      tags:
        - scim
  /scim/v2/Groups:
    get:
      summary: List groups
      description: Lists custom groups in the domain (default groups are not returned).  Pagination parameters `startIndex` and `count` are supported; a `filter` can be used to match group names.
      operationId: listScimGroups
      parameters:
        - name: startIndex
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: 1‑based index of first result
        - name: count
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: Number of groups per page
        - name: filter
          in: query
          required: false
          schema:
            type: string
          description: Filter by displayName using 'eq', 'co' (contains) or 'sw' (starts with) operators
      responses:
        '200':
          description: List of groups
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listScimGroupsResponse200'
              example:
                schemas:
                  - urn:scim:schemas:core:1.0
                totalResults: 3
                itemsPerPage: 3
                startIndex: 1
                resources:
                  - id: 8b9dd5aa-40ab-4a43-9b76-f55a412c8a6a
                    displayName: IT
                  - id: d5ea2e76-63e4-4b47-92af-0d7ba6972e3c
                    displayName: Finance
                  - id: a1004249-5e29-438f-ad72-b4e90af14ee7
                    displayName: Sales
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      tags:
        - scim
    post:
      summary: Create group
      description: Creates a new custom group.  Provide a `displayName` and optionally a list of member user IDs.
      operationId: createScimGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Group'
            example:
              displayName: Marketing
              members:
                - value: 9967960066
                  display: Test User
                - value: 9967960068
                  display: John Doe
      responses:
        '201':
          description: Group created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      tags:
        - scim
  /scim/v2/Groups/{groupId}:
    get:
      summary: Get group
      description: Returns the details of a single group, including its members.
      operationId: getScimGroup
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
          description: Group ID
      responses:
        '200':
          description: Group details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '404':
          description: Group not found
      tags:
        - scim
    put:
      summary: Replace group
      description: Replaces a group’s attributes and membership entirely.
      operationId: replaceScimGroup
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
          description: Group ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Group'
      responses:
        '200':
          description: Group replaced
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '404':
          description: Group not found
      tags:
        - scim
    patch:
      summary: Update group
      description: Applies partial updates to a group using SCIM Patch operations (e.g. add or remove members).
      operationId: patchScimGroup
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
          description: Group ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/patchScimUserRequest'
      responses:
        '200':
          description: Group updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '404':
          description: Group not found
      tags:
        - scim
    delete:
      summary: Delete group
      description: Removes a group from the domain.
      operationId: deleteScimGroup
      parameters:
        - name: groupId
          in: path
          required: true
          schema:
            type: string
          description: Group ID
      responses:
        '204':
          description: Group deleted
        '404':
          description: Group not found
      tags:
        - scim
  /v1/search:
    get:
      summary: Search files and folders (v1)
      description: Performs a keyword search across file names, folder names, full‑text content and metadata.  The `query` parameter is required and must be between 3 and 100 characters.  Optional parameters control pagination and filtering by folder or modification/upload dates and specify whether to include snippets.
      operationId: searchV1Get
      parameters:
        - name: query
          in: query
          required: true
          description: Search string (3–100 characters)
          schema:
            type: string
        - name: offset
          in: query
          required: false
          description: 0‑based index of the first result
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          required: false
          description: Number of results per page (1–20)
          schema:
            type: integer
            minimum: 1
            maximum: 20
        - name: folder
          in: query
          required: false
          description: Limit search to a specific folder and its descendants (URL‑encoded path)
          schema:
            type: string
        - name: modified_before
          in: query
          required: false
          description: Return items modified before this ISO‑8601 timestamp
          schema:
            type: string
            format: date-time
        - name: modified_after
          in: query
          required: false
          description: Return items modified after this ISO‑8601 timestamp
          schema:
            type: string
            format: date-time
        - name: uploaded_before
          in: query
          required: false
          description: Return items uploaded before this ISO‑8601 timestamp
          schema:
            type: string
            format: date-time
        - name: uploaded_after
          in: query
          required: false
          description: Return items uploaded after this ISO‑8601 timestamp
          schema:
            type: string
            format: date-time
        - name: type
          in: query
          required: false
          description: Restrict search to file or folder objects
          schema:
            type: string
            enum:
              - FILE
              - FOLDER
        - name: snippet_requested
          in: query
          required: false
          description: Whether to include snippets in the results.
          schema:
            type: boolean
            default: true
        - name: sort_by
          in: query
          required: false
          description: Field used for sorting
          schema:
            type: string
            enum:
              - last_modified
              - size
              - name
              - score
        - name: sort_direction
          in: query
          required: false
          description: Sort direction
          schema:
            type: string
            enum:
              - ascending
              - descending
        - name: file_query_fields
          in: query
          required: false
          description: Search files in specific fields.
          schema:
            type: string
            enum:
              - ALL
              - FILENAME
              - COMMENTS
              - CONTENT
            default: ALL
        - name: folder_query_fields
          in: query
          required: false
          description: Search folders in specific fields.
          schema:
            type: string
            enum:
              - ALL
              - FOLDERNAME
              - DESCRIPTION
            default: ALL
        - name: query_operator
          in: query
          required: false
          description: Match all words or any word.
          schema:
            type: string
            enum:
              - ANY
              - ALL
            default: ANY
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchV1GetResponse200'
              example:
                results:
                  - name: LocalCloudPress.doc
                    path: /Shared/Documents/Sales/Proposals/LocalCloudPress.doc
                    type: application/msword
                    size: 28672
                    snippet: Egnyte brings its storage cloud closer to home...
                    entry_id: 2c8e1083-47f8-4d57-94dc-fd05429b7ec3
                    group_id: 61ed8373-6ff8-493f-8c6f-g4d8a05867243
                    last_modified: '2020-01-14T22:19:29Z'
                    uploaded_by: David Pfeffer
                    uploaded_by_username: david
                    num_versions: 1
                    snippet_html: Egnyte brings its storage cloud closer to home...
                    is_folder: false
                total_count: 20
                offset: 0
                count: 1
        '400':
          description: Invalid query or parameters
        '401':
          description: Unauthorized
        '403':
          description: Forbidden – user lacks permission to access search results.
        '404':
          description: Not found – specified folder does not exist.
        '429':
          description: Rate limited – too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Server error
      tags:
        - search
    post:
      summary: Search files and folders with metadata (v1 POST)
      description: Performs a search and allows searching of custom metadata by specifying a JSON body.  Provide the `query` string plus optional arrays for `namespaces` and `custom_metadata` objects with namespace, key, operator and value fields.
      operationId: searchV1Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/searchV1PostRequest'
            example:
              query: test
              offset: 0
              count: 20
              namespaces:
                - namespace1
                - namespace2
              custom_metadata:
                - namespace: bear
                  key: the name
                  operator: EQUALS
                  value: hi
      responses:
        '200':
          description: Search results including metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchV1PostResponse200'
              example:
                count: 1
                total_count: 1
                hasMore: false
                results:
                  - name: temp_image.jpg
                    path: /Shared/images/temp_image.jpg
                    type: image/jpeg
                    entry_id: 1603e372-75f2-4b9f-af74-080dec5e4aef
                    group_id: 1234567c-ac62-222f-a5d5-e84aaa4050f0
                    last_modified: '2020-08-27T01:31:00Z'
                    uploaded_by: Grant Yanng
                    uploaded_by_username: gyang
                    custom_properties:
                      - scope: public
                        namespace: bear
                        key: the name
                        value: hi
                      - scope: public
                        namespace: namespace1
                        key: key1
                        value: value1
                    snippet: ''
                    snippet_html: ''
                    size: 80972
                offset: 0
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden – user lacks permission to access search results.
        '404':
          description: Not found – specified folder does not exist.
        '429':
          description: Rate limited – too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Server error
      tags:
        - search
  /v2/search:
    post:
      summary: Search with custom metadata (v2)
      description: Performs a metadata‑aware search.  Provide `offset`, `count`, an optional list of `namespaces` and an array of `custom_metadata` filters.  Each filter object requires a `namespace`, `key` and an `operator` (EQUALS, GREATER_THAN, LESS_THAN, BETWEEN, IN, HAS_KEY, HAS_NOT_KEY, CONTAINS, SUB_SET).  The response includes a list of matching files with a `custom_properties` array.
      operationId: searchV2Post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/searchV2PostRequest'
            example:
              offset: 0
              count: 20
              namespaces:
                - namespace1
                - namespace2
              custom_metadata:
                - namespace: ns1
                  key: status
                  operator: EQUALS
                  value: active
                - namespace: ns1
                  key: priority
                  operator: GREATER_THAN
                  value: 3
                - namespace: ns1
                  key: effort
                  operator: LESS_THAN
                  value: 40
                - namespace: ns1
                  key: review_date
                  operator: BETWEEN
                  range:
                    start: 1704085200000
                    end: 1735621200000
                - namespace: ns2
                  key: document_type
                  operator: IN
                  values:
                    - invoice
                    - contract
                - namespace: ns2
                  key: metadata_map
                  operator: HAS_KEY
                - namespace: ns2
                  key: metadata_map
                  operator: HAS_NOT_KEY
                - namespace: ns2
                  key: description
                  operator: CONTAINS
                  value: budget
                - namespace: egnyte document tags
                  key: document type
                  operator: SUB_SET
                  values:
                    - Employee Handbook
                    - Balance Sheet
                    - Annual Reports
      responses:
        '200':
          description: Search results with metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchV2PostResponse200'
              example:
                count: 2
                offset: 0
                total_count: 2
                results:
                  - name: cat.txt
                    path: /Shared/test/cat.txt
                    type: text/plain
                    entry_id: b1be1ef9-65be-4b7a-bbd3-0e9e9b13accf
                    group_id: f457a871-9293-470d-8ca5-65223e2bede4
                    last_modified: '2023-11-20T15:04:52Z'
                    uploaded_by: admin
                    uploaded_by_username: admin
                    custom_properties: []
                    snippet: ''
                    snippet_html: ''
                    size: 6
                  - name: dog.txt
                    path: /Shared/test/dog.txt
                    type: text/plain
                    entry_id: c2be1ef9-65be-4b7a-bbd3-0e9e9b13accf
                    group_id: f457a871-9293-470d-8ca5-65223e2bedf4
                    last_modified: '2023-11-20T15:04:53Z'
                    uploaded_by: admin
                    uploaded_by_username: admin
                    custom_properties: []
                    snippet: ''
                    snippet_html: ''
                    size: 10
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden – user lacks permission to access search results.
        '404':
          description: Not found – specified folder does not exist.
        '429':
          description: Rate limited – too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Server error
      tags:
        - search
  /v1/advanced_search:
    post:
      summary: Advanced search (v1)
      description: Performs an advanced search using a structured JSON criteria object.  Parameters may include `keywords`, `path`, `owners`, date ranges such as `uploadedAfter` and `uploadedBefore`, and numeric filters like `sizeGreaterThan` and `sizeLessThan`.  This endpoint mirrors the advanced search capabilities of the Egnyte web UI.
      operationId: advancedSearchV1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/advancedSearchV1Request'
            example:
              keywords: invoice
              path: /Shared/Accounting
              owners:
                - jdoe
              uploadedAfter: '2023-01-01T00:00:00Z'
              uploadedBefore: '2023-12-31T23:59:59Z'
              sizeGreaterThan: 1000
              sizeLessThan: 5000000
      responses:
        '200':
          description: Advanced search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/advancedSearchV1Response200'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized
        '403':
          description: Forbidden – user lacks permission to access search results.
        '429':
          description: Rate limited – too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '500':
          description: Server error
      tags:
        - search
  /v1/sfdc/foldermap/{recordId}:
    get:
      summary: Get folder mapping for a Salesforce record
      description: Retrieves the Egnyte folder mapped to a Salesforce record.  Supply the 18‑character Salesforce record ID as the path parameter.  The response returns the folder path and folder UUID.
      operationId: getSfdcFolderMap
      parameters:
        - name: recordId
          in: path
          required: true
          description: 18‑character Salesforce record ID
          schema:
            type: string
            minLength: 18
            maxLength: 18
      responses:
        '200':
          description: Folder mapping
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SfdcFolderMap'
              example:
                path: Accounts/ABC
                folder_id: a74bb119-724a-4264-ad82-62226e2368ea
        '400':
          description: Invalid record ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Mapping not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Server error
      tags:
        - sfdc
  /pubapi/v1/egnyte-sign/templates:
    get:
      summary: List Templates
      description: Retrieve a list of active templates available to the authenticated user.
      operationId: list-sign-templates
      tags:
        - sign
      parameters:
        - name: status
          in: query
          required: false
          description: Filter templates by status.
          schema:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
        - name: sort_by
          in: query
          required: false
          description: Field to sort results by.
          schema:
            type: string
            enum:
              - name
              - created_at
        - name: sort_direction
          in: query
          required: false
          description: Sort direction.
          schema:
            type: string
            enum:
              - ASC
              - DESC
      responses:
        '200':
          description: List of templates returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-sign-templatesResponse200'
              example:
                count: 2
                results:
                  - template_id: a0c989ce-9126-4437-ad1f-44c166eea083
                    name: Agreement
                    description: ''
                    status: ACTIVE
                    created_by: 12
                    full_name: John Doe
                    created_at: '2026-01-02T11:33:12Z'
        '400':
          description: Bad request – invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – invalid or expired OAuth token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /pubapi/v1/egnyte-sign/templates/{template_id}:
    get:
      summary: Get Template Details
      description: Retrieve detailed information about a specific template, including participants and document configuration.
      operationId: get-sign-template
      tags:
        - sign
      parameters:
        - name: template_id
          in: path
          required: true
          description: Unique identifier for the template (UUID)
          schema:
            type: string
      responses:
        '200':
          description: Template details returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetail'
              example:
                template_id: 54680c8d-094b-473e-b47d-c8e35c84dd16
                name: NDA
                description: ''
                status: ACTIVE
                target_location: /Shared/Documents
                is_ordered_signing: false
                email_message: ''
                expiration_days: 30
                signer_allowed_to_reassign: false
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Template not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /pubapi/v1/egnyte-sign/signature-requests:
    post:
      summary: Create Signature Request
      description: Create a signature request from an existing template. If the template includes role-based participants, you must provide recipient mappings.
      operationId: create-signature-request
      tags:
        - sign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-signature-requestRequest'
            example:
              template_id: 016d7399-b16e-4b6b-9ed9-fa2bb6114997
              signature_request_name: NDA of 2026A
              email_message: Hi, Please sign this document
              recipients:
                - template_participant_id: 357abea8-6c1e-488f-b3e7-5f90b0cad255
                  email: john.doe@externalmail.com
      responses:
        '200':
          description: Signature request created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-signature-requestResponse200'
        '400':
          description: Bad request – missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Template not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /pubapi/v1/egnyte-sign/signature-requests/sent-requests:
    get:
      summary: List Sent Signature Requests
      description: Retrieve all signature requests sent by the authenticated user.
      operationId: list-sent-signature-requests
      tags:
        - sign
      parameters:
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - INPROGRESS
              - DECLINED
              - COMPLETED
              - CANCELLED
              - EXPIRED
              - FAILED
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - name
              - dueDate
              - createdAt
        - name: sort_direction
          in: query
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: Sent signature requests returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-sent-signature-requestsResponse200'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /pubapi/v1/egnyte-sign/signature-requests/{agreement_id}/cancel:
    post:
      summary: Cancel Signature Request
      description: Cancel an in-progress signature request. This action cannot be undone.
      operationId: cancel-signature-request
      tags:
        - sign
      parameters:
        - name: agreement_id
          in: path
          required: true
          description: Unique identifier for the signature request to cancel (UUID)
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/cancel-signature-requestRequest'
            example:
              message: Document no longer required
      responses:
        '200':
          description: Signature request cancelled successfully.
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Signature request not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /pubapi/v1/egnyte-sign/signature-requests/my-requests:
    get:
      summary: List Assigned Signature Requests
      description: Retrieve all signature requests assigned to the authenticated user.
      operationId: list-my-signature-requests
      tags:
        - sign
      parameters:
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - INPROGRESS
              - DECLINED
              - COMPLETED
              - CANCELLED
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - name
              - dueDate
              - createdAt
        - name: sort_direction
          in: query
          required: false
          schema:
            type: string
            enum:
              - ASC
              - DESC
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: Assigned signature requests returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-my-signature-requestsResponse200'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /v1/workflows/tasks:
    get:
      summary: List tasks assigned to the current user
      description: Returns a paginated list of workflow tasks assigned to the authenticated user.  Optional query parameters allow filtering by task status (NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, APPROVED, REJECTED, COMPLETED), controlling the page size (limit), specifying an offset for pagination, and sorting by name, due date, status or task type in ascending or descending order.
      operationId: list-tasks
      tags:
        - tasks
      parameters:
        - name: status
          in: query
          description: Filter tasks by status.  Valid values are NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, APPROVED, REJECTED or COMPLETED.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum number of tasks to return per request.  Defaults to 50 and must be between 1 and 50.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
        - name: offset
          in: query
          description: Zero‑based index used with limit to paginate results.  Defaults to 0.
          required: false
          schema:
            type: integer
            minimum: 0
        - name: sortBy
          in: query
          description: Field by which to sort results.  Accepts NAME, DUE_DATE, STATUS or TASK_TYPE and defaults to DUE_DATE.
          required: false
          schema:
            type: string
        - name: sortDirection
          in: query
          description: Sort direction.  Either ASC or DESC.  Defaults to ASC.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A JSON object containing the list of tasks and the total count
          content:
            application/json:
              example:
                results:
                  - id: 37296067-29b3-4ce7-b419-45249a1b3e9e
                    name: Review
                    description: Please review this policy update
                    creationDate: '2022-02-22T16:49:27.812Z'
                    dueDate: '2022-02-26T06:59:59.999Z'
                    completionDate: null
                    status: IN_PROGRESS
                    taskType: REVIEW
                    workflow:
                      id: f1ae9f50-c5fc-45b1-9345-67e98f906d63
                      name: Policy Update
                    assigner:
                      id: 1
                      username: jsmith
                      firstName: James
                      lastName: Smith
                      email: jsmith@example.com
                    file:
                      groupId: 3d1d09d3-4533-4f90-b561-2d4ecdeba259
                      entryId: 19efb714-db45-44c5-8e47-f185f0fdd5d9
                totalCount: 28
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized – missing or invalid token
        '500':
          description: Internal server error
  /v1/userinfo:
    get:
      summary: Get user information for a token
      description: Returns basic user information (id, first name, last name, username) associated with the OAuth access token presented in the Authorization header.
      operationId: get-userinfo
      tags:
        - tokens
      parameters: []
      responses:
        '200':
          description: A JSON object describing the user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserInfo'
              example:
                id: 123
                first_name: Test
                last_name: User
                username: test
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – the token is invalid or missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /v1/tokens/revoke:
    post:
      summary: Revoke an OAuth token
      description: Revokes a bearer token.  This endpoint accepts a form‑encoded body with a single `token` field containing the token to revoke.
      operationId: revoke-token
      tags:
        - tokens
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/revoke-tokenRequest'
            example:
              token: 68zc95e3xv954u6k3hbnma3q
      responses:
        '200':
          description: Token revoked successfully
        '400':
          description: Invalid request – missing or malformed token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized – the token used to authorize the request is invalid or expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error
  /pubapi/v1/fs/trash:
    get:
      summary: List Trash Contents (v1)
      description: |
        Retrieve a paginated list of all items in the trash. **Deprecated:** Use GET /pubapi/v2/fs/trash for new integrations.
      operationId: listTrashV1
      deprecated: true
      tags:
        - Trash
      parameters:
        - name: sort_by
          in: query
          required: false
          description: Field to sort by.
          schema:
            type: string
            enum:
              - date_deleted
              - name
              - deleted_by
              - purge_date
            default: date_deleted
        - name: sort_direction
          in: query
          required: false
          description: Sort order.
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: count
          in: query
          required: false
          description: Number of entries per page.
          schema:
            type: integer
            default: 50
        - name: offset
          in: query
          required: false
          description: Zero-based index of the first entry to return.
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Paginated list of trash items.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listTrashV1Response200'
              example:
                count: 2
                offset: 0
                total_count: 2
                items:
                  - id: NWM5ZTViMWMtOWMxNS00MDM3LWE5NjgtYTkzYzlhNTgzZjg4fDE0NjA5OTU4OTgwOTh8ZmlsZQ
                    type: file
                    path: /Private/asmith/2013-06-22 12.36.20.jpg
                    name: 2013-06-22 12.36.20.jpg
                    size: 1733
                    deleted_by: Ashley Smith
                    delete_date: '2016-04-18T16:11:38Z'
                    purge_date: '2016-05-19T00:00:00Z'
                    last_modified: '2016-04-18T16:11:09Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
    post:
      summary: Restore or Permanently Delete Items from Trash
      description: |
        Restore or permanently delete up to 10 files, folders, or versions from the trash. Set `action` to `RESTORE` to restore items to their original locations, or `PURGE` to permanently delete them. Purged items cannot be recovered.
      operationId: trashAction
      tags:
        - Trash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/trashActionRequest'
            example:
              action: RESTORE
              ids:
                - NWM5ZTViMWMtOWMxNS00MDM3LWE5NjgtYTkzYzlhNTgzZjg4fDE0NjA5OTU4OTgwOTh8ZmlsZQ
      responses:
        '200':
          description: All items were successfully processed. No response body.
        '207':
          description: Multi-status — some items succeeded, some failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/trashActionResponse207'
              example:
                resources:
                  - id: NWM5ZTViMWMtOWMxNS00MDM3LWE5NjgtYTkzYzlhNTgzZjg4fDE0NjA5OTU4OTgwOTh8ZmlsZQ
                    code: '200'
                  - id: Y2U3MDVlNmItOWJhYS00ZjA2LTk5Y2EtNTZlMzA4YjFmNTkzfDE0NjA5OTU4OTc4OTZ8ZmlsZQ
                    code: '404'
                    descriptions: Item is not in the trash
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /pubapi/v2/fs/trash:
    get:
      summary: List Trash Contents (v2)
      description: |
        Retrieve a paginated list of all items in the trash with optional filtering by user and date range.
      operationId: listTrashV2
      tags:
        - Trash
      parameters:
        - name: sort_by
          in: query
          required: false
          description: Field to sort by.
          schema:
            type: string
            enum:
              - date_deleted
              - name
              - deleted_by
              - purge_date
              - orig_location
              - owner
              - type
            default: date_deleted
        - name: sort_direction
          in: query
          required: false
          description: Sort order.
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: count
          in: query
          required: false
          description: Number of entries per page.
          schema:
            type: integer
            default: 50
        - name: offset
          in: query
          required: false
          description: Zero-based index of the first entry to return.
          schema:
            type: integer
            default: 0
        - name: deletedBy
          in: query
          required: false
          description: Filter by user's first and/or last name (URL-encoded). Required if startDate or endDate is used.
          schema:
            type: string
        - name: startDate
          in: query
          required: false
          description: Start of date range in ISO-8601 format (e.g. 2016-04-18T16:11:38Z). Required if deletedBy or endDate is used.
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          required: false
          description: End of date range in ISO-8601 format. Required if deletedBy or startDate is used.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Paginated list of trash items.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listTrashV2Response200'
              example:
                count: 2
                offset: 0
                has_more: false
                items:
                  - id: NWM5ZTViMWMtOWMxNS00MDM3LWE5NjgtYTkzYzlhNTgzZjg4fDE0NjA5OTU4OTgwOTh8ZmlsZQ
                    type: file
                    path: /Private/asmith/2013-06-22 12.36.20.jpg
                    name: 2013-06-22 12.36.20.jpg
                    size: 1733
                    deleted_by: Ashley Smith
                    delete_date: '2016-04-18T16:11:38Z'
                    purge_date: '2016-05-19T00:00:00Z'
                    last_modified: '2016-04-18T16:11:09Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /pubapi/v2/fs/trash/totalcount:
    get:
      summary: Get Trash Total Count
      description: |
        Retrieve the total count of items in the trash without fetching the full list. Use this endpoint before paginating with the v2 list endpoint.
      operationId: getTrashTotalCount
      tags:
        - Trash
      responses:
        '200':
          description: Total count of items in the trash.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getTrashTotalCountResponse200'
              example:
                totalCount: 2
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /v1/upload-requests/templates:
    get:
      summary: List Templates
      description: |
        Retrieves a list of available upload request templates. Use this endpoint to obtain template IDs and default instructions needed when creating upload requests.
      operationId: listUploadRequestTemplates
      tags:
        - Templates
      security:
        - BearerAuth: []
      responses:
        '200':
          description: Templates returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listUploadRequestTemplatesResponse200'
              example:
                - templateId: 74403afb-1f9b-43f4-b219-a5acd29c41e0
                  version: '1.0'
                  name: Account Onboarding
                  status: ACTIVE
                  assigneeInstructions: Provide the following documents to help us create your account
        '400':
          description: Bad request — invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.uploadrequests scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v1/upload-requests:
    post:
      summary: Create Upload Request
      description: |
        Creates a new upload request and sends it to one or more assignees. Assignees can be internal users (identified by `userId`) or external users (identified by `externalEmail`).
      operationId: createUploadRequest
      tags:
        - Upload Requests
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUploadRequestBody'
            example:
              name: Account Onboarding
              dueDate: '2026-12-31T23:59:59.000Z'
              folderId: 6e4465e9-2713-4b16-a787-3560b50f2236
              templateId: 0af99f3d-a2d6-4a4e-af81-b2aab2d58787
              assignees:
                - userId: 47
                - externalEmail: bob@example.com
              assigneeInstructions: Provide the following documents to help us create your account
      responses:
        '201':
          description: Upload request created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateUploadRequestResponse'
              example:
                id: e250227d-044c-45b5-9dbb-c1120a856b84
        '400':
          description: Bad request — invalid request body or missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or expired token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — missing Egnyte.uploadrequests scope or insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — template ID or folder ID does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests — rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
  /v2/users:
    get:
      summary: List users
      description: Retrieves a paginated list of users.  Administrators can filter the results using the `filter` parameter, and control pagination using the `startIndex` and `count` query parameters.  The response includes SCIM pagination attributes (`itemsPerPage`, `totalResults`, `startIndex`) and an array of user resources.
      operationId: list-users
      tags:
        - users
      parameters:
        - name: startIndex
          in: query
          description: 1‑based index of the first search result. Defaults to 1.
          required: false
          schema:
            type: integer
            minimum: 1
        - name: count
          in: query
          description: Maximum number of users to return.  Must be a non‑negative integer and defaults to 100.
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 100
        - name: filter
          in: query
          description: Filter expression to limit results to users matching specified attributes (e.g. `userName eq "john"`).  Supported attributes include userName, email and externalId.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A SCIM list response containing user resources
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListResponse'
              example:
                totalResults: 1
                itemsPerPage: 1
                startIndex: 1
                resources:
                  - id: 12345678
                    userName: jmiller
                    email: jmiller@example.com
                    name:
                      givenName: John
                      familyName: Miller
                    active: true
                    authType: sso
                    userType: power
                    groups:
                      - displayName: Marketing Team
                        value: 1ee2e04c-bdde-42ee-ae07-c3aad375f6da
        '400':
          description: Malformed filter or pagination parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error
    post:
      summary: Create a user
      description: Creates a new user.  Required fields include userName, email, name, active, authType and userType.  Additional options include sending an invitation email and specifying a language or externalId.  Returns the created user resource.
      operationId: create-user
      tags:
        - users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-userRequest'
            example:
              userName: jmiller
              email: jmiller@example.com
              name:
                givenName: John
                familyName: Miller
              active: true
              sendInvite: false
              authType: sso
              userType: power
      responses:
        '201':
          description: User created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResource'
              example:
                id: 12345678
                userName: jmiller
                email: jmiller@example.com
                name:
                  familyName: Miller
                  givenName: John
                  formatted: John Miller
                active: true
                locked: false
                authType: sso
                userType: power
        '400':
          description: Malformed request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: A user with the same userName already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error
  /v2/users/{id}:
    get:
      summary: Get a single user
      description: Retrieves detailed information for a specific user identified by the numeric user id.
      operationId: get-user
      tags:
        - users
      parameters:
        - name: id
          in: path
          description: The unique user id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResource'
              example:
                id: 12345678
                userName: jmiller
                email: jmiller@example.com
                name:
                  familyName: Miller
                  givenName: John
                active: true
                locked: false
                authType: sso
                userType: admin
                groups:
                  - displayName: Marketing Team
                    value: 1ee2e04c-bdde-42ee-ae07-c3aad375f6da
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error
    patch:
      summary: Update a user
      description: Performs a partial update of the specified user.  Only fields present in the request body will be updated.
      operationId: update-user
      tags:
        - users
      parameters:
        - name: id
          in: path
          description: The unique user id
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-userRequest'
            example:
              email: john.miller@example.com
              language: de-DE
              userType: admin
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResource'
        '400':
          description: Malformed request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error
    delete:
      summary: Delete a user
      description: Deletes the specified user.
      operationId: delete-user
      tags:
        - users
      parameters:
        - name: id
          in: path
          description: The unique user id
          required: true
          schema:
            type: integer
      responses:
        '204':
          description: User deleted successfully
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal server error
  /1.0/users:
    get:
      summary: List users (legacy)
      description: Legacy version of the user list endpoint.  It functions similarly to `/v2/users` but may return slightly different field names.  For new integrations use `/v2/users`.  Parameters and responses are omitted here for brevity.
      operationId: list-users-v1
      tags:
        - users
      parameters: []
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests – rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
  /v1/webhooks:
    get:
      summary: List registered webhooks
      description: Returns all webhooks registered by the authenticated client.  Each element includes a webhookId, expiration timestamp and status.
      operationId: list-webhooks
      tags:
        - webhooks
      responses:
        '200':
          description: An array of webhook objects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-webhooksResponse200'
              example:
                - webhookId: c9ac0519-284a-4bee-9574-30ae7891e5dc
                  expires: 2100000000
                  status: enabled
                - webhookId: d2fcb85e-7eaf-4b47-9081-72d622d9c3f1
                  expires: 2100000000
                  status: disabled
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Missing required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      summary: Register a webhook
      description: Registers a new webhook callback.  The request body must include a callback URL (`url`), an array of event type strings (`eventType`) and optionally a comma‑separated list of folder paths to scope the webhook (`path`).  Event type values can be wildcards such as `fs:*` or specific events like `fs:add_file`.
      operationId: register-webhook
      tags:
        - webhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/register-webhookRequest'
            example:
              url: https://example.com/webhook
              eventType:
                - fs:add_file
              path: /Shared/Documents/Invoices,/Shared/Documents/Samples
      responses:
        '201':
          description: Webhook registered successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
              example:
                webhookId: c9ac0519-284a-4bee-9574-30ae7891e5dc
                expires: 2100000000
                status: enabled
        '400':
          description: Input error (invalid URL or event types)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Missing required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Webhook quota exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/webhooks/{webhookId}:
    put:
      summary: Update a webhook
      description: Updates an existing webhook.  Fields that can be updated include `url`, `eventType`, `path`, `status` (enabled or disabled) and custom headers.
      operationId: update-webhook
      tags:
        - webhooks
      parameters:
        - name: webhookId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Identifier of the webhook to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-webhookRequest'
            example:
              url: https://example.com/webhook
              eventType:
                - fs:add_file
              path: /Shared/Documents/Invoices
              status: enabled
              authHeader: AuthHeader
      responses:
        '200':
          description: Webhook updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-webhookResponse200'
        '400':
          description: Input error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Missing required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Webhook not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      summary: Unregister a webhook
      description: Deletes the specified webhook registration.
      operationId: delete-webhook
      tags:
        - webhooks
      parameters:
        - name: webhookId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Identifier of the webhook to delete
      responses:
        '204':
          description: Webhook removed
        '400':
          description: Input error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Missing required scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Webhook not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/webhooks/{webhookId}/status:
    get:
      summary: Get webhook status
      description: Returns the status of a webhook (enabled or disabled) along with its expiration timestamp.
      operationId: get-webhook-status
      tags:
        - webhooks
      parameters:
        - name: webhookId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Identifier of the webhook
      responses:
        '200':
          description: Webhook status information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookStatusResponse'
              example:
                webhookId: c9ac0519-284a-4bee-9574-30ae7891e5dc
                expires: 2100000000
                status: enabled
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the token does not have the Egnyte.webhooks scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Webhook not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      summary: Set webhook status
      description: Updates the status of a webhook to enabled or disabled.  Provide a JSON body with a `status` property set to either `enabled` or `disabled`.
      operationId: set-webhook-status
      tags:
        - webhooks
      parameters:
        - name: webhookId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Identifier of the webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/set-webhook-statusRequest'
            example:
              status: enabled
      responses:
        '200':
          description: Status updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookStatusResponse'
              example:
                webhookId: c9ac0519-284a-4bee-9574-30ae7891e5dc
                expires: 2100000000
                status: disabled
        '400':
          description: Invalid status value
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Webhook not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/webhooks/{webhookId}/details:
    get:
      summary: Get webhook details
      description: Returns full details of a webhook including its ID, expiration timestamp, status, event types, path, auth header and callback URL.
      operationId: get-webhook-details
      tags:
        - webhooks
      parameters:
        - name: webhookId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Identifier of the webhook
      responses:
        '200':
          description: Webhook detail information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookDetailResponse'
              example:
                webhookId: c9ac0519-284a-4bee-9574-30ae7891e5dc
                expires: 2100000000
                status: enabled
                eventType:
                  - event type 1
                  - event type 2
                path: /path/dummypath,/path/samples
                authHeader: AuthHeader
                url: https://myidealurl/?qwer
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden – the token does not have the Egnyte.webhooks scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Webhook not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/whoami:
    get:
      summary: Get basic information about the caller
      description: Returns information about the application and user associated with the current token, including the clientId, username, domain and scopes.
      operationId: whoami
      tags:
        - webhooks
      responses:
        '200':
          description: Information about the current token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiResponse'
              example:
                clientId: hweb8adyh3gumiypa45qdgkm
                username: johndoe
                domain: acme
                scopes:
                  - fs
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/workflows:
    post:
      summary: Create a workflow
      description: Creates a new workflow on a file.  The request body must include a workflow name, the file’s groupId and an array of step definitions.  Optionally include a reasonForChange and workflowType (TODO, APPROVAL or REVIEW_APPROVE).  Each step definition contains a name, type (TODO, REVIEW or APPROVAL), optional description and stepOptions specifying assignees, dueDate, minMustComplete and signatureRequired.
      operationId: create-workflow
      tags:
        - workflows
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-workflowRequest'
            example:
              name: Demo Workflow
              workflowType: REVIEW_APPROVE
              file:
                groupId: 3d1d09d3-4533-4f90-b561-2d4ecdeba259
              steps:
                - name: Document Review
                  type: REVIEW
                  description: Please review this file
                  stepOptions:
                    dueDate: '2022-02-24T18:00:00Z'
                    assignees:
                      - 1
                      - 46
                    minMustComplete: 1
                - name: Document Approval
                  type: APPROVAL
                  description: Please approve this file
                  stepOptions:
                    dueDate: '2022-03-02T18:00:00Z'
                    assignees:
                      - 16
                    signatureRequired: false
      responses:
        '201':
          description: Workflow created successfully
          content:
            application/json:
              example:
                workflowId: 403eeaaf-6997-47f8-bbb0-6092ce4c5196
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
    get:
      summary: List workflows
      description: Returns a list of workflows visible to the caller.  Admins receive all workflows in the domain; non‑admins receive only the workflows they created.  Supports filtering by assignerId, assigneeId, groupId, status and completionStatus, as well as pagination and sorting.
      operationId: list-workflows
      tags:
        - workflows
      parameters:
        - name: assignerId
          in: query
          description: Return workflows created by a specific user
          required: false
          schema:
            type: integer
        - name: assigneeId
          in: query
          description: Return workflows assigned to a specific user
          required: false
          schema:
            type: integer
        - name: groupId
          in: query
          description: Return workflows created on a specific file (groupId of the file)
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: Filter workflows by status (NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, COMPLETED)
          required: false
          schema:
            type: string
        - name: completionStatus
          in: query
          description: Filter completed workflows by approval status (APPROVED, REJECTED)
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum number of workflows to return.  Defaults to 25 and must be between 1 and 25.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 25
        - name: offset
          in: query
          description: Zero‑based index used for pagination
          required: false
          schema:
            type: integer
            minimum: 0
        - name: sortBy
          in: query
          description: Sort by NAME, CREATION_DATE, DUE_DATE, COMPLETION_DATE, WORKFLOW_STATUS or WORKFLOW_COMPLETION_STATUS.
          required: false
          schema:
            type: string
        - name: sortDirection
          in: query
          description: Sort direction (ASC or DESC)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A paginated list of workflows
          content:
            application/json:
              example:
                results:
                  - id: 0ec5926c-afc5-46bd-aa0e-7540e675d808
                    name: Demo Workflow
                    description: null
                    reasonForChange: null
                    creationDate: '2022-02-23T16:19:14.519Z'
                    dueDate: '2022-03-02T18:00:00Z'
                    completionDate: null
                    workflowDisplayId: 85
                    type: REVIEW_APPROVE
                    status: IN_PROGRESS
                    completionStatus: null
                    creator:
                      id: 1
                      username: jsmith
                      firstName: James
                      lastName: Smith
                      email: jsmith@example.com
                    currentStepNum: 1
                    totalSteps: 2
                    currentStepProgress: 0
                    assignees:
                      - id: 1
                        username: grandolph
                        firstName: Greg
                        lastName: Randolph
                        email: grandolph@example.com
                    file:
                      groupId: 3d1d09d3-4533-4f90-b561-2d4ecdeba259
                      entryId: 19efb714-db45-44c5-8e47-f185f0fdd5d9
                totalCount: 85
        '400':
          description: Invalid query parameters
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
  /v1/workflows/{workflowId}:
    get:
      summary: Get workflow details
      description: Fetches the details of a specific workflow, including steps, assignees, status and associated file.
      operationId: get-workflow
      tags:
        - workflows
      parameters:
        - name: workflowId
          in: path
          required: true
          schema:
            type: string
          description: The unique workflow identifier
      responses:
        '200':
          description: Workflow details
          content:
            application/json:
              example:
                id: 0ec5926c-afc5-46bd-aa0e-7540e675d808
                name: Demo Workflow
                reasonForChange: null
                status: IN_PROGRESS
                workflowCompletionStatus: null
                creationDate: '2022-02-23T16:19:14.519Z'
                completionDate: null
                creator:
                  id: 1
                  username: jsmith
                  firstName: James
                  lastName: Smith
                  email: jsmith@example.com
                steps:
                  - id: 85627761-07b2-4ec8-9f94-10d9cd39a92a
                    name: Document Review
                    description: Please review this file
                    type: REVIEW
                    status: IN_PROGRESS
                    dueDate: '2022-02-24T18:00:00Z'
                    startDate: '2022-02-23T16:19:14.635Z'
                    completionDate: null
                    signatureRequired: null
                    minMustComplete: null
                    tasks:
                      - id: 2b4a7375-7131-4f6b-b298-f4bfd59633ae
                        type: REVIEW
                        status: IN_PROGRESS
        '401':
          description: Unauthorized
        '404':
          description: Workflow not found
        '500':
          description: Internal server error
  /v1/workflows/{workflowId}/cancel:
    post:
      summary: Cancel a workflow
      description: Cancels an in‑progress workflow.  Once cancelled, the workflow cannot be resumed.
      operationId: cancel-workflow
      tags:
        - workflows
      parameters:
        - name: workflowId
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the workflow to cancel
      responses:
        '204':
          description: Workflow cancelled successfully
        '401':
          description: Unauthorized
        '404':
          description: Workflow not found
        '500':
          description: Internal server error
  /v1/workflows/{workflowId}/tasks/{taskId}/completion-signal:
    post:
      summary: Send completion signal for a webhook task
      description: Marks a task of type Outbound Webhook as completed.  When using an outbound webhook step with the completion signal option enabled, the payload includes a callback URL; invoke this endpoint to signal completion.
      operationId: complete-webhook-task
      tags:
        - workflows
      parameters:
        - name: workflowId
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the workflow
        - name: taskId
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the task to mark as completed
      responses:
        '204':
          description: Task marked as completed
        '401':
          description: Unauthorized
        '404':
          description: Workflow or task not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
  schemas:
    Agent:
      type: object
      properties:
        agentId:
          type: string
          description: Unique identifier for the agent.
        name:
          type: string
          description: Agent name.
        description:
          type: string
          description: Description of the agent's functionality.
        status:
          type: string
          enum:
            - DRAFT
            - ACTIVE
          description: Current status of the agent.
        subType:
          type: string
          description: Agent sub-type (e.g. TRANSLATION_AGENT, USER_DEFINED).
        category:
          type: string
          enum:
            - TASK
            - QUESTION
            - GENERIC
          description: Agent category.
        instruction:
          type: string
          description: Core instructions provided to the agent.
        createdBy:
          type: string
          description: Display name of the user who created the agent.
    AskRequest:
      type: object
      required:
        - question
      properties:
        question:
          type: string
          description: The question to ask the agent. Maximum 35,000 characters.
          maxLength: 35000
        instructions:
          type: string
          description: Optional system prompt to guide the agent's response.
        conversationId:
          type: string
          description: Conversation identifier for multi-turn context. Omit for the first question.
        chatHistory:
          type: object
          description: Previous conversation messages.
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                    enum:
                      - user
                      - assistant
                  content:
                    type: string
        entryIds:
          type: array
          items:
            type: string
          description: Array of file entry IDs to provide as context.
        selectedItems:
          type: object
          description: Pre-selected files and folders to provide as context.
          properties:
            files:
              type: array
              items:
                type: object
                properties:
                  entryId:
                    type: string
                  filePath:
                    type: string
            folders:
              type: array
              items:
                type: string
    AskResponse:
      type: object
      properties:
        requestId:
          type: string
          description: Unique identifier for this execution request. Use to poll status.
        conversationId:
          type: string
          description: Unique identifier for the conversation thread.
    AgentStatusResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - PENDING
            - RUNNING
            - COMPLETED
            - FAILED
          description: Execution status.
        responseText:
          type: string
          description: The agent's answer. Present only when status is COMPLETED.
        citations:
          type: array
          description: References used to generate the answer. Present only when status is COMPLETED.
          items:
            $ref: '#/components/schemas/Citation'
        lastUpdated:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the last status update.
    Citation:
      type: object
      properties:
        previewUrl:
          type: string
          description: URL of the referenced source.
        type:
          type: string
          description: Source type (e.g. WEB_SEARCH).
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
        message:
          type: string
          description: Human-readable description of the error
        details:
          type: string
          description: Additional context about the error
      required:
        - message
    RateLimitError:
      type: object
      properties:
        errorMessage:
          type: string
        retryAfter:
          type: integer
          description: Seconds to wait before retrying.
    CitationChunk:
      type: object
      properties:
        chunkId:
          type: string
        text:
          type: string
    CitationObject:
      type: object
      properties:
        filename:
          type: string
        entryId:
          type: string
        chunkId:
          type: string
        text:
          type: string
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/CitationChunk'
    AssistantCitationChunk:
      type: object
      properties:
        chunkId:
          type: string
        sourceText:
          type: string
    AssistantCitationObject:
      type: object
      properties:
        filename:
          type: string
        entryId:
          type: string
        objectId:
          type: string
        previewUrl:
          type: string
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/AssistantCitationChunk'
    CopilotCitationObject:
      type: object
      properties:
        filename:
          type: string
        entryId:
          type: string
        objectId:
          type: string
        previewUrl:
          type: string
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/CitationChunk'
    AskDocumentResponse:
      type: object
      properties:
        response:
          type: object
          properties:
            text:
              type: string
        citations:
          type: array
          items:
            $ref: '#/components/schemas/CitationObject'
    SummaryResponse:
      type: object
      properties:
        response:
          type: object
          properties:
            text:
              type: string
    AssistantAskResponse:
      description: Async response from POST /v1/ai/assistant/ask. Use executionId to poll for the result.
      type: object
      properties:
        conversationId:
          type: string
          description: Unique identifier for this conversation
        executionId:
          type: string
          description: Use this to poll GET /v1/ai/assistant/{executionId}/status
        executionStatus:
          type: string
          description: Initial execution status (e.g. IN_PROGRESS)
        truncated:
          type: boolean
        actions:
          type: array
          items:
            type: object
    ToolCall:
      type: object
      properties:
        name:
          type: string
        sourceDisplayName:
          type: string
        toolDisplayName:
          type: string
        thought:
          type: string
        thoughts:
          type: array
          items:
            type: string
        input:
          type: object
        output:
          type: object
        status:
          type: string
        timestamp:
          type: string
        metadata:
          type: object
    PendingAction:
      type: object
      properties:
        type:
          type: string
        serverId:
          type: string
        toolCallId:
          type: string
    AssistantStatusResponse:
      description: Response from GET /v1/ai/assistant/{executionId}/status. Poll until status is no longer IN_PROGRESS.
      type: object
      properties:
        status:
          type: string
          description: 'Possible values: IN_PROGRESS, COMPLETED, FAILED, AWAITING_USER_CONFIRMATION'
        responseText:
          type: string
          description: The AI-generated answer. Populated when status is COMPLETED
        thoughts:
          type: array
          items:
            type: string
        citations:
          type: array
          items:
            $ref: '#/components/schemas/AssistantCitationObject'
        actions:
          type: array
          items:
            type: object
        intent:
          type: string
        lastUpdated:
          type: integer
          format: int64
          description: Unix epoch milliseconds
        numToolCalls:
          type: integer
        pendingActions:
          type: array
          items:
            $ref: '#/components/schemas/PendingAction'
        toolCalls:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ToolCall'
    CopilotAskResponse:
      description: Response shape for the deprecated `/v1/ai/copilot/ask` endpoint. Unlike the async `/v1/ai/assistant/ask` (which returns an `executionId` for polling), this endpoint returns the answer synchronously, with an additional `deprecationNotice` field.
      type: object
      properties:
        response:
          type: object
          properties:
            text:
              type: string
        citations:
          type: array
          items:
            $ref: '#/components/schemas/CopilotCitationObject'
        conversationId:
          type: string
        deprecationNotice:
          type: string
          description: A message indicating that `/v1/ai/copilot/ask` is deprecated and that callers should migrate to `/v1/ai/assistant/ask`.
    KbPath:
      type: object
      properties:
        id:
          type: string
        folderId:
          type: string
        path:
          type: string
        permission:
          type: string
        status:
          type: string
    KbCreatedByUser:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        userName:
          type: string
        userId:
          type: integer
        avatarEosObjectId:
          type: string
    KnowledgeBase:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        paths:
          type: array
          items:
            $ref: '#/components/schemas/KbPath'
        status:
          type: string
        type:
          type: string
        createdBy:
          type: string
        createdByUser:
          $ref: '#/components/schemas/KbCreatedByUser'
        createdOn:
          type: integer
        noResponseMessage:
          type: string
        iconName:
          type: string
        subType:
          type: string
        progress:
          type: integer
        lastProcessedAt:
          type: integer
        pathCount:
          type: integer
        prompts:
          type: array
          items:
            type: object
        subStatus:
          type: string
    KbListResponse:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeBase'
        number:
          type: integer
        size:
          type: integer
        first:
          type: boolean
        last:
          type: boolean
        empty:
          type: boolean
        numberOfElements:
          type: integer
        totalElements:
          type: integer
        totalPages:
          type: integer
        fileLimit:
          type: integer
    KbAskResponse:
      type: object
      properties:
        response:
          type: object
          properties:
            text:
              type: string
        citations:
          type: array
          items:
            $ref: '#/components/schemas/CopilotCitationObject'
        conversationId:
          type: string
    HybridSearchChunk:
      type: object
      properties:
        chunkId:
          type: string
        score:
          type: number
          format: float
        text:
          type: string
    HybridSearchResult:
      type: object
      properties:
        filename:
          type: string
        entryId:
          type: string
        objectId:
          type: string
        chunks:
          type: array
          items:
            $ref: '#/components/schemas/HybridSearchChunk'
    HybridSearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/HybridSearchResult'
        totalElements:
          type: integer
        totalPages:
          type: integer
        number:
          type: integer
        size:
          type: integer
        first:
          type: boolean
        last:
          type: boolean
    AuditReportBaseRequest:
      type: object
      required:
        - format
        - date_start
        - date_end
      properties:
        format:
          type: string
          description: Report format.
          enum:
            - csv
            - json
          example: json
        date_start:
          type: string
          description: Start date in YYYY-MM-DD or ISO 8601 format.
          example: '2019-05-01'
        date_end:
          type: string
          description: End date in YYYY-MM-DD or ISO 8601 format (must be after date_start).
          example: '2019-05-20'
        suppress_emails:
          type: boolean
          description: If true, suppresses email notifications on report completion. Default false.
          example: false
    LoginAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          required:
            - events
          properties:
            events:
              type: array
              description: Events to include.
              items:
                type: string
                enum:
                  - logins
                  - logouts
                  - account_lockouts
                  - password_resets
                  - failed_attempts
              example:
                - logins
                - failed_attempts
            access_points:
              type: array
              description: Access points to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - Web
                  - FTP
                  - Mobile
              example:
                - Web
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
              example:
                - jsmith
                - kjohnson
    FileAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            folders:
              type: array
              description: Absolute folder paths to report on. Required unless file is specified.
              items:
                type: string
              example:
                - /Shared/Marketing
            file:
              type: string
              description: Specific file path to report on. Supports * wildcard (cannot start with *).
              example: /Shared/Marketing/report.pdf
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
              example:
                - jsmith
            transaction_type:
              type: array
              description: Transactions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - upload
                  - download
                  - preview
                  - delete
                  - copy
                  - move
                  - create_folder
                  - restore_trash
                  - delete_trash
                  - create_link
                  - delete_link
                  - download_link
              example:
                - download
                - upload
    PermissionsAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            folders:
              type: array
              description: Absolute folder paths to report on. If omitted, includes all folders.
              items:
                type: string
            assigners:
              type: array
              description: Usernames of users who assigned permissions. If omitted, includes all.
              items:
                type: string
            assignee_users:
              type: array
              description: Usernames of users who received permissions.
              items:
                type: string
            assignee_groups:
              type: array
              description: Group names that received permissions.
              items:
                type: string
    UserAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            action_type:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - CREATE
                  - UPDATE
                  - DISABLE
                  - ENABLE
                  - DELETE
                  - PASSWORD_RESET
                  - PASSWORD_CHANGE
            performed_by:
              type: array
              description: Usernames of users who performed changes.
              items:
                type: string
            include_system_actions:
              type: boolean
              description: If true, includes system-initiated actions. Default false.
            subject:
              type: array
              description: Usernames of users who were modified.
              items:
                type: string
    GroupAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            action_type:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - CREATE
                  - ADD_USERS
                  - REMOVE_USERS
                  - RENAME
                  - DELETE
            users:
              type: array
              description: Usernames of users who performed changes.
              items:
                type: string
            include_system_actions:
              type: boolean
              description: If true, includes system-initiated actions. Default false.
            groups:
              type: array
              description: Group names to report on (case-insensitive). If omitted, includes all.
              items:
                type: string
    WorkgroupSettingsAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Usernames of users who changed settings. If omitted, includes all.
              items:
                type: string
    WorkflowAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            file:
              type: string
              description: Search pattern to filter workflows by name. Supports * wildcard.
            workflow_actions:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - WORKFLOW_CREATED
                  - WORKFLOW_CANCELLED
                  - WORKFLOW_COMPLETED
                  - STEP_ACTIVATED
                  - STEP_COMPLETED
                  - STEP_CANCELLED
                  - STEP_REJECTED
                  - STEP_FAILED
                  - WEBHOOK_CALLED
                  - WEBHOOK_COMPLETION_SIGNAL_RECEIVED
                  - WEBHOOK_RETRIED
                  - FILE_MOVED
                  - FILE_MOVE_RETRIED
                  - FILE_CONVERTED
                  - FILE_CONVERT_RETRIED
                  - TODO_TASK_COMPLETED
                  - REVIEW_TASK_COMPLETED
                  - REVIEW_TASK_CANCELLED
                  - APPROVAL_TASK_APPROVED
                  - APPROVAL_TASK_REJECTED
                  - APPROVAL_TASK_CANCELLED
                  - E_SIGNATURE_CAPTURED
                  - COMMENT_ADDED
                  - WORKFLOW_EDITED
            workflow_types:
              type: array
              description: Workflow types to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - REVIEW_APPROVE
                  - TODO
                  - APPROVAL
                  - REVIEW
                  - MULTISTEP
                  - TEMPLATE
    WorkflowTemplatesAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            workflow_template_actions:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - TEMPLATE_CREATED
                  - TEMPLATE_STATUS_CHANGED
                  - TEMPLATE_EDITED
                  - STEP_ADDED
                  - STEP_REMOVED
                  - ITEM_ADDED
                  - ITEM_REMOVED
    QualityDocsCategoryFilter:
      type: object
      properties:
        id:
          type: string
          description: Category ID.
        subcategoryIds:
          type: array
          description: Optional subcategory IDs to filter by.
          items:
            type: string
    QualityDocsAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            quality_document_id:
              type: string
              description: Specific Quality Docs document ID to report on.
            quality_docs_categories:
              type: array
              description: Categories to filter by.
              items:
                $ref: '#/components/schemas/QualityDocsCategoryFilter'
            quality_docs_actions:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - DOCUMENT_ADDED
                  - DOCUMENT_MODIFIED
                  - DOCUMENT_IMPORTED
                  - DOWNLOAD_RENDITION
                  - PREVIEW
                  - DOWNLOAD_ORIGINAL
                  - TRAINING_ASSIGNED
                  - TRAINING_MODIFIED
                  - TRAINING_CANCELED
                  - TRAINING_OVERDUE
                  - TRAINING_COMPLETED
                  - TRAINING_IMPORTED
                  - DRAFT_ADDED
                  - DRAFT_EDITED
                  - DRAFT_DELETED
            quality_docs_statuses:
              type: array
              description: Document statuses to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - DRAFT
                  - EFFECTIVE
                  - FUTURE_EFFECTIVE
                  - OBSOLETE
    QualityDocsCategoriesAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            quality_docs_categories:
              type: array
              description: Categories to filter by.
              items:
                $ref: '#/components/schemas/QualityDocsCategoryFilter'
            quality_docs_categories_actions:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - CATEGORY_ADDED
                  - CATEGORY_MODIFIED
                  - SUBCATEGORY_ADDED
                  - SUBCATEGORY_MODIFIED
    QualityDocsCoursesAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            quality_docs_courses_ids:
              type: array
              description: Course IDs to filter by. If omitted, includes all courses.
              items:
                type: string
            quality_docs_courses_actions:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - COURSE_CREATED
                  - COURSE_MODIFIED
                  - COURSE_STATUS_CHANGED
                  - COURSE_DOCUMENT_STATUS_CHANGED
            quality_docs_courses_parameters:
              type: array
              description: Course parameters to filter by. If omitted, includes all.
              items:
                type: string
                enum:
                  - NAME
                  - DESCRIPTION
                  - DAYS_TO_COMPLETE
                  - MIN_DAYS_BEFORE_OBSOLETE
                  - RECURRENCE_PERIOD
                  - START_DATE
                  - ASSIGNEES
                  - DOCUMENTS
                  - COURSE_STATUS
                  - DOCUMENT_STATUS
    EtmfAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            etmf_actions:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - STUDY_CREATED
                  - STUDY_UPDATED
                  - TRIAL_UPDATED
                  - COUNTRY_CREATED
                  - COUNTRY_UPDATED
                  - SITE_CREATED
                  - SITE_UPDATED
                  - STUDY_ACTIVATED
                  - STUDY_DEACTIVATED
                  - TRIAL_ACTIVATED
                  - TRIAL_DEACTIVATED
                  - COUNTRY_ACTIVATED
                  - COUNTRY_DEACTIVATED
                  - SITE_ACTIVATED
                  - SITE_DEACTIVATED
                  - DOCUMENT_ADDED
                  - DOCUMENT_DELETED
                  - DOCUMENT_RECLASSIFIED
                  - DOCUMENT_CLASSIFICATION_CHANGED
                  - ARTIFACT_CREATED
                  - ARTIFACT_STATUS_UPDATED
                  - REQUIRED_ARTIFACT_ADDED
                  - REQUIRED_ARTIFACT_REMOVED
                  - STUDY_PERMISSIONS_UPDATED
                  - TRIAL_PERMISSIONS_UPDATED
                  - COUNTRY_PERMISSIONS_UPDATED
                  - SITE_PERMISSIONS_UPDATED
                  - MILESTONE_ADDED
                  - MILESTONE_COMPLETED
                  - MILESTONE_ACTIVATED
                  - MILESTONE_UPDATED
                  - IMPORT_CREATED
                  - IMPORT_FAILED
                  - IMPORT_SUCCEEDED
                  - IMPORT_CONFIRMED
                  - IMPORT_REJECTED
                  - QC_INITIATED
                  - QC_APPROVED
                  - QC_REJECTED
                  - COMMENT_CREATED
                  - ARTIFACT_REQUIREMENT_SETTING_UPDATED
                  - MILESTONE_REQUIREMENT_SETTING_UPDATED
                  - MILESTONE_ACTIVATION_REQUIREMENT_SETTING_UPDATED
                  - ARTIFACT_UNBLINDED
                  - ARTIFACT_BLINDED
            etmf_study_ids:
              type: array
              description: Study IDs to filter by. If omitted, includes all studies.
              items:
                type: string
            etmf_artifact_number:
              type: string
              description: Artifact number to filter by.
    SnapshotRestoreAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            include_system_actions:
              type: boolean
              description: If true, includes system-initiated actions. Default true.
    UploadRequestsAuditReportRequest:
      allOf:
        - $ref: '#/components/schemas/AuditReportBaseRequest'
        - type: object
          properties:
            users:
              type: array
              description: Egnyte usernames to report on. If omitted, includes all users.
              items:
                type: string
            upload_requests_actions:
              type: array
              description: Actions to include. If omitted, includes all.
              items:
                type: string
                enum:
                  - REQUEST_CREATED
                  - REQUEST_MODIFIED
                  - REQUEST_STATUS_CHANGED
                  - FILE_UPLOADED
                  - FILE_REMOVED
                  - DOCUMENT_SUBMITTED
                  - DOCUMENT_SKIPPED
                  - DOCUMENT_ACCEPTED
                  - DOCUMENT_REJECTED
                  - REQUEST_COMPLETED
                  - REQUEST_CANCELED
    AuditJobResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: Job ID for tracking report generation status.
          example: '12345678'
    AuditJobStatusResponse:
      type: object
      required:
        - status
      properties:
        status:
          type: string
          description: Current job status.
          enum:
            - running
            - completed
          example: running
    AuditReportResponse:
      type: object
      properties:
        events:
          type: array
          description: Array of audit event objects.
          items:
            type: object
            additionalProperties: true
        totalCount:
          type: integer
          description: Total number of events in the report.
    AuditStreamRequest:
      type: object
      description: |
        Either startDate or nextCursor is required, but not both. Use startDate for initial requests; use nextCursor for subsequent requests.
      properties:
        startDate:
          type: string
          description: |
            Start of date range. Format: YYYY-MM-DD or ISO 8601 YYYY-MM-DDTHH:MM:SSZ. Must be within the last 7 days. Required if nextCursor is not provided.
          example: '2021-12-08'
        endDate:
          type: string
          description: End of date range in YYYY-MM-DD or ISO 8601 YYYY-MM-DDTHH:MM:SSZ format.
          example: '2021-12-10'
        nextCursor:
          type: string
          description: Cursor from the previous response. Required if startDate is not provided.
          example: QmlnVGFibGVLZXk=
        auditType:
          type: array
          description: Filter events by type. Defaults to ANY if omitted.
          items:
            type: string
            enum:
              - FILE_AUDIT
              - LOGIN_AUDIT
              - PERMISSION_AUDIT
              - USER_AUDIT
              - GROUP_AUDIT
              - WG_SETTINGS_AUDIT
              - WORKFLOW_AUDIT
              - WORKFLOW_TEMPLATES_AUDIT
              - QUALITY_DOCS_AUDIT
              - QUALITY_DOCS_CATEGORIES_AUDIT
              - QUALITY_DOCS_COURSES_AUDIT
              - ETMF_AUDIT
              - SNAPSHOT_RESTORE_AUDIT
              - ESIGNATURE_AUDIT
              - UPLOAD_REQUESTS_AUDIT
              - AI_SAFEGUARDS_ENTRY_ALLOWED_AUDIT
              - AI_SAFEGUARDS_ENTRY_REJECTED_AUDIT
              - AI_SAFEGUARDS_ENTRY_REPORTED_AUDIT
              - ANY
          example:
            - FILE_AUDIT
            - LOGIN_AUDIT
    AuditStreamResponse:
      type: object
      required:
        - nextCursor
        - events
        - moreEvents
      properties:
        nextCursor:
          type: string
          description: Cursor to use in the next request to retrieve subsequent events.
          example: QmlnVGFibGVLZXk=
        events:
          type: array
          description: Array of audit event objects. May contain 0 to 5,000 events.
          items:
            type: object
            additionalProperties: true
        moreEvents:
          type: boolean
          description: true if more events are available; false if all events up to current time have been retrieved.
          example: true
    RateLimitErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code
        message:
          type: string
          description: Human-readable description of the error
        retryAfter:
          type: integer
          description: Number of seconds to wait before retrying
      required:
        - message
        - retryAfter
    BookmarkObject:
      type: object
      properties:
        id:
          type: integer
          description: Bookmark identifier
        path:
          type: string
          description: Path to the bookmarked folder
        folder_id:
          type: string
          description: UUID of the bookmarked folder
        creation_date:
          type: string
          description: ISO-8601 timestamp of bookmark creation
    BookmarkListResponse:
      type: object
      properties:
        offset:
          type: integer
        count:
          type: integer
        bookmarks:
          type: array
          items:
            $ref: '#/components/schemas/BookmarkObject'
    RateLimitResponse:
      type: object
      properties:
        message:
          type: string
    NoteObject:
      type: object
      properties:
        id:
          type: string
          description: UUID of the comment
        message:
          type: string
          description: Text content of the comment
        username:
          type: string
          description: Username of the comment author
        can_delete:
          type: boolean
          description: Whether the current user can delete this comment
        creation_time:
          type: string
          description: ISO-8601 timestamp of when the comment was created
        formatted_name:
          type: string
          description: Display name of the comment author
        file_path:
          type: string
          description: Path to the file or folder the comment is attached to
        group_id:
          type: string
          description: UUID of the file/folder group
    NoteListResponse:
      type: object
      properties:
        total_results:
          type: integer
          description: Total number of comments matching the query
        count:
          type: integer
          description: Number of comments returned
        offset:
          type: integer
          description: Zero-based index of the first result
        notes:
          type: array
          items:
            $ref: '#/components/schemas/NoteObject'
    ImportDocumentRequest:
      type: object
      required:
        - docId
        - name
        - version
        - entryId
      properties:
        docId:
          type: string
          description: Document identifier used within Controlled Document Management (e.g. SOP-1)
          example: SOP-1
        name:
          type: string
          description: Name of the document
          example: Change Management SOP
        isDraft:
          type: boolean
          description: Whether the document is a draft. Default is false. If true, version must be less than 1.0 and effectiveFromDate/effectiveToDate/approvedOn must not be provided.
          default: false
        version:
          type: string
          description: Document version (e.g. 1.0, 1.1). Must be less than 1.0 if isDraft is true.
          example: '1.0'
        entryId:
          type: string
          format: uuid
          description: Unique ID of the file version to import
          example: f450227d-044c-45b5-9dbb-c1120a856b81
        responsibleDepartment:
          type: string
          description: Department or personnel responsible for maintaining the document
          example: Clinical
        effectiveFromDate:
          type: string
          format: date
          description: Date the document becomes effective (YYYY-MM-DD). Required when isDraft is false. Must not be provided when isDraft is true.
          example: '2023-01-22'
        effectiveToDate:
          type: string
          format: date
          description: Date the document's effective period ends (YYYY-MM-DD). Must not be provided when isDraft is true.
          example: '2024-01-21'
        approvedOn:
          type: string
          format: date
          description: Date the document was approved (YYYY-MM-DD). Required when isDraft is false. Must not be provided when isDraft is true. Cannot be in the future or after effectiveFromDate.
          example: '2022-12-17'
    ImportAssignmentRequest:
      type: object
      required:
        - assigneeId
        - docId
        - version
        - dueDate
      properties:
        assigneeId:
          type: integer
          description: ID of the user assigned the training
          example: 11
        docId:
          type: string
          description: Document ID for which training is assigned
          example: SOP-1
        version:
          type: string
          description: Document version for which training is assigned
          example: '1.0'
        assignedDate:
          type: string
          format: date-time
          description: Date the training assignment was created (ISO-8601). Defaults to current date if not provided.
          example: '2023-01-22T14:00:00Z'
        dueDate:
          type: string
          format: date
          description: Due date of the training assignment (YYYY-MM-DD)
          example: '2023-02-22'
        completedDate:
          type: string
          format: date-time
          description: Training assignment completion date (ISO-8601). Set only for completed assignments.
          example: '2023-01-27T16:22:07Z'
        canceledDate:
          type: string
          format: date-time
          description: Date the training assignment was canceled (ISO-8601). Set only for canceled assignments.
        assignedById:
          type: integer
          description: ID of the user who assigned the training. Defaults to the requesting user if not provided.
          example: 22
    ImportResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          description: Internal identifier for the created resource
          example: f450227d-044c-45b5-9dbb-c1120a856b81
    WorkspaceCreator:
      type: object
      properties:
        id:
          type: integer
          description: Creator's user ID
          example: 1
        username:
          type: string
          description: Creator's username
          example: jsmith
        email:
          type: string
          format: email
          description: Creator's email address
          example: jsmith@example.com
        firstName:
          type: string
          description: Creator's first name
          example: Jane
        lastName:
          type: string
          description: Creator's last name
          example: Smith
    Workspace:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique workspace identifier (UUID)
          example: ae898c78-c1e8-4d99-aea0-f7538d085ae4
        name:
          type: string
          description: Workspace name
          example: Acme Enterprises
        type:
          type: string
          description: Workspace type (e.g. "Client", "Vendor")
          example: Client
        status:
          type: string
          description: Workspace status
          enum:
            - ACTIVE
            - INACTIVE
          example: ACTIVE
        taskCount:
          type: integer
          description: Number of tasks in the workspace
          example: 0
        creator:
          $ref: '#/components/schemas/WorkspaceCreator'
    WorkspacesListResponse:
      type: object
      properties:
        count:
          type: integer
          description: Total number of workspaces
          example: 1
        results:
          type: array
          items:
            $ref: '#/components/schemas/Workspace'
    TemplateVariable:
      type: object
      properties:
        name:
          type: string
          description: Variable name as defined in the permission template
          example: Account Manager
        value:
          type: array
          description: Array of user IDs to assign to this variable
          items:
            type: integer
          example:
            - 123
    CreateWorkspaceRequest:
      type: object
      required:
        - name
        - status
        - type
      description: |
        Exactly one of the following creation mode combinations must be provided:
        - **From existing folder**: `workspaceFolderId` (mutually exclusive with `workspaceParentFolderId`) - **Blank workspace**: `workspaceParentFolderId` only - **From template**: `workspaceParentFolderId` + `workspaceTemplateId` (optionally with `variables`)
        Providing both `workspaceFolderId` and `workspaceParentFolderId` returns 400. Providing `workspaceTemplateId` without `workspaceParentFolderId` returns 400.
      properties:
        name:
          type: string
          description: |
            Workspace name; also used as the folder name when creating a blank workspace or workspace from a template.
          example: Acme Enterprises
        status:
          type: string
          description: Workspace status
          enum:
            - ACTIVE
            - INACTIVE
          example: ACTIVE
        type:
          type: string
          description: |
            Workspace type; must match one of the workspace types from Get Document Portal Settings (e.g. "Client", "Vendor").
          example: Client
        workspaceFolderId:
          type: string
          format: uuid
          description: |
            Folder ID (UUID) to convert to a workspace. Required for "from existing folder" mode. Mutually exclusive with workspaceParentFolderId — providing both returns 400.
          example: 21dd19b3-8c28-4229-88a7-eae44f8768f5
        workspaceParentFolderId:
          type: string
          format: uuid
          description: |
            Parent folder ID (UUID) under which to create the workspace. Required for "blank workspace" and "from template" modes. Mutually exclusive with workspaceFolderId — providing both returns 400.
          example: 4e6173b7-fe20-411d-ba2a-a005d58154c8
        workspaceTemplateId:
          type: string
          format: uuid
          description: |
            Template folder ID (UUID) to use for workspace creation. Required for "from template" mode. Must be combined with workspaceParentFolderId — providing without workspaceParentFolderId returns 400.
          example: 0ee1f7ff-39cc-44ea-a12d-3c8477736d93
        variables:
          type: array
          description: |
            Permission template variables for dynamic permission assignment. Used only when creating from a template (workspaceTemplateId provided).
          items:
            $ref: '#/components/schemas/TemplateVariable'
    CreateWorkspaceResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier (UUID) of the newly created workspace
          example: e250227d-044c-45b5-9dbb-c1120a856b84
    SettingsResponse:
      type: object
      properties:
        workspaceTypes:
          type: array
          description: List of available workspace type strings configured for your domain
          items:
            type: string
          example:
            - Client
            - Vendor
            - Partner
    NavigateResponse:
      type: object
      properties:
        redirect:
          type: string
          format: uri
          description: One-time URL that launches the Egnyte Web UI session. Valid for a single use and expires after 1 minute.
      required:
        - redirect
    Study:
      type: object
      properties:
        systemId:
          type: string
          description: Unique system identifier for the study
          example: eee92526-53ce-45be-bdce-7263567c9e78
        id:
          type: string
          description: Human-readable study identifier
          example: DEM-81
        name:
          type: string
          description: Display name of the study
          example: Demo 81 Study
        description:
          type: string
          description: Study description
        status:
          type: string
          description: Study status
          example: ACTIVE
    StudiesResponse:
      type: object
      properties:
        studies:
          type: array
          items:
            $ref: '#/components/schemas/Study'
    Site:
      type: object
      properties:
        systemId:
          type: string
          description: System ID of the site filing level
        id:
          type: string
          description: Site identifier
        status:
          type: string
          description: Site status
    Country:
      type: object
      properties:
        systemId:
          type: string
          description: System ID of the country filing level
        code:
          type: string
          description: ISO country code
        status:
          type: string
          description: Country status
        sites:
          type: array
          items:
            $ref: '#/components/schemas/Site'
    Trial:
      type: object
      properties:
        systemId:
          type: string
          description: System ID of the trial filing level
        status:
          type: string
          description: Trial status
        countries:
          type: array
          items:
            $ref: '#/components/schemas/Country'
    FilingLevelsResponse:
      type: object
      properties:
        trial:
          $ref: '#/components/schemas/Trial'
    Artifact:
      type: object
      properties:
        referenceModelArtifactId:
          type: string
          description: Reference model artifact identifier
        number:
          type: string
          description: Artifact number (e.g. 01.01.01)
        name:
          type: string
          description: Artifact name
        isUnblinded:
          type: boolean
          description: Whether the artifact is unblinded
        milestoneNumber:
          type: integer
          description: Associated milestone number
    Milestone:
      type: object
      properties:
        id:
          type: string
          description: Milestone system ID
        name:
          type: string
          description: Milestone name
        number:
          type: integer
          description: Milestone number
        status:
          type: string
          description: Milestone status
    ArtifactsResponse:
      type: object
      properties:
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
        milestones:
          type: array
          items:
            $ref: '#/components/schemas/Milestone'
    ListDocumentsRequest:
      type: object
      required:
        - filingLevel
      properties:
        filingLevel:
          type: object
          required:
            - type
            - systemId
          properties:
            type:
              type: string
              description: Filing level type
              enum:
                - TRIAL
                - COUNTRY
                - SITE
            systemId:
              type: string
              description: System ID of the filing level
        zone:
          type: string
          description: Filter by zone (format — {number} {name})
        artifact:
          type: string
          description: Filter by artifact (format — {number} {name})
        status:
          type: string
          description: Filter by document status
          enum:
            - DRAFT
            - IN_QC
            - APPROVED
            - REJECTED
        limit:
          type: integer
          description: Maximum number of documents to return (1-200). Default 20.
          minimum: 1
          maximum: 200
          default: 20
        offset:
          type: integer
          description: Zero-based index for pagination. Default 0.
          minimum: 0
          default: 0
    DocumentArtifact:
      type: object
      properties:
        artifactNumber:
          type: string
        artifactName:
          type: string
        sectionNumber:
          type: string
        sectionName:
          type: string
        zoneNumber:
          type: string
        zone:
          type: string
        referenceModelArtifactId:
          type: string
        isUnblinded:
          type: boolean
    DocumentMilestone:
      type: object
      properties:
        name:
          type: string
        number:
          type: integer
        id:
          type: string
    DocumentFilingLevel:
      type: object
      properties:
        type:
          type: string
    DocumentFile:
      type: object
      properties:
        name:
          type: string
        entryId:
          type: string
        groupId:
          type: string
    QualityControl:
      type: object
      properties:
        dueOn:
          type: string
          format: date-time
        status:
          type: string
          description: Quality control status of the document
          enum:
            - DRAFT
            - IN_QC
            - APPROVED
            - REJECTED
    Document:
      type: object
      properties:
        studyId:
          type: string
        id:
          type: string
        artifact:
          $ref: '#/components/schemas/DocumentArtifact'
        milestone:
          $ref: '#/components/schemas/DocumentMilestone'
        filingLevel:
          $ref: '#/components/schemas/DocumentFilingLevel'
        file:
          $ref: '#/components/schemas/DocumentFile'
        qualityControl:
          $ref: '#/components/schemas/QualityControl'
    DocumentsListResponse:
      type: object
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/Document'
        offset:
          type: integer
          description: Current offset value
        hasMore:
          type: boolean
          description: Whether more results are available
    AddDocumentRequest:
      type: object
      required:
        - filingLevel
        - sourceFile
      properties:
        filingLevel:
          type: object
          required:
            - type
            - systemId
          properties:
            type:
              type: string
              description: Filing level type
              enum:
                - TRIAL
                - COUNTRY
                - SITE
            systemId:
              type: string
              description: System ID of the filing level
        classification:
          type: object
          properties:
            referenceModelArtifactId:
              type: string
              description: Reference model artifact ID for classification
            milestoneId:
              type: string
              description: Milestone system ID to associate with the document
            unblinded:
              type: boolean
              description: Required when the document is unclassified. Indicates whether the document is unblinded.
        sourceFile:
          type: object
          required:
            - groupId
          properties:
            groupId:
              type: string
              description: Group ID of the file in the Egnyte file system
    AddDocumentResponse:
      type: object
      properties:
        id:
          type: string
          description: System ID of the newly created document
        file:
          type: object
          properties:
            groupId:
              type: string
              description: File group ID
            entryId:
              type: string
              description: File entry ID
            path:
              type: string
              description: Full path to the file in the eTMF structure
    CursorResponse:
      type: object
      properties:
        latest_event_id:
          type: integer
          description: The most recent event ID available; use this as your starting cursor.
        oldest_event_id:
          type: integer
          description: The oldest event ID still available in the stream.
        timestamp:
          type: string
          format: date-time
          description: ISO-8601 formatted timestamp of the latest event.
      required:
        - latest_event_id
        - oldest_event_id
        - timestamp
    EventListResponse:
      type: object
      properties:
        latest_id:
          type: integer
          description: Latest event ID in this response; use as cursor for next poll.
        oldest_id:
          type: integer
          description: Oldest event ID in this response.
        count:
          type: integer
          description: Number of events returned.
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
      required:
        - latest_id
        - oldest_id
        - count
        - events
    Event:
      type: object
      properties:
        id:
          type: integer
          description: Unique event identifier.
        timestamp:
          type: string
          format: date-time
          description: ISO-8601 formatted timestamp when the event was recorded.
        action_source:
          type: string
          description: Source of the event.
          enum:
            - WebUI
            - SyncEngine
            - Mobile
            - PublicAPI
            - WebEdit
            - System
            - VPC
            - Other
        actor:
          type: integer
          description: Numeric ID of the user who performed the action.
        type:
          type: string
          description: Event type.
          enum:
            - file_system
            - note
            - permission_change
        action:
          type: string
          description: Action performed. Rename is represented as `move`.
          enum:
            - create
            - delete
            - restore
            - move
            - copy
            - permission_change
        object_detail:
          type: string
          nullable: true
          description: Optional URI to the affected resource. Present for `file_system` events (except `delete`) linking to the file metadata endpoint, and for `note` `create` events linking to the annotation endpoint. Null or absent otherwise.
        data:
          type: object
          description: Additional data specific to the event type and action.
          oneOf:
            - $ref: '#/components/schemas/FileSystemEventData'
            - $ref: '#/components/schemas/NoteEventData'
            - $ref: '#/components/schemas/PermissionChangeData'
        eventTypeSpecificAttributes:
          allOf:
            - $ref: '#/components/schemas/PermissionChangeAttributes'
          description: Additional permission-change metadata. Present only on `permission_change` events (v2 only).
          nullable: true
      required:
        - id
        - timestamp
        - action_source
        - actor
        - type
        - action
        - data
    FileSystemEventData:
      type: object
      description: Data fields for file_system events.
      properties:
        target_path:
          type: string
          description: Destination path for move/copy operations.
        target_id:
          type: string
          description: Unique identifier of the file version at the target path.
        target_group_id:
          type: string
          description: Unique identifier of the file at the target path.
        source_path:
          type: string
          description: Original path for move/copy operations.
        source_id:
          type: string
          description: Unique identifier of the file version at the source path.
        source_group_id:
          type: string
          description: Unique identifier of the file at the source path.
        is_folder:
          type: boolean
          description: '`true` if the object is a folder, `false` if it is a file.'
    NoteEventData:
      type: object
      description: Data fields for note events.
      properties:
        note_id:
          type: string
          description: Unique identifier of the note (comment/annotation).
    PermissionChangeData:
      type: object
      description: Data fields for permission_change events.
      properties:
        target_path:
          type: string
          description: Folder path where permissions were changed.
        is_folder:
          type: boolean
          description: '`true` if the object is a folder, `false` if it is a file.'
    PermissionChangeAttributes:
      type: object
      description: Additional attributes specific to permission_change events.
      properties:
        changeGroupEvents:
          type: array
          description: Changes that occurred to user groups.
          items:
            type: object
        changePermissionEvent:
          $ref: '#/components/schemas/ChangePermissionEvent'
        changeContext:
          type: object
          nullable: true
          description: Context of the change; contains snapshot-restore ID if changed via snapshot restore.
        targetFolderId:
          type: string
          description: Unique identifier of the folder where permissions changed.
        groupChange:
          type: boolean
          description: '`true` if `changeGroupEvents` contains at least one element.'
    ChangePermissionEvent:
      type: object
      properties:
        changedPermissions:
          type: array
          description: Array of permission change objects.
          items:
            $ref: '#/components/schemas/ChangedPermission'
    ChangedPermission:
      type: object
      properties:
        action:
          type: string
          description: Type of change.
          enum:
            - ADD
            - DELETE
        entry:
          $ref: '#/components/schemas/PermissionEntry'
    PermissionEntry:
      type: object
      properties:
        subject:
          type: string
          description: User or group identifier (e.g., `/user/6`).
        priv:
          type: string
          description: Permission level.
          enum:
            - NONE
            - VIEWER_ONLY
            - READ
            - READWRITE
            - RWD
            - MODIFY
    FolderEntry:
      type: object
      properties:
        name:
          type: string
        path:
          type: string
        folder_id:
          type: string
        parent_id:
          type: string
        is_folder:
          type: boolean
        lastModified:
          type: integer
        uploaded:
          type: integer
    FileEntry:
      type: object
      properties:
        name:
          type: string
        path:
          type: string
        size:
          type: integer
        entry_id:
          type: string
        group_id:
          type: string
        is_folder:
          type: boolean
        lastModified:
          type: integer
        uploaded:
          type: integer
        checksum:
          type: string
        num_versions:
          type: integer
    FsMetadataResponse:
      type: object
      properties:
        name:
          type: string
        path:
          type: string
        is_folder:
          type: boolean
        folder_id:
          type: string
        parent_id:
          type: string
        count:
          type: integer
        offset:
          type: integer
        total_count:
          type: integer
        folders:
          type: array
          items:
            $ref: '#/components/schemas/FolderEntry'
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileEntry'
        size:
          type: integer
        entry_id:
          type: string
        group_id:
          type: string
        lastModified:
          type: integer
        uploaded:
          type: integer
        checksum:
          type: string
        num_versions:
          type: integer
    DeleteResponse:
      type: object
      properties:
        parent_folder_path:
          type: string
          description: Path of the parent folder of the deleted item.
    FolderStatsResponse:
      type: object
      properties:
        allVersionsSize:
          type: integer
          description: Total size of all file versions in bytes.
        allFilesSize:
          type: integer
          description: Total size of all current file versions in bytes.
        filesCount:
          type: integer
          description: Total number of files.
        fileVersionsCount:
          type: integer
          description: Total number of file versions.
        foldersCount:
          type: integer
          description: Total number of subfolders.
        allVersionsSizeInKB:
          type: integer
          description: Total size of all file versions in kilobytes.
        allFilesSizeInKB:
          type: integer
          description: Total size of all current file versions in kilobytes.
    UploadResponse:
      type: object
      properties:
        path:
          type: string
        filename:
          type: string
        checksum:
          type: string
        entry_id:
          type: string
        group_id:
          type: string
        last_modified:
          type: string
        size:
          type: integer
    GroupMember:
      type: object
      properties:
        value:
          type: string
          description: User ID
        display:
          type: string
          description: Username
    GroupResource:
      type: object
      properties:
        id:
          type: string
          description: Unique group identifier (UUID)
        displayName:
          type: string
          description: Display name of the group
        members:
          type: array
          items:
            $ref: '#/components/schemas/GroupMember'
    GroupListResponse:
      type: object
      properties:
        totalResults:
          type: integer
        itemsPerPage:
          type: integer
        startIndex:
          type: integer
        resources:
          type: array
          items:
            $ref: '#/components/schemas/GroupResource'
    LinkObject:
      type: object
      properties:
        id:
          type: string
          description: Unique link identifier
        url:
          type: string
          description: Full URL of the link
        path:
          type: string
          description: Absolute path of the target file or folder
        type:
          type: string
          enum:
            - file
            - folder
            - upload
          description: Link type
        accessibility:
          type: string
          enum:
            - anyone
            - password
            - domain
            - recipients
          description: Access level
        protection:
          type: string
          description: PREVIEW for preview-only links, otherwise NONE
        recipients:
          type: array
          items:
            type: string
        notify:
          type: boolean
        link_to_current:
          type: boolean
        creation_date:
          type: string
          description: ISO-8601 timestamp of link creation
        created_by:
          type: string
          description: Username of the link creator
        resource_id:
          type: string
          description: Group ID (file links) or folder ID (folder/upload links)
        expiry_clicks:
          type: integer
          description: Number of clicks remaining before expiration
        expiry_date:
          type: string
          description: ISO-8601 timestamp of expiration
        last_accessed:
          type: string
          description: ISO-8601 timestamp of last access
    LinkListV1Response:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
          description: Array of link IDs visible to the user
        offset:
          type: integer
          description: 0-based index of the first record returned
        count:
          type: integer
          description: Number of items returned
        total_count:
          type: integer
          description: Total number of links visible to the user
    LinkListV2Response:
      type: object
      properties:
        links:
          type: array
          items:
            $ref: '#/components/schemas/LinkObject'
          description: Array of link objects with full details
        count:
          type: integer
          description: Number of links returned
    CreateLinkResponse:
      type: object
      properties:
        links:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              url:
                type: string
              recipients:
                type: array
                items:
                  type: string
        path:
          type: string
        type:
          type: string
        accessibility:
          type: string
        notify:
          type: boolean
        link_to_current:
          type: boolean
        creation_date:
          type: string
        created_by:
          type: string
        expiry_date:
          type: string
        expiry_clicks:
          type: integer
    KeyDefinition:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - integer
            - string
            - decimal
            - date
            - enum
            - labels
            - multi_value_enum
        displayName:
          type: string
        priority:
          type: integer
        helpText:
          type: string
        data:
          type: array
          items:
            type: string
          description: Enumerated values (required for enum and multi_value_enum; optional for labels).
    NamespaceObject:
      type: object
      properties:
        name:
          type: string
          description: Namespace identifier.
        displayName:
          type: string
          description: Display name shown in the UI.
        priority:
          type: integer
          description: Display order priority.
        scope:
          type: string
          enum:
            - public
            - protected
            - private
          description: Namespace scope.
        schemaSystemGenerated:
          type: boolean
          description: Whether the schema was system-generated.
        inheritable:
          type: boolean
          description: Whether metadata is inherited by child items.
        metadataScopeType:
          type: string
          enum:
            - GLOBAL
            - FOLDER_SCOPE
            - DOCUMENT_TYPE
          description: Scope type.
        keys:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/KeyDefinition'
          description: Map of metadata keys and their definitions.
        folderAssociations:
          type: array
          items:
            type: object
            properties:
              folderId:
                type: string
              path:
                type: string
          description: Folders associated with this namespace (only when metadataScopeType is FOLDER_SCOPE).
        hasAccessToAllAssociations:
          type: boolean
          description: Whether the user has access to all associated folders.
        documentTypes:
          type: array
          items:
            type: string
          description: Document type categories (only when metadataScopeType is DOCUMENT_TYPE).
        documentExtensions:
          type: array
          items:
            type: string
          description: File extensions matching the document types.
    MetadataValuesResponse:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            additionalProperties:
              type: object
              additionalProperties: true
          description: Array containing metadata values. Each item is an object keyed by namespace name.
    MspEventType:
      type: string
      description: MSP webhook event type.
      enum:
        - user_created
        - user_deleted
        - user_updated
        - group_created
        - group_deleted
        - group_updated
        - role_assigned
        - role_removed
        - license_allocated
        - license_removed
        - domain_created
        - domain_deleted
        - domain_updated
    WebhookStatus:
      type: string
      description: Current status of the webhook.
      enum:
        - active
        - inactive
    Webhook:
      type: object
      required:
        - webhook_id
        - status
        - event_types
        - webhook_url
      properties:
        webhook_id:
          type: string
          description: Unique identifier of the webhook.
          example: '12345'
        status:
          $ref: '#/components/schemas/WebhookStatus'
        event_types:
          type: array
          description: List of event types this webhook is subscribed to.
          items:
            $ref: '#/components/schemas/MspEventType'
          example:
            - user_created
            - license_allocated
        webhook_url:
          type: string
          format: uri
          description: HTTPS endpoint that receives webhook notifications.
          example: https://example.com/egnyte/webhook
    WebhookDetail:
      allOf:
        - $ref: '#/components/schemas/Webhook'
        - type: object
          properties:
            auth_header:
              type: string
              description: Name of the custom HTTP authentication header sent with notifications.
              example: Authorization
            auth_header_value:
              type: string
              writeOnly: true
              description: Value of the custom authentication header. Write-only — never returned in responses.
    WebhookListResponse:
      type: object
      required:
        - webhooks
      properties:
        webhooks:
          type: array
          description: List of registered webhooks.
          items:
            $ref: '#/components/schemas/Webhook'
    CreateWebhookRequest:
      type: object
      required:
        - event_types
        - webhook_url
      properties:
        event_types:
          type: array
          description: List of event types to subscribe to.
          items:
            $ref: '#/components/schemas/MspEventType'
          example:
            - user_created
            - license_allocated
        webhook_url:
          type: string
          format: uri
          description: HTTPS endpoint to receive notifications.
          example: https://example.com/egnyte/webhook
        auth_header:
          type: string
          description: Optional name of a custom HTTP header to include in notifications.
          example: Authorization
        auth_header_value:
          type: string
          writeOnly: true
          description: Optional value of the custom authentication header. Write-only — never returned in responses.
    UpdateWebhookRequest:
      type: object
      description: At least one field must be provided. All provided fields replace their current values.
      minProperties: 1
      properties:
        event_types:
          type: array
          description: New list of event types to subscribe to.
          items:
            $ref: '#/components/schemas/MspEventType'
        webhook_url:
          type: string
          format: uri
          description: New HTTPS endpoint to receive notifications.
          example: https://example.com/updated/webhook
        auth_header:
          type: string
          description: New name of the custom HTTP authentication header.
        auth_header_value:
          type: string
          writeOnly: true
          description: New value of the custom authentication header. Write-only — never returned in responses.
    CreateWebhookResponse:
      type: object
      required:
        - webhook_id
        - status
      properties:
        webhook_id:
          type: string
          description: Unique identifier of the newly registered webhook.
          example: '12345'
        status:
          $ref: '#/components/schemas/WebhookStatus'
    Domain:
      type: object
      required:
        - domain
        - plan_id
        - plan_name
        - status
        - created_on
        - available_licenses
        - used_licenses
        - storage_allocated_gb
        - storage_used_gb
      properties:
        domain:
          type: string
          description: Domain name (without .egnyte.com).
          example: acme
        plan_id:
          type: string
          description: Identifier of the subscription plan (e.g. BUSINESS, TEAM, ENTERPRISE).
          example: BUSINESS
        plan_name:
          type: string
          description: Human-readable name of the subscription plan.
          example: Business Plan
        status:
          type: string
          description: Current status of the domain.
          enum:
            - active
            - trial
            - suspended
            - cancelled
          example: active
        created_on:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the domain was created.
          example: '2024-01-15T10:20:30Z'
        subscription_date:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 timestamp when the domain's paid subscription started. Null if on trial.
          example: '2024-02-01T00:00:00Z'
        available_licenses:
          type: integer
          description: Total number of licenses available for this domain.
          example: 50
        used_licenses:
          type: integer
          description: Number of licenses currently in use.
          example: 30
        storage_allocated_gb:
          type: number
          description: Total storage allocated to the domain in gigabytes.
          example: 200
        storage_used_gb:
          type: number
          description: Storage currently used by the domain in gigabytes.
          example: 120
    DomainListResponse:
      type: object
      required:
        - domains
      properties:
        domains:
          type: array
          description: List of domains managed by the MSP.
          items:
            $ref: '#/components/schemas/Domain'
    PermissionLevel:
      type: string
      enum:
        - None
        - Nav
        - Viewer Only
        - Viewer
        - Editor
        - Full
        - Owner
      description: The permission level assigned to a user or group.
    PermissionSubject:
      type: object
      properties:
        subject:
          type: string
          description: The username or group name.
        permission:
          $ref: '#/components/schemas/PermissionLevel'
    ErrorModel:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: string
    SyncFromDB:
      type: object
      properties:
        id:
          type: string
          description: Synced project ID
        jobId:
          type: string
          description: Synced project job ID
        egnyteDomain:
          type: string
          description: Egnyte domain
        egnyteFolderPath:
          type: string
          description: Egnyte folder path
        procoreFolderPaths:
          type: array
          description: Synced Procore paths
        procoreServiceAccountId:
          type: string
          description: Procore service account ID
        procoreProjectId:
          type: number
          description: Procore project ID
        procoreProjectName:
          type: string
          description: Procore project name
        syncType:
          type: string
          enum:
            - 2-way sync
            - no sync
          description: Sync option
        companyId:
          type: number
          description: Procore company ID
    SyncedProject:
      type: object
      properties:
        id:
          type: string
          description: Synced project ID
        jobId:
          type: string
          description: Synced project job ID
        folder:
          type: string
          description: Egnyte folder path
        procoreFolderPaths:
          type: array
          description: Procore folder paths
        project:
          type: string
          description: Procore project name
        procoreProjectId:
          type: number
          description: Procore project ID
        serviceAccountName:
          type: string
          description: Service account name
        syncType:
          type: string
          enum:
            - 2-way sync
            - no sync
          description: Sync option
        lastSuccessTime:
          type: string
          description: Timestamp of last successful sync
        isHealthy:
          type: boolean
        isHealthyNote:
          oneOf:
            - type: string
              description: Error description when isHealthy is false
            - type: 'null'
              description: null when isHealthy is true
        skipped:
          type: array
          description: Files skipped due to errors; empty array when isHealthy is true
          items:
            type: object
            properties:
              path:
                type: string
                description: Path of skipped file
              size:
                type: number
                description: File size in bytes
              source:
                type: string
                description: Source of the error
              errorCode:
                type: string
                description: Error code
              version:
                type: string
                description: File version
              ctime:
                type: number
              checksum:
                type: string
    ProcoreProject:
      type: object
      properties:
        id:
          type: number
          description: Procore project ID
        name:
          type: string
          description: Procore project name
        isSynced:
          type: boolean
          description: Whether project is synced with an Egnyte folder
        companyId:
          type: number
          description: Procore company ID
    CustomFieldDefinition:
      type: object
      properties:
        name:
          type: string
          description: Unique internal identifier for the field (auto-derived from displayName).
        displayName:
          type: string
          maxLength: 40
          description: User-friendly display name.
        type:
          type: string
          enum:
            - string
            - integer
            - decimal
            - date
            - enum
            - labels
            - multi_value_enum
          description: Field data type. `enum` = dropdown with single select; `multi_value_enum` = dropdown with multi select; `labels` = multi-value free-text field.
        data:
          type: array
          items:
            type: string
          description: Predefined values for `enum`, `labels`, and `multi_value_enum` types.
        helpText:
          type: string
          maxLength: 200
          description: Help text shown alongside the field.
        priority:
          type: integer
          minimum: 0
          maximum: 65535
          description: Display order (lower values appear first).
        createdAt:
          type: string
          format: date-time
          description: Custom field creation timestamp (ISO 8601).
        updatedAt:
          type: string
          format: date-time
          description: Custom field last updated timestamp (ISO 8601).
    CustomFieldsListResponse:
      type: object
      properties:
        keys:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/CustomFieldDefinition'
          description: Dictionary of custom field definitions, keyed by field name.
    CustomFieldCreateRequest:
      type: object
      required:
        - displayName
        - type
        - helpText
      properties:
        displayName:
          type: string
          maxLength: 40
          description: Display name (max 40 characters). The internal `name` key is auto-derived (lowercase, spaces → hyphens).
        type:
          type: string
          enum:
            - string
            - integer
            - decimal
            - date
            - enum
            - labels
            - multi_value_enum
          description: Data type for the field. `enum` = dropdown with single select; `multi_value_enum` = dropdown with multi select; `labels` = multi-value free-text field.
        data:
          type: array
          items:
            type: string
          description: Predefined values. Required for `enum` and `multi_value_enum`. Optional for `labels`. Must not be provided for primitive types.
        helpText:
          type: string
          maxLength: 200
          description: Custom field description (max 200 characters).
        priority:
          type: integer
          minimum: 0
          maximum: 65535
          description: Display order in project settings (0–65535). Omitting appends the field last.
    CustomFieldUpdateRequest:
      type: object
      properties:
        displayName:
          type: string
          maxLength: 40
          description: New display name (max 40 characters).
        helpText:
          type: string
          maxLength: 200
          description: Updated field description (max 200 characters).
        priority:
          type: integer
          minimum: 0
          maximum: 65535
          description: New display order (0–65535). Omitting leaves existing order unchanged.
        data:
          type: array
          items:
            type: string
          description: 'Predefined values to set or append. For `enum`: new values replace existing values. For `multi_value_enum` and `labels`: new values are appended to existing values.'
    User:
      type: object
      properties:
        id:
          type: integer
        userName:
          type: string
        externalId:
          type: string
        name:
          type: object
          properties:
            givenName:
              type: string
            familyName:
              type: string
        emails:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              type:
                type: string
        active:
          type: boolean
        groups:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              display:
                type: string
    Group:
      type: object
      properties:
        id:
          type: string
        displayName:
          type: string
        members:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              display:
                type: string
              username:
                type: string
    SearchResultItem:
      type: object
      properties:
        name:
          type: string
        path:
          type: string
        type:
          type: string
        size:
          type: integer
        snippet:
          type: string
        snippet_html:
          type: string
        entry_id:
          type: string
        group_id:
          type: string
        last_modified:
          type: string
          format: date-time
        uploaded_by:
          type: string
        uploaded_by_username:
          type: string
        num_versions:
          type: integer
        is_folder:
          type: boolean
        score:
          type: number
          description: Relevance score for this result.
        custom_properties:
          type: array
          items:
            $ref: '#/components/schemas/CustomProperty'
    CustomProperty:
      type: object
      properties:
        scope:
          type: string
        namespace:
          type: string
        key:
          type: string
        value:
          type: string
        valueToStampOnFile:
          type: string
          description: Value to display on file stamps (if applicable).
    SfdcFolderMap:
      type: object
      properties:
        path:
          type: string
          description: Path to the corresponding Egnyte folder
        folder_id:
          type: string
          description: UUID of the Egnyte folder
    TemplateDocument:
      type: object
      properties:
        template_document_id:
          type: string
          description: Unique identifier for the document (UUID)
        document_name:
          type: string
          description: Name of the document file
        document_type:
          type: string
          description: Document file type (e.g., pdf)
        entry_id:
          type: string
          description: Egnyte file system entry ID (UUID)
        location:
          type: string
          description: File path in Egnyte file system
        document_order:
          type: integer
          description: Display order of the document
    TemplateSummary:
      type: object
      properties:
        template_id:
          type: string
          description: Unique identifier for the template (UUID)
        name:
          type: string
          description: Template name
        description:
          type: string
          description: Template description
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        created_by:
          type: integer
          description: User ID of the template creator
        full_name:
          type: string
          description: Full name of the template creator
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of template creation
        template_documents:
          type: array
          items:
            $ref: '#/components/schemas/TemplateDocument'
    TemplateParticipant:
      type: object
      properties:
        template_participant_id:
          type: string
          description: Unique identifier for the participant (UUID)
        participant_type:
          type: string
          description: Type of participant (e.g., SIGNER)
        order:
          type: integer
          description: Signing order (0 if not ordered)
        email:
          type: string
          nullable: true
          description: Email address (null for role-based participants)
        type:
          type: string
          enum:
            - INTERNAL
            - EXTERNAL
            - ROLE
        role_name:
          type: string
          nullable: true
          description: Role name (null for non-role participants)
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
    TemplateDetail:
      type: object
      properties:
        template_id:
          type: string
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
        target_location:
          type: string
        is_ordered_signing:
          type: boolean
        email_message:
          type: string
        expiration_days:
          type: integer
        signer_allowed_to_reassign:
          type: boolean
        reminder_details:
          type: object
          nullable: true
        template_participants:
          type: array
          items:
            $ref: '#/components/schemas/TemplateParticipant'
        template_documents:
          type: array
          items:
            $ref: '#/components/schemas/TemplateDocument'
    AgreementParticipant:
      type: object
      properties:
        participant_id:
          type: string
        link_id:
          type: string
        role:
          type: string
        status:
          type: string
        order:
          type: integer
        color_code:
          type: string
        expires_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        is_internal:
          type: boolean
    AgreementDocument:
      type: object
      properties:
        document_id:
          type: string
        entry_id:
          type: string
        document_order:
          type: integer
    Agreement:
      type: object
      properties:
        agreement_id:
          type: string
        agreement_name:
          type: string
        target_location:
          type: string
        status:
          type: string
        participants:
          type: array
          items:
            $ref: '#/components/schemas/AgreementParticipant'
        documents:
          type: array
          items:
            $ref: '#/components/schemas/AgreementDocument'
    SentRequestParticipant:
      type: object
      properties:
        participant_id:
          type: string
        email:
          type: string
        name:
          type: string
          nullable: true
        role:
          type: string
        status:
          type: string
        order:
          type: integer
        signed_at:
          type: string
          nullable: true
        is_in_queue:
          type: boolean
    SentRequest:
      type: object
      properties:
        agreement_id:
          type: string
        signature_request_name:
          type: string
        status:
          type: string
        documents:
          type: array
          items:
            type: object
            properties:
              document_id:
                type: string
        participants:
          type: array
          items:
            $ref: '#/components/schemas/SentRequestParticipant'
        created_at:
          type: string
          format: date-time
        due_date:
          type: string
          format: date-time
        template_id:
          type: string
        template_name:
          type: string
    MyRequest:
      type: object
      properties:
        agreement_id:
          type: string
        signature_request_name:
          type: string
        sent_by_name:
          type: string
        sent_by_email:
          type: string
        created_by:
          type: integer
        expires_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        link_url:
          type: string
        signing_log_generation_status:
          type: string
        document_info:
          type: array
          items:
            type: object
            properties:
              document_id:
                type: string
        agreement_participant_status:
          type: string
        status:
          type: string
    UserInfo:
      type: object
      properties:
        id:
          type: integer
          description: User ID
        first_name:
          type: string
          description: User's first name
        last_name:
          type: string
          description: User's last name
        username:
          type: string
          description: Egnyte username
    TrashItem:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the trash item.
        type:
          type: string
          enum:
            - file
            - folder
            - version
          description: Item type.
        path:
          type: string
          description: Original path before deletion.
        name:
          type: string
          description: Item name.
        size:
          type: integer
          description: File size in bytes (files only).
        deleted_by:
          type: string
          description: Full name of user who deleted the item.
        delete_date:
          type: string
          format: date-time
          description: ISO-8601 timestamp when item was deleted.
        purge_date:
          type: string
          format: date-time
          description: ISO-8601 timestamp when item will be permanently deleted.
        last_modified:
          type: string
          format: date-time
          description: ISO-8601 timestamp of last modification before deletion.
        owner:
          type: object
          description: Owner information (files only).
          properties:
            id:
              type: integer
            username:
              type: string
            firstName:
              type: string
            lastName:
              type: string
            email:
              type: string
            typeName:
              type: string
        data_retention_info:
          type: object
          description: Data retention information, if domain has data retention enabled.
          properties:
            retention:
              type: string
              enum:
                - RETENTION_POLICY
                - GRACE_PERIOD
                - DEFAULT_RETENTION_PERIOD
              description: Reason for retention.
            earliest_expiry:
              type: string
              description: Unix timestamp of when item's retention will expire.
            is_retained:
              type: boolean
              description: Whether item is retained.
    Template:
      type: object
      required:
        - templateId
        - version
        - name
        - status
        - assigneeInstructions
      properties:
        templateId:
          type: string
          format: uuid
          description: Unique identifier for the template.
          example: 74403afb-1f9b-43f4-b219-a5acd29c41e0
        version:
          type: string
          description: Template version number.
          example: '1.0'
        name:
          type: string
          description: Display name of the template.
          example: Account Onboarding
        status:
          type: string
          description: Template status.
          enum:
            - ACTIVE
          example: ACTIVE
        assigneeInstructions:
          type: string
          description: Default instructions shown to assignees.
          example: Provide the following documents to help us create your account
    Assignee:
      type: object
      description: |
        An assignee for the upload request. Provide either `userId` for an internal user or `externalEmail` for an external user. These fields are mutually exclusive — do not provide both in the same object.
      oneOf:
        - type: object
          required:
            - userId
          additionalProperties: false
          properties:
            userId:
              type: integer
              description: User ID of an internal Egnyte user.
              example: 47
        - type: object
          required:
            - externalEmail
          additionalProperties: false
          properties:
            externalEmail:
              type: string
              format: email
              description: Email address of an external user.
              example: bob@example.com
    CreateUploadRequestBody:
      type: object
      required:
        - name
        - dueDate
        - folderId
        - templateId
        - assignees
        - assigneeInstructions
      properties:
        name:
          type: string
          description: Name of the upload request.
          example: Account Onboarding
        dueDate:
          type: string
          format: date-time
          description: Due date and time in ISO 8601 format.
          example: '2026-12-31T23:59:59.000Z'
        folderId:
          type: string
          format: uuid
          description: ID of the folder where uploaded files will be stored.
          example: 6e4465e9-2713-4b16-a787-3560b50f2236
        templateId:
          type: string
          format: uuid
          description: Template ID obtained from the List Templates endpoint.
          example: 0af99f3d-a2d6-4a4e-af81-b2aab2d58787
        assignees:
          type: array
          description: |
            Array of assignee objects. Each object must contain either `userId` (integer) for an internal user or `externalEmail` (string) for an external user — not both.
          minItems: 1
          items:
            $ref: '#/components/schemas/Assignee'
        assigneeInstructions:
          type: string
          description: |
            Instructions displayed to assignees. Use the default instructions from the template or provide custom text.
          example: Provide the following documents to help us create your account
    CreateUploadRequestResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the newly created upload request.
          example: e250227d-044c-45b5-9dbb-c1120a856b84
    UserName:
      type: object
      properties:
        givenName:
          type: string
        familyName:
          type: string
        formatted:
          type: string
    GroupRef:
      type: object
      properties:
        displayName:
          type: string
        value:
          type: string
    UserResource:
      type: object
      properties:
        id:
          type: integer
        userName:
          type: string
        externalId:
          type: string
        email:
          type: string
        name:
          $ref: '#/components/schemas/UserName'
        active:
          type: boolean
        locked:
          type: boolean
        authType:
          type: string
        userType:
          type: string
        role:
          type: string
        language:
          type: string
        idpUserId:
          type: string
        userPrincipalName:
          type: string
        createdDate:
          type: string
        lastModificationDate:
          type: string
        lastActiveDate:
          type: string
          nullable: true
        expiryDate:
          type: string
          nullable: true
        deleteOnExpiry:
          type: boolean
          nullable: true
        groups:
          type: array
          items:
            $ref: '#/components/schemas/GroupRef'
    UserListResponse:
      type: object
      properties:
        totalResults:
          type: integer
        itemsPerPage:
          type: integer
        startIndex:
          type: integer
        resources:
          type: array
          items:
            $ref: '#/components/schemas/UserResource'
    WebhookListItem:
      type: object
      properties:
        webhookId:
          type: string
          format: uuid
          description: Unique identifier for the webhook
        expires:
          type: integer
          description: Unix timestamp when the webhook registration expires
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Current status of the webhook
      required:
        - webhookId
        - expires
        - status
    WebhookResponse:
      type: object
      properties:
        webhookId:
          type: string
          format: uuid
          description: Unique identifier for the registered webhook
        expires:
          type: integer
          description: Unix timestamp when the webhook registration expires
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Current status of the webhook
      required:
        - webhookId
        - expires
        - status
    WebhookStatusResponse:
      type: object
      properties:
        webhookId:
          type: string
          format: uuid
          description: Unique identifier for the webhook
        expires:
          type: integer
          description: Unix timestamp when the webhook registration expires
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Current status of the webhook
      required:
        - webhookId
        - expires
        - status
    WebhookDetailResponse:
      type: object
      properties:
        webhookId:
          type: string
          format: uuid
          description: Unique identifier for the webhook
        expires:
          type: integer
          description: Unix timestamp when the webhook registration expires
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Current status of the webhook
        eventType:
          type: array
          items:
            type: string
          description: Subscribed event types
        path:
          type: string
          description: Comma-separated list of monitored folder paths
        authHeader:
          type: string
          description: Custom authorization header value
        url:
          type: string
          format: uri
          description: Endpoint receiving webhook notifications
      required:
        - webhookId
        - expires
        - status
        - url
        - eventType
    WhoamiResponse:
      type: object
      properties:
        clientId:
          type: string
          description: OAuth client ID of the application
        username:
          type: string
          description: Username of the authenticated user
        domain:
          type: string
          description: Egnyte domain name
        scopes:
          type: array
          items:
            type: string
          description: OAuth scopes granted to the token
      required:
        - clientId
        - username
        - domain
        - scopes
    list-agentsResponse200:
      type: array
      items:
        $ref: '#/components/schemas/Agent'
    ask-documentRequest:
      type: object
      properties:
        question:
          type: string
          description: The natural language question to ask
        includeCitations:
          type: boolean
          description: Whether to include citations in the response
          default: false
        chatHistory:
          type: object
          description: Previous conversation history
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
      required:
        - question
    summarize-documentRequest:
      type: object
      properties:
        chatHistory:
          type: object
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
    ask-assistantRequest:
      type: object
      properties:
        question:
          type: string
          description: The question for AI Assistant
        selectedItems:
          type: object
          description: Files, folders, and search options to scope the AI's context
          properties:
            folders:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                required:
                  - id
            files:
              type: array
              items:
                type: object
                properties:
                  entryId:
                    type: string
                required:
                  - entryId
            allEgnyteSearch:
              type: boolean
              description: Search across all content in the Egnyte domain
              default: false
            webSearch:
              type: boolean
              description: Include web search results in the response
              default: false
        includeCitations:
          type: boolean
          description: Whether to include citations in the status response
          default: false
        chatHistory:
          type: object
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
        conversationId:
          type: string
          description: Pass the conversationId from a previous response to continue an existing conversation
        mcpSelectionId:
          type: string
          description: ID of the MCP server selection to use for this request
        modelDetails:
          type: object
          description: Override the AI model. When omitted, defaults to Gemini-2.5 Flash
          properties:
            name:
              type: string
              description: Display name of the model
            version:
              type: string
              description: Model version identifier (e.g. gemini-2.5-flash)
      required:
        - question
    ask-copilotRequest:
      type: object
      properties:
        question:
          type: string
          description: The question for Copilot
        selectedItems:
          type: object
          description: Lists of folders and files to scope the AI's context
          properties:
            folders:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                required:
                  - id
            files:
              type: array
              items:
                type: object
                properties:
                  entryId:
                    type: string
                required:
                  - entryId
        includeCitations:
          type: boolean
        chatHistory:
          type: object
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
      required:
        - question
        - selectedItems
    list-kbRequest:
      type: object
      properties:
        sortBy:
          type: array
          items:
            type: string
            enum:
              - createdOn
              - name
        sortDirection:
          type: array
          items:
            type: string
            enum:
              - ASC
              - DESC
        status:
          type: array
          items:
            type: string
            enum:
              - ACTIVE
              - DELETED
              - CREATED
        page:
          type: integer
        size:
          type: integer
        createdBy:
          type: integer
        createdAfter:
          type: integer
        createdBefore:
          type: integer
        includePlaceholderData:
          type: boolean
        includeProcessingStatistics:
          type: boolean
        includePrompts:
          type: boolean
      required:
        - sortBy
        - sortDirection
        - status
    ask-kbRequest:
      type: object
      properties:
        question:
          type: string
        includeCitations:
          type: boolean
        chatHistory:
          type: object
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                  content:
                    type: string
      required:
        - question
    hybrid-searchRequest:
      type: object
      properties:
        query:
          type: string
          description: Natural language search query
        semanticWeight:
          type: number
          format: float
          minimum: 0
          maximum: 1
          description: Weight given to semantic (vector) search vs keyword search (0=keyword only, 1=semantic only)
        folderPath:
          type: string
          description: Restrict search to files under this folder path
        limit:
          type: integer
          description: Maximum number of results to return
        fileTypes:
          type: array
          items:
            type: string
          description: List of file extensions to include (e.g. ["pdf","docx"])
        dateFrom:
          type: string
          description: Filter files modified on or after this ISO 8601 date
        dateTo:
          type: string
          description: Filter files modified on or before this ISO 8601 date
        createdBy:
          type: integer
          description: Filter by user ID of file creator
        modifiedBy:
          type: integer
          description: Filter by user ID of last modifier
        includeArchived:
          type: boolean
          description: Whether to include archived files in results
          default: false
        page:
          type: integer
          description: Zero-based page number for pagination
          default: 0
        size:
          type: integer
          description: Number of results per page
          default: 20
      required:
        - query
    createBookmarkRequest:
      type: object
      properties:
        path:
          type: string
          description: Path to the folder to bookmark
        folder_id:
          type: string
          description: UUID of the folder to bookmark
    addCommentRequest:
      type: object
      properties:
        path:
          type: string
          description: Path to the file or folder
        body:
          type: string
          description: Text of the comment
      required:
        - path
        - body
    navigate-post-v2Request:
      type: object
      properties:
        embedded:
          type: boolean
          description: Whether to return an embedded view without headers, search or tree.
        path:
          type: string
          description: Optional path to a folder to open. If omitted, defaults to the user's home folder.
        share:
          type: boolean
          description: When true, opens the share dialog at the specified path. When true, the `type`, `base`, and `items` fields should be provided.
        fileVersion:
          type: boolean
          description: When true, opens the file version view in embedded mode.
        fileVersionFullUI:
          type: boolean
          description: When true, opens the file version view in full UI mode.
        type:
          type: string
          enum:
            - File
            - Folder
          description: 'Type of items for share dialog. Used with `share: true`.'
        base:
          type: string
          description: 'Base folder name for share dialog. Used with `share: true`.'
        items:
          type: array
          items:
            type: string
          description: 'List of item paths to share. Used with `share: true`.'
        postMessageNotifications:
          type: boolean
          description: When true, enables post-message notifications from the embedded UI to the parent window.
        componentId:
          type: string
          description: Identifies the specific UI component to open. Used for targeted embedded UI integrations.
      required:
        - embedded
    portal-prod-patch-folder-options-v1Request:
      type: object
      minProperties: 1
      properties:
        folder_description:
          type: string
          maxLength: 200
          description: Text description of the folder. Maximum 200 characters.
        allow_links:
          type: boolean
          description: |
            Whether any links (both private and public) can be created for files or sub-folders within this folder. When set to false, all link creation is disabled regardless of the public_links setting.
        allow_upload_links:
          type: boolean
          description: Whether upload links are allowed for this folder.
        public_links:
          type: string
          enum:
            - files_folders
            - folders
            - files
            - disabled
          description: Public link permissions.
        restrict_move_delete:
          type: boolean
          description: |
            If true, restricts move and delete operations to Admins and Owners only. If false, maps to admins_owners_or_full_access_users. Cannot be applied to top-level folders in /Shared or /Private. If both restrict_move_delete and move_delete_folder_restriction are provided, move_delete_folder_restriction takes precedence.
        move_delete_folder_restriction:
          type: string
          enum:
            - admins_owners_or_full_access_users
            - admins_or_owners
            - admins_only
          description: |
            Granular move/delete restriction level. Cannot be applied to top-level folders in /Shared or /Private. Takes precedence over restrict_move_delete if both are provided.
        inheritance_rule:
          type: string
          enum:
            - legacy
            - this_folder_only
            - this_folder_and_subfolders_until_overridden
            - this_folder_and_subfolders
          default: legacy
          description: |
            Controls how the updated settings propagate to subfolders. this_folder_only applies settings without propagation. legacy uses legacy propagation behavior.
        email_preferences:
          type: object
          description: |
            Email notification settings. Write-only — not included in the response. Setting content_accessed for a Standard User will return a 400 error.
          properties:
            content_updates:
              type: boolean
              description: Receive notifications when folder content is updated.
            content_accessed:
              type: boolean
              description: |
                Receive notifications when folder content is accessed. Only available to Power Users and above.
    portal-prod-patch-folder-options-v1Response200:
      type: object
      properties:
        name:
          type: string
          description: Folder name.
        lastModified:
          type: integer
          description: Last modified timestamp in milliseconds since epoch.
        uploaded:
          type: integer
          description: Upload timestamp in milliseconds since epoch.
        path:
          type: string
          description: Full path to the folder.
        folder_id:
          type: string
          description: Unique identifier for the folder.
        parent_id:
          type: string
          description: Unique identifier of the parent folder.
        folder_description:
          type: string
          description: Text description of the folder.
        is_folder:
          type: boolean
          description: Always true for folders.
        allow_links:
          type: boolean
          description: Whether any links can be created for files or sub-folders within this folder.
        allow_upload_links:
          type: boolean
          description: Whether upload links are allowed for this folder.
        allowed_file_link_types:
          type: array
          items:
            type: string
          description: List of allowed file link types for this folder.
        allowed_folder_link_types:
          type: array
          items:
            type: string
          description: List of allowed folder link types for this folder.
        public_links:
          type: string
          enum:
            - files_folders
            - folders
            - files
            - disabled
          description: Public link permission setting.
        restrict_move_delete:
          type: boolean
          description: Whether move/delete operations are restricted to Admins and Owners.
        move_delete_folder_restriction:
          type: string
          enum:
            - admins_owners_or_full_access_users
            - admins_or_owners
            - admins_only
            - forbidden
            - none
          description: |
            Granular move/delete restriction level. Legacy data may also return none (deprecated, equivalent to no restriction).
    portal-prod-post-fs-v1Request:
      type: object
      properties:
        action:
          type: string
          description: The operation to perform.
          enum:
            - add_folder
            - move
            - copy
            - rename
            - lock
            - unlock
        destination:
          type: string
          description: Destination path for move or copy operations.
        new_name:
          type: string
          description: New name when renaming or when moving/copying to rename the item.
        permissions:
          type: string
          description: How permissions are derived on move/copy. One of `keep_original` or `inherit_from_parent`.
          enum:
            - keep_original
            - inherit_from_parent
        folder_options_mode:
          type: string
          description: How folder options are handled on move/copy. One of `keep_source` or `apply_destination`.
        destination_id:
          type: string
          description: Destination folder ID for ID-based move/copy operations.
        lock_token:
          type: string
          description: Token required to unlock the file. If omitted on lock, a random token is generated.
        lock_timeout:
          type: integer
          description: Lock duration in seconds (default 3600, max 604800).
        collaboration:
          type: string
          description: Collaboration token for UI Integration Framework apps (Base64-encoded).
      required:
        - action
    portal-prod-post-fs-v2Request:
      type: object
      properties:
        action:
          type: string
          enum:
            - add_folder
            - move
            - copy
            - rename
            - lock
            - unlock
        destination:
          type: string
        new_name:
          type: string
        permissions:
          type: string
          enum:
            - keep_original
            - inherit_from_parent
        folder_options_mode:
          type: string
        destination_id:
          type: string
        lock_token:
          type: string
        lock_timeout:
          type: integer
        collaboration:
          type: string
      required:
        - action
    portal-prod-post-fs-by-id-v1Request:
      type: object
      properties:
        action:
          type: string
          description: The operation to perform.
          enum:
            - move
            - copy
            - lock
            - unlock
        destination:
          type: string
          description: Destination path for move or copy operations.
        destination_id:
          type: string
          description: Destination folder ID for ID-based move/copy operations.
        name:
          type: string
          description: Destination entity name when using destination_id.
        permissions:
          type: string
          description: How permissions are derived on move/copy. One of `keep_original` or `inherit_from_parent`.
          enum:
            - keep_original
            - inherit_from_parent
        folder_options_mode:
          type: string
          description: How folder options are handled on move/copy. One of `keep_source` or `apply_destination`.
        lock_token:
          type: string
          description: Token required to unlock the file. If omitted on lock, a random token is generated.
        lock_timeout:
          type: integer
          description: Lock duration in seconds (default 3600, max 604800).
        collaboration:
          type: string
          description: Collaboration token for UI Integration Framework apps (Base64-encoded).
      required:
        - action
    portal-prod-post-fs-content-by-path-v1Request:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: The file data to upload.
      required:
        - file
    portal-prod-post-fs-content-chunked-by-id-v1Request:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: The chunk data to upload.
      required:
        - file
    portal-prod-post-groups-v2Request:
      type: object
      properties:
        displayName:
          type: string
          description: Name of the group.
        members:
          type: array
          description: Optional list of user IDs to include in the group.
          items:
            type: string
      required:
        - displayName
    portal-prod-put-groups-by-id-v2Request:
      type: object
      properties:
        displayName:
          type: string
        members:
          type: array
          items:
            type: string
      required:
        - displayName
    portal-prod-patch-groups-by-id-v2Request:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
          description: Must include `urn:ietf:params:scim:api:messages:2.0:PatchOp`.
        Operations:
          type: array
          description: Array of patch operations.
          items:
            type: object
            properties:
              op:
                type: string
                description: Operation to perform (add, remove, replace).
              path:
                type: string
                description: Path to the attribute being modified.
              value:
                type: object
                description: Value to apply.
            required:
              - op
      required:
        - schemas
        - Operations
    portal-prod-get-insights-files-v1Response200:
      type: object
      properties:
        recentFiles:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: File name.
              path:
                type: string
                description: Full path to the file.
              size:
                type: integer
                description: File size in bytes.
              entry_id:
                type: string
                description: Unique identifier for the file.
              group_id:
                type: string
                description: Unique identifier for the file version group.
              uploaded_by:
                type: string
                description: Name of the user who uploaded the file. Omitted when owner is unavailable.
              num_versions:
                type: integer
                description: Number of versions for this file.
              last_modified:
                type: integer
                description: Last modification timestamp in Unix time (milliseconds).
              last_accessed:
                type: integer
                description: Last access timestamp in Unix time (milliseconds).
              recommendation_type:
                type: string
                description: Always "recent" for this endpoint.
    portal-prod-post-links-v1Request:
      type: object
      properties:
        path:
          type: string
          description: Absolute path to the target file or folder.
        type:
          type: string
          description: 'Type of link: `file`, `folder`, or `upload`.'
          enum:
            - file
            - folder
            - upload
        accessibility:
          type: string
          description: Who can access the link.
          enum:
            - anyone
            - password
            - domain
            - recipients
        useDefaultSettings:
          type: boolean
          description: If true, uses domain-level defaults for accessibility.
        send_email:
          type: boolean
          description: If true, Egnyte sends the link via email to recipients.
        recipients:
          type: array
          items:
            type: string
          description: Array of email addresses (required if send_email is true).
        message:
          type: string
          description: Personal message for link email.
        copy_me:
          type: boolean
          description: If true, sends a copy of the link email to the creator.
        notify:
          type: boolean
          description: Whether to send notifications to the creator when the link is accessed.
        link_to_current:
          type: boolean
          description: If true, link always refers to the current version of the file.
        expiry_date:
          type: string
          description: Link expiration date in YYYY-MM-DD format.
        expiry_clicks:
          type: integer
          description: Number of clicks before link expires (1-10).
        add_file_name:
          type: boolean
          description: If true, appends the filename to the link URL.
        password:
          type: string
          description: Password for password-protected links.
        protection:
          type: string
          description: Set to PREVIEW for preview-only link, or NONE for standard.
        folder_per_recipient:
          type: boolean
          description: If true, each recipient's uploads are placed in a separate folder.
      required:
        - path
        - type
    portal-prod-post-links-v2Request:
      type: object
      properties:
        path:
          type: string
        type:
          type: string
          enum:
            - file
            - folder
            - upload
        accessibility:
          type: string
          enum:
            - anyone
            - password
            - domain
            - recipients
        password:
          type: string
        expiry_date:
          type: string
        expiry_clicks:
          type: integer
        notify:
          type: boolean
        link_to_current:
          type: boolean
        recipients:
          type: array
          items:
            type: string
      required:
        - path
        - type
    portal-prod-get-namespaces-v1Response200:
      type: array
      items:
        $ref: '#/components/schemas/NamespaceObject'
    portal-prod-post-namespace-v1Request:
      type: object
      properties:
        name:
          type: string
          description: Unique namespace identifier.
        scope:
          type: string
          description: Visibility of the namespace.
          enum:
            - public
            - protected
            - private
        displayName:
          type: string
          description: Display name shown in the UI.
        inheritable:
          type: boolean
          description: Whether metadata is inherited by child items.
        metadataScopeType:
          type: string
          enum:
            - GLOBAL
            - FOLDER_SCOPE
            - DOCUMENT_TYPE
          description: Scope type for the namespace.
        associatedFolderIds:
          type: array
          items:
            type: string
          description: Folder IDs to associate (only when metadataScopeType is FOLDER_SCOPE).
        documentTypes:
          type: array
          items:
            type: string
            enum:
              - PDF
              - DOCUMENT
              - SPREADSHEET
              - PRESENTATION
              - IMAGE
              - AUDIO_VIDEO
              - TEXT_SOURCE_CODE
              - GOOGLE_FILE
              - EMAIL
              - CAD
              - ARCHIVE
          description: Document type categories (required when metadataScopeType is DOCUMENT_TYPE).
        keys:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/KeyDefinition'
          description: Definitions of keys in the namespace. The object's property names are the key names.
      required:
        - name
        - scope
        - keys
    portal-prod-patch-namespace-v1Request:
      type: object
      properties:
        displayName:
          type: string
          description: Display name shown in the UI.
        priorities:
          type: object
          additionalProperties:
            type: integer
          description: Map of key names to priority values.
        folderAssociation:
          type: object
          description: Folders to associate or dissociate. Do not combine with documentTypeAssociation.
          properties:
            associateFolderIds:
              type: array
              items:
                type: string
              description: Folder IDs to associate.
            dissociateFolderIds:
              type: array
              items:
                type: string
              description: Folder IDs to dissociate.
        documentTypeAssociation:
          type: object
          description: Document types to associate or dissociate. Do not combine with folderAssociation.
          properties:
            associateDocumentTypes:
              type: array
              items:
                type: string
              description: Document types to associate.
            dissociateDocumentTypes:
              type: array
              items:
                type: string
              description: Document types to dissociate.
      minProperties: 1
    portal-prod-post-metadata-key-v1Request:
      type: object
      properties:
        key:
          type: string
          description: Name of the key to create.
        type:
          type: string
          enum:
            - integer
            - string
            - decimal
            - date
            - enum
            - labels
            - multi_value_enum
        displayName:
          type: string
        priority:
          type: integer
        helpText:
          type: string
        data:
          type: array
          items:
            type: string
      required:
        - key
        - type
    portal-prod-patch-metadata-key-v1Request:
      type: object
      properties:
        displayName:
          type: string
        helpText:
          type: string
        priority:
          type: integer
        type:
          type: string
          enum:
            - integer
            - string
            - decimal
            - date
            - enum
            - labels
            - multi_value_enum
        data:
          type: array
          items:
            type: string
      minProperties: 1
    portal-prod-put-file-metadata-v1Request:
      type: object
      description: Object containing key/value pairs for the namespace.
      additionalProperties: true
    portal-prod-put-folder-metadata-v1Request:
      type: object
      additionalProperties: true
    getEffectivePermissionsForUserResponse200:
      type: object
      properties:
        permission:
          $ref: '#/components/schemas/PermissionLevel'
    getFolderPermissionsV2Response200:
      type: object
      properties:
        userPerms:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PermissionLevel'
          description: Map of username to permission level.
        groupPerms:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PermissionLevel'
          description: Map of group name to permission level.
        inheritsPermissions:
          type: boolean
          description: Whether this folder inherits permissions from its parent.
    setFolderPermissionsV2Request:
      type: object
      properties:
        userPerms:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PermissionLevel'
          description: Map of username to permission level.
        groupPerms:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/PermissionLevel'
          description: Map of group name to permission level.
        inheritsPermissions:
          type: boolean
          description: Whether this folder should inherit permissions from its parent. Only include when changing inheritance status.
        keepParentPermissions:
          type: boolean
          description: Only valid when inheritsPermissions is false. When setting inheritsPermissions to false, whether to copy currently inherited permissions to this folder.
    getFolderPermissionsV1Response200:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/PermissionSubject'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/PermissionSubject'
    setFolderPermissionsV1Request:
      type: object
      required:
        - permission
      properties:
        users:
          type: array
          items:
            type: string
          description: Array of usernames to set permissions for.
        groups:
          type: array
          items:
            type: string
          description: Array of group names to set permissions for.
        permission:
          $ref: '#/components/schemas/PermissionLevel'
    listSyncedProjectsResponse200:
      type: array
      items:
        $ref: '#/components/schemas/SyncedProject'
    createSyncRequest:
      type: object
      required:
        - folderPath
        - companyId
        - procoreProjectId
      properties:
        folderPath:
          type: string
          description: Egnyte folder path (e.g. /Shared/folder)
        procoreFolderPaths:
          type: string
          description: Comma-separated Procore folder paths to include (e.g. /01 Design Files,/03 Safety/01 Inbound). If omitted, the entire project is synced.
        companyId:
          type: string
          description: Procore company ID
        procoreProjectId:
          type: string
          description: Procore project ID to sync
    updateSyncRequest:
      type: object
      required:
        - syncOption
      properties:
        syncOption:
          type: string
          enum:
            - 2-way sync
            - no sync
          description: New sync type
        procoreFolderPaths:
          type: string
          description: Comma-separated Procore folder paths. If omitted, the entire project is synced.
    listProcoreProjectsResponse200:
      type: array
      items:
        $ref: '#/components/schemas/ProcoreProject'
    portal-prod-patch-project-custom-field-data-v1Request:
      type: array
      items:
        type: string
      minItems: 1
      description: Array of predefined values to delete from the custom field.
    listProjectFoldersResponse200:
      type: object
      properties:
        itemsPerPage:
          type: integer
        totalResults:
          type: integer
        startIndex:
          type: integer
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              rootFolderId:
                type: string
              name:
                type: string
              projectId:
                type: string
              customerName:
                type: string
              status:
                type: string
              startDate:
                type: string
              completionDate:
                type: string
    markFolderAsProjectRequest:
      type: object
      properties:
        rootFolderId:
          type: string
        name:
          type: string
        description:
          type: string
        status:
          type: string
          enum:
            - pending
            - in-progress
            - completed
            - on-hold
            - canceled
        startDate:
          type: string
        completionDate:
          type: string
      required:
        - rootFolderId
        - name
        - status
    markFolderAsProjectResponse201:
      type: object
      properties:
        id:
          type: string
        rootFolderId:
          type: string
        name:
          type: string
        description:
          type: string
        status:
          type: string
        startDate:
          type: string
        completionDate:
          type: string
    getProjectDetailsResponse200:
      type: object
      properties:
        id:
          type: string
        rootFolderId:
          type: string
        name:
          type: string
        projectId:
          type: string
        customerName:
          type: string
        description:
          type: string
        location:
          type: object
          properties:
            streetAddress1:
              type: string
            streetAddress2:
              type: string
            city:
              type: string
            state:
              type: string
            country:
              type: string
            postalCode:
              type: string
        status:
          type: string
        startDate:
          type: string
        createdBy:
          type: integer
        lastUpdatedBy:
          type: integer
        creationTime:
          type: string
        lastModifiedTime:
          type: string
    listScimUsersResponse200:
      type: object
      properties:
        itemsPerPage:
          type: integer
        totalResults:
          type: integer
        startIndex:
          type: integer
        schemas:
          type: array
          items:
            type: string
        Resources:
          type: array
          items:
            $ref: '#/components/schemas/User'
    patchScimUserRequest:
      type: object
      properties:
        Operations:
          type: array
          items:
            type: object
            properties:
              op:
                type: string
              path:
                type: string
              value:
                description: Any value type.
            required:
              - op
              - path
              - value
        schemas:
          type: array
          items:
            type: string
      required:
        - Operations
    listScimGroupsResponse200:
      type: object
      properties:
        schemas:
          type: array
          items:
            type: string
        totalResults:
          type: integer
        itemsPerPage:
          type: integer
        startIndex:
          type: integer
        resources:
          type: array
          items:
            $ref: '#/components/schemas/Group'
    searchV1GetResponse200:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              path:
                type: string
              type:
                type: string
              size:
                type: integer
              snippet:
                type: string
              entry_id:
                type: string
              group_id:
                type: string
              last_modified:
                type: string
                format: date-time
              uploaded_by:
                type: string
              uploaded_by_username:
                type: string
              num_versions:
                type: integer
              snippet_html:
                type: string
              is_folder:
                type: boolean
        total_count:
          type: integer
        offset:
          type: integer
        count:
          type: integer
    searchV1PostRequest:
      type: object
      properties:
        query:
          type: string
        offset:
          type: integer
        count:
          type: integer
        namespaces:
          type: array
          items:
            type: string
        custom_metadata:
          type: array
          items:
            type: object
            properties:
              namespace:
                type: string
              key:
                type: string
              operator:
                type: string
                enum:
                  - EQUALS
                  - GREATER_THAN
                  - LESS_THAN
                  - BETWEEN
                  - IN
                  - CONTAINS
                  - HAS_KEY
                  - HAS_NOT_KEY
                  - SUB_SET
              value:
                description: Any value type.
            required:
              - namespace
              - key
              - operator
      required:
        - query
    searchV1PostResponse200:
      type: object
      properties:
        count:
          type: integer
        total_count:
          type: integer
        hasMore:
          type: boolean
        results:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              path:
                type: string
              type:
                type: string
              entry_id:
                type: string
              group_id:
                type: string
              last_modified:
                type: string
                format: date-time
              uploaded_by:
                type: string
              uploaded_by_username:
                type: string
              custom_properties:
                type: array
                items:
                  type: object
                  properties:
                    scope:
                      type: string
                    namespace:
                      type: string
                    key:
                      type: string
                    value:
                      type: string
              snippet:
                type: string
              snippet_html:
                type: string
              size:
                type: integer
        offset:
          type: integer
    searchV2PostRequest:
      type: object
      properties:
        query:
          type: string
          description: Keyword search string (3–100 characters). Either query or custom_metadata is required.
          minLength: 3
          maxLength: 100
        offset:
          type: integer
          minimum: 0
          default: 0
        count:
          type: integer
          minimum: 1
          maximum: 20
          default: 20
        folder:
          type: string
          description: Limit results to items in this folder and its descendants. Do NOT URL-encode when using v2.
        modified_before:
          type: integer
          description: Limit results to items modified before this Unix timestamp in milliseconds.
        modified_after:
          type: integer
          description: Limit results to items modified after this Unix timestamp in milliseconds.
        uploaded_before:
          type: integer
          description: Limit results to items uploaded before this Unix timestamp in milliseconds.
        uploaded_after:
          type: integer
          description: Limit results to items uploaded after this Unix timestamp in milliseconds.
        type:
          type: string
          enum:
            - FILE
            - FOLDER
            - ALL
          default: ALL
          description: Filter by item type.
        snippet_requested:
          type: boolean
          default: true
          description: Whether to include text snippets in results.
        sort_by:
          type: string
          enum:
            - score
            - last_modified
            - size
            - name
          default: score
        sort_direction:
          type: string
          enum:
            - ascending
            - descending
        query_operator:
          type: string
          enum:
            - ANY
            - ALL
          default: ANY
        file_query_fields:
          type: array
          items:
            type: string
            enum:
              - ALL
              - FILENAME
              - COMMENTS
              - CONTENT
          description: Search files in specific fields.
        folder_query_fields:
          type: array
          items:
            type: string
            enum:
              - ALL
              - FOLDERNAME
              - DESCRIPTION
          description: Search folders in specific fields.
        mlt:
          type: array
          items:
            type: string
          description: Array of document entry IDs to use as reference for similarity search.
        mltt:
          type: array
          items:
            type: string
          description: Array of text strings to use as reference for similarity search.
        namespaces:
          type: array
          items:
            type: string
          description: Array of namespace names to include in results.
        custom_metadata:
          type: array
          items:
            type: object
            properties:
              namespace:
                type: string
              key:
                type: string
              operator:
                type: string
              value:
                description: Any value type.
              range:
                type: object
                properties:
                  start:
                    description: Any value type.
                  end:
                    description: Any value type.
              values:
                type: array
                items:
                  description: Any value type.
            required:
              - namespace
              - key
              - operator
    searchV2PostResponse200:
      type: object
      properties:
        count:
          type: integer
        offset:
          type: integer
        total_count:
          type: integer
        hasMore:
          type: boolean
          description: true if there are more results available.
        results:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              path:
                type: string
              type:
                type: string
              size:
                type: integer
              snippet:
                type: string
              snippet_html:
                type: string
              entry_id:
                type: string
              group_id:
                type: string
              last_modified:
                type: string
                format: date-time
              uploaded_by:
                type: string
              uploaded_by_username:
                type: string
              num_versions:
                type: integer
              is_folder:
                type: boolean
              score:
                type: number
                description: Relevance score for this result.
              custom_properties:
                type: array
                items:
                  type: object
                  properties:
                    scope:
                      type: string
                    namespace:
                      type: string
                    key:
                      type: string
                    value:
                      type: string
                    valueToStampOnFile:
                      type: string
                      description: Value to display on file stamps (if applicable).
    advancedSearchV1Request:
      type: object
      properties:
        keywords:
          type: string
          description: Search keywords
        path:
          type: string
          description: Restrict search to this folder and its descendants
        owners:
          type: array
          items:
            type: string
          description: Usernames of content owners
        uploadedAfter:
          type: string
          format: date-time
          description: Find items uploaded after this time
        uploadedBefore:
          type: string
          format: date-time
          description: Find items uploaded before this time
        sizeGreaterThan:
          type: integer
          description: Minimum file size in bytes
        sizeLessThan:
          type: integer
          description: Maximum file size in bytes
    advancedSearchV1Response200:
      type: object
      properties:
        count:
          type: integer
        total_count:
          type: integer
        offset:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResultItem'
    list-sign-templatesResponse200:
      type: object
      properties:
        count:
          type: integer
          description: Total number of templates returned
        results:
          type: array
          items:
            $ref: '#/components/schemas/TemplateSummary'
    create-signature-requestRequest:
      type: object
      properties:
        template_id:
          type: string
          description: Template UUID to use for the signature request
        signature_request_name:
          type: string
          description: Name for the signature request (max 255 characters)
        email_message:
          type: string
          description: Custom email message
        recipients:
          type: array
          items:
            type: object
            properties:
              template_participant_id:
                type: string
              email:
                type: string
      required:
        - template_id
        - signature_request_name
    create-signature-requestResponse200:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Agreement'
    list-sent-signature-requestsResponse200:
      type: object
      properties:
        count:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/SentRequest'
    cancel-signature-requestRequest:
      type: object
      properties:
        message:
          type: string
          description: Reason for cancellation (max 500 characters)
    list-my-signature-requestsResponse200:
      type: object
      properties:
        count:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/MyRequest'
    revoke-tokenRequest:
      type: object
      properties:
        token:
          type: string
          description: The OAuth token to revoke
      required:
        - token
    listTrashV1Response200:
      type: object
      properties:
        count:
          type: integer
          description: Number of items returned in this response.
        offset:
          type: integer
          description: Zero-based offset of the first item.
        total_count:
          type: integer
          description: Total number of items in trash.
        items:
          type: array
          items:
            $ref: '#/components/schemas/TrashItem'
    trashActionRequest:
      type: object
      required:
        - action
        - ids
      properties:
        action:
          type: string
          enum:
            - RESTORE
            - PURGE
          description: Action to perform on the specified trash items.
        ids:
          type: array
          items:
            type: string
          maxItems: 10
          description: Array of trash item IDs (max 10).
    trashActionResponse207:
      type: object
      properties:
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Trash item ID.
              code:
                type: string
                description: HTTP status code for this item.
              descriptions:
                type: string
                description: Error description (only present if code is not 200).
    listTrashV2Response200:
      type: object
      properties:
        count:
          type: integer
          description: Number of items returned in this response.
        offset:
          type: integer
          description: Zero-based offset of the first item.
        has_more:
          type: boolean
          description: Whether additional pages are available.
        items:
          type: array
          items:
            $ref: '#/components/schemas/TrashItem'
    getTrashTotalCountResponse200:
      type: object
      properties:
        totalCount:
          type: integer
          description: Total number of items in trash.
    listUploadRequestTemplatesResponse200:
      type: array
      items:
        $ref: '#/components/schemas/Template'
    create-userRequest:
      type: object
      properties:
        userName:
          type: string
        externalId:
          type: string
        email:
          type: string
          format: email
        name:
          type: object
          properties:
            givenName:
              type: string
            familyName:
              type: string
          required:
            - givenName
            - familyName
        active:
          type: boolean
        sendInvite:
          type: boolean
        language:
          type: string
        authType:
          type: string
        userType:
          type: string
        role:
          type: string
        idpUserId:
          type: string
        userPrincipalName:
          type: string
      required:
        - userName
        - email
        - name
        - active
        - authType
        - userType
    update-userRequest:
      type: object
      properties:
        email:
          type: string
          format: email
        familyName:
          type: string
        givenName:
          type: string
        active:
          type: boolean
        sendInvite:
          type: boolean
        language:
          type: string
        authType:
          type: string
        userType:
          type: string
        role:
          type: string
        idpUserId:
          type: string
        userPrincipalName:
          type: string
    list-webhooksResponse200:
      type: array
      items:
        $ref: '#/components/schemas/WebhookListItem'
    register-webhookRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: The HTTPS endpoint that will receive webhook notifications
        eventType:
          type: array
          items:
            type: string
          description: 'One or more event types to subscribe to. Supported categories: `fs:*`, `link:*`, `comment:*`, `permission:*`, `meta:*`, `workflow:*`, `group:*`, `user:*`. Use a category wildcard (e.g. `fs:*`) to subscribe to all events in that category, or a specific event name (e.g. `fs:add_file`). If omitted, subscribes to all events.'
        path:
          type: string
          description: Comma‑separated list of folder paths to scope the webhook. Maximum 100 paths.
        authHeader:
          type: string
          description: Optional header name used to send a custom authentication value with webhook requests
        authHeaderValue:
          type: string
          description: Optional value associated with `authHeader`
      required:
        - url
    update-webhookRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: The HTTPS endpoint where Egnyte will send event notifications
        eventType:
          type: array
          items:
            type: string
          description: 'List of event types to subscribe to. Minimum 1 item if provided. Supported categories: `fs:*`, `link:*`, `comment:*`, `permission:*`, `meta:*`, `workflow:*`, `group:*`, `user:*`. Use a category wildcard (e.g. `fs:*`) or a specific event name (e.g. `fs:add_file`).'
        path:
          type: string
          description: Comma-separated list of folder paths to monitor. Maximum 100 paths.
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Webhook status
        authHeader:
          type: string
          description: Custom authorization header value sent with webhook notifications
        authHeaderValue:
          type: string
          description: Optional value associated with `authHeader`
      required:
        - url
    update-webhookResponse200:
      type: object
      description: Empty response body on successful update
    set-webhook-statusRequest:
      type: object
      properties:
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: The desired new status of the webhook
      required:
        - status
    create-workflowRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the workflow
        file:
          type: object
          description: Identifier of the file on which the workflow is created
          properties:
            groupId:
              type: string
          required:
            - groupId
        reasonForChange:
          type: string
        workflowType:
          type: string
          enum:
            - TODO
            - APPROVAL
            - REVIEW_APPROVE
        steps:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              description:
                type: string
              type:
                type: string
                enum:
                  - TODO
                  - REVIEW
                  - APPROVAL
              stepOptions:
                type: object
                properties:
                  assignees:
                    type: array
                    items:
                      type: integer
                  minMustComplete:
                    type: integer
                  dueDate:
                    type: string
                    format: date-time
                  signatureRequired:
                    type: boolean
                required:
                  - assignees
            required:
              - name
              - type
              - stepOptions
      required:
        - name
        - file
        - steps
  parameters:
    FieldName:
      name: field_name
      in: path
      required: true
      description: The unique internal name of the custom field.
      schema:
        type: string
      example: project_category
    ForceDelete:
      name: X-Egnyte-Force-Delete
      in: header
      required: false
      description: Set to `Yes` to force delete a custom field that is in use.
      schema:
        type: string
        enum:
          - 'Yes'
  responses:
    BadRequest:
      description: Bad request — invalid query parameter or malformed request body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized — invalid or expired OAuth token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden — user is not an administrator or power user with trash management privileges.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not found – custom field does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errorMessage: Custom field does not exist
            errorCode: NOT_FOUND
    TooManyRequests:
      description: Too many requests — rate limit exceeded.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Number of seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errorMessage: API encountered an unexpected error
            errorCode: INTERNAL_SERVER_ERROR
