This endpoint deletes a user document located by file GUID, in association with the target Tenant & User Account Id.  The action will remove the file from the system, which is both the Database entry and the physical file as stored. This is irreversible once actioned.


You may need to use this in conjunction with Retrieve user's documents info to determine the file GUID of the document(s) you wish to delete. 


POST /api/library/documents/delete/ 

[Json DTO]



Request Example



"FileDTO" requirements (Json camelcase)

TenantSubDomain
stringTenant Sub Domain value
UserAccountId
int
Account ID of the user who owns the document to delete
FileGUIDstringGUID of the document


See the above PostMan screenshot for example demonstration, for UserAccountId = 6 and a Tenant declared in Postman environment variables.


Authorization

The following authorization header is required.  The authorisation header should be set to a 'Bearer Token' type


Token


Permissions

The API Client requires at write permission to Tenant users document library to successfully action (See Admin User Roles for more details).  Only a tenant that the API client has access to will be allowed.


Response

A successful response will be a 200 HTTP status code with no attached message. The validity of the delete can be further checked by looking for User System File Delete Events in the User's activity screen.


Examples


C# Example


var client = new HttpClient(); 
var request = new HttpRequestMessage(HttpMethod.Post, "https://{platform API url}/api/library/documents/delete"); 
request.Headers.Add("Authorization", "Bearer {access token}"); 
var content = new StringContent({\"userAccountId\": 6, \"tenantSubDomain\": \"myTenant\", \"fileGuid\": \"fcc588f3-d1e8-47cd-8b08-e878daecb214\"}", null, "application/json");
request.Content = content; 
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());


cURL Example


curl --location 'https://{platform API url}/api/library/documents/delete' \--header 'Content-Type: application/json' \ --data-'{"userAccountId": 6, "tenantSubDomain": "myTenant", "fileGuid": "fcc588f3-d1e8-47cd-8b08-e878daecb214"}'