restores
Restores

Create Restore

post/restores

Request

  • Base URL
    https://app.files.com/api/rest/v1
  • URL
    https://app.files.com/api/rest/v1/restores
  • Auth
    none declared

Request body multipart/form-data

earliest_datestring date-time required

Restore files or users deleted on or after this date/time. Don't set this earlier than you need. Can not be greater than 365 days prior to the restore request.

prefixstring

Prefix of the files/folders to restore, or a case-insensitive username prefix for a user restore. A trailing slash selects that folder and its contents only; without it, the prefix matches any path beginning with that text. Do not use a leading slash. To restore all deleted items of the selected restoration type within the selected site or workspace scope, specify an empty string ('') or omit the field.

restoration_type'files' | 'users'

Type of restoration to perform. files restores deleted filesystem items. users restores deleted users and associated authentication records, plus permissions when restore_deleted_permissions=true. A 5-minute grace period allows for batch deletion processes: associated records deleted within the 5 minutes before the user are included, even if removed independently. Records deleted earlier, or before earliest_date, remain deleted.

restore_deleted_permissionsboolean

If true, a user restore restores permissions deleted along with the selected users, including permissions removed independently within the 5 minutes before user deletion. Permissions deleted earlier, or before earliest_date, remain deleted. An in-place file restore restores user and group permissions on returned folders and their subfolders that were deleted from the time of the folder's deletion through 24 hours afterward, including permissions removed independently within that window. File restores into a new folder do not restore permissions.

restore_in_placeboolean

If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.

update_timestampsboolean

If true, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.

workspace_idinteger

Workspace ID for a workspace-scoped restore. 0 means the default site-wide scope.

Example request

{
  "earliest_date": "2000-01-01T01:00:00Z",
  "prefix": "foo/bar/baz.txt",
  "restoration_type": "files",
  "restore_deleted_permissions": true,
  "restore_in_place": true,
  "update_timestamps": true,
  "workspace_id": 12
}

Response

The Restores object.

earliest_datestring date-time

Restore files or users deleted on or after this date/time. Don't set this earlier than you need. Can not be greater than 365 days prior to the restore request.

idinteger

Restore Record ID.

dirs_restoredinteger

Number of directories that were successfully restored.

dirs_erroredinteger

Number of directories that were not able to be restored.

dirs_totalinteger

Total number of directories processed.

files_restoredinteger

Number of files successfully restored.

files_erroredinteger

Number of files that were not able to be restored.

files_totalinteger

Total number of files processed.

prefixstring

Prefix of the files/folders to restore, or a case-insensitive username prefix for a user restore. A trailing slash selects that folder and its contents only; without it, the prefix matches any path beginning with that text. Do not use a leading slash. To restore all deleted items of the selected restoration type within the selected site or workspace scope, specify an empty string ('') or omit the field.

restoration_type'files' | 'users'

Type of restoration to perform. files restores deleted filesystem items. users restores deleted users and associated authentication records, plus permissions when restore_deleted_permissions=true. A 5-minute grace period allows for batch deletion processes: associated records deleted within the 5 minutes before the user are included, even if removed independently. Records deleted earlier, or before earliest_date, remain deleted.

restore_in_placeboolean

If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.

restore_deleted_permissionsboolean

If true, a user restore restores permissions deleted along with the selected users, including permissions removed independently within the 5 minutes before user deletion. Permissions deleted earlier, or before earliest_date, remain deleted. An in-place file restore restores user and group permissions on returned folders and their subfolders that were deleted from the time of the folder's deletion through 24 hours afterward, including permissions removed independently within that window. File restores into a new folder do not restore permissions.

users_restoredinteger

Number of users successfully restored (only present for restoration_type=users).

users_erroredinteger

Number of users that failed to restore (only present for restoration_type=users).

users_totalinteger

Total number of users processed (only present for restoration_type=users).

api_keys_restoredinteger

Number of API keys restored (only present for restoration_type=users).

public_keys_restoredinteger

Number of public keys restored (only present for restoration_type=users).

two_factor_authentication_methods_restoredinteger

Number of two factor authentication methods restored (only present for restoration_type=users).

status'pending' | 'counting' | 'restoring' | 'complete' | 'validating'

Status of the restoration process.

update_timestampsboolean

If true, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.

workspace_idinteger

Workspace ID for a workspace-scoped restore. 0 means the default site-wide scope.

error_messagesstring[]

Error messages received while restoring files and/or directories. Only present if there were errors.

Example response

{
  "earliest_date": "2000-01-01T01:00:00Z",
  "id": 1,
  "dirs_restored": 1,
  "dirs_total": 1,
  "files_restored": 1,
  "files_total": 1,
  "prefix": "foo/bar/baz.txt",
  "restoration_type": "files",
  "restore_in_place": true,
  "restore_deleted_permissions": true,
  "users_restored": 1,
  "users_total": 1,
  "api_keys_restored": 1,
  "public_keys_restored": 1,
  "two_factor_authentication_methods_restored": 1,
  "status": "pending",
  "update_timestamps": true,
  "workspace_id": 12,
  "error_messages": [
    "example"
  ]
}

Changes