View as Markdown

Restore from Trash

POST/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.

Body parameters

  • kindenumrequired

    Which Trash tab the rows are in.

    Allowed values: person company list

  • idsstring[]optional

    Trash row ids (id of GET /v2/trash items). Exactly one of ids and all: true.

  • allbooleanoptional

    Restore every row of kind the listing filters match.

  • searchstringoptionalmax length: 200

    With all: a case-insensitive name prefix.

  • sincestringoptional

    With all: only rows deleted at or after this ISO 8601 date.

Responses

  • 200 Applied inline: the job, done.
  • 202 Queued: the job, running. Poll Location (GET /v2/jobs/{id}).
  • 400 Invalid body or Idempotency-Key (VALIDATION_ERROR; payload.code says which kind of mistake), or a selection the command cannot run.
  • 401 Missing, unknown or inactive credentials (UNAUTHORIZED).
  • 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).
  • 429 Over the jobs rate limit (RATE_LIMIT); wait Retry-After seconds.
  • 500 Unexpected server error.

For error handling see Errors. Response objects are described in Person object and Company object.