Back to Features
Feature

Write API

Create, update, and delete records over REST.

Your csv-api dataset is no longer read-only. Create new rows with POST, edit existing rows with PATCH, and remove rows with DELETE — all using standard REST verbs and your existing API key.

What it does

Every dataset exposes a full set of CRUD endpoints under /api/v1/datasets/:public_id/records. Issuing a POST creates a row; a PATCH on /:id updates the supplied columns; a DELETE on /:id removes the row. Type coercion happens server-side using the same column types csv-api detected at upload, so you can submit JSON values directly without worrying about strings vs. integers vs. dates. Writes are gated by API-key scope: private (sk_) keys allow writes, while public (pk_) keys stay read-only and safe to embed in client-side code.

How it works

  1. 1

    Create a writeable key

    On the Account page, mint a private API key (sk_…). Public keys (pk_…) stay read-only and safe to ship in frontend bundles.

  2. 2

    POST a JSON record

    Send a JSON object whose keys match your dataset's column names. csv-api validates types, inserts the row, and returns it with its new id.

  3. 3

    Update or delete by id

    PATCH /:id with a partial object to update columns; DELETE /:id to remove the row. Both return immediately and are reflected in subsequent reads.

See it in action

bash
# Create a new row
curl -X POST "https://csv-api.com/api/v1/datasets/d_a8f3bc91/records" \
  -H "Authorization: Bearer sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "record": { "name": "Eve", "age": 27, "city": "Austin" } }'

# → 201 Created
{ "data": { "id": 48, "name": "Eve", "age": 27, "city": "Austin" } }

# Update one field
curl -X PATCH "https://csv-api.com/api/v1/datasets/d_a8f3bc91/records/48" \
  -H "Authorization: Bearer sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "record": { "city": "Portland" } }'

# Delete it
curl -X DELETE "https://csv-api.com/api/v1/datasets/d_a8f3bc91/records/48" \
  -H "Authorization: Bearer sk_YOUR_KEY"
# → 204 No Content

Why it matters

  • Real CRUD without a backend

    Build an admin tool, a contact form, or an internal dashboard that mutates data — without standing up a server, an ORM, or a migration pipeline.

  • Safe public reads, locked-down writes

    Embed a pk_ key in your static site for reads. Keep sk_ keys server-side for writes. The same dataset, two trust levels.

  • Type-coerced and parameterized

    Inputs are bound as parameters and coerced to the dataset's column types. No SQL injection, no string-vs-int mismatches.

The problem it solves

Read-only APIs are great for prototypes, but the second you need a user to add a row or correct a typo, you're back to standing up a backend. The Write API closes that gap so a single csv-api dataset can be the durable source of truth for both reads and writes.

Common use cases

  • Internal admin tools that edit a CSV-backed dataset from a UI

  • Contact forms that append leads into a Google-Sheets-replacement table

  • Webhook receivers that record incoming events as rows

  • Test fixtures: seed and tear down rows from your CI pipeline

Try Write API for yourself

Create a free csv-api account, upload a file, and see your API live in under a minute.

We use essential cookies to keep you logged in. No tracking or analytics. Privacy policy