---
title: "Process Migrated Files"
method: POST
path: "/internal/files/migrated/process"
tags: ["internal"]
---

# Process Migrated Files

`POST /internal/files/migrated/process`

Run one batch of pending migrated uploads through the pipeline.

Only `PROCESSING_SKIPPED` rows are dispatched, named or not —
`dispatch_migrated_file_processing` claims the row with a guarded UPDATE — so re-posting
the same ids is a no-op rather than a second pipeline run over documents that already had
one.

A download-only document is refused by name rather than left to the guard, since "the
pipeline is never run over this format" and "this one has already had its batch" would
otherwise both read as `not_pending`, and only the second is worth re-checking.

## Request body

- ProcessMigratedFilesRequest — Which migrated uploads to put through the pipeline they skipped at import. `upload_ids` names them exactly. Leaving it unset takes the oldest `limit` rows still owed a batch, optionally narrowed to one tenant — the shape a "do the next 25" batch wants, without the caller having to list the ids first.
  - `upload_ids` string[], nullable
  - `company_id` string, uuid, nullable
  - `limit` integer

## Response `200`

Successful Response

- ProcessMigratedFilesResponse
  - `items` ProcessMigratedFileResultItem[], required
    - `upload_id` string, uuid, required
    - `dispatched` boolean, required
    - `reason` string, nullable, required
  - `remaining_pending` integer, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-04** `816d6dca5096` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/kobaltlabs/apis/fastapi/changes/internal/files/migrated/process/post.md)

---

[API](https://skmtc.dev/kobaltlabs/apis/fastapi.md) · [All operations](https://skmtc.dev/kobaltlabs/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kobaltlabs/fastapi/revisions/816d6dca5096/schema)
