Metadata
The Metadata API allows you to define custom metadata fields and apply them to files, file versions, and folders in your Egnyte domain. Metadata fields (keys) are organized into namespaces, which control visibility and modification permissions.
Namespaces and Scope
Namespaces can have one of three scope levels:
- Private: Only visible to the application that created it (same OAuth client ID). Other applications and the Web UI cannot see or modify private namespaces.
- Protected: Visible to all applications and the Web UI, but only the creating application can modify or delete it.
- Public: Visible to all applications and the Web UI. Any application or user can modify or delete public namespaces.
Metadata Scope Types
Namespaces can be scoped in three ways:
- GLOBAL: Applies to all files and folders in the domain.
- FOLDER_SCOPE: Applies only to files and folders within specified folders.
- DOCUMENT_TYPE: Applies only to files matching specified document type categories (e.g., PDF, DOCUMENT, SPREADSHEET).
Base URL
https://{domain}.egnyte.com/pubapi/v1/properties
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.
Supported Data Types
Metadata keys support the following data types:
| Type | Description | Example |
|---|---|---|
string | Text value | "Project Alpha" |
integer | Whole number | 42 |
decimal | Decimal number | 3.14 |
date | Unix epoch timestamp in milliseconds. For timezone-independent fields, the value must be at exactly UTC midnight (divisible by 86400000). | 1725753600000 (2024-09-08 UTC midnight) |
enum | Single value from predefined list | "male" |
labels | Multiple values that append to existing values. Predefined values are optional and serve as suggestions only — values outside the predefined list can also be added. | ["urgent", "review"] |
multi_value_enum | Multiple values from a predefined list (appends to existing values). Values must be chosen from the predefined list. | ["clinical", "healthcare"] |
Note: For the labels type, the data field is optional. If omitted, users can add any values without predefined suggestions. For enum and multi_value_enum types, the data field is required to define the allowed values.
Timezone-Independent Date Fields
DATE fields support an optional timezoneIndependent flag that controls how date values are stored and displayed:
timezoneIndependent: true— The value is treated as a plain calendar date with no timezone context. Values must be milliseconds at exactly UTC midnight (divisible by 86400000), for example1725753600000for 2024-09-08. The value is displayed as-is without any timezone adjustment.timezoneIndependent: false— The value is timezone-dependent and may be adjusted based on the viewer's timezone settings (legacy behavior).
Note: Once a DATE field is set to timezoneIndependent: true, it cannot be reverted to false.
Get All Namespaces
Retrieves all custom metadata namespaces in the domain.
Request
GET /pubapi/v1/properties/namespace
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
includeFolderAssociations | boolean | No | false | Include folder association details in the response |
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/properties/namespace?includeFolderAssociations=true" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
name | string | Namespace identifier |
displayName | string | Display name shown in the UI |
priority | integer | Display order priority |
keys | object | Map of metadata keys and their definitions |
scope | string | Namespace scope: public, protected, or private |
schemaSystemGenerated | boolean | Whether the schema was system-generated |
inheritable | boolean | Whether metadata is inherited by child items |
metadataScopeType | string | Scope type: GLOBAL, FOLDER_SCOPE, or DOCUMENT_TYPE |
folderAssociations | array | Folders associated with this namespace (only when metadataScopeType is FOLDER_SCOPE) |
hasAccessToAllAssociations | boolean | Whether the user has access to all associated folders |
documentTypes | array | Document type categories (only when metadataScopeType is DOCUMENT_TYPE) |
documentExtensions | array | File extensions matching the document types |
For each key object within keys, the following fields may be present:
| Key Field | Type | Description |
|---|---|---|
type | string | Data type of the key |
displayName | string | Display name shown in the UI |
helpText | string | Tooltip description |
priority | integer | Display order priority |
data | array | Predefined values (for enum, labels, multi_value_enum) |
timezoneIndependent | boolean | Whether the DATE field stores values without timezone context. Only present on date-type keys. |
Example Response
[
{
"name": "public-global-all-data-types",
"displayName": "public-global-all-data-types",
"priority": 0,
"keys": {
"date-key": {
"displayName": "date-key",
"helpText": "Enter a date value for this field",
"priority": 6,
"type": "date",
"timezoneIndependent": true
},
"string-key": {
"displayName": "string-key",
"helpText": "Enter a text value for this field",
"priority": 5,
"type": "string"
},
"decimal-key": {
"displayName": "decimal-key",
"helpText": "Enter a decimal number for this field",
"priority": 4,
"type": "decimal"
},
"int-key": {
"displayName": "int-key",
"helpText": "Enter a whole number for this field",
"priority": 3,
"type": "integer"
},
"enum-key": {
"data": ["male", "female"],
"displayName": "enum-key",
"helpText": "Select a gender value",
"priority": 2,
"type": "enum"
},
"labels-key": {
"data": ["green", "red"],
"displayName": "labels-key",
"helpText": "Select one or more color labels",
"priority": 1,
"type": "labels"
},
"multi-value-enum-key": {
"data": ["clinical", "healthcare", "shipping"],
"displayName": "multi-value-enum-key",
"helpText": "Select one or more industry categories",
"priority": 0,
"type": "multi_value_enum"
}
},
"scope": "public",
"schemaSystemGenerated": false,
"inheritable": false,
"metadataScopeType": "GLOBAL"
}
]
Create Namespace
Creates a new namespace with custom metadata fields.
Request
POST /pubapi/v1/properties/namespace
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Namespace identifier |
displayName | string | No | Display name shown in the UI |
scope | string | Yes | Namespace scope: public, protected, or private |
keys | object | Yes | Map of metadata keys to create (see Create Metadata Key for field definitions) |
inheritable | boolean | No | Whether metadata is inherited by child items |
metadataScopeType | string | No | Scope type: GLOBAL, FOLDER_SCOPE, or DOCUMENT_TYPE |
associatedFolderIds | array | No | Folder IDs to associate (only when metadataScopeType is FOLDER_SCOPE) |
documentTypes | array | Conditional | Document type categories (required when metadataScopeType is DOCUMENT_TYPE) |
Note: Every metadata key within a namespace must include a helpText field containing between 20 and 200 characters.
Available Document Types
PDFDOCUMENTSPREADSHEETPRESENTATIONIMAGEAUDIO_VIDEOTEXT_SOURCE_CODEGOOGLE_FILEEMAILCADARCHIVE
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/properties/namespace" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "name": "public-global-all-data-types", "displayName": "all-data-types-example", "scope": "public", "inheritable": false, "metadataScopeType": "GLOBAL", "keys": { "labels-key": { "type": "labels", "data": [ "red", "green" ], "helpText": "Select one or more color labels" }, "multi-value-enum-key": { "type": "multi_value_enum", "data": [ "shipping", "healthcare", "clinical" ], "helpText": "Select one or more industry categories" }, "enum-key": { "type": "enum", "data": [ "male", "female" ], "helpText": "Select a gender value" }, "int-key": { "type": "integer", "priority": 1, "helpText": "Enter a whole number for this field" }, "decimal-key": { "type": "decimal", "priority": 2, "displayName": "decimal-key", "helpText": "Enter a decimal number for this field" }, "string-key": { "type": "string", "priority": 3, "displayName": "string-key", "helpText": "Enter a text value for this field" }, "date-key": { "type": "date", "priority": 4, "displayName": "date-key", "helpText": "Enter a date value for this field", "timezoneIndependent": true } } }'
Response
204 No Content
The namespace was created successfully.
Get Namespace
Retrieves all custom metadata keys within a specific namespace.
Request
GET /pubapi/v1/properties/namespace/{namespace_name}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace |
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/public-global-all-data-types" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
name | string | Namespace identifier |
displayName | string | Display name shown in the UI |
scope | string | Namespace scope |
keys | object | Map of metadata keys and their definitions |
priority | integer | Display order priority |
inheritable | boolean | Whether metadata is inherited by child items |
schemaSystemGenerated | boolean | Whether the schema was system-generated |
metadataScopeType | string | Scope type |
Example Response
{
"name": "public-global-all-data-types",
"scope": "public",
"keys": {
"date-key": {
"type": "date",
"displayName": "date-key",
"priority": 4,
"timezoneIndependent": true
},
"string-key": {
"type": "string",
"displayName": "string-key",
"priority": 3
},
"decimal-key": {
"type": "decimal",
"displayName": "decimal-key",
"priority": 2
},
"int-key": {
"type": "integer",
"priority": 1
},
"enum-key": {
"type": "enum",
"data": ["male", "female"],
"priority": 0
},
"labels-key": {
"type": "labels",
"data": ["green", "red"],
"priority": 0
},
"multi-value-enum-key": {
"type": "multi_value_enum",
"data": ["clinical", "healthcare", "shipping"],
"priority": 0
}
},
"displayName": "all-data-types-example",
"priority": 0,
"inheritable": false,
"schemaSystemGenerated": false,
"metadataScopeType": "GLOBAL"
}
Update Namespace Attributes
Updates the display name, key priorities, folder associations, or document type associations of a namespace.
Request
PATCH /pubapi/v1/properties/namespace/{namespace_name}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | No | Display name shown in the UI |
priorities | object | No | Map of key names to priority values (integer) |
folderAssociation | object | No | Folders to associate or dissociate |
folderAssociation.associateFolderIds | array | No | Folder IDs to associate |
folderAssociation.dissociateFolderIds | array | No | Folder IDs to dissociate |
documentTypeAssociation | object | No | Document types to associate or dissociate |
documentTypeAssociation.associateDocumentTypes | array | No | Document types to associate |
documentTypeAssociation.dissociateDocumentTypes | array | No | Document types to dissociate |
Note: Only include folderAssociation or documentTypeAssociation in a single request, not both.
Example Request
curl -i -X PATCH "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/metadata" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "displayName": "scope-metadata", "priorities": { "first_name": 5, "last_name": 3, "role": 0 }, "folderAssociation": { "associateFolderIds": [ "{folderId}" ], "dissociateFolderIds": [ "{folderId}" ] } }'
Response
200 OK
| Field | Type | Description |
|---|---|---|
name | string | Namespace identifier |
displayName | string | Updated display name |
priority | integer | Display order priority |
keys | object | Map of metadata keys with updated priorities |
scope | string | Namespace scope |
schemaSystemGenerated | boolean | Whether the schema was system-generated |
metadataScopeType | string | Scope type |
folderAssociations | array | Updated folder associations (if applicable) |
hasAccessToAllAssociations | boolean | Whether the user has access to all associated folders |
documentTypes | array | Updated document types (if applicable) |
documentExtensions | array | File extensions matching the document types |
Example Response
{
"name": "metadata",
"displayName": "scope-metadata",
"priority": 0,
"keys": {
"first_name": {
"displayName": "first_name",
"helpText": "Enter the person's first name",
"priority": 5,
"type": "string"
},
"role": {
"displayName": "role",
"helpText": "Enter the numeric role identifier",
"priority": 0,
"type": "integer"
},
"last_name": {
"displayName": "last_name",
"helpText": "Enter the person's last name",
"priority": 3,
"type": "string"
}
},
"scope": "public",
"schemaSystemGenerated": false,
"metadataScopeType": "FOLDER_SCOPE",
"folderAssociations": [
{
"folderId": "d21a238a-b72e-46b2-9998-8571bdca3085",
"path": "/Shared/video"
}
],
"hasAccessToAllAssociations": true
}
Example Response with documentTypes and documentExtensions
{
"name": "metadata",
"displayName": "scope-metadata",
"priority": 0,
"keys": {
"first_name": {
"displayName": "first_name",
"helpText": "Enter the person's first name",
"priority": 5,
"type": "string"
},
"role": {
"displayName": "role",
"helpText": "Enter the numeric role identifier",
"priority": 0,
"type": "integer"
},
"last_name": {
"displayName": "last_name",
"helpText": "Enter the person's last name",
"priority": 3,
"type": "string"
}
},
"scope": "public",
"schemaSystemGenerated": false,
"metadataScopeType": "GLOBAL/FOLDER_SCOPE/DOCUMENT_TYPE",
"folderAssociations": [
{
"folderId": "d21a238a-b72e-46b2-9998-8571bdca3085",
"path": "/Shared/video"
}
],
"hasAccessToAllAssociations": true,
"documentTypes": [
"PDF"
],
"documentExtensions": [
"pdf"
]
}
Note: The folderAssociations block is only relevant when folder associations are configured. The documentTypes and documentExtensions blocks are only relevant when document type associations are configured.
Update Namespace Keys
Updates the definition of a specific metadata key within a namespace.
Request
PATCH /pubapi/v1/properties/namespace/{namespace_name}/keys/{key_name}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace |
key_name | string | Yes | Name of the key to update |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | No | Display name shown in the UI |
type | string | No | Data type (can only change to broader types) |
priority | integer | No | Display order priority |
data | array | No | Enumerated values for enum, labels, or multi_value_enum types |
helpText | string | *Yes | Tooltip description for the field. If provided, must be between 20 and 200 characters. |
timezoneIndependent | boolean | No | Only applies to date-type keys. Once set to true, cannot be changed back to false. |
*Note: Providing helpText in the update payload is mandatory if the key currently lacks a helpText or has one outside the required length (20–200 characters). If the key already has a valid helpText (20–200 characters), including it in the request is optional unless you want to modify it.
Allowed Type Changes
You can only change a key's type to a broader type:
date→string,decimal,integerinteger→string,decimaldecimal→stringenum→string(thedatafield will be automatically set tonull)
Data Field Behavior
- enum: New values replace existing values. Existing values on files/folders will be deleted.
- multi_value_enum: New values are appended to existing values.
- labels: New values are appended to existing values.
Example Request
curl -i -X PATCH "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/my-namespace/keys/color-key" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "displayName": "My new display name", "helpText": "Use this key to describe the field", "data": [ "red", "green", "blue", "new color" ], "priority": 21, "type": "enum" }'
Response
204 No Content
The key was updated successfully.
Delete Namespace
Deletes a namespace and all its metadata keys.
Request
DELETE /pubapi/v1/properties/namespace/{namespace_name}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace to delete |
Headers
| Header | Required | Description |
|---|---|---|
X-Egnyte-Force-Delete | No | Set to Yes to force delete a namespace that is in use |
Warning: If the namespace is in use and X-Egnyte-Force-Delete is not set to Yes, the request will fail with a 403 error.
Example Request
curl -i -X DELETE "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/my-namespace" \ -H "X-Egnyte-Force-Delete: Yes" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
204 No Content
The namespace was deleted successfully.
Create Metadata Key
Adds a new metadata key to an existing namespace.
Request
POST /pubapi/v1/properties/namespace/{namespace_name}/keys
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Name of the key to create |
type | string | Yes | Data type: integer, string, decimal, date, enum, labels, or multi_value_enum |
displayName | string | No | Display name shown in the UI |
priority | integer | No | Display order priority (higher values display first) |
helpText | string | Yes | Tooltip description for the field. Must be between 20 and 200 characters. |
data | array | Conditional | Enumerated values (required for enum, labels, and multi_value_enum types; optional for labels if no predefined values needed) |
timezoneIndependent | boolean | No | Only applies to date-type keys. When true, values must be UTC midnight milliseconds and are displayed without timezone adjustment. Defaults to false (timezone-dependent) when omitted. Set to true to opt in to timezone-independent behavior. Cannot be reverted to false once set to true. |
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/my-namespace/keys" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "key": "new-enum-key", "type": "enum", "data": [ "active", "completed", "archived" ], "displayName": "Project Status", "priority": 5, "helpText": "Select the current status of the project" }'
Response
204 No Content
The key was created successfully.
Delete Metadata Key
Deletes a metadata key from a namespace.
Request
DELETE /pubapi/v1/properties/namespace/{namespace_name}/keys/{key_name}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace |
key_name | string | Yes | Name of the key to delete |
Headers
| Header | Required | Description |
|---|---|---|
X-Egnyte-Force-Delete | No | Set to Yes to force delete a key that is in use |
Warning: If the key is in use and X-Egnyte-Force-Delete is not set to Yes, the request will fail with a 403 error.
Example Request
curl -i -X DELETE "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/my-namespace/keys/old-key" \ -H "X-Egnyte-Force-Delete: Yes" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
204 No Content
The key was deleted successfully.
Set Values for a Namespace
Sets metadata values for a file, file version, or folder. Multiple key/value pairs can be set at once. Existing values are overwritten. Setting a value to null removes the existing value.
Note: To set metadata on a file, use the file's group_id. To set metadata on a specific file version, use the version's entry_id. To set metadata on a folder, use the folder_id. See the File System API for details on obtaining these IDs.
Request
For Files:
PUT /pubapi/v1/fs/ids/file/{group_id_or_entry_id}/properties/{namespace_name}
For Folders:
PUT /pubapi/v1/fs/ids/folder/{folder_id}/properties/{namespace_name}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
group_id_or_entry_id | string | Yes | File's group ID or version's entry ID |
folder_id | string | Yes | Folder ID |
namespace_name | string | Yes | Name of the namespace |
Request Body
Provide a JSON object with key/value pairs matching the keys defined in the namespace.
Value Behavior by Type:
- enum: Overwrites the existing value
- labels: Appends to existing values
- multi_value_enum: Appends to existing values
Example Request (File)
curl -i -X PUT "https://{domain}.egnyte.com/pubapi/v1/fs/ids/file/a1b2c3d4-e5f6-7890-abcd-ef{id}90/properties/my-namespace" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "enum-key": "abc", "multi-value-enum-key": [ "value-1" ], "labels-key": [ "egnyte" ], "int-key": 1, "decimal-key": 2.2, "date-key": "1465413843995", "string-key": "egnyte" }'
Example Request (Folder)
curl -i -X PUT "https://{domain}.egnyte.com/pubapi/v1/fs/ids/folder/f1g2h3i4-j5k6-7890-lmno-pq{id}90/properties/my-namespace" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "string-key": "Marketing Campaign", "int-key": 42 }'
Response
204 No Content
The metadata values were set successfully.
Get Values for a Namespace
Retrieves metadata values for a file, file version, or folder within a specific namespace.
Request
For Files:
GET /pubapi/v1/fs/ids/file/{group_id_or_entry_id}/properties/{namespace_name}
For Folders:
GET /pubapi/v1/fs/ids/folder/{folder_id}/properties/{namespace_name}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
group_id_or_entry_id | string | Yes | File's group ID or version's entry ID |
folder_id | string | Yes | Folder ID |
namespace_name | string | Yes | Name of the namespace |
Example Request (File)
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/fs/ids/file/a1b2c3d4-e5f6-7890-abcd-ef{id}90/properties/my-namespace" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Request (Folder)
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/fs/ids/folder/f1g2h3i4-j5k6-7890-lmno-pq{id}90/properties/my-namespace" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
| Field | Type | Description |
|---|---|---|
results | array | Array containing metadata values |
results[].{namespace_name} | object | Key/value pairs for the namespace |
Example Response
{
"results": [
{
"workspace": {
"string-key": "abc",
"int-key": 10
}
}
]
}
Search Metadata
Searches for files and folders that have specific metadata fields or field values.
Request
POST /pubapi/v1/search
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | No | Item types to search: ALL, FOLDER, or FILE |
has_key | array | No | Find items with specific keys (array of objects with namespace and key fields) |
key_with_value | array | No | Find items where a key contains a specific value (array of objects with namespace, key, and value fields) |
Note: The key_with_value search performs a substring match, not an exact match. If multiple objects are provided in either array, items matching any condition will be returned.
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/search" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "type": "ALL", "key_with_value": [ { "namespace": "namespace1", "key": "string-key", "value": "abc" } ] }'
Response
200 OK
Returns search results matching the metadata criteria. See the Search API for response format details.
Delete Data for a Single Key
Deletes specific enumerated values from a single metadata key.
Request
PATCH /pubapi/v1/properties/namespace/{namespace_name}/keys/{key_name}/data
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace |
key_name | string | Yes | Name of the key |
Headers
| Header | Required | Description |
|---|---|---|
X-Egnyte-Force-Delete | No | Set to Yes to force delete data that is in use |
Request Body
Provide an array of enumerated values to delete.
Warning: If the key data is in use and X-Egnyte-Force-Delete is not set to Yes, the request will fail with a 403 error.
Example Request
curl -i -X PATCH "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/my-namespace/keys/status-key/data" \ -H "Content-Type: application/json" \ -H "X-Egnyte-Force-Delete: Yes" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '[ "urgent", "review", "archived" ]'
Response
204 No Content
The key data was deleted successfully.
Delete Data for Multiple Keys
Deletes specific enumerated values from multiple metadata keys in a single request.
Request
PATCH /pubapi/v1/properties/namespace/{namespace_name}/keys/data
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Name of the namespace |
Headers
| Header | Required | Description |
|---|---|---|
X-Egnyte-Force-Delete | No | Set to Yes to force delete data that is in use |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
keyDataDeletions | array | Yes | Array of objects specifying keys and data to delete |
keyDataDeletions[].key | string | Yes | Name of the key |
keyDataDeletions[].data | array | Yes | Enumerated values to delete |
Example Request
curl -i -X PATCH "https://{domain}.egnyte.com/pubapi/v1/properties/namespace/my-namespace/keys/data" \ -H "Content-Type: application/json" \ -H "X-Egnyte-Force-Delete: Yes" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "keyDataDeletions": [ { "key": "status", "data": [ "completed", "cancelled" ] }, { "key": "priority", "data": [ "low" ] }, { "key": "tags", "data": [ "archived", "obsolete" ] } ] }'
Response
204 No Content
The key data was deleted successfully.
Error Codes
| Status | Error | Description | Resolution |
|---|---|---|---|
| 200 | OK | Successful operation | — |
| 204 | No Content | Successful operation with no response body | — |
| 400 | Bad Request | Invalid request payload or parameters | Verify the request body matches the expected schema and all required fields are present |
| 403 | Forbidden | User is not authorized or resource is in use | Ensure the user has the required permissions. To delete a resource in use, set the X-Egnyte-Force-Delete header to Yes |
| 404 | Not Found | Namespace, key, or item not found | Verify the namespace name, key name, or item ID is correct |
| 400 | Bad Request | Date value is not a valid timezone-independent date | For timezoneIndependent: true DATE fields, the value must be epoch milliseconds at exactly UTC midnight (divisible by 86400000) |
| 400 | Bad Request | Timezone-independent downgrade not allowed | A DATE key with timezoneIndependent: true cannot be updated to false |
Code Examples
POST /pubapi/v1/fs/ids/file/{entryId}/properties/project-metadata
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/fs/ids/file/{entryId}/properties/project-metadata" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "project-name": "Website Redesign", "project-status": "active" }'
PUT /pubapi/v1/fs/ids/file/{entryId}/properties/project-metadata
curl -i -X PUT "https://{domain}.egnyte.com/pubapi/v1/fs/ids/file/{entryId}/properties/project-metadata" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "project-name": "Website Redesign", "project-status": "active" }'
GET /pubapi/v1/fs/ids/file/{entryId}/properties/project-metadata
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/fs/ids/file/{entryId}/properties/project-metadata" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Related Resources
- File System API — Obtain file and folder IDs for metadata operations
- Search API — Advanced search capabilities including metadata filtering
- Authentication — How to obtain and refresh OAuth tokens
- Best Practices — Rate limiting, error handling, and optimization strategies
