Skip to main content

Responses and Errors

Success Envelope

Single-resource and write responses use a standard success envelope:

{
"success": true,
"message": "Member retrieved successfully",
"data": {
"_id": "507f1f77bcf86cd799439011"
}
}

List responses include pagination metadata:

{
"success": true,
"message": "Members retrieved successfully",
"data": [],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalItems": 47,
"itemsPerPage": 10,
"hasNextPage": true,
"hasPrevPage": false
}
}

Error Envelope

{
"success": false,
"message": "Invalid API key"
}

Validation failures may include an errors array.

{
"success": false,
"message": "Validation failed",
"errors": [
{
"type": "field",
"msg": "Valid email is required",
"path": "email",
"location": "body"
}
]
}

Rate limit responses may include limit, remaining, resetTime, and retryAfter.

Common Status Codes

  • 200: Request succeeded.
  • 201: Resource created.
  • 400: Validation or bad request.
  • 401: Missing, invalid, inactive, or expired API key.
  • 403: Permission, plan, or access failure.
  • 404: Resource not found.
  • 429: Rate limit exceeded.
  • 500: Server error.

All examples in the endpoint reference show the response fields available for that endpoint.