The 7en Platform API uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success, codes in the 4xx range indicate client-side errors (e.g., missing parameters or invalid requests), and codes in the 5xx range indicate server-side errors (these are rare).
Some 4xx errors include specific error codes that can be handled programmatically, providing details about the issue encountered.
| Error Code | What It Means |
|---|---|
agent_validation_error | Agent not found, not accessible, or invalid |
knowledge_source_validation_error | Knowledge source not found or invalid |
user_validation_error | User input or data is invalid |
authentication_required | Authentication is required or API key missing |
insufficient_permissions | User lacks required permissions |
throttle_exceeded | Too many requests (rate limit exceeded) |
object_not_found | Object not found in the database |
api_key_duplicate | Duplicate API key for the team |
malformed_api_key | API key header is malformed |
inactive_api_key | API key is invalid or inactive |
team_required | User must belong to a team |
stringA human-readable message code. Refer to the error types table for details. Example: "authentication_required"
stringA human-readable message providing details about the error. Example: "Authentication failed."
numberThe HTTP status code associated with the error. Refer to HTTP status code summary for possible values. Example: 401
objectAdditional details about the error, often an array of field-specific error messages. Example: []
code field in the error response to handle specific errors programmatically. For example, handle authentication_required by prompting the user to re-authenticate or verify the API key.fields object to identify and display specific validation errors to users, such as duplicate emails or invalid inputs, to improve user experience.throttle_exceeded errors and implement exponential backoff or retry logic to respect rate limits (e.g., 100 requests/min for free tier, 1000 for pro, 10000 for enterprise).5xx server errors, implement fallback mechanisms or retry logic with a reasonable delay to handle temporary server issues.code, message, and status for debugging and monitoring. This helps identify recurring issues like object_not_found or insufficient_permissions.user_validation_error into a clear message like "This email is already in use" for better usability.malformed_api_key or inactive_api_key errors, ensure API keys are securely stored and refreshed as needed via the dashboard settings at https://app.7en.ai/settings.agent_validation_error or team_required during development to ensure your application handles them robustly.Start building intelligent AI agents to engage with customers.