OPAQUE Workflows API

The workflows API from OPAQUE — 9 operation(s) for workflows.

OpenAPI Specification

opaque-workflows-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Opaque UI Workflows API
  version: '2.5'
  description: This documentation details the REST API endpoints that the client exposes.
  contact:
    name: Opaque Systems
    email: hello@opaque.co
servers:
- url: http://localhost:5001/
  description: Local Server
security:
- sessionToken: []
  refreshTokenCookie: []
tags:
- name: workflows
paths:
  /{version}/workspace/{workspace-uuid}/workflow:
    parameters:
    - schema:
        type: string
      name: workspace-uuid
      in: path
      required: true
      description: Workspace UUID
    - $ref: '#/components/parameters/version'
    post:
      summary: Create workflow
      tags:
      - workflows
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                endpointPrefix:
                  type: string
                  description: Prefix for the workflow endpoint
                workflowGraph:
                  type: object
                  description: JSON object that stores the structure and configuration of the workflow
                  x-python-type: Dict[str, object]
                  additionalProperties: true
                uiDefinition:
                  type: object
                  description: JSON object that can be used to store UI-specific information about the workflow
                  x-python-type: Dict[str, object]
                  additionalProperties: true
              required:
              - name
              - workflowGraph
              - uiDefinition
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/Workflow.yaml
      operationId: create_workflow
      description: Create a new workflow
  /{version}/workflow/{workflow-uuid}:
    parameters:
    - schema:
        type: string
      name: workflow-uuid
      in: path
      required: true
      description: Workflow UUID
    - $ref: '#/components/parameters/version'
    get:
      summary: Get workflow
      tags:
      - workflows
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/Workflow.yaml
      operationId: get_workflow
      description: Get a workflow by UUID
    patch:
      summary: Update workflow
      operationId: update_workflow
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/Workflow.yaml
        '400':
          description: 'Bad Request

            - Invalid workflow status

            - Invalid body parameter'
          content:
            application/json:
              schema:
                $ref: ../models/Error.yaml
      tags:
      - workflows
      description: 'Update the workflow with one or more of the provided values.

        Can only be called by the workflow''s creator or an admin.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New name for the workflow
                description:
                  type: string
                  description: New description for the workflow
                endpointPrefix:
                  type: string
                  description: New prefix for the workflow endpoint
                workflowGraph:
                  type: object
                  description: New JSON object that stores the structure and configuration of the workflow. Required if status is "under review".
                  x-python-type: Dict[str, object]
                  additionalProperties: true
                uiDefinition:
                  type: object
                  description: New JSON object that can be used to store UI-specific information about the workflow
                  x-python-type: Dict[str, object]
                  additionalProperties: true
    delete:
      summary: Delete workflow
      operationId: delete_workflow
      responses:
        '204':
          description: No Content
        '400':
          description: 'Bad Request

            - Workflow cannot be deleted (not in DRAFT status)'
          content:
            application/json:
              schema:
                $ref: ../models/Error.yaml
      tags:
      - workflows
      description: Delete a workflow by UUID. Only works if the workflow is in the DRAFT state.
  /{version}/workflow/{workflow-uuid}/request-review:
    parameters:
    - schema:
        type: string
      name: workflow-uuid
      in: path
      required: true
      description: Workflow UUID
    - $ref: '#/components/parameters/version'
    post:
      summary: Request workflow review
      operationId: request_workflow_review
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/Workflow.yaml
        '400':
          description: 'Bad Request

            - Invalid workflow graph'
          content:
            application/json:
              schema:
                $ref: ../models/Error.yaml
      description: Request a review for a workflow. A workflow graph must also be provided to be compared against the existing workflow graph for security purposes.
      tags:
      - workflows
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workflowGraph:
                  type: object
                  description: JSON object that stores the structure and configuration of the workflow to be reviewed. Will be compared against the existing workflow graph and an error will be thrown if they do not match.
                  x-python-type: Dict[str, object]
                  additionalProperties: true
              required:
              - workflowGraph
      security:
      - sessionToken: []
        refreshTokenCookie: []
        userIdentitySecret: []
  /{version}/workflow/{workflow-uuid}/cancel-review:
    parameters:
    - schema:
        type: string
      name: workflow-uuid
      in: path
      required: true
      description: Workflow UUID
    - $ref: '#/components/parameters/version'
    post:
      summary: Canel workflow review
      operationId: cancel_workflow_review
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/Workflow.yaml
      description: Cancel workflow reivew and set back the status to draft.
      tags:
      - workflows
  /{version}/workflow/{workflow-uuid}/review:
    parameters:
    - schema:
        type: string
      name: workflow-uuid
      in: path
      required: true
      description: Workflow UUID
    - $ref: '#/components/parameters/version'
    post:
      summary: Review workflow
      operationId: review_workflow
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/WorkflowReview.yaml
        '400':
          description: 'Bad Request

            - Workflow status must be **under review**'
          content:
            application/json:
              schema:
                $ref: ../models/Error.yaml
      description: Review a workflow.
      tags:
      - workflows
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                decision:
                  type: string
                  enum:
                  - accepted
                  - rejected
                comment:
                  type: string
                workflowGraph:
                  type: object
                  description: New JSON object that stores the structure and configuration of the workflow. Required if status is "under review".
                  x-python-type: Dict[str, object]
                  additionalProperties: true
              required:
              - decision
              - workflowGraph
      security:
      - userIdentitySecret: []
        sessionToken: []
        refreshTokenCookie: []
  /{version}/workflow/{workflow-uuid}/reviews:
    parameters:
    - schema:
        type: string
      name: workflow-uuid
      in: path
      required: true
      description: Workflow UUID
    - $ref: '#/components/parameters/version'
    get:
      summary: Get workflow reviews
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: ../models/WorkflowReview.yaml
      operationId: get_workflow_reviews
      description: Returns all the reviews for a workflow, ordered by creation descending.
      tags:
      - workflows
  /{version}/workflow/{workflow-uuid}/launch-workflow:
    parameters:
    - schema:
        type: string
      name: workflow-uuid
      in: path
      required: true
      description: Workflow UUID
    - $ref: '#/components/parameters/version'
    post:
      summary: Launch workflow
      tags:
      - workflows
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/Workflow.yaml
      operationId: launch_workflow
      description: launch a workflow by UUID
  /{version}/workflow/{workflow-uuid}/stop-workflow:
    parameters:
    - schema:
        type: string
      name: workflow-uuid
      in: path
      required: true
      description: Workflow UUID
    - $ref: '#/components/parameters/version'
    post:
      summary: Stop or shutdown workflow
      tags:
      - workflows
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: ../models/Workflow.yaml
      operationId: shutdown_workflow
      description: stop or shutdown a workflow by UUID
  /{version}/workspace/{workspace-uuid}/workflows:
    parameters:
    - schema:
        type: string
      name: workspace-uuid
      in: path
      required: true
      description: Workspace UUID
    - $ref: '#/components/parameters/version'
    get:
      summary: Get workspace workflows
      tags:
      - workflows
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: ../models/SimpleWorkflow.yaml
      operationId: get_workspace_workflows
      description: Get all metadata about all workflows associated with a workspace
components:
  parameters:
    version:
      in: path
      name: version
      schema:
        type: string
        default: v1.2
        example: v1.2
      description: Version of the API to call
      required: true
  securitySchemes:
    sessionToken:
      type: http
      scheme: bearer
      description: The bearer token is obtained from the `/login` and `/register` endpoints.
    userIdentitySecret:
      name: userIdentitySecret
      type: apiKey
      in: cookie
      description: A binary blob derived from a user's passkey. It can be obtained from the `/login` and `/register` endpoints.
    sessionTokenCookie:
      name: sessionTokenCookie
      type: apiKey
      in: cookie
    refreshTokenCookie:
      name: refreshTokenCookie
      type: apiKey
      in: cookie
x-origin: origin
x-extension-with: x-extension-with