# Restore from Trash `POST https://api.getprospect.com/v2/trash/restore` Restores Trash rows of one `kind`: by `ids` (Trash row ids from `GET /v2/trash`), or `all: true` with the listing filters (`search`, `since`). Restored records are saved in the workspace again, in the lists they were in. Small restores are applied inline (200, `done`); larger ones are queued (202, `running`, poll `Location`). One bulk action runs per workspace at a time. With an `Idempotency-Key`, a retry answers the job it started. Free; 1 `jobs` rate-limit unit. ## Authentication Pass your API key in the `x-api-key` header. ## Body parameters - `kind` (enum, required): Which Trash tab the rows are in. Allowed values: `person`, `company`, `list`. - `ids` (string[], optional): Trash row ids (`id` of `GET /v2/trash` items). Exactly one of `ids` and `all: true`. - `all` (boolean, optional): Restore every row of `kind` the listing filters match. - `search` (string, optional, max length: 200): With `all`: a case-insensitive name prefix. - `since` (string, optional): With `all`: only rows deleted at or after this ISO 8601 date. ## Example request ```bash curl --request POST \ --url https://api.getprospect.com/v2/trash/restore \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' \ --data ' { "kind": "person", "ids": [ "66ff0d2e3a4b5c6d7e8f9001", "66ff0d2e3a4b5c6d7e8f9002" ] } ' ``` ## Response 200 Applied inline: the job, `done`. ```json { "success": true, "data": { "id": "66ff0c1e2a4b5c6d7e8f9012", "type": "trash_restore", "status": "done", "total": 3, "processed": 3, "progress_percent": 100, "result": { "restored": 3, "lists_restored": 0, "skipped": 0 }, "error": null, "resource_url": null, "created_at": "2026-10-05T09:00:00.000Z", "finished_at": "2026-10-05T09:00:00.000Z" }, "metadata": { "timestamp": "2026-10-05T09:00:00.000Z" } } ``` ## Response 202 Queued: the job, `running`. Poll `Location` (`GET /v2/jobs/{id}`). ```json { "success": true, "data": { "id": "66ff0c1e2a4b5c6d7e8f9012", "type": "trash_restore", "status": "running", "total": 25000, "processed": 0, "progress_percent": 0, "result": { "restored": 0, "lists_restored": 0, "skipped": 0 }, "error": null, "resource_url": null, "created_at": "2026-10-05T09:00:00.000Z", "finished_at": null }, "metadata": { "timestamp": "2026-10-05T09:00:00.000Z" } } ``` ## Response 400 Invalid body or `Idempotency-Key` (`VALIDATION_ERROR`; `payload.code` says which kind of mistake), or a selection the command cannot run. ```json { "success": false, "data": null, "metadata": { "timestamp": "2026-10-05T09:00:00.000Z" }, "errors": [ { "name": "VALIDATION_ERROR", "message": "kind: \"lead\" is not an accepted value. Accepted: person, company, list", "payload": { "field": "kind", "code": "value_not_allowed", "received_value": "lead", "received_type": "string", "invalid_values": [ "lead" ], "allowed_values": [ "person", "company", "list" ], "constraints": { "isIn": "kind must be one of the following values: person, company, list" } } } ] } ``` ## Response 401 Missing, unknown or inactive credentials (`UNAUTHORIZED`). ## Response 409 `CONFLICT`: another bulk action of the workspace is running (`bulk_action_running`, `payload.job_id` names it; `data` repeats `{code, job_id}` during the App transition), or the `Idempotency-Key` was used for another request (`idempotency_key_reused`), or its first request is still running (`idempotency_in_progress`, `Retry-After: 2`). ```json { "success": false, "data": { "code": "bulk_action_running", "job_id": "66ff0c1e2a4b5c6d7e8f9099" }, "metadata": { "timestamp": "2026-10-05T09:00:00.000Z" }, "errors": [ { "name": "CONFLICT", "message": "Another bulk action is still running in this workspace.", "payload": { "code": "bulk_action_running", "job_id": "66ff0c1e2a4b5c6d7e8f9099" } } ] } ``` ## Response 429 Over the `jobs` rate limit (`RATE_LIMIT`); wait `Retry-After` seconds. ## Response 500 Unexpected server error.