---
title: "Start an import: a presigned URL to upload an .apkg, .colpkg, AlgoApp or text deck file"
method: POST
path: "/revise/imports/upload-url"
tags: ["revise"]
---

# Start an import: a presigned URL to upload an .apkg, .colpkg, AlgoApp or text deck file

`POST /revise/imports/upload-url`

## Request

- Base URL: `https://api.focusbear.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.focusbear.io/revise/imports/upload-url`
- Auth: HTTP bearer

## Request body

- CreateReviseImportUploadUrlDto
  - `file_name` string, required: The file's name; must end in .apkg, .colpkg, .zip, .xml, .csv, .tsv, .txt
  - `file_size` number, required: Bytes
  - `deck_id` string, uuid: One of the user's live decks to put every card in, whatever decks the file names; no decks are created. Omit to make decks from the file

## Response `201`

- ReviseImportUploadUrlResponseDto
  - `import` ReviseImportResponseDto, required
    - `id` string, required
    - `file_name` string, required
    - `status` 'awaiting_upload' | 'queued' | 'processing' | 'completed' | 'failed', required
    - `source` 'anki' | 'algoapp' | 'file', nullable, required
    - `format` 'anki2' | 'anki21' | 'anki21b' | 'algoapp' | 'csv' | 'tsv', nullable, required
    - `progress_included` boolean, required: False when the file had no scheduling, so every card arrived new
    - `decks_imported` number, required
    - `deck_ids` string[], required
    - `cards_imported` number, required: New cards
    - `cards_updated` number, required: Cards already imported, updated to the file (progress kept)
    - `cards_unchanged` number, required: Cards already imported and identical to the file
    - `cards_with_progress` number, required
    - `reviews_imported` number, required
    - `images_imported` number, required: Images stored on the imported cards
    - `total_cards` number, nullable, required: Cards in the file; null until it has been read
    - `processed_cards` number, nullable, required: Cards ready to be written so far, while processing
    - `total_images` number, nullable, required: Images to store; null until the file has been read
    - `processed_images` number, nullable, required: Images stored or skipped so far, while processing
    - `skipped` object, required: Counts by reason: already_imported, suspended, empty_front, empty_back, unsupported_note_type, missing_note_type, card_limit, deck_limit, malformed_row
    - `warnings` object, required: Counts by warning: media_not_imported, text_truncated, history_not_stored
    - `error_code` string, nullable, required
    - `error_message` string, nullable, required
    - `created_at` string, required
    - `updated_at` string, required
    - `finished_at` string, nullable, required
  - `upload_url` string, required: PUT the raw file here, with exactly upload_headers and no Authorization header
  - `upload_headers` object, required
  - `expires_at` string, required

---

[API](https://skmtc.dev/focusbear/apis/focusbear-api.md) - [All operations](https://skmtc.dev/focusbear/apis/focusbear-api/llms.txt) - [OpenAPI document](https://skmtc.dev/focusbear/apis/focusbear-api/revisions/3a83a3b9a811?raw)
