Check a restore in progress
amber_get_import_statusCheck the progress of a memory restore by task ID: see if it is awaiting upload, queued, running, complete, or failed, and read the error reason when a restore fails.
Instructions
Check a restore in progress, whichever way it was started: the upload panel from amber_upload_backup, the browser page at https://ambermem.com/restore, a URL given to amber_import_memories, or a presigned upload from POST /import/presign. Not rate-limited. Read-only. Requires an active subscription.
Statuses: awaiting_upload (a link was handed out and no file has arrived yet; not a failure), pending (queued), running (restoring), complete, failed (error says why).
imported_count climbs while it runs, so a caller can tell progress from a stall. There is NO total to compare it against: the archive is never read in full up front, which is what lets a restore of any size cost the same per step. It counts memories PROCESSED, so re-running a restore counts them again even though nothing is written twice.
IF IT FAILED, SAY SO PLAINLY AND RELAY error, which names the cause and what to do. Starting a new restore is safe: memories keep their ids, so anything already restored is skipped rather than written twice. If the error says the file is damaged or cut short, the same file will stop at the same place, so restore from a fresh backup instead. A memory that was in the trash in the backup is restored INTO the trash, and is counted in imported_count like the rest. Errors: not_found (no task with that id, or it belongs to another account, or it aged out after 7 days), invalid_input (the id is missing or not a string -- the schema layer answers this one).
If the user still needs to get a file INTO Amber, amber_upload_backup shows them an uploader; https://ambermem.com/backups documents the scripted route.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The id returned by whichever call started the restore: `amber_upload_backup` with action `finish`, `amber_import_memories`, or `POST /import/presign`. An unknown or expired id returns `code: not_found`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | Yes | Why it stopped, when status is `failed`. Re-uploading the SAME file is safe and resumes rather than duplicating, so say that when you relay this. | |
| status | Yes | `awaiting_upload` set up and waiting for the file, which is the normal state for the whole upload flow and NOT an error, `pending` queued, `running` restoring, `complete` finished, `failed` stopped (see `error`). A restore never sits on `running` for ever: a stall becomes `failed` with a reason. | |
| task_id | Yes | The task this report is about. | |
| exported_at | Yes | When the archive was originally taken. | |
| imported_count | Yes | Memories PROCESSED so far, and the final count once status is `complete`. Not a fraction: the archive is never read in full up front, so nothing knows the total until the restore finishes. Not a count of new rows either: writes are keyed on the id the memory had in the archive, so restoring a file twice counts every memory again while writing none of them twice. |