RecycleBin - Huddle/huddle-apis GitHub Wiki
The recycle bin lists recently deleted documents and folders in a workspace. It is served by the Files API; use the /files/ prefix on the public API host (for example GET /files/workspaces/{workspaceId}/deletedItems).
Workspace managers (or whoever your account’s view recycle bin policy allows) can call this resource. Up to 50 deleted items are returned, newest first.
| Method | Path | Purpose | Details |
|---|---|---|---|
GET |
/files/workspaces/{workspaceId}/deletedItems |
List deleted items | Jump |
| Method | Path |
|---|---|
GET |
/files/workspaces/{workspaceId}/deletedItems |
The folder representation for the workspace document library can advertise this URL with link relation recycleBin (when the recycle bin is available for that context).
GET /files/workspaces/42/deletedItems HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml<recycleBin>
<link rel="self" href="https://api.example.com/files/workspaces/42/deletedItems" />
<link rel="documentLibrary" href="https://api.example.com/files/workspaces/42/folders/root" />
<deletedItems>
<deletedItem type="folder">
<link rel="self" href="https://api.example.com/files/folders/201" />
<link rel="restore" href="https://api.example.com/files/folders/201/restore" />
<title>Old project</title>
<description>Archived tree</description>
<deletedDate>2014-12-17T11:32:06Z</deletedDate>
<actor rel="deleter" name="Alex Example" email="[email protected]">
<link rel="self" href="https://api.example.com/users/99" />
<link rel="avatar" href="https://api.example.com/files/users/99/avatar?h=..." type="image/jpeg" />
<link rel="alternate" href="https://my.huddle.example/user/alex" type="text/html" />
</actor>
</deletedItem>
<deletedItem type="document">
<link rel="self" href="https://api.example.com/files/documents/305" />
<link rel="restore" href="https://api.example.com/files/documents/305/restore" />
<title>Notes</title>
<description>Draft</description>
<mimeType>application/pdf</mimeType>
<extension>.pdf</extension>
<deletedDate>2014-12-17T10:17:34Z</deletedDate>
<actor rel="deleter" name="Alex Example" email="[email protected]">
<link rel="self" href="https://api.example.com/users/99" />
<link rel="avatar" href="https://api.example.com/files/users/99/avatar?h=..." type="image/jpeg" />
<link rel="alternate" href="https://my.huddle.example/user/alex" type="text/html" />
</actor>
</deletedItem>
</deletedItems>
</recycleBin>GET /files/workspaces/42/deletedItems HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherootyHTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json{
"links": [
{ "rel": "self", "href": "https://api.example.com/files/workspaces/42/deletedItems" },
{ "rel": "documentLibrary", "href": "https://api.example.com/files/workspaces/42/folders/root" }
],
"deletedItems": [
{
"type": "folder",
"links": [
{ "rel": "self", "href": "https://api.example.com/files/folders/201" },
{ "rel": "restore", "href": "https://api.example.com/files/folders/201/restore" }
],
"title": "Old project",
"description": "Archived tree",
"deletedDate": "2014-12-17T11:32:06Z",
"actors": [
{
"rel": "deleter",
"name": "Alex Example",
"email": "[email protected]",
"links": [
{ "rel": "self", "href": "https://api.example.com/users/99" },
{ "rel": "avatar", "href": "https://api.example.com/files/users/99/avatar?h=...", "type": "image/jpeg" },
{ "rel": "alternate", "href": "https://my.huddle.example/user/alex", "type": "text/html" }
]
}
]
},
{
"type": "document",
"links": [
{ "rel": "self", "href": "https://api.example.com/files/documents/305" },
{ "rel": "restore", "href": "https://api.example.com/files/documents/305/restore" }
],
"title": "Notes",
"description": "Draft",
"mimeType": "application/pdf",
"extension": ".pdf",
"deletedDate": "2014-12-17T10:17:34Z",
"actors": [
{
"rel": "deleter",
"name": "Alex Example",
"email": "[email protected]",
"links": [
{ "rel": "self", "href": "https://api.example.com/users/99" },
{ "rel": "avatar", "href": "https://api.example.com/files/users/99/avatar?h=...", "type": "image/jpeg" },
{ "rel": "alternate", "href": "https://my.huddle.example/user/alex", "type": "text/html" }
]
}
]
}
]
}-
documentLibrary— link to the workspace root folder (document library). -
deletedItem—typeisfolderordocument(lowercase). Documents includemimeTypeandextension; folders omit or null them depending on serializer settings. -
restore— URI to restore that item (see Files API restore routes for documents and folders). -
actors— JSON array; XML uses oneactorelement per item for the deleter.
| Status code | Meaning |
|---|---|
200 OK |
Success; response contains the recycle bin representation |
401 Unauthorized |
Missing or invalid access token |
403 Forbidden |
Caller is not allowed to view the recycle bin for this workspace (e.g. not a workspace manager where policy requires it) |
404 Not Found |
Workspace not found or not accessible |