Opal Workflows API

## Workflows Overview In Opal, a workflow is an arrangement of tasks and approvals required to progress through the lifecycle of a StoryFirst resource. **Historical Note:** *The v2 Workflows API will supersede the v2 [Phase Items](#tag/Phase-Items) API, although initial rollout will only include support for Workflow on Moments which means there will be a period of time during which the Phase Items API remains the API for Content Workflows.* ### Workflow / Phase Items Translations The following resources described below for the v2 Workflows API have fairly direct translations to the older Phase Items API. - A _workflow_ was known as a _phase group_. - A _stage_ was known as a _phase_. - An _assignment_ was known as a _phase item_. ### Context Workflows from the v2 Workflow API have an optional `context` relationship. These contexts tie workflows to the resources against which the workflow is being performed. Currently only the **Moment** context is supported. A workflow without a `context` is a reasonable thing to think about: Such a workflow might have common stages that apply broadly in more than one context. Although a workflow can conceptually be created without a context, it must be given a context before it can be started. Currently, the capabilities supported by contextless workflows are not built out in the Opal Platform. API requests should be made to create contexts for all workflows before building them out or starting them. **Important:** Contexts tie workflows to resources from neighboring services; although Opal has one coherent v2 API, a client must request StoryFirst resources (like `moment`s) from other services rather than `including` them on Workflow requests. For example, a Workflow might have a `context` with a `moment_id` of `'3432'`; the client would make a request to `moments/v2/3432` to retrieve details for that Moment. See the documentation on [`POST` **Create a Context**](#tag/Workflows/operation/CreateContextV2) for more information. ### Resources A `workflow` is arranged into `stage`s, each of which is a `circuit_breaker`, an `approval` stage, or a `task` stage. All stages can optionally specify a `due_date`, but if `null` then the due date is left up to interpretation of the user of the workflow -- For a Moment Workflow, perhaps the due date is the `scheduled_date` of the Moment, or perhaps the exact date is not important. Assignments are completed by `POST`ing `response`s. Circuit breakers and tasks can be completed and approvals can be approved or declined. An approved response can be superseded by a following declined response on the same assignment. Similarly, tasks can be "undone" after being marked complete by sending a follow-up response. Responses are a ledger with the most recent response representing the current state of the assignment. #### Circuit Breaker Circuit breakers generally just contain one assignment. When the assignment is completed, the circuit breaker is completed and the following stage becomes active. Circuit breakers allow workflows to pause between any two stages and they are used to create the initial pause before a workflow is started (giving users time to build a workflow out before beginning work against it). #### Approval Approval stages can contain any number of approval `assignment`s. They can be configured such that all of those approvals must be given for the workflow to progress (`metadata.completion_rules.all`) or they can be configured such that the workflow progresses after any one of the approvals is given (`metadata.completion_rules.one`). ##### Approval Response Each approval `response` can be either `approved` or `declined` and it can optionally contain a message from the approver. As noted above, any number of responses can be given on a single assignment; the most recent response represents the state of the approval: approved, declined, or in the absence of a response, simply incomplete. #### Task Task stages can contain any number of task `assignment`s. A task stage is complete after all assignments within it have been completed. ##### Task Response Each task `response` can be either _complete_ (`complete: true`) or _incomplete_ (`complete: false`). As noted above, any number of responses can be given on a single task; the most recent response represents the state of the task: complete or incomplete. ### Templates Creation of a new workflow often involves creating a handful of the same resources every time. For this reason, there are templates the allow you to create one of two types of workflows more easily. You always get a `circuit_breaker` with one assignment at the start and then you get either an `approval` or a `task` `stage` next, again with one assignment. All assignments start out unassigned. See the documentation on [`POST` **Create a Workflow**](#tag/Workflows/operation/CreateWorkflowsV2) for more information. ### Rewinding Workflows can be "rewound" to undo some portion of them. **The big caveat being:** You are not allowed to rewind back to the start of (or before) a completed final approvel stage. Final approval stages (i.e. the last approval stage in a workflow) are special because they can have side effects that cannot be taken back -- if workflow completion resulted in publishing to a third party platform, for example, then rewinding back to an unapproved state for the workflow would leave the workflow unrepresentative of the fact that something had already been published. See the documentation on [`PATCH` **Rewind a Workflow**](#tag/Workflows/operation/RewindWorkflowV2) for more information.

Operations 21

POST /workflows/v2/contexts Create a Context #
GET /workflows/v2/workflows Get a collection of workflows #
POST /workflows/v2/workflows Create a workflow #
GET /workflows/v2/workflows/{workflow_id} Get a Workflow #
PATCH /workflows/v2/workflows/{workflow_id}/rewind Rewind a Workflow #
POST /workflows/v2/workflows/{workflow_id}/duplicate Duplicate a Workflow #
POST /workflows/v2/stages Create a stage #
GET /workflows/v2/stages/{stage_id} Get a stage by ID #
PATCH /workflows/v2/stages/{stage_id} Update a Stage by id #
DELETE /workflows/v2/stages/{stage_id} Delete a stage #
GET /workflows/v2/assignments/{assignment_id} Get an Assignment #
PATCH /workflows/v2/assignments/{assignment_id} Update an assignment by id #
DELETE /workflows/v2/assignments/{assignment_id} Delete an Assignment #
GET /workflows/v2/assignments Get a collection of assignments #
POST /workflows/v2/assignments Create an assignment #
POST /workflows/v2/responses Create a Response for an Assignment #
GET /workflows/v2/responses/{response_id} Fetch a Response for an Assignment #
GET /v3/workflows Get a collection of workflows #
POST /v3/workflows Create a workflow #
GET /v3/workflows/{workflow_id} Get a Workflow by ID #
POST /v3/workflows/{workflow_id}/duplicate Duplicate a Workflow #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/opal-workflows-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

opal-workflows-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Opal Workflows API
  license:
    name: Opal API License
    url: https://www.workwithopal.com/api-license
  version: '1.0'
  description: 'Operations tagged Workflows across 2 of this provider''s published API definitions: opal-v2-openapi.yml, opal-v3-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://login.ouropal.com
tags:
- name: Workflows
  description: "## Workflows Overview\nIn Opal, a workflow is an arrangement of tasks and approvals required to progress through the lifecycle of a \nStoryFirst resource. \n\n**Historical Note:**\n*The v2 Workflows API will supersede the v2 [Phase Items](#tag/Phase-Items) API, although initial rollout will only include support for\nWorkflow on Moments which means there will be a period of time during which the Phase Items API remains the API\nfor Content Workflows.*\n\n### Workflow / Phase Items Translations\nThe following resources described below for the v2 Workflows API have fairly direct translations to the older Phase Items API.\n\n- A _workflow_ was known as a _phase group_.\n- A _stage_ was known as a _phase_.\n- An _assignment_ was known as a _phase item_.\n\n### Context\nWorkflows from the v2 Workflow API have an optional `context` relationship. These contexts tie workflows to the resources against\nwhich the workflow is being performed. Currently only the **Moment** context is supported.\n\nA workflow without a `context` is a reasonable thing to think about: Such a workflow might have common stages that apply broadly\nin more than one context. Although a workflow can conceptually be created without a context, it must be given a context before it can\nbe started.\n\nCurrently, the capabilities supported by contextless workflows are not built out in the Opal Platform. API requests should be made to\ncreate contexts for all workflows before building them out or starting them.\n\n**Important:** Contexts tie workflows to resources from neighboring services; although Opal has one coherent v2 API, a client must\nrequest StoryFirst resources (like `moment`s) from other services rather than `including` them on Workflow requests. For example,\na Workflow might have a `context` with a `moment_id` of `'3432'`; the client would make a request to `moments/v2/3432` to retrieve\ndetails for that Moment.\n\nSee the documentation on [`POST` **Create a Context**](#tag/Workflows/operation/CreateContextV2) for more information.\n\n### Resources\nA `workflow` is arranged into `stage`s, each of which is a `circuit_breaker`, an `approval` stage, or a `task` stage.\nAll stages can optionally specify a `due_date`, but if `null` then the due date is left up to interpretation of the user\nof the workflow -- For a Moment Workflow, perhaps the due date is the `scheduled_date` of the Moment, or perhaps\nthe exact date is not important.\n\nAssignments are completed by `POST`ing `response`s. Circuit breakers and tasks can be completed and approvals can be\napproved or declined. An approved response can be superseded by a following declined response on the same assignment.\nSimilarly, tasks can be \"undone\" after being marked complete by sending a follow-up response. Responses are a ledger with\nthe most recent response representing the current state of the assignment.\n\n#### Circuit Breaker\nCircuit breakers generally just contain one assignment. When the assignment is completed, the circuit breaker is completed\nand the following stage becomes active. Circuit breakers allow workflows to pause between any two stages and they are used\nto create the initial pause before a workflow is started (giving users time to build a workflow out before beginning work\nagainst it).\n\n#### Approval\nApproval stages can contain any number of approval `assignment`s. They can be configured such that all of those approvals\nmust be given for the workflow to progress (`metadata.completion_rules.all`) or they can be configured such that the workflow\nprogresses after any one of the approvals is given (`metadata.completion_rules.one`).\n\n##### Approval Response\nEach approval `response` can be either `approved` or `declined` and it can optionally contain a message from the approver.\n\nAs noted above, any number of responses can be given on a single assignment; the most recent response represents the state\nof the approval: approved, declined, or in the absence of a response, simply incomplete.\n\n#### Task\nTask stages can contain any number of task `assignment`s. A task stage is complete after all assignments within it have been\ncompleted.\n\n##### Task Response\nEach task `response` can be either _complete_ (`complete: true`) or _incomplete_ (`complete: false`).\n\nAs noted above, any number of responses can be given on a single task; the most recent response represents the state of the\ntask: complete or incomplete.\n\n### Templates\nCreation of a new workflow often involves creating a handful of the same resources every time. For this reason, there are templates\nthe allow you to create one of two types of workflows more easily. You always get a `circuit_breaker` with one assignment at the start\nand then you get either an `approval` or a `task` `stage` next, again with one assignment. All assignments start out unassigned.\n\nSee the documentation on [`POST` **Create a Workflow**](#tag/Workflows/operation/CreateWorkflowsV2) for more information.\n\n### Rewinding\nWorkflows can be \"rewound\" to undo some portion of them. \n\n**The big caveat being:** You are not allowed to rewind back to the start of (or before) a completed final approvel stage. Final approval\nstages (i.e. the last approval stage in a workflow) are special because they can have side effects that cannot be taken back --\nif workflow completion resulted in publishing to a third party platform, for example, then rewinding back to an unapproved state for the\nworkflow would leave the workflow unrepresentative of the fact that something had already been published.\n\nSee the documentation on [`PATCH` **Rewind a Workflow**](#tag/Workflows/operation/RewindWorkflowV2) for more information.\n"
paths:
  /workflows/v2/contexts:
    post:
      tags:
      - Workflows
      operationId: CreateContextV2
      summary: Create a Context
      description: 'You create a context to tie a Workflow to a particular resource the workflow

        should operate on. Currently, only `moment` resource is supported. Additionally, the

        `workflow` relationship is required.

        '
      security:
      - oauth2:
        - offline_access
      - api_key:
        - Session-Token
      parameters:
      - name: include
        in: query
        required: false
        description: A comma separated value of related objects to include.
        schema:
          type: array
          items:
            type: string
            enum:
            - workflow
            - workflow.stages
            - workflow.stages.assignments
        style: form
        explode: false
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - data
              properties:
                data:
                  type: object
                  required:
                  - type
                  - attributes
                  - relationships
                  properties:
                    type:
                      type: string
                      enum:
                      - context
                    attributes:
                      type: object
                      properties: {}
                    relationships:
                      type: object
                      required:
                      - workflow
                      - moment
                      properties:
                        workflow:
                          type: object
                          required:
                          - data
                          additionalProperties: false
                          properties:
                            data:
                              type: object
                              required:
                              - id
                              - type
                              additionalProperties: false
                              properties:
                                id:
                                  type: string
                                type:
                                  type: string
                                  enum:
                                  - workflow
                        moment:
                          type: object
                          required:
                          - data
                          additionalProperties: false
                          properties:
                            data:
                              type: object
                              required:
                              - id
                              - type
                              additionalProperties: false
                              properties:
                                id:
                                  type: string
                                type:
                                  type: string
                                  enum:
                                  - moment
            example:
              data:
                id: 4ac02fc7-705c-467e-933e-8bf16fc3ebf1
                type: context
                attributes: {}
                relationships:
                  workflow:
                    data:
                      id: d7a0168b-edc6-4737-85b6-8b551d1faf99
                      type: workflow
                  moment:
                    data:
                      id: '1'
                      type: moment
      responses:
        '201':
          description: Context created
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    title: context
                    type: object
                    additionalProperties: false
                    required:
                    - id
                    - type
                    - attributes
                    - relationships
                    properties:
                      id:
                        type: string
                        format: uuid
                      type:
                        type: string
                        enum:
                        - context
                      attributes:
                        type: object
                        additionalProperties: false
                        required:
                        - created_at
                        - deleted_at
                        - updated_at
                        properties:
                          created_at:
                            type: string
                            format: date-time
                            description: An ISO8601 date-time.
                            readOnly: true
                          deleted_at:
                            type:
                            - string
                            - 'null'
                            format: date-time
                            description: An ISO8601 date-time.
                            readOnly: true
                          updated_at:
                            type: string
                            format: date-time
                            description: An ISO8601 date-time.
                            readOnly: true
                      relationships:
                        type: object
                        additionalProperties: false
                        required:
                        - created_by_user
                        properties:
                          created_by_user:
                            type: object
                            required:
                            - data
                            additionalProperties: false
                            properties:
                              data:
                                type: object
                                required:
                                - id
                                - type
                                additionalProperties: false
                                properties:
                                  id:
                                    type: string
                                  type:
                                    type: string
                                    enum:
                                    - user
                          workflow:
                            type: object
                            required:
                            - data
                            additionalProperties: false
                            properties:
                              data:
                                type: object
                                required:
                                - id
                                - type
                                additionalProperties: false
                                properties:
                                  id:
                                    type: string
                                  type:
                                    type: string
                                    enum:
                                    - workflow
                          moment:
                            type: object
                            required:
                            - data
                            additionalProperties: false
                            properties:
                              data:
                                type: object
                                required:
                                - id
                                - type
                                additionalProperties: false
                                properties:
                                  id:
                                    type: string
                                  type:
                                    type: string
                                    enum:
                                    - moment
                  included:
                    type: array
                    items:
                      oneOf:
                      - title: workflow
                        type: object
                        required:
                        - id
                        - attributes
                        - relationships
                        additionalProperties: false
                        properties:
                          id:
                            type: string
                            format: uuid
                          type:
                            type: string
                            enum:
                            - workflow
                          meta:
                            type: object
                            description: "Optionally calculated workflow status metadata. **Not part of responses by default.**\n\nThis is currently only available when requesting workflow resources from the\n`/workflows/v2/workflows` and `/workflows/v2/workflows/{id}` `GET` endpoints.\nYou request that this metadata be included in responses with the `expose` query \nparameter like: `/workflows/v2/workflows?expose[workflow][meta]`.\n\nThe \"latest active stage\" is either the stage that is currently active or it is the\nlast stage of a completed workflow.\n"
                            required:
                            - latest_active_stage
                            - completed_stages
                            - stage_type_count
                            additionalProperties: false
                            properties:
                              latest_active_stage:
                                oneOf:
                                - title: Stage Status Metadata
                                  allOf:
                                  - required:
                                    - stage_type
                                    - resource_identifier
                                    properties:
                                      stage_type:
                                        type: string
                                        enum:
                                        - approval
                                        - task
                                        - circuit_breaker
                                      title:
                                        type:
                                        - string
                                        - 'null'
                                        description: The title of the stage.
                                      due_date:
                                        type:
                                        - string
                                        - 'null'
                                        format: date-time
                                        description: The due date of the stage if set.
                                      resource_identifier:
                                        type: object
                                        required:
                                        - data
                                        additionalProperties: false
                                        properties:
                                          data:
                                            type: object
                                            required:
                                            - id
                                            - type
                                            additionalProperties: false
                                            properties:
                                              id:
                                                type: string
                                              type:
                                                type: string
                                                enum:
                                                - stage
                                  - type: object
                                    description: The status metadata of a stage.
                                    required:
                                    - assignment_counts
                                    properties:
                                      assignment_counts:
                                        type: object
                                        description: "Assignment counts broken down in three ways.\n\nFirst, the number of complete/incomplete assignments for\nall users (both approvals and tasks).\n\nSecond, the number of complete/incomplete assignments for\nthe current user (both approvals and tasks).\n\nThird, the number of declined approvals.\n\nIn the first two cases, both approvals and tasks can be \ncomplete or incomplete where both approved and declined responses\non an approval assignment count as completion.\n"
                                        required:
                                        - all
                                        - current_user
                                        - declined
                                        additionalProperties: false
                                        properties:
                                          all:
                                            type: object
                                            required:
                                            - incomplete
                                            - complete
                                            additionalProperties: false
                                            properties:
                                              incomplete:
                                                type: integer
                                                minimum: 0
                                              complete:
                                                type: integer
                                                minimum: 0
                                          current_user:
                                            type: object
                                            required:
                                            - incomplete
                                            - complete
                                            additionalProperties: false
                                            properties:
                                              incomplete:
                                                type: integer
                                                minimum: 0
                                              complete:
                                                type: integer
                                                minimum: 0
                                          declined:
                                            type: integer
                                            minimum: 0
                                - title: 'null'
                                  type:
                                  - object
                                  - 'null'
                                  enum:
                                  - null
                              completed_stages:
                                type: integer
                                minimum: 0
                              stage_type_count:
                                type: object
                                required:
                                - approval
                                - task
                                - circuit_breaker
                                additionalProperties: false
                                properties:
                                  approval:
                                    type: integer
                                    minimum: 0
                                  task:
                                    type: integer
                                    minimum: 0
                                  circuit_breaker:
                                    type: integer
                                    minimum: 0
                          attributes:
                            type: object
                            required:
                            - created_at
                            - status
                            - is_approved
                            - updated_at
                            - deleted_at
                            additionalProperties: false
                            properties:
                              created_at:
                                type: string
                                format: date-time
                                description: An ISO8601 date-time indicating when the workflow was created.
                                readOnly: true
                              status:
                                type: string
                                description: A string indicating the current status of the workflow.
                                enum:
                                - active
                                - complete
                                - inactive
                                - paused
                                readOnly: true
                              is_approved:
                                type: boolean
                                description: Indicative of whether the latest approval stage has been completed. Workflows with only task stages will never result in `is_approved=true`.
                                readOnly: true
                              updated_at:
                                type: string
                                format: date-time
                                description: An ISO8601 date-time indicating when the workflow was last updated.
                                readOnly: true
                              deleted_at:
                                type:
                                - string
                                - 'null'
                                format: date-time
                                description: An ISO8601 date-time indicating when the workflow was deleted (if it was deleted).
                                readOnly: true
                          relationships:
                            type: object
                            additionalProperties: false
                            required:
                            - created_by_user
                            - stages
                            properties:
                              created_by_user:
                                type: object
                                required:
                                - data
                                additionalProperties: false
                                properties:
                                  data:
                                    type: object
                                    required:
                                    - id
                                    - type
                                    additionalProperties: false
                                    properties:
                                      id:
                                        type: string
                                      type:
                                        type: string
                                        enum:
                                        - user
                              context:
                                type: object
                                required:
                                - data
                                additionalProperties: false
                                properties:
                                  data:
                                    type: object
                                    required:
                                    - id
                                    - type
                                    additionalProperties: false
                                    properties:
                                      id:
                                        type: string
                                      type:
                                        type: string
                                        enum:
                                        - context
                              stages:
                                type: object
                                required:
                                - data
                                additionalProperties: false
                                properties:
                                  data:
                                    type: array
                                    items:
                                      type: object
                                      required:
                                      - id
                                      - type
                                      additionalProperties: false
                                      properties:
                                        id:
                                          type: string
                                        type:
                                          type: string
                                          enum:
                                          - stage
              example:
                data:
                  id: 4ac02fc7-705c-467e-933e-8bf16fc3ebf1
                  type: context
                  attributes:
                    created_at: '2021-01-04T22:23:51Z'
                    deleted_at: null
                    updated_at: '2021-01-04T22:23:51Z'
                  relationships:
                    moment:
                      data:
                        id: '1'
                        type: moment
                    created_by_user:
                      data:
                        id: '1'
                        type: user
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                required:
                - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: string
                        title:
                          type: string
                        detail:
                          type: string
                      required:
                      - status
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: string
                        title:
                          type: string
                        detail:
                          type: string
                      required:
                      - status
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                required:
                - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: string
                        title:
                          type: string
                        detail:
                          type: string
                      required:
                      - status
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                type: object
                required:
                - errors
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        status:
                          type: string
                        title:
                          type: string
                        detail:
                          type: string
                      required:
                      - status
    servers:
    - url: https://login.ouropal.com
  /workflows/v2/workflows:
    get:
      tags:
      - Workflows
      operationId: ReadWorkflowsV2
      summary: Get a collection of workflows
      description: "This endpoint gets a response of created workflows. To be included, \na workflow will need to be put in the context of a StoryFirst resource \n(like a moment) using the `/workflows/v2/contexts` endpoint.\n\nIf you do not specify a pagination limit, a default page limit of 150 workflows will be\nused.\n"
      security:
      - oauth2:
        - offline_access
      - api_key:
        - Session-Token
      parameters:
      - name: include
        in: query
        required: false
        description: A comma separated value of related objects to include.
        schema:
          type: array
          items:
            type: string
            enum:
            - context
            - stages
            - stages.assignments
            - stages.assignments.responses
        style: form
        explode: false
      - name: filter
        in: query
        required: false
        description: Filter the resulting workflows.
        schema:
          type: object
          properties:
            context.moment_id:
              type: array
              items:
                type: integer
              description: 'Filter workflows by their context''s `moment_id`. Uses syntax `filter[context.moment_id]=1,2,3`.

                '
            context.created_at:
              allOf:
              - type: object
                properties:
                  eq:
                    type: string
                    description: 'Equal to filter. If no other filter is specified, `eq` will be assumed.

                      '
                  gt:
                    type: string
                    de

# --- truncated at 32 KB (921 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/opal/refs/heads/main/openapi/opal-workflows-api-openapi.yml