Skip to main content

Error Codes

All API errors follow a consistent JSON structure:

{
"error": "error_code",
"message": "A human-readable description of the error",
"request_id": "req_abc123"
}

HTTP status codes

StatusMeaning
200Success
400Bad request — check your request body
401Unauthorized — invalid or missing API key
403Forbidden — your plan does not support this action
404Not found — the resource does not exist
429Too many requests — you have hit the rate limit
500Internal server error — something went wrong on our end

Common error codes

CodeDescription
unauthorizedAPI key is missing or invalid
invalid_requestRequired fields are missing or malformed
agent_not_foundThe specified agent_id does not exist
conversation_closedThe conversation has already ended
rate_limit_exceededToo many requests — slow down and retry
internal_errorUnexpected server error — contact support if it persists

Handling errors

const response = await fetch('https://api.netomi.com/v1/conversations', {
method: 'POST',
headers: { Authorization: `Bearer ${API_KEY}` },
body: JSON.stringify({ agent_id, message, user_id })
});

if (!response.ok) {
const error = await response.json();
console.error(`Error ${response.status}: ${error.message}`);
}

Was this page helpful?