RecycleBin - Huddle/huddle-apis GitHub Wiki

Summary

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.

Operations

Method Path Purpose Details
GET /files/workspaces/{workspaceId}/deletedItems List deleted items Jump

GET workspace recycle bin

Request

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).

Example (XML)

Request

GET /files/workspaces/42/deletedItems HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

HTTP/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>

Example (JSON)

Request

GET /files/workspaces/42/deletedItems HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: Bearer frootymcnooty/vonbootycherooty

Response

HTTP/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" }
          ]
        }
      ]
    }
  ]
}

Payload notes

  • documentLibrary — link to the workspace root folder (document library).
  • deletedItemtype is folder or document (lowercase). Documents include mimeType and extension; 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 one actor element per item for the deleter.

Status codes

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

See also

  • FolderrecycleBin link on the document library folder
  • Document / Folder — delete and restore flows
⚠️ **GitHub.com Fallback** ⚠️