Roll back an import
https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/imports/{id}/rollbackRequires the imports:rollback scope. See keys and scopes.
Deletes rows this import created, within 7 days. Rows that anything now references, or that have been edited since, are SKIPPED rather than deleted, and counted in `skipped`. Requires a key bound to an Administrator.
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.
Path parameters
Headers (1)
curl --request POST \
--url 'https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/imports/{id}/rollback' \
--header 'Authorization: Bearer '"$CUSPFLOW_API_KEY" \
--header 'Accept: application/json'Path parameters
idstring<uuid> required | The import report id returned by POST /v1/imports. |
Headers
Idempotency-Keystring | 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. |
Responses
{
"data": {
"deleted": 0,
"skipped": 0
}
}401 | Missing, malformed, revoked or expired key. |
403 | Key lacks `imports:rollback`, or the clinic is read-only. |
404 | No such import report in this clinic. |
409 | The 7-day rollback window has passed. |
429 | Rate limited. |
Every error is application/problem+json and carries a code you can branch on. The full catalogue is in error codes.
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.
Path parameters
Headers (1)
curl --request POST \
--url 'https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/imports/{id}/rollback' \
--header 'Authorization: Bearer '"$CUSPFLOW_API_KEY" \
--header 'Accept: application/json'