Error Codes

All DomeAgent API errors follow a consistent format. When a request fails, the response body contains an error object with a machine-readable code and a human-readable message.

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters."
  },
  "meta": {
    "request_id": "req_abc123",
    "timestamp": "2026-01-15T10:30:00.000Z"
  }
}

Error Code Reference

CodeHTTPDescription
VALIDATION_ERROR400The request body or query parameters are invalid. Check the message field for details on which parameter failed validation.
INVALID_URL400A URL provided in the request (e.g. image_url) is not a valid HTTP/HTTPS URL.
UNAUTHORIZED401The request is missing a valid API key, or the provided key is invalid or expired. Include your key in the X-API-Key header.
FORBIDDEN403Your API key is valid but you don't have permission to perform this action.
FEATURE_DISABLED403The requested feature is not enabled for your organization. Contact support to enable it.
INSUFFICIENT_QUOTA403Your organization has exceeded its usage quota for the current billing period.
JOB_NOT_FOUND404The requested job ID does not exist or does not belong to your organization.
JOB_IN_PROGRESS409A job of this type is already in progress. Wait for it to complete before submitting a new one.
RATE_LIMITED429You've exceeded the rate limit. Back off and retry after a short delay.
INTERNAL_ERROR500An unexpected error occurred on the server. If this persists, contact support.

Handling Errors

Use the code field for programmatic error handling rather than parsing the message string:

const response = await fetch(
  "https://api.domeagent.com.au/v1/drone-footage/generate",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": "dome_live_your_key_here",
    },
    body: JSON.stringify({ address: "123 Collins St, Melbourne VIC 3000" }),
  },
);

if (!response.ok) {
  const { error, meta } = await response.json();

  switch (error.code) {
    case "UNAUTHORIZED":
      // Re-authenticate or check API key
      break;
    case "INSUFFICIENT_QUOTA":
      // Notify user about quota limits
      break;
    case "JOB_IN_PROGRESS":
      // Wait and retry, or poll the existing job
      break;
    case "RATE_LIMITED":
      // Implement exponential backoff
      break;
    case "VALIDATION_ERROR":
      // Fix request parameters based on error.message
      break;
    default:
      console.error(
        `API error [${error.code}]: ${error.message} (request: ${meta.request_id})`,
      );
  }
}

Support

If you encounter persistent INTERNAL_ERROR responses, contact support@domeagent.com.au with the request_id from the error response meta object.