# Trash

## List deleted profiles

`GET /trash`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "List deleted profiles",
  "description": "Returns profiles archived by `DELETE /profiles/{id}`, newest first, with their restoration expiration time. Expired entries are deleted when the launcher starts.",
  "responses": {
    "200": {
      "description": "The trash.",
      "content": {
        "application/json": {
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrashEntry"
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## Restore a deleted profile

`POST /trash/{id}/restore`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Restore a deleted profile",
  "description": "Restores the profile with its original ID. The archive is deleted after the profile is restored.\n\nCookies, logins, web data, preferences, history, bookmarks, Local Storage, and IndexedDB are restored. Cache data is rebuilt on the next launch.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "The restored profile.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ProfileMeta"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "description": "No deleted profile with this ID.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

## Delete a trashed profile for good

`DELETE /trash/{id}`

```json
{
  "tags": [
    "Trash"
  ],
  "summary": "Delete a trashed profile for good",
  "description": "Permanently deletes the profile archive. This action cannot be undone.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Purged.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "purged": {
                "type": "boolean",
                "example": true
              },
              "id": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```
