---
title: "Upsert rows from a CSV file (same operation, CSV transport)"
method: POST
path: "/tables/{tableId}/rows/upsert-file"
tags: ["Workspace"]
---

# Upsert rows from a CSV file (same operation, CSV transport)

`POST /tables/{tableId}/rows/upsert-file`

The CSV transport for `POST /tables/{tableId}/rows/upsert`: `content`
is a base64-encoded CSV whose headers are input-column slugs (the same
keys as JSON upsert rows) with one record per data row. Identical
match/enrich semantics, identical per-`batchId` idempotency, identical
row cap — a CSV with more than **100** data rows is rejected with
`413 TOO_MANY_ROWS` (split the file or page the JSON upsert).

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `content` string, required — Base64-encoded CSV. Headers are input-column slugs.
  - `filename` string
  - `matchColumns` string[], required
  - `enrich` boolean
  - `reenrichUpdated` boolean
  - `batchId` string, uuid

## Response `200`

Idempotent replay of an existing `batchId` (same receipt shape).

- UpsertReceipt — Response of `POST /tables/{tableId}/rows/upsert` and `.../rows/upsert-file` — an `enrichment_run` reference the caller polls via `GET /enrichment-runs/{runId}`.
  - `object` 'enrichment_run', required
  - `id` string, uuid, required
  - `batchId` string, uuid, required — Legacy alias of `id`.
  - `counts` object, required
    - `inserted` integer, required
    - `updated` integer, required
    - `skipped` integer, required

## Other responses

- `201` — The upsert receipt — an `enrichment_run` reference with per-outcome counts.
- `400` — VALIDATION_ERROR — bad base64 / undecodable or empty CSV.
- `404` — TABLE_NOT_FOUND.
- `413` — TOO_MANY_ROWS — the CSV exceeds 100 data rows; details carry `{ rows, limit }`.

---

[API](https://skmtc.net/origami/apis/origami-agent-api.md) · [All operations](https://skmtc.net/origami/apis/origami-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/origami/origami-agent-api/versions/8083ad7fe081/schema)
