Start a bulk import

POSThttps://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/imports

Requires the imports:write scope. See keys and scopes.

Creates a report that every subsequent batch is stamped against, and that rollback acts on. Refused with 409 if this clinic started another import in the last 6 hours, so two concurrent migrations cannot make per-row failures unattributable or rollback ambiguous.

Try it

10 requests a minute

Kept in this tab only (sessionStorage), never saved to disk and never put in the code sample. It is sent to CuspFlow's own proxy on this domain, not to a third party.

Confirm the clinic id (optional)

Fill this in and the request is refused unless the key really belongs to that clinic. It guards against pasting the wrong key, not against an attacker: the clinic is already in the key and anyone holding it can read it from whoami.

Headers (1)
curl --request POST \
  --url 'https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/imports' \
  --header 'Authorization: Bearer '"$CUSPFLOW_API_KEY" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{ "entity": "" }'
Paste a key to run this.

Headers

Idempotency-Key
string
Replay protection. Resending the SAME key with the SAME body returns the first response instead of acting twice; the same key with a DIFFERENT body is rejected with 422. The window is 24 hours.

Body

1 required field, 1 optional.

entity
string
required
Only entities that are both writable AND rollback-supported.
source_label
string
Free text shown in the app's Import Reports tab.

Responses

201Import created. `data` carries its id.
{
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entity": "string",
    "title": "string",
    "created_at": "2026-11-05T09:30:00+03:00"
  }
}
401Missing, malformed, revoked or expired key.
403Key lacks `imports:write`, or the clinic is read-only.
409Another import was started for this clinic within the last 6 hours.
422Unsupported entity.
429Rate limited.

Every error is application/problem+json and carries a code you can branch on. The full catalogue is in error codes.