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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of the workflow |
file | object | Yes | File identifier. Must contain groupId field with the file's Group ID |
workflowType | string | No | Workflow type. Defaults to REVIEW_APPROVE. Use TODO for single-step TODO workflows or APPROVAL for single-step approval workflows |
reasonForChange | string | No | Reason for changing the document. Only valid for domains with GxP Workflows enabled |
steps | array | Yes | Array of step definitions. See Step Definition below |
Step Definition
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of the step |
description | string | No | The description of the step |
type | string | Yes | Step type: TODO, REVIEW, or APPROVAL |
stepOptions | object | Yes | Step configuration. See Step Options below |
Step Options
| Field | Type | Required | Description |
|---|---|---|---|
assignees | array | Yes | Array of user IDs (integers) assigned to this step |
minMustComplete | integer | No | Minimum number of assignees who must complete the step. If omitted or null, all assignees must complete their tasks |
dueDate | string | No | Due date in ISO-8601 format (e.g., 2022-02-27T14:00:00Z) |
signatureRequired | boolean | Yes (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
| Field | Type | Description |
|---|---|---|
workflowId | string | The 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
| Parameter | Type | Required | Description |
|---|---|---|---|
WORKFLOW_ID | string | Yes | The 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
| Field | Type | Description |
|---|---|---|
id | string | Workflow ID |
name | string | Workflow name |
reasonForChange | string | Reason for change (GxP workflows only) |
status | string | Workflow status: NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, or COMPLETED |
workflowCompletionStatus | string | Completion status for approval workflows: APPROVED or REJECTED |
creationDate | string | ISO-8601 timestamp of workflow creation |
completionDate | string | ISO-8601 timestamp of workflow completion (null if incomplete) |
creator | object | User object containing id, username, firstName, lastName, and email |
steps | array | Array of step objects with tasks and comments |
file | object | File 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
assignerId | integer | No | — | Filter by user ID of workflow creator |
assigneeId | integer | No | — | Filter by user ID of assignee |
groupId | string | No | — | Filter by file Group ID |
status | string | No | — | Filter by workflow status: NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, or COMPLETED |
completionStatus | string | No | — | Filter completed approval workflows by status: APPROVED or REJECTED |
limit | integer | No | 25 | Maximum number of workflows to return (1-25) |
offset | integer | No | 0 | Zero-based index for pagination |
sortBy | string | No | DUE_DATE | Sort field: NAME, CREATION_DATE, DUE_DATE, COMPLETION_DATE, WORKFLOW_STATUS, or WORKFLOW_COMPLETION_STATUS |
sortDirection | string | No | ASC | Sort 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
| Field | Type | Description |
|---|---|---|
results | array | Array of workflow summary objects |
totalCount | integer | Total 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
status | string | No | — | Filter by task status: NOT_STARTED, IN_PROGRESS, BEING_CANCELLED, CANCELLED, SUSPENDED, APPROVED, REJECTED, or COMPLETED |
limit | integer | No | 50 | Maximum number of tasks to return (1-50) |
offset | integer | No | 0 | Zero-based index for pagination |
sortBy | string | No | DUE_DATE | Sort field: NAME, DUE_DATE, STATUS, or TASK_TYPE |
sortDirection | string | No | ASC | Sort 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
| Field | Type | Description |
|---|---|---|
results | array | Array of task objects |
totalCount | integer | Total 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
| Parameter | Type | Required | Description |
|---|---|---|---|
WORKFLOW_ID | string | Yes | The 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
| Parameter | Type | Required | Description |
|---|---|---|---|
WORKFLOW_ID | string | Yes | The unique identifier of the workflow |
TASK_ID | string | Yes | The 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
| Status | Error | Description | Resolution |
|---|---|---|---|
| 400 | Bad Request | Invalid request body or parameters | Verify all required fields are present and correctly formatted |
| 401 | Unauthorized | Invalid or expired token | Refresh your OAuth token |
| 403 | Forbidden | Insufficient permissions to create or modify workflow | Ensure the user has appropriate permissions for the file and workflow operations |
| 404 | Not Found | Workflow, task, or file does not exist | Verify the workflow ID, task ID, or file Group ID |
| 429 | Rate Limited | Too many requests | Implement exponential backoff; check Retry-After header |
Related Resources
- File System API — Retrieve file Group IDs for workflow creation
- User Management API — Retrieve user IDs for task assignment
- Authentication — How to obtain and refresh OAuth tokens
