Schemas · Delete
Delete a schema via API
Endpoint
https://www.claix.dev/api/delete-schemaDeletes a schema from the API key account. Only schemas you own are removed: if the UUID is missing or belongs to another account, the response is 404 without revealing whether it exists.
Always call https://www.claix.dev/api/delete-schema. Do not use the internal Supabase URL (https://yuhcusjiywsuzjwirarw.supabase.co/functions/v1/delete-schema).
The operation is irreversible. It is not billed (no usage_logs row).
1. Authentication
Every request must include your API key. It is a personal server credential, distinct from any session token.
Option A — Dedicated header (recommended):
x-api-key: <YOUR_API_KEY>
Option B — Standard Authorization header:
Authorization: Bearer <YOUR_API_KEY>
Either one is sufficient. If you send both, x-api-key takes priority.
The system checks that the key exists, is active, and the account is not suspended. Failure returns 401.
2. Request format
Method: POST (DELETE is also accepted) · Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
| schema_id | uuid | Yes | Schema to delete. id is also accepted, or ?schema_id= as a query param. |
{ "schema_id": "b980cfe7-61ef-4a5a-9724-881c8a5541e2" }3. How to build the call
- Get the
idfromGET /api/schemas. - Send a JSON POST to
https://www.claix.dev/api/delete-schema. - Add the authentication header and schema_id.
- Check the HTTP status: only 200 means it was deleted.
4. Request examples
Use the panel on the right for cURL, JavaScript, Node.js, Python, PHP, and n8n examples.
5. Successful response
200 OK · Content-Type: application/json
{
"success": true,
"deleted": true,
"id": "b980cfe7-61ef-4a5a-9724-881c8a5541e2"
}| Field | Type | Description |
|---|---|---|
| success | boolean | Always true when HTTP is 200. |
| deleted | boolean | Confirms the schema was removed. |
| id | uuid | UUID of the deleted schema. |
6. Error codes
{
"error": "Descripción legible del problema.",
"detalle": "Información técnica adicional (solo presente en algunos casos)."
}400 — Missing schema_id or not a valid UUID.
401 — Authentication failed: missing, unknown, or disabled key, or suspended account.
404 — The schema does not exist or does not belong to your account.
405 — Method other than POST or DELETE. · 500 — Internal error.
7. Status code summary
| Code | Category | Retry? |
|---|---|---|
| 200 | Success | — |
| 400 | Client error (malformed data) | No — fix the request first |
| 401 | Authentication error | No — fix credentials first |
| 404 | Resource not found | No — fix schema_id first |
| 405 | Incorrect HTTP method | No — fix the method first |
| 500 | Internal server error | Yes, with caution |
8. Best practices
- Use
https://www.claix.dev/api/delete-schema, never the Supabase URL. - Deletion is permanent; confirm the UUID before calling.
- A 404 does not distinguish “missing” from “not yours”, on purpose.
- Never put your API key in frontend code or public repos.