Skip to main content
All API errors follow a consistent format:
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description of what went wrong"
  }
}

Error code reference

CodeHTTP StatusDescription
UNAUTHORIZED401Missing or invalid authentication credentials.
FORBIDDEN403Authenticated but not allowed to perform this action.
VALIDATION_ERROR400Request body failed schema validation.
INVALID_JOB_TYPE400The requested job type does not exist or is not available on your plan.
INSUFFICIENT_CREDITS402Not enough credits to process this job.
PLAN_LIMIT403A plan-enforced limit has been reached (e.g., concurrent jobs, file size).
RATE_LIMITED429Too many requests. Retry after the indicated period.
NOT_FOUND404The requested resource does not exist.
CONFLICT409The request conflicts with the current state of the resource.
PROVIDER_ERROR502The upstream processing provider returned an error.
PROVIDER_TIMEOUT504The upstream processing provider did not respond in time.
ORG_SUSPENDED403Your organization has been suspended. Contact support.
INTERNAL_ERROR500An unexpected server error occurred. Contact support if it persists.

Handling errors

const response = await fetch("https://api.rendobar.com/transcode", {
  method: "POST",
  headers: { "Authorization": "Bearer rb_your_key", "Content-Type": "application/json" },
  body: JSON.stringify({ inputs: { source: url }, params: {} }),
});

if (!response.ok) {
  const { error } = await response.json();
  switch (error.code) {
    case "INSUFFICIENT_CREDITS":
      // Redirect to billing page or top up
      break;
    case "RATE_LIMITED":
      // Wait and retry
      break;
    case "VALIDATION_ERROR":
      // Fix the request body
      break;
    default:
      console.error(`API error: ${error.code} - ${error.message}`);
  }
}