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

# Get operation results

> Returns paginated execution results for an operation within the authorized organization.



## OpenAPI

````yaml /en/api-reference/openapi.en-v1.json get /v1/organizations/{organization_id}/operations/{operation_id}/results
openapi: 3.0.3
info:
  title: Public Portal API
  version: 1.0.0
  description: Public REST API for portal
servers:
  - url: https://api.staging.flxwvdexternal.com
    description: Staging API server.
security:
  - bearerAuth: []
tags: []
paths:
  /v1/organizations/{organization_id}/operations/{operation_id}/results:
    get:
      tags:
        - Operations
      summary: Get operation results
      description: >-
        Returns paginated execution results for an operation within the
        authorized organization.
      operationId: get_operation_results
      parameters:
        - name: organization id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{24}$
            minLength: 24
            maxLength: 24
          description: Organization identifier.
          example: 507f1f77bcf86cd799439011
        - name: operation_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{24}$
            minLength: 24
            maxLength: 24
          description: Identifier of the operation.
          example: 64f0c2a1b2d3e4f506070811
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
          description: Page to query.
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 100
            maximum: 100
            minimum: 1
          description: Number of items per page.
        - name: fields
          in: query
          required: false
          schema:
            type: string
          description: Comma-separated list of response fields to be included.
          example: id,workspace_id,status,name,start_date,end_date
        - name: sort
          in: query
          required: false
          schema:
            type: string
            pattern: ^([a-z_]+):(asc|desc)$
          description: >-
            Sorting expression in the format <field>:asc|desc. In aggregate
            mode, only accepts `group_by` fields or aggregated aliases (`count`,
            `<function>_<field>`).
          example: start_date:desc
        - name: aggregate
          in: query
          required: false
          schema:
            type: string
            maxLength: 1024
          description: >-
            JSON expression for aggregation. Structure:
            {"group_by":["field"],"aggregates":[{"field":"*","function":"count"}]}.
            Cannot be combined with `fields`.
          examples:
            group-by-status-count:
              summary: Group by status and count
              value: >-
                {"group_by":["status"],"aggregates":[{"field":"*","function":"count"}]}
            group-by-status-avg-script-duration:
              summary: Group by status and calculate average
              value: >-
                {"group_by":["status"],"aggregates":[{"field":"*","function":"count"},{"field":"script_duration","function":"avg"}]}
        - name: filters
          in: query
          required: false
          schema:
            type: string
          description: JSON expression of filters on allowed fields.
          examples:
            simple:
              summary: Simple filter by machine name
              value: '{"field":"name","op":"contains","value":"srv"}'
            complex-and:
              summary: Combined filter with AND conditions
              value: >-
                {"and":[{"field":"status","op":"eq","value":"completed"},{"field":"name","op":"contains","value":"win"}]}
            complex-or-and:
              summary: Nested OR and AND filter
              value: >-
                {"and":[{"or":[{"field":"status","op":"eq","value":"error"},{"field":"status","op":"eq","value":"timeout"}]},{"field":"name","op":"contains","value":"desk"}]}
      responses:
        '200':
          description: Results successfully retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOperationResultsResponseV1'
              examples:
                results_page:
                  summary: Operation results page
                  value:
                    data:
                      - id: 66b5f6d2f8d5a4d8a7f1c101
                        operation_id: 64f0c2a1b2d3e4f506070811
                        workspace_id: 66b5f6d2f8d5a4d8a7f1c301
                        organization_id: 507f1f77bcf86cd799439011
                        status: completed
                        name: ws-001
                        start_date: '2026-05-10T10:15:30Z'
                        end_date: '2026-05-10T10:16:41Z'
                        script_detail: Script executed successfully
                        script_duration: 71
                        script_response:
                          - timestamp: '2026-05-10T10:15:35.100Z'
                            line: |-
                              Initial line
                              Multiline detail
                          - timestamp: '2026-05-10T10:15:37.100Z'
                            line: Second block OUT
                    has_next: true
                aggregated_by_status:
                  summary: Aggregated result by status
                  value:
                    has_next: false
                    data:
                      - status: completed
                        count: 120
                        avg_script_duration: 17.4
                      - status: error
                        count: 45
                        avg_script_duration: 3.1
        '400':
          description: Invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_parameters:
                  summary: Parameter validation error
                  value:
                    error:
                      message: Invalid query parameters
                      code: BAD_REQUEST
        '401':
          description: Not authorized or without access to the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: Authorization failure
                  value:
                    error:
                      message: Unauthorized
                      code: unauthorized
        '404':
          description: Operation not found in the organization's authorized scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                not_found:
                  summary: Non-existent operation
                  value:
                    error:
                      message: Operation not found
                      code: not_found
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unexpected_error:
                  summary: Unexpected error
                  value:
                    error:
                      message: Internal Server Error
                      code: internal_error
components:
  schemas:
    GetOperationResultsResponseV1:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/GetOperationResultItemV1'
        has_next:
          type: boolean
          description: Indicates if more results exist on the next page.
      required:
        - data
        - has_next
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            code:
              type: string
            details:
              type: string
          required:
            - message
            - code
      required:
        - error
    GetOperationResultItemV1:
      type: object
      properties:
        id:
          type: string
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Result identifier.
        operation_id:
          type: string
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Associated operation identifier.
        workspace_id:
          type: string
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Identifier of the associated workspace.
        organization_id:
          type: string
          pattern: ^[0-9a-f]{24}$
          minLength: 24
          maxLength: 24
          description: Identifier of the associated organization.
        status:
          type: string
          description: Execution status of the result.
          enum:
            - scheduled
            - pending
            - in-progress
            - completed
            - error
            - timeout
            - cancelled
            - unknown
        name:
          type: string
          nullable: true
          description: Machine name associated with the session when it exists.
        start_date:
          type: string
          format: date-time
          nullable: true
          description: Execution start date and time.
        end_date:
          type: string
          format: date-time
          nullable: true
          description: Execution end date and time.
        script_detail:
          type: string
          nullable: true
          description: Script execution detail when it exists.
        script_duration:
          type: number
          nullable: true
          description: Script duration in seconds when it exists.
        script_response:
          type: array
          nullable: true
          description: Structured script output with timestamp and line.
          items:
            $ref: '#/components/schemas/GetOperationResultScriptResponseLineV1'
      required:
        - id
        - operation_id
        - workspace_id
        - status
    GetOperationResultScriptResponseLineV1:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          nullable: true
          description: ISO-8601 timestamp of the line or null when not available.
        line:
          type: string
          description: Content of the line or output block.
      required:
        - timestamp
        - line
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````