Soft-delete a treatment plan
https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/treatment_plans/{id}Requires the treatment:write scope. See keys and scopes.
Sets `deleted_at`. There is no hard delete in this API: the row stays restorable from Trash in the app.
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 (2)
curl --request DELETE \
--url 'https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/treatment_plans/{id}' \
--header 'Authorization: Bearer '"$CUSPFLOW_API_KEY" \
--header 'Accept: application/json'Path parameters
idstring<uuid> required | — |
Headers
If-Matchstring | The ETag from a previous GET. The write then applies only if nothing changed in between, otherwise 412. Not supported on resources with no updated_at column. |
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
400 | Body is not JSON, or names a field that cannot be patched. See `errors[]`. `appointments.status` and `treatment_plans.status` report `create_only` here. |
401 | Missing, malformed, revoked or expired key. |
403 | Key lacks `treatment:write`, or the clinic is read-only. |
404 | No such row in this clinic. Also returned for another clinic's row. |
412 | If-Match did not match, or the row changed between read and write. |
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 (2)
curl --request DELETE \
--url 'https://zwhwryofdsgmzgqbcghl.supabase.co/functions/v1/api/v1/treatment_plans/{id}' \
--header 'Authorization: Bearer '"$CUSPFLOW_API_KEY" \
--header 'Accept: application/json'