Egnyte Protect Public API (1.0.0)

Download OpenAPI specification:Download

Egnyte Protect Public API exposes issues for the purpose of listing, polling for new issues and watching for changes in issue pool.

Definitions:

Environment
One of the two egnyteprotect.com subdomains to use with the API: usc1-api.egnyteprotect.com or euw1-api.egnyteprotect.com
Tenant
A company/organization account in Egnyte Protect.
Issue
A violation of data protection policies listed in Protect

Authentication

CodeGrantAuth

Code Grant from OAuth2 is used for obtaining tokens to the API for applications using the Public API to provide functionality for Protect users.

Request client_id and client_secret from partners@egnyte.com

Example calls

# get code - open in the browser
https://usc1-api.egnyteprotect.com/oauth2/code?client_id=CLIENT_ID&redirect_uri=https://your-app.com/oauthredirect&response_type=code&scope=issues:read

# exchange code for token - POST request
curl -v -d 'client_id=CLIENT_ID&client_secret=SECRET&grant_type=authorization_code&redirect_uri=https://your-app.com/oauthredirect&code=CODE' https://usc1-api.egnyteprotect.com/oauth2/token

# refresh token - POST request
curl -v -d 'client_id=CLIENT_ID&client_secret=SECRET&grant_type=refresh_token&redirect_uri=https://your-app.com/oauthredirect&refresh_token=REF_TOKEN' https://usc1-api.egnyteprotect.com/oauth2/token
Security scheme type: OAuth2
authorizationCode OAuth Flow
Authorization URL: https://<env>.egnyteprotect.com/oauth2/code
Token URL: https://<env>.egnyteprotect.com/oauth2/token
Refresh URL: https://<env>.egnyteprotect.com/oauth2/token
Scopes:
  • issues:read -

    read issues listings and details

  • classification:write -

    upload items and metadata for classification

Get list of issues

Returns Protect issues, starting from oldest, uses a cursor to iterate without duplicates.

Issue
A violation of data protection policies listed in Protect
Cursor
A value pointing to a location in the list of issues. Cursor refers to the last item you already received. The API will return items newer than the cursor.

Authorizations:
CodeGrantAuth (issues:read)
query Parameters
count
integer [ 1 .. 100 ]
Default: 100

Number of items to return at most

cursor
integer <int64> (IssueId) >= 0

Most recent known id, return items with IDs after this one.

Responses

200

List of issues returned with a cursor for next request

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

not authorized

404

Not Found

500

Unexpected Error

get /v1/issues
https://usc1-stage-api.egnyteprotect.com/api/v1/issues
https://usc1-api.egnyteprotect.com/api/v1/issues
https://euw1-api.egnyteprotect.com/api/v1/issues

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "cursor": 46,
  • "issues":
    [
    ]
}

Get latest cursor or a cursor for provided timestamp

Returns cursor (issue id) for timestamp specified as startTime param. When querying issue listing for the cursor provided, you'll receive all issues created on the timestamp or later.
If the timestamp is older than the oldest issue, the API returns a cursor pointing to a value before all issues
If the timestamp is newer than the newest issue or not provided at all, a cursor is returned that, when used, will only return future issues. (useful for polling for new issues)

Authorizations:
CodeGrantAuth (issues:read)
query Parameters
startTime
integer >= 1500000000000

Timestamp in miliseconds for which to get the cursor

Responses

200

Cursor value returned.

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

get /v1/issues/cursor
https://usc1-stage-api.egnyteprotect.com/api/v1/issues/cursor
https://usc1-api.egnyteprotect.com/api/v1/issues/cursor
https://euw1-api.egnyteprotect.com/api/v1/issues/cursor

Response samples

Content type
application/json
Copy
Expand all Collapse all
"{\"cursor\":2343}"

Get list of issues updates

Returns Issues in their current state, but ordered by their modification time. Polling this endpoint starting at the current timestamp will result in getting a list of issues as they're being updated or added. Polling with no timestamp to start with will list all issues in their current state and continue returning issues as they're being added or changed over time. Responses from this endpoint may contain more elements than the declared count if the last item in the returned set was not the last with the same timestamp value.

Authorizations:
CodeGrantAuth (issues:read)
query Parameters
count
integer [ 1 .. 100 ]
Default: 100

Approximate number of items to return. API doesn't not guarantee the exact match.

modifiedAfter
integer <int64> (Timestamp) >= 0

Most recent known timestamp, return items which were updated after that timestamp.

Responses

200

List of issues updates returned with a cursor for next request

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

not authorized

404

Not Found

500

Unexpected Error

get /v1/issueupdates
https://usc1-stage-api.egnyteprotect.com/api/v1/issueupdates
https://usc1-api.egnyteprotect.com/api/v1/issueupdates
https://euw1-api.egnyteprotect.com/api/v1/issueupdates

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "modifiedAfter": 0,
  • "issues":
    [
    ]
}

Get detailed information about specified issue

Returns detailed information about selected issue. It allows to track its status over time.

Authorizations:
CodeGrantAuth (issues:read)
path Parameters
id
required
integer <int64> (IssueId) >= 0

ID of the issue to return

Responses

200

Detailed information about the issue.

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

get /v1/issues/{id}
https://usc1-stage-api.egnyteprotect.com/api/v1/issues/{id}
https://usc1-api.egnyteprotect.com/api/v1/issues/{id}
https://euw1-api.egnyteprotect.com/api/v1/issues/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "sourceId": "string",
  • "status": "string",
  • "type": "string",
  • "source": "string",
  • "sourceLabel": "string",
  • "sourceType": "string",
  • "severity": 1,
  • "updated": 1500000000000,
  • "detected": 1500000000000,
  • "item":
    {
    },
  • "policies":
    [
    ]
}

Get basic information about the user

Returns information about the user making request: data from Protect plus clientId of application used.

Authorizations:

Responses

200

Current token information.

get /v1/whoami
https://usc1-stage-api.egnyteprotect.com/api/v1/whoami
https://usc1-api.egnyteprotect.com/api/v1/whoami
https://euw1-api.egnyteprotect.com/api/v1/whoami

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "clientId": "hweb8adyh3gumiypa45qdgkm",
  • "user": "d870600d-dd67-448f-b482-7c4618862008",
  • "tenant": "fc7e9d03-b838-40b3-ae6b-80f761f418d7",
  • "scopes":
    [
    ]
}

Register an issues webhook

Allows for webhook registration. It will be getting notifications about changes in Egnyte Protect issues. Endpoint returns ID of newly registered webhook, expiration timestamp and current status.

Authorizations:
CodeGrantAuth (issues:read)
Request Body schema: application/json
url
required
string
eventType
Array of strings (EventType) non-empty
Items Enum: "create" "modify" "resolve"
authHeader
string

Responses

201

Successfully registered a webhook.

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

409

Registered webhooks quota exceeded.

500

Unexpected Error

post /v1/webhooks/issues
https://usc1-stage-api.egnyteprotect.com/api/v1/webhooks/issues
https://usc1-api.egnyteprotect.com/api/v1/webhooks/issues
https://euw1-api.egnyteprotect.com/api/v1/webhooks/issues

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "webhookId": "c9ac0519-284a-4bee-9574-30ae7891e5dc",
  • "expires": 2100000000,
  • "status": "enabled"
}

Unregister an issues webhook

Allows for webhook unregistration.

Authorizations:
CodeGrantAuth (issues:read)
path Parameters
webhookId
required
string (WebhookId)

ID of the webhook to unregister

Responses

204

Successfully unregistered a webhook

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

delete /v1/webhooks/issues/{webhookId}
https://usc1-stage-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}
https://usc1-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}
https://euw1-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": "string",
  • "message": "string",
  • "details": "string"
}

Get webhook status

Returns webhook ID, expiration timestamp and status.

Authorizations:
CodeGrantAuth (issues:read)
path Parameters
webhookId
required
string (WebhookId)

ID of the webhook

Responses

200

Webhook status information

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

get /v1/webhooks/issues/{webhookId}/status
https://usc1-stage-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}/status
https://usc1-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}/status
https://euw1-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}/status

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "webhookId": "c9ac0519-284a-4bee-9574-30ae7891e5dc",
  • "expires": 2100000000,
  • "status": "enabled"
}

Set webhook status

Allows to set webhook status.

Authorizations:
CodeGrantAuth (issues:read)
path Parameters
webhookId
required
string (WebhookId)

ID of the webhook

Request Body schema: application/json
status
required
string
Enum: "enabled" "disabled"

Responses

200

Updated webhook status information

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

post /v1/webhooks/issues/{webhookId}/status
https://usc1-stage-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}/status
https://usc1-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}/status
https://euw1-api.egnyteprotect.com/api/v1/webhooks/issues/{webhookId}/status

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "status": "enabled"
}

Response samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "webhookId": "c9ac0519-284a-4bee-9574-30ae7891e5dc",
  • "expires": 2100000000,
  • "status": "enabled"
}

Register a source for classification

Creates a classification source in Protect sourceId in response can be used to unregister, it also shows up as sourceId in results of Content Classification and Issues

Authorizations:
CodeGrantAuth (classification:write)
Request Body schema: application/json
transport
required
string
Value: "https"

Transport choice. https is the default, more will be added.

discoveryURL
required
string

URL of the Classification FS discovery endpoint for the particular source

sourceDisplayName
required
string

Visible name of the registered source

location
string

Visible name of the location of the source, can be left empty or used as a hint to the user as to where to look for the source (a network address or a specific section of the source system)

troubleshootingURL
required
string

A URL to display to the user if the classification source stops responding. Can be a direct link to configuration of the source or a link to a troubleshooting guide.

authHeader
string

The content for authorization header of requests made to Classification FS

emailContact
string

E-mail address to contact when source is down for

Responses

201

Source added

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

post /v1/classification
https://usc1-stage-api.egnyteprotect.com/api/v1/classification
https://usc1-api.egnyteprotect.com/api/v1/classification
https://euw1-api.egnyteprotect.com/api/v1/classification

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "transport": "https",
  • "discoveryURL": "string",
  • "sourceDisplayName": "string",
  • "location": "string",
  • "troubleshootingURL": "string",
  • "authHeader": "string",
  • "emailContact": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "sourceId": "string"
}

Unregister classification source

Unregister a classification source from Protect

Authorizations:
CodeGrantAuth (classification:write)
path Parameters
sourceId
required
string

Responses

204

Source unregistered

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

delete /v1/classification/{sourceId}
https://usc1-stage-api.egnyteprotect.com/api/v1/classification/{sourceId}
https://usc1-api.egnyteprotect.com/api/v1/classification/{sourceId}
https://euw1-api.egnyteprotect.com/api/v1/classification/{sourceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": "string",
  • "message": "string",
  • "details": "string"
}

Request a test run on a classification source

Runs a simulation of a Classification Source scan pass on the given source URL and invokes report endpoint with issues it finds.
Does not return a success/failure result - it's intended as a tool for helping the developer during work and manual acceptance testing, not as a CI/CD tool.

Authorizations:
CodeGrantAuth (classification:write)
Request Body schema: application/json
transport
required
string
Value: "https"

Transport choice. https is the default, more will be added.

discoveryURL
required
string

URL of the Classification FS discovery endpoint for the particular source

authHeader
string

The content for authorization header of requests made to Classification FS

Responses

201

Test scheduled.

400

Input Error

401

Not Authorized (token expired, invalid or missing)

403

Missing Scope (code: missing_scope_error)

404

Not Found

500

Unexpected Error

post /v1/classificationtest
https://usc1-stage-api.egnyteprotect.com/api/v1/classificationtest
https://usc1-api.egnyteprotect.com/api/v1/classificationtest
https://euw1-api.egnyteprotect.com/api/v1/classificationtest

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "transport": "https",
  • "discoveryURL": "string",
  • "authHeader": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "code": "string",
  • "message": "string",
  • "details": "string"
}