Wahlu API

Errors

Error response format and all error codes explained.

Error response format

When something goes wrong, the API returns a JSON error response with a consistent structure:

Error response
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Missing required field: name"
  }
}
ParameterTypeDescription
success*booleanAlways false for error responses.
error.code*stringA machine-readable error code. See the table below.
error.message*stringA human-readable description of the error.

Error codes

ParameterTypeDescription
UNAUTHORIZED401Missing or invalid API key. Check the Authorization header.
FORBIDDEN403The API key doesn't have the required scope, or the brand is restricted.
NOT_FOUND404The requested resource doesn't exist, or you don't have access to it.
VALIDATION_ERROR400The request body or query parameters failed validation.
RATE_LIMITED429You've exceeded the rate limit. Wait for the Retry-After duration and try again.
PLAN_LIMIT_EXCEEDED403Your current plan doesn't allow this action (e.g. you've reached the maximum number of brands or scheduled posts).
INTERNAL_ERROR500Something went wrong on our end. If this persists, contact support.

Handling errors

JavaScript
const response = await fetch("https://api.wahlu.com/v1/brands", {
  headers: {
    Authorization: "Bearer wahlu_live_your_api_key_here",
  },
});

if (!response.ok) {
  const body = await response.json();
  console.error(`API error: ${body.error.code} — ${body.error.message}`);

  if (response.status === 429) {
    const retryAfter = response.headers.get("Retry-After");
    console.log(`Retry after ${retryAfter} seconds`);
  }
  return;
}

const { data } = await response.json();