Document Portal
The Document Portal API allows you to list and create workspaces programmatically. Use this API to integrate Egnyte's document portal functionality into your application or workflow.
Note: All Document Portal API endpoints require the Egnyte.documentportal OAuth scope.
Base URL
https://{domain}.egnyte.com/pubapi/v1/document-portal
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 with the Egnyte.documentportal scope.
List Workspaces
Retrieve a list of all workspaces in your Egnyte domain.
Request
GET /pubapi/v1/document-portal/workspaces
Query Parameters
This endpoint does not accept query parameters.
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/document-portal/workspaces" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
count | integer | Total number of workspaces |
results | array | Array of workspace objects |
results[].id | string | Unique workspace identifier (UUID) |
results[].name | string | Workspace name |
results[].type | string | Workspace type (e.g., "Client", "Vendor") |
results[].status | string | Workspace status: ACTIVE or INACTIVE |
results[].taskCount | integer | Number of tasks in the workspace |
results[].creator | object | User who created the workspace |
results[].creator.id | integer | Creator's user ID |
results[].creator.username | string | Creator's username |
results[].creator.email | string | Creator's email address |
results[].creator.firstName | string | Creator's first name |
results[].creator.lastName | string | Creator's last name |
Example Response
{
"count": 1,
"results": [
{
"id": "ae898c78-c1e8-4d99-aea0-f7538d085ae4",
"name": "Acme Enterprises",
"type": "Client",
"status": "ACTIVE",
"taskCount": 0,
"creator": {
"id": 1,
"username": "jsmith",
"email": "jsmith@example.com",
"firstName": "Jane",
"lastName": "Smith"
}
}
]
}
Create Workspace
Create a new workspace from an existing folder, from a template, or as a blank workspace.
Request
POST /pubapi/v1/document-portal/workspaces
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Workspace name; also used as the folder name when creating a blank workspace or workspace from a template |
status | string | Yes | Workspace status: ACTIVE or INACTIVE |
type | string | Yes | Workspace type; must match one of the workspace types from Get Document Portal Settings (e.g., "Client", "Vendor") |
workspaceFolderId | string | Conditional | Folder ID (UUID) to convert to a workspace; required when creating from an existing folder |
workspaceParentFolderId | string | Conditional | Parent folder ID (UUID) under which to create the workspace; required when creating a blank workspace or workspace from a template |
workspaceTemplateId | string | Conditional | Template folder ID (UUID) to use for workspace creation; required when creating from a template |
variables | array | No | Permission template variables for dynamic permission assignment; used only when creating from a template |
variables[].name | string | No | Variable name as defined in the permission template |
variables[].value | array | No | Array of user IDs (integers) to assign to this variable |
Note: Exactly one of the following combinations is required:
- From existing folder:
workspaceFolderId - Blank workspace:
workspaceParentFolderId - From template:
workspaceParentFolderId+workspaceTemplateId(optionally withvariables)
Example Request: Create from Existing Folder
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/document-portal/workspaces" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "name": "Acme Enterprises", "status": "ACTIVE", "type": "Client", "workspaceFolderId": "21dd19b3-8c28-4229-88a7-eae44f8768f5" }'
Example Request: Create Blank Workspace
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/document-portal/workspaces" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "name": "Acme Enterprises", "status": "ACTIVE", "type": "Client", "workspaceParentFolderId": "{workspaceParentFolderId}" }'
Example Request: Create from Template with Variables
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/document-portal/workspaces" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "name": "Acme Enterprises", "status": "ACTIVE", "type": "Client", "workspaceParentFolderId": "{workspaceParentFolderId}", "workspaceTemplateId": "{workspaceTemplateId}", "variables": [ { "name": "Account Manager", "value": [ 123 ] }, { "name": "Clients", "value": [ 234, 235 ] } ] }'
Response
201 Created
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (UUID) of the newly created workspace |
Example Response
{
"id": "e250227d-044c-45b5-9dbb-c1120a856b84"
}
Get Document Portal Settings
Retrieve Document Portal configuration settings, including available workspace types.
Request
GET /pubapi/v1/document-portal/settings
Query Parameters
This endpoint does not accept query parameters.
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/document-portal/settings" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
workspaceTypes | array | List of available workspace type strings configured for your domain |
Example Response
{
"workspaceTypes": [
"Client",
"Vendor",
"Partner"
]
}
Error Codes
| Status | Error | Description | Resolution |
|---|---|---|---|
| 400 | Bad Request | Missing required fields or invalid field combination (e.g., both workspaceFolderId and workspaceParentFolderId provided) | Review the request body and ensure you're using the correct field combination for your workspace creation method |
| 401 | Unauthorized | Invalid or expired OAuth token | Refresh your OAuth token |
| 403 | Forbidden | Missing Egnyte.documentportal scope or insufficient permissions | Ensure your OAuth token includes the Egnyte.documentportal scope and the user has permission to manage workspaces |
| 404 | Not Found | Specified folder ID, template ID, or workspace does not exist | Verify the folder/template/workspace ID is correct and accessible |
| 429 | Rate Limited | Too many requests | Implement exponential backoff; check Retry-After header |
Code Examples
List Workspaces
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/document-portal/workspaces" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Create Workspace from Template
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/document-portal/workspaces" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "name": "Acme Enterprises", "status": "ACTIVE", "type": "Client", "workspaceParentFolderId": "4e6173b7-fe20-411d-ba2a-a005d58154c8", "workspaceTemplateId": "0ee1f7ff-39cc-44ea-a12d-3c8477736d93", "variables": [ { "name": "Account Manager", "value": [ 123 ] }, { "name": "Clients", "value": [ 234, 235 ] } ] }'
Related Resources
- Authentication — How to obtain an OAuth token with the
Egnyte.documentportalscope - File System API — Manage folders and files referenced by workspace operations
- User Management API — Retrieve user IDs for permission template variables
