Workflow

The Workflow API lets you create, list, retrieve, and cancel workflows on files in your Egnyte domain. Workflows enable multi-step review and approval processes with task assignments, due dates, and optional digital signatures.

Note: Workflows are created on files using their Group ID. You can retrieve a file's Group ID using the File System API.

Base URL

https://{domain}.egnyte.com/pubapi/v1/workflows

Authentication

All requests require an OAuth 2.0 Bearer token in the Authorization header:

Authorization: Bearer {access_token}

See Authentication for details on obtaining a token.


Create Workflow

Create a new workflow on a file with one or more steps.

Request

POST /pubapi/v1/workflows

Request Body

FieldTypeRequiredDescription
namestringYesThe name of the workflow
fileobjectYesFile identifier. Must contain groupId field with the file's Group ID
workflowTypestringNoWorkflow type. Defaults to REVIEW_APPROVE. Use TODO for single-step TODO workflows or APPROVAL for single-step approval workflows
reasonForChangestringNoReason for changing the document. Only valid for domains with GxP Workflows enabled
stepsarrayYesArray of step definitions. See Step Definition below
Step Definition
FieldTypeRequiredDescription
namestringYesThe name of the step
descriptionstringNoThe description of the step
typestringYesStep type: TODO, REVIEW, or APPROVAL
stepOptionsobjectYesStep configuration. See Step Options below
Step Options
FieldTypeRequiredDescription
assigneesarrayYesArray of user IDs (integers) assigned to this step
minMustCompleteintegerNoMinimum number of assignees who must complete the step. If omitted or null, all assignees must complete their tasks
dueDatestringNoDue date in ISO-8601 format (e.g., 2022-02-27T14:00:00Z)
signatureRequiredbooleanYes (for APPROVAL steps)Whether digital signatures are required for approval. Can only be true for domains with GxP Workflows enabled

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/workflows" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "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
      }
    }
  ]
}'

Response

201 Created

FieldTypeDescription
workflowIdstringThe unique identifier for the created workflow

Example Response

{
  "workflowId": "403eeaaf-6997-47f8-bbb0-6092ce4c5196"
}

Get Workflow Details

Retrieve detailed information about a specific workflow, including all steps, tasks, and comments.

Request

GET /pubapi/v1/workflows/{WORKFLOW_ID}

Path Parameters

ParameterTypeRequiredDescription
WORKFLOW_IDstringYesThe unique identifier of the workflow

Example Request

curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/workflows/{workflowId}" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

200 OK

FieldTypeDescription
idstringWorkflow ID
namestringWorkflow name
reasonForChangestringReason for change (GxP workflows only)
statusstringWorkflow status: NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, or COMPLETED
workflowCompletionStatusstringCompletion status for approval workflows: APPROVED or REJECTED
creationDatestringISO-8601 timestamp of workflow creation
completionDatestringISO-8601 timestamp of workflow completion (null if incomplete)
creatorobjectUser object containing id, username, firstName, lastName, and email
stepsarrayArray of step objects with tasks and comments
fileobjectFile identifier containing groupId and entryId

Example Response

{
  "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",
          "dueDate": "2022-02-24T18:00:00Z",
          "creationDate": "2022-02-23T16:19:14.635Z",
          "completionDate": null,
          "assignee": {
            "id": 17,
            "username": "grandolph",
            "firstName": "Greg",
            "lastName": "Randolph",
            "email": "grandolph@example.com"
          }
        },
        {
          "id": "3c1e7375-7131-4f6b-b298-f4bfd59633a2",
          "type": "REVIEW",
          "status": "COMPLETED",
          "dueDate": "2022-02-24T18:00:00Z",
          "creationDate": "2022-02-23T16:19:14.635Z",
          "completionDate": "2022-02-24T16:03:27Z",
          "assignee": {
            "id": 22,
            "username": "pbloom",
            "firstName": "Petunia",
            "lastName": "Bloom",
            "email": "pbloom@example.com"
          }
        }
      ],
      "comments": [
        {
          "id": "51a317e6-bd48-488c-a190-75962fe83452",
          "message": "Looks good to me!",
          "tags": [],
          "timestamp": 1645650964117,
          "author": {
            "status": "ACTIVE",
            "username": "grandolph",
            "email": "grandolph@example.com",
            "firstName": "Greg",
            "lastName": "Grandolph",
            "typeName": "admin",
            "id": 17
          },
          "mentioned": {}
        }
      ]
    },
    {
      "id": "6157337b-93ec-4658-86de-608642fab34d",
      "name": "Document Approval",
      "description": "Please approve this file",
      "type": "APPROVAL",
      "status": "NOT_STARTED",
      "dueDate": "2022-03-02T18:00:00Z",
      "startDate": "1970-01-01T00:00:00Z",
      "completionDate": null,
      "signatureRequired": false,
      "minMustComplete": null,
      "tasks": [
        {
          "id": "e4b52ff2-bdb6-48c5-b4ac-dec423a2ccf5",
          "type": "APPROVAL",
          "status": "NOT_STARTED",
          "dueDate": "1970-01-01T00:00:00Z",
          "creationDate": "1970-01-01T00:00:00Z",
          "completionDate": null,
          "assignee": {
            "id": 6,
            "username": "erockland",
            "firstName": "Emily",
            "lastName": "Rockland",
            "email": "erockland@example.com"
          }
        }
      ],
      "comments": []
    }
  ],
  "file": {
    "groupId": "3d1d09d3-4533-4f90-b561-2d4ecdeba259",
    "entryId": "19efb714-db45-44c5-8e47-f185f0fdd5d9"
  }
}

List Workflows

List workflows in the domain. Admins can view all workflows; non-admins can only view workflows they created.

Request

GET /pubapi/v1/workflows

Query Parameters

ParameterTypeRequiredDefaultDescription
assignerIdintegerNo—Filter by user ID of workflow creator
assigneeIdintegerNo—Filter by user ID of assignee
groupIdstringNo—Filter by file Group ID
statusstringNo—Filter by workflow status: NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, or COMPLETED
completionStatusstringNo—Filter completed approval workflows by status: APPROVED or REJECTED
limitintegerNo25Maximum number of workflows to return (1-25)
offsetintegerNo0Zero-based index for pagination
sortBystringNoDUE_DATESort field: NAME, CREATION_DATE, DUE_DATE, COMPLETION_DATE, WORKFLOW_STATUS, or WORKFLOW_COMPLETION_STATUS
sortDirectionstringNoASCSort direction: ASC or DESC

Example Request

curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/workflows?status=IN_PROGRESS&sortBy=CREATION_DATE&sortDirection=DESC" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

200 OK

FieldTypeDescription
resultsarrayArray of workflow summary objects
totalCountintegerTotal number of workflows matching the query

Example Response

{
  "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
}

List Tasks

List tasks assigned to the current user.

Request

GET /pubapi/v1/workflows/tasks

Query Parameters

ParameterTypeRequiredDefaultDescription
statusstringNo—Filter by task status: NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, APPROVED, REJECTED, or COMPLETED
limitintegerNo50Maximum number of tasks to return (1-50)
offsetintegerNo0Zero-based index for pagination
sortBystringNoDUE_DATESort field: NAME, DUE_DATE, STATUS, or TASK_TYPE
sortDirectionstringNoASCSort direction: ASC or DESC

Example Request

curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/workflows/tasks?status=IN_PROGRESS" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

200 OK

FieldTypeDescription
resultsarrayArray of task objects
totalCountintegerTotal number of tasks matching the query

Example Response

{
  "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
}

Cancel Workflow

Cancel an in-progress workflow.

Request

POST /pubapi/v1/workflows/{WORKFLOW_ID}/cancel

Path Parameters

ParameterTypeRequiredDescription
WORKFLOW_IDstringYesThe unique identifier of the workflow to cancel

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/workflows/{workflowId}/cancel" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

204 No Content

Returns an empty response body on success.


Webhook Completion Signal

Complete an outbound webhook task that has the completion signal option enabled.

Note: When you receive a webhook payload, it includes a callback field containing the fully-formed URL for this endpoint. You do not need to construct the URL manually.

Request

POST /pubapi/v1/workflows/{WORKFLOW_ID}/tasks/{TASK_ID}/completion-signal

Path Parameters

ParameterTypeRequiredDescription
WORKFLOW_IDstringYesThe unique identifier of the workflow
TASK_IDstringYesThe unique identifier of the webhook task to mark as completed

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/workflows/{workflowId}/tasks/{taskId}/completion-signal" \
     -H "Content-Length: 0" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response

204 No Content

Returns an empty response body on success.


Error Codes

StatusErrorDescriptionResolution
400Bad RequestInvalid request body or parametersVerify all required fields are present and correctly formatted
401UnauthorizedInvalid or expired tokenRefresh your OAuth token
403ForbiddenInsufficient permissions to create or modify workflowEnsure the user has appropriate permissions for the file and workflow operations
404Not FoundWorkflow, task, or file does not existVerify the workflow ID, task ID, or file Group ID
429Rate LimitedToo many requestsImplement exponential backoff; check Retry-After header