Error response format
API errors use application/problem+json. The HTTP status gives the broad failure type, while the code field is intended for stable programmatic handling.
{
"type": "https://api.pincodeapi.in/problems/pincode-not-found",
"title": "PIN code not found",
"status": 404,
"detail": "No postal record was found for the requested PIN code.",
"instance": "/api/v1/pincode/999999",
"code": "PINCODE_NOT_FOUND",
"request_id": "example-request-id"
}Use the HTTP status or stable code rather than matching the wording of title or detail.
| HTTP | Error code | What to do |
|---|---|---|
| 400 | INVALID_PINCODE | Correct the PIN format before trying again. |
| 404 | PINCODE_NOT_FOUND | Check the PIN. Do not retry the same unchanged request repeatedly. |
| 400 | INVALID_QUERY | Correct the search query. |
| 405 | METHOD_NOT_ALLOWED | Use the documented GET method. |
| 429 | RATE_LIMITED | Wait before sending more requests and follow Retry-After when supplied. |
| 404 | ENDPOINT_NOT_FOUND | Check the /api/v1 base URL and endpoint path. |
| 500 | INTERNAL_ERROR | Use a small, bounded retry strategy. |
| 503 | SERVICE_UNAVAILABLE | Try again later with backoff. |