Trash API

REST API

Manage soft-deleted links — list, restore, and permanently purge.

GET/api/trash

List all soft-deleted links belonging to the authenticated user, ordered by deletion date descending.

Request Example

Request
curl -H "Authorization: Bearer <token>" \
  "http://localhost:3000/api/trash"

Response Example

Response
[
  {
    "id": "uuid",
    "url": "https://example.com",
    "title": "Example Article",
    "domain": "example.com",
    "tldr": "A sample description.",
    "tags": ["Tag1"],
    "deletedAt": "2024-04-01T10:00:00.000Z",
    "createdAt": "2024-03-26T12:00:00.000Z"
  }
]
POST/api/trash/:id/restore

Restore a soft-deleted link by clearing its deletedAt timestamp. The link immediately reappears in the dashboard and is re-indexed for search and AI features.

Request Example

Request
curl -X POST "http://localhost:3000/api/trash/123e4567-e89b-12d3/restore" \
  -H "Authorization: Bearer <token>"

Response Example

Response
{ "success": true, "id": "123e4567-e89b-12d3" }
DELETE/api/trash/:id

Permanently delete a specific link from trash. This removes the row, all AI metadata, and the embedding vector. This action is irreversible.

Request Example

Request
curl -X DELETE "http://localhost:3000/api/trash/123e4567-e89b-12d3" \
  -H "Authorization: Bearer <token>"

Response Example

Response
{ "success": true, "id": "123e4567-e89b-12d3" }
DELETE/api/trash

Empty the entire trash — permanently deletes all soft-deleted links for the authenticated user. This action is irreversible.

Request Example

Request
curl -X DELETE "http://localhost:3000/api/trash" \
  -H "Authorization: Bearer <token>"

Response Example

Response
{ "success": true, "deleted": 12 }