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

FieldTypeDescription
countintegerTotal number of workspaces
resultsarrayArray of workspace objects
results[].idstringUnique workspace identifier (UUID)
results[].namestringWorkspace name
results[].typestringWorkspace type (e.g., "Client", "Vendor")
results[].statusstringWorkspace status: ACTIVE or INACTIVE
results[].taskCountintegerNumber of tasks in the workspace
results[].creatorobjectUser who created the workspace
results[].creator.idintegerCreator's user ID
results[].creator.usernamestringCreator's username
results[].creator.emailstringCreator's email address
results[].creator.firstNamestringCreator's first name
results[].creator.lastNamestringCreator'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

FieldTypeRequiredDescription
namestringYesWorkspace name; also used as the folder name when creating a blank workspace or workspace from a template
statusstringYesWorkspace status: ACTIVE or INACTIVE
typestringYesWorkspace type; must match one of the workspace types from Get Document Portal Settings (e.g., "Client", "Vendor")
workspaceFolderIdstringConditionalFolder ID (UUID) to convert to a workspace; required when creating from an existing folder
workspaceParentFolderIdstringConditionalParent folder ID (UUID) under which to create the workspace; required when creating a blank workspace or workspace from a template
workspaceTemplateIdstringConditionalTemplate folder ID (UUID) to use for workspace creation; required when creating from a template
variablesarrayNoPermission template variables for dynamic permission assignment; used only when creating from a template
variables[].namestringNoVariable name as defined in the permission template
variables[].valuearrayNoArray 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 with variables)

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

FieldTypeDescription
idstringUnique 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

FieldTypeDescription
workspaceTypesarrayList of available workspace type strings configured for your domain

Example Response

{
  "workspaceTypes": [
    "Client",
    "Vendor",
    "Partner"
  ]
}

Error Codes

StatusErrorDescriptionResolution
400Bad RequestMissing 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
401UnauthorizedInvalid or expired OAuth tokenRefresh your OAuth token
403ForbiddenMissing Egnyte.documentportal scope or insufficient permissionsEnsure your OAuth token includes the Egnyte.documentportal scope and the user has permission to manage workspaces
404Not FoundSpecified folder ID, template ID, or workspace does not existVerify the folder/template/workspace ID is correct and accessible
429Rate LimitedToo many requestsImplement 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
      ]
    }
  ]
}'
  • Authentication — How to obtain an OAuth token with the Egnyte.documentportal scope
  • File System API — Manage folders and files referenced by workspace operations
  • User Management API — Retrieve user IDs for permission template variables