Errors

Errors

Forge uses conventional HTTP status codes and a consistent error envelope. Any non-2xx response has this shape:

{
  "status": "error",
  "error": {
    "code": "string",
    "message": "human-readable description",
    "doc_url": "https://forge-api.dev/docs/..."
  }
}

Always branch on error.code in your application logic, not on error.message, which is meant for humans and may be reworded over time.

Error codes

HTTP statusCodeDescription
400invalid_paramsA parameter was missing or malformed — for example an out-of-range lat/lon, an unrecognized units value, or days outside 1–7.
401missing_api_keyNo Authorization header was provided.
401invalid_api_keyThe key was provided but is malformed, unknown, or revoked.
404not_foundThe requested resource doesn't exist — typically an unrecognized city name passed to city.
429rate_limitedYou've exceeded your plan's per-minute rate limit. See rate limits.
500internal_errorAn unexpected error occurred on Forge's side. Safe to retry with backoff.

Example bodies

Invalid parameter, such as a latitude outside -90..90:

{
  "status": "error",
  "error": {
    "code": "invalid_params",
    "message": "lat must be between -90 and 90",
    "doc_url": "https://forge-api.dev/docs/api/weather"
  }
}

Unknown city name:

{
  "status": "error",
  "error": {
    "code": "not_found",
    "message": "No location found matching 'atlantsi'",
    "doc_url": "https://forge-api.dev/docs/api/weather"
  }
}

Missing key:

{
  "status": "error",
  "error": {
    "code": "missing_api_key",
    "message": "No API key provided. Pass your key in the Authorization header: Bearer fg_live_...",
    "doc_url": "https://forge-api.dev/docs/authentication"
  }
}

Handling errors defensively

Next steps

See rate limits for details on the 429 response, or the weather and geocode references for endpoint-specific parameter constraints.