Error Handling

Complete error code reference and how to handle errors gracefully.

The IPO Guruji API uses standard HTTP status codes and returns consistent error responses with structured error codes. This page describes the error format and lists all possible error codes.

Error Response Format

All error responses follow a consistent JSON structure:

Error Response Structure400
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error description",
    "documentation": "https://docs.ipoguruji.com/errors/ERROR_CODE",
    "details": {}
  },
  "disclaimer": "Data aggregated from publicly accessible sources. Not investment advice.",
  "timestamp": "2026-02-09T14:30:00.000Z",
  "requestId": "req_abc123def456"
}
FieldTypeDescription
successbooleanAlways false for error responses
error.codestringMachine-readable error code (e.g., AUTH_001)
error.messagestringHuman-readable error description
error.documentationstringLink to relevant documentation for this error
error.detailsobject | undefinedAdditional context (e.g., validation errors, retry information)
timestampstringISO 8601 timestamp of the error
requestIdstringUnique request ID for debugging and support

HTTP Status Codes

The API uses standard HTTP status codes to indicate success or failure:

StatusNameDescription
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request parameters or body
401UnauthorizedMissing or invalid API key
403ForbiddenFeature not available on your plan
404Not FoundResource does not exist
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error
503Service UnavailableTemporary maintenance or overload

Error Codes Reference

Authentication Errors (AUTH_*)

CodeHTTPDescriptionResolution
AUTH_001401Missing or invalid API keyInclude a valid X-API-Key header with your request
AUTH_002401API key not found or revokedGenerate a new API key from your dashboard
AUTH_003401API key expiredGenerate a new API key from your dashboard
AUTH_004403Account suspendedContact support at support@ipoguruji.com

Validation Errors (VAL_*)

CodeHTTPDescriptionResolution
VAL_001400Invalid request parametersCheck the details field for specific validation errors
VAL_002400Invalid request bodyEnsure the request body matches the expected schema
VAL_003400Invalid query parameter valueCheck allowed values for the query parameter
Validation Error Example400
{
  "success": false,
  "error": {
    "code": "VAL_001",
    "message": "Invalid request parameters",
    "documentation": "https://docs.ipoguruji.com/errors/VAL_001",
    "details": {
      "validationErrors": {
        "limit": ["limit must be between 1 and 100"],
        "status": ["Invalid status value. Allowed: upcoming, open, closed, listed, withdrawn"]
      }
    }
  },
  "disclaimer": "Data aggregated from publicly accessible sources. Not investment advice.",
  "timestamp": "2026-02-09T14:30:00.000Z",
  "requestId": "req_v4l1d3r0r1"
}

Not Found Errors (NOT_*)

CodeHTTPDescriptionResolution
NOT_001404Resource not foundVerify the slug or ID exists. Use the list endpoint to find valid identifiers.
NOT_002404Endpoint not foundCheck the API endpoint URL for typos

Rate Limit Errors (RATE_*)

CodeHTTPDescriptionResolution
RATE_001429Per-minute rate limit exceededWait for the Retry-After period, then retry with exponential backoff
RATE_002429Daily quota exceededWait until the next day or upgrade your plan for a higher quota

Plan Errors (PLAN_*)

CodeHTTPDescriptionResolution
PLAN_001403Feature not available on current planUpgrade to a plan that includes this feature
PLAN_002403Webhook limit reached for your planDelete unused webhooks or upgrade your plan

Server Errors (SRV_*)

CodeHTTPDescriptionResolution
SRV_001500Internal server errorRetry the request. If the error persists, contact support with the requestId.
SRV_002503Service temporarily unavailableThe service is under maintenance. Retry after a few minutes.

Handling Errors in Code

Always check the success field and handle errors appropriately:

Error Handling Example
async function fetchIPO(slug, apiKey) {  const response = await fetch(    `https://api.ipoguruji.com/v1/ipos/${slug}`,    { headers: { 'X-API-Key': apiKey } }  );  const result = await response.json();  if (!result.success) {    const { code, message } = result.error;    switch (code) {      case 'AUTH_001':      case 'AUTH_002':        throw new Error('Authentication failed. Check your API key.');      case 'NOT_001':        return null; // Resource not found      case 'RATE_001':        // Wait and retry        const retryAfter = result.error.retryAfter || 30;        await new Promise(r => setTimeout(r, retryAfter * 1000));        return fetchIPO(slug, apiKey); // Retry      case 'PLAN_001':        throw new Error('Upgrade your plan to access this feature.');      case 'VAL_001':        console.error('Validation errors:', result.error.details);        throw new Error(`Invalid request: ${message}`);      default:        throw new Error(`API error (${code}): ${message}`);    }  }  return result.data;}

Debugging Tips

Save the requestId

Every response includes a unique requestId. Include this when contacting support for faster resolution.

Check the details field

For validation errors (VAL_*), the error.details object contains field-level error messages that indicate exactly what went wrong.

Follow the documentation link

Each error includes a documentation URL that links to specific guidance for resolving the error.