Request

Response

    Create a Draft Approval Workflow

    This tutorial demonstrates how to create a draft approval workflow in a project and publish it as an active approval workflow. The steps include creating the draft, updating it until it is ready to publish, confirming its status, and publishing it.

    A draft approval workflow stores a workflow configuration that you can complete over multiple requests. A draft cannot be used to create a review until it is published.

    For more details about draft approval workflows, see the Help documentation.

    Before You Begin

    • Register an app, and select Forma APIs in the API Access dropdown.
    • Acquire a 3-legged or 2-legged OAuth token with data:read and data:write scopes for operating draft approval workflows.

      • For a 3-legged token, ensure that the user is a project administrator.
      • For a 2-legged token, the x-user-id header is required. Retrieve the user’s Autodesk ID by calling GET projects/:projectId/users with your 2-legged OAuth token and the user’s email address. Ensure that the user is a project administrator. In this example, assume the x-user-id is U5XCJQ22TL8G.
    • Find the project ID for the project you want to create a draft approval workflow in by following the Retrieve a Forma Hub ID and Project ID tutorial. In this example, assume the project ID is 9ba6681e-1952-4d54-aac4-9de6d9858dd4.
    • Retrieve the Autodesk IDs of the users who will be candidates in each step. In this example, assume the candidate user ID is A96JX8NUKRLVFWSR.

    Step 1: Create a Draft Approval Workflow

    Use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) to call POST workflow-drafts, and create a new draft approval workflow in the project. Only name is required. The name must be unique within the project.

    Request

    curl 'https://developer.api.autodesk.com/construction/reviews/v1/projects/9ba6681e-1952-4d54-aac4-9de6d9858dd4/workflow-drafts' \
      -X POST \
      -H 'x-user-id: U5XCJQ22TL8G' \
      -H 'Authorization: Bearer <ACCESS_TOKEN>' \
      -H 'Content-Type: application/json' \
      -d '{
        "name": "Structural Draft Approval Workflow"
      }'
    
    Show More

    Response

    The response includes the draft id, which you use in the following steps. A draft that only has a name has a status of PENDING because it does not yet satisfy the publication requirements. The built-in Approved and Rejected approval statuses are added automatically.

    {
      "id": "8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      "name": "Structural Draft Approval Workflow",
      "description": null,
      "notes": null,
      "status": "PENDING",
      "approvalStatusOptions": [
        {
          "label": "Approved",
          "value": "APPROVED",
          "id": "f44e623d-f04f-47fe-8195-efc43d1d985b",
          "builtIn": true
        },
        {
          "label": "Rejected",
          "value": "REJECTED",
          "id": "b2a3c3b7-4fef-40a4-868b-981b23e7182f",
          "builtIn": true
        }
      ],
      "steps": [],
      "attachedAttributes": [],
      "updateAttributesOptions": {
        "updateSourceAndCopiedFiles": false,
        "enableAttachedAttributes": false,
        "allowApproverToUpdateRejectedFiles": false
      },
      "additionalOptions": {
        "approverEditPermissions": [],
        "initiatorEditPermissions": []
      },
      "createdAt": "2026-11-11T07:15:20.304Z",
      "updatedAt": "2026-11-11T07:15:20.304Z",
      "createdBy": {
        "autodeskId": "A96JX8NUKRLVFWSR",
        "name": "Tim Tucker"
      },
      "copyFilesOptions": {
        "enabled": false,
        "allowOverride": false,
        "condition": "ANY",
        "folderUrn": null,
        "includeMarkups": false,
        "disableOverrideMarkupSetting": false
      }
    }
    
    Show More

    Find the draft id and note the ID (8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c). You use it in Steps 2, 3, and 4.

    Step 2: Update a Draft Approval Workflow

    Use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) and the draft ID returned in Step 1 to call PATCH workflow-drafts/:draftWorkflowId, and complete the draft configuration. You can call this operation as many times as needed, until status is READY_TO_FINALIZE.

    The update is partial: top-level fields that you do not send are unchanged, and a top-level array that you send, such as steps, replaces the entire stored array. Do not include step IDs in the request. The server generates them from the order of the submitted array.

    To be ready to publish, a draft needs, at a minimum:

    • Between 2 and 7 steps, starting with an INITIATOR step and ending with an APPROVER step.
    • At least one candidate (user, role, or company) in every step.
    • A configured copyFilesOptions object.

    For the complete list of publication requirements, see POST workflow-drafts:batch-publish.

    Request

    curl 'https://developer.api.autodesk.com/construction/reviews/v1/projects/9ba6681e-1952-4d54-aac4-9de6d9858dd4/workflow-drafts/8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c' \
      -X PATCH \
      -H 'x-user-id: U5XCJQ22TL8G' \
      -H 'Authorization: Bearer <ACCESS_TOKEN>' \
      -H 'Content-Type: application/json' \
      -d '{
        "steps": [
          {
            "name": "Initiator",
            "type": "INITIATOR",
            "candidates": {
              "users": [ { "autodeskId": "A96JX8NUKRLVFWSR" } ],
              "roles": [ ],
              "companies": [ ]
            }
          },
          {
            "name": "Approver",
            "type": "APPROVER",
            "duration": 3,
            "dueDateType": "CALENDAR_DAY",
            "candidates": {
              "users": [ { "autodeskId": "A96JX8NUKRLVFWSR" } ],
              "roles": [ ],
              "companies": [ ]
            }
          }
        ],
        "copyFilesOptions": {
          "enabled": false
        }
      }'
    
    Show More

    Response

    The response returns the updated draft. In this example, the draft now satisfies the publication requirements, so status is READY_TO_FINALIZE. If status is still PENDING, the draft does not satisfy one or more publication requirements. Update the draft again. Because copyFilesOptions.enabled is false, copyFilesOptions.condition can be null in the response.

    {
      "id": "8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      "name": "Structural Draft Approval Workflow",
      "description": null,
      "notes": null,
      "status": "READY_TO_FINALIZE",
      "approvalStatusOptions": [
        {
          "label": "Approved",
          "value": "APPROVED",
          "id": "f44e623d-f04f-47fe-8195-efc43d1d985b",
          "builtIn": true
        },
        {
          "label": "Rejected",
          "value": "REJECTED",
          "id": "b2a3c3b7-4fef-40a4-868b-981b23e7182f",
          "builtIn": true
        }
      ],
      "steps": [
        {
          "name": "Initiator",
          "type": "INITIATOR",
          "id": "Lane_0",
          "candidates": {
            "roles": [],
            "users": [
              {
                "name": "Tim Tucker",
                "autodeskId": "A96JX8NUKRLVFWSR"
              }
            ],
            "companies": []
          }
        },
        {
          "name": "Approver",
          "type": "APPROVER",
          "duration": 3,
          "dueDateType": "CALENDAR_DAY",
          "id": "Lane_1",
          "candidates": {
            "roles": [],
            "users": [
              {
                "name": "Tim Tucker",
                "autodeskId": "A96JX8NUKRLVFWSR"
              }
            ],
            "companies": []
          }
        }
      ],
      "attachedAttributes": [],
      "updateAttributesOptions": {
        "updateSourceAndCopiedFiles": false,
        "enableAttachedAttributes": false,
        "allowApproverToUpdateRejectedFiles": false
      },
      "additionalOptions": {
        "approverEditPermissions": [],
        "initiatorEditPermissions": []
      },
      "createdAt": "2026-11-11T07:15:20.304Z",
      "updatedAt": "2026-11-11T07:15:21.973Z",
      "createdBy": {
        "autodeskId": "A96JX8NUKRLVFWSR",
        "name": "Tim Tucker"
      },
      "copyFilesOptions": {
        "enabled": false,
        "allowOverride": false,
        "condition": null,
        "folderUrn": null,
        "includeMarkups": false,
        "disableOverrideMarkupSetting": false
      }
    }
    
    Show More

    Note that status is now READY_TO_FINALIZE, indicating the draft satisfies the publication requirements and is ready to publish. If status is still PENDING, the draft does not yet satisfy one or more publication requirements. Update the draft again and check status.

    Step 3: Retrieve a Draft Approval Workflow

    Use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) and the draft ID returned in Step 1 to call GET workflow-drafts/:draftWorkflowId, and confirm that the update was applied and check status. To check all drafts in the project at once, call GET workflow-drafts.

    Request

    curl 'https://developer.api.autodesk.com/construction/reviews/v1/projects/9ba6681e-1952-4d54-aac4-9de6d9858dd4/workflow-drafts/8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c' \
      -X GET \
      -H 'x-user-id: U5XCJQ22TL8G' \
      -H 'Authorization: Bearer <ACCESS_TOKEN>'
    

    Response

    Verify that steps match your update and that status is READY_TO_FINALIZE before you publish.

    {
      "id": "8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      "name": "Structural Draft Approval Workflow",
      "description": null,
      "notes": null,
      "status": "READY_TO_FINALIZE",
      "approvalStatusOptions": [
        {
          "label": "Approved",
          "value": "APPROVED",
          "id": "f44e623d-f04f-47fe-8195-efc43d1d985b",
          "builtIn": true
        },
        {
          "label": "Rejected",
          "value": "REJECTED",
          "id": "b2a3c3b7-4fef-40a4-868b-981b23e7182f",
          "builtIn": true
        }
      ],
      "steps": [
        {
          "name": "Initiator",
          "type": "INITIATOR",
          "id": "Lane_0",
          "candidates": {
            "roles": [],
            "users": [
              {
                "name": "Tim Tucker",
                "autodeskId": "A96JX8NUKRLVFWSR"
              }
            ],
            "companies": []
          }
        },
        {
          "name": "Approver",
          "type": "APPROVER",
          "duration": 3,
          "dueDateType": "CALENDAR_DAY",
          "id": "Lane_1",
          "candidates": {
            "roles": [],
            "users": [
              {
                "name": "Tim Tucker",
                "autodeskId": "A96JX8NUKRLVFWSR"
              }
            ],
            "companies": []
          }
        }
      ],
      "attachedAttributes": [],
      "updateAttributesOptions": {
        "updateSourceAndCopiedFiles": false,
        "enableAttachedAttributes": false,
        "allowApproverToUpdateRejectedFiles": false
      },
      "additionalOptions": {
        "approverEditPermissions": [],
        "initiatorEditPermissions": []
      },
      "createdAt": "2026-11-11T07:15:20.304Z",
      "updatedAt": "2026-11-11T07:15:21.973Z",
      "createdBy": {
        "autodeskId": "A96JX8NUKRLVFWSR",
        "name": "Tim Tucker"
      },
      "copyFilesOptions": {
        "enabled": false,
        "allowOverride": false,
        "condition": null,
        "folderUrn": null,
        "includeMarkups": false,
        "disableOverrideMarkupSetting": false
      }
    }
    
    Show More

    Confirm that status is READY_TO_FINALIZE before proceeding to Step 4. If status is still PENDING, return to Step 2 and update the draft further.

    Step 4: Publish a Draft Approval Workflow

    When status is READY_TO_FINALIZE, use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) and the draft ID returned in Step 1 to call POST workflow-drafts:batch-publish, and publish the draft as an active approval workflow.

    Request

    curl 'https://developer.api.autodesk.com/construction/reviews/v1/projects/9ba6681e-1952-4d54-aac4-9de6d9858dd4/workflow-drafts:batch-publish' \
      -X POST \
      -H 'x-user-id: U5XCJQ22TL8G' \
      -H 'Authorization: Bearer <ACCESS_TOKEN>' \
      -H 'Content-Type: application/json' \
      -d '{
        "draftWorkflowIds": [
          "8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c"
        ]
      }'
    
    Show More

    Response

    The response reports the outcome for each draft. For each draft that is published, the active workflow appears in results, and the source draft is deleted. For each draft that fails, an entry appears in errors and the draft remains stored. If all drafts fail, the response is still 200 OK with an empty results array.

    {
      "results": [
        {
          "draftWorkflowId": "8f3c2a1b-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
          "id": "4e609369-e950-4097-b7d3-e6cf1c3c5415",
          "name": "Structural Draft Approval Workflow",
          "status": "ACTIVE"
        }
      ],
      "errors": [ ]
    }
    
    Show More

    Use results[].id as the workflowId when you create a review. The draftWorkflowId no longer exists after a successful publish.

    Congratulations! You have successfully created and published a draft approval workflow.

    Next Steps