Errors
All error responses follow a consistent shape:
json
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}Always check the success field before accessing data.
Error codes
These are the only error codes the API returns:
| Status | Code | When |
|---|---|---|
400 | BAD_REQUEST | Missing or invalid parameters — e.g. no q on search, no file on upload, empty creator name, or storage quota exceeded |
401 | UNAUTHORIZED | Missing, malformed, or unknown API key |
404 | NOT_FOUND | Resource doesn't exist in your workspace |
500 | INTERNAL_SERVER_ERROR | Unexpected server failure — safe to retry |
Handling errors
A robust integration should:
- Check
response.success === truebefore usingresponse.data - Handle
401by verifying your API key (Settings → API Keys) - Fix the request on
400/404— retrying won't help - Retry
500errors with backoff, then contact support if they persist
Example error handling
typescript
const res = await fetch('https://findclix.com/api/v1/media/search?q=hello', {
headers: { 'Authorization': `Bearer ${apiKey}` }
})
const json = await res.json()
if (!json.success) {
console.error(`API error: ${json.error.code} — ${json.error.message}`)
return
}
// Use json.data safely
for (const clip of json.data) {
console.log(clip.filename, clip.score)
}