Response Structure
All Pandabase API responses follow a consistent format that includes anok field to indicate success or failure.
Success Response
When a request succeeds, the API returnsok: true along with the requested data:
Always
true for successful requestsThe requested resource or response data. The structure varies by endpoint.
Error Response
When a request fails, the API returnsok: false along with error details:
Always
false for failed requestsError messages are designed to not contain sensitive information and can be safely displayed in user interfaces.
HTTP Status Codes
The API uses standard HTTP status codes to indicate the general category of response:| Status Code | Description |
|---|---|
200 | OK - Request succeeded |
201 | Created - Resource created successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Missing or invalid authentication |
403 | Forbidden - Authenticated but lacks permission |
404 | Not Found - Resource doesn’t exist |
409 | Conflict - Request conflicts with current state |
422 | Unprocessable Entity - Validation error |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error |
503 | Service Unavailable - Temporary service interruption |
Common Error Codes
Here are some common error codes you may encounter:| Error Code | HTTP Status | Description |
|---|---|---|
invalid_request | 400 | The request was malformed or missing required parameters |
authentication_required | 401 | Valid authentication credentials are required |
invalid_api_key | 401 | The provided API key is invalid or expired |
insufficient_permissions | 403 | Your account doesn’t have permission for this action |
not_found | 404 | The requested resource doesn’t exist |
resource_already_exists | 409 | A resource with this identifier already exists |
validation_error | 422 | One or more fields failed validation |
rate_limit_exceeded | 429 | Too many requests, please slow down |
internal_error | 500 | An unexpected error occurred on our servers |
Example Responses
Successful GET Request
Successful POST Request
Validation Error
Not Found Error
Rate Limit Error
Handling Responses
Always check theok field to determine if a request succeeded:
