Getting started
Errors
Understand error responses and HTTP status codes returned by the API.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Understand error responses and HTTP status codes returned by the API.
{
"error": {
"code": "not_found",
"message": "Lead not found"
}
}
| Field | Type | Description |
|---|---|---|
error.code | string | A machine-readable error code |
error.message | string | A human-readable description of the error |
| Code | Status | Description |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | Resource successfully created |
400 | Bad Request | Invalid request body or missing required parameters |
401 | Unauthorized | Missing, invalid, or revoked API key |
403 | Forbidden | API key does not have permission for this action |
404 | Not Found | The requested resource does not exist |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Error | An unexpected error occurred on the server |
| Error Code | HTTP Status | Description |
|---|---|---|
unauthorized | 401 | Invalid or missing API key |
bad_request | 400 | Invalid request parameters |
not_found | 404 | Resource not found |
rate_limited | 429 | Rate limit exceeded |
internal | 500 | Server error |
curl -X GET "https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/leads"
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header. Use: Bearer rchd_live_xxx"
}
}
curl -X POST \
"https://kdjmltmhxvvmiuehafgl.supabase.co/functions/v1/api-gateway/v1/leads" \
-H "Authorization: Bearer rchd_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d 'invalid json'
{
"error": {
"code": "bad_request",
"message": "Invalid JSON body"
}
}
{
"error": {
"code": "not_found",
"message": "Lead not found"
}
}
error.code field programmatically rather than parsing the message string, as messages may change over time..png?fit=max&auto=format&n=PYj-p9lRwfHX4QQS&q=85&s=967f00940a17d1d8cc11bd8995dc98d0)