Wilayah Indonesia

Reference

Error codes

Failed requests return "success": false and an error object. Branch on error.code: it is stable. message and hint are for people, detail names the exact value, and fields lists each invalid parameter.

CodeHTTPWhen it happensWhat to do
INVALID_REGION_CODE 422 A code has the wrong number of digits for the level it is used at. Use 2 digits for a province, 4 for a regency, 6 for a district, or 10 for a village.
VALIDATION_FAILED 422 A path or query parameter is not a number, or is outside its allowed range. Fix the invalid request parameters and try again. See fields for details.
REGION_NOT_FOUND 404 The code is well formed but no region in the dataset uses it. Verify the region code using GET /api/0 for valid province codes.
PROVINCE_NOT_FOUND 404 No province uses the given province code. Verify the province code with GET /api/0.
REGENCY_NOT_FOUND 404 No regency or city with that code exists under the given province. Check that the regency belongs to the given province.
DISTRICT_NOT_FOUND 404 No district with that code exists under the given regency or city. Check that the district belongs to the given regency.
VILLAGE_NOT_FOUND 404 No village with that code exists under the given district. Check that the village belongs to the given district.
RESOURCE_NOT_FOUND 404 The path does not match any endpoint. Verify the request path. GET /api/ lists every endpoint.
METHOD_NOT_ALLOWED 405 The endpoint exists but only answers GET requests. This API is read-only. Use GET.
INTERNAL_ERROR 500 Something failed on the server. Retrying is safe; every endpoint is read-only. Please try again. If the issue persists, contact support.