CPCCambodiaPostalCode Dev
API ReferencePricing
Sign inGet started
CPCCambodiaPostalCode Dev

REST API for Cambodia address data — provinces, districts, communes, and villages. Free to start, no credit card required.

GitHubTwitter / X
Free API — no credit card required

Docs

  • Introduction
  • Quick Start
  • API Reference
  • Authentication
  • Error Codes
  • Rate Limits

Product

  • Pricing
  • Use Cases
  • Dashboard
  • API Keys
  • Changelog
  • Status

Community

  • GitHub
  • Blog
  • Changelog
  • Discussions
  • Contact

Company

  • About
  • Privacy Policy
  • Terms of Service

© 2026 CambodiaPostalCode Dev. Built for developers.

PrivacyTermsContactChangelogGitHub
CPCCambodiaPostalCode Dev
API ReferencePricing
Sign inGet started
CPCCambodiaPostalCode Dev

REST API for Cambodia address data — provinces, districts, communes, and villages. Free to start, no credit card required.

GitHubTwitter / X
Free API — no credit card required

Docs

  • Introduction
  • Quick Start
  • API Reference
  • Authentication
  • Error Codes
  • Rate Limits

Product

  • Pricing
  • Use Cases
  • Dashboard
  • API Keys
  • Changelog
  • Status

Community

  • GitHub
  • Blog
  • Changelog
  • Discussions
  • Contact

Company

  • About
  • Privacy Policy
  • Terms of Service

© 2026 CambodiaPostalCode Dev. Built for developers.

PrivacyTermsContactChangelogGitHub
CambodiaPostalCode Dev
CambodiaPostalCode Dev
DocsAPI ReferenceHomeIntroduction
API ReferenceGet all provinces GETGet province by ID GETGet districts by province GETGet district by ID GETGet communes by district GETGet commune by ID GETGet villages by commune GETGet village by ID GETSearch administrative units GETLookup postal code GET
Error HandlingRate LimitsSDKs & Libraries
CambodiaPostalCode Dev
CambodiaPostalCode Dev
DocsAPI ReferenceHomeIntroduction
API ReferenceGet all provinces GETGet province by ID GETGet districts by province GETGet district by ID GETGet communes by district GETGet commune by ID GETGet villages by commune GETGet village by ID GETSearch administrative units GETLookup postal code GET
Error HandlingRate LimitsSDKs & Libraries
Resources

Error Handling

Understand API error responses and status codes

Error Format

All errors follow a consistent JSON format with a statusCode field, an error object containing a machine-readable code and a human-readable message, and a metadata object with a correlationId for tracing:

{
  "statusCode": 404,
  "error": {
    "code": "NOT_FOUND",
    "message": "Postal code not found",
    "details": {}
  },
  "metadata": {
    "correlationId": "01a0642a-f300-765d-abd3-aac300a772e8"
  }
}

The correlationId in metadata is a UUIDv7 that uniquely identifies the request across all services. Include it when contacting support — it lets us trace the exact request path through logs.

HTTP Status Codes

CodeDescription
200Success
400Bad Request — invalid parameters
401Unauthorized — missing or invalid API key
404Not Found — resource doesn't exist
429Too Many Requests — rate limit exceeded
500Internal Server Error

Common Errors

401 Unauthorized

Your API key is missing, invalid, revoked, or expired. Send the key in the x-api-key header.

{
  "statusCode": 401,
  "error": {
    "code": "TOSKEY_API_KEY_MISSING",
    "message": "API key is required. Provide it via the x-api-key or Authorization header."
  },
  "metadata": {
    "correlationId": "01a0642b-17f8-788f-8536-ae8d7d32eef3"
  }
}

The API is fronted by the TosKey gateway. Depending on the project's error-code namespace, auth failures appear either with a TOSKEY_ prefix (TOSKEY_API_KEY_MISSING, TOSKEY_API_KEY_INVALID) or unprefixed (API_KEY_MISSING, API_KEY_INVALID) — the two spellings are equivalent. A missing key produces *_API_KEY_MISSING; a supplied key that cannot be authenticated produces *_API_KEY_INVALID.

A supplied key that is invalid, revoked, expired, or unknown is intentionally indistinguishable — all of them produce the same *_API_KEY_INVALID response. Check that the key is correct and active on your dashboard rather than probing for a more specific reason.

400 Bad Request

The request failed validation. The error.models field lists which parameter failed and why:

{
  "statusCode": 400,
  "error": {
    "message": "Validation failed",
    "code": "VALIDATION_FAILED",
    "models": {
      "_": "Invalid input: expected string, received undefined"
    }
  },
  "metadata": {
    "correlationId": "01a0642a-f300-765d-abd3-aac300a772e8"
  }
}

404 Not Found

The requested resource (province, district, commune, or village) doesn't exist with the given ID or postal code.

429 Too Many Requests

You've exceeded your rate limit. See Rate Limits for details.

Lookup postal code GET

Previous Page

Rate Limits

API rate limiting and quota information

Resources

Error Handling

Understand API error responses and status codes

Error Format

All errors follow a consistent JSON format with a statusCode field, an error object containing a machine-readable code and a human-readable message, and a metadata object with a correlationId for tracing:

{
  "statusCode": 404,
  "error": {
    "code": "NOT_FOUND",
    "message": "Postal code not found",
    "details": {}
  },
  "metadata": {
    "correlationId": "01a0642a-f300-765d-abd3-aac300a772e8"
  }
}

The correlationId in metadata is a UUIDv7 that uniquely identifies the request across all services. Include it when contacting support — it lets us trace the exact request path through logs.

HTTP Status Codes

CodeDescription
200Success
400Bad Request — invalid parameters
401Unauthorized — missing or invalid API key
404Not Found — resource doesn't exist
429Too Many Requests — rate limit exceeded
500Internal Server Error

Common Errors

401 Unauthorized

Your API key is missing, invalid, revoked, or expired. Send the key in the x-api-key header.

{
  "statusCode": 401,
  "error": {
    "code": "TOSKEY_API_KEY_MISSING",
    "message": "API key is required. Provide it via the x-api-key or Authorization header."
  },
  "metadata": {
    "correlationId": "01a0642b-17f8-788f-8536-ae8d7d32eef3"
  }
}

The API is fronted by the TosKey gateway. Depending on the project's error-code namespace, auth failures appear either with a TOSKEY_ prefix (TOSKEY_API_KEY_MISSING, TOSKEY_API_KEY_INVALID) or unprefixed (API_KEY_MISSING, API_KEY_INVALID) — the two spellings are equivalent. A missing key produces *_API_KEY_MISSING; a supplied key that cannot be authenticated produces *_API_KEY_INVALID.

A supplied key that is invalid, revoked, expired, or unknown is intentionally indistinguishable — all of them produce the same *_API_KEY_INVALID response. Check that the key is correct and active on your dashboard rather than probing for a more specific reason.

400 Bad Request

The request failed validation. The error.models field lists which parameter failed and why:

{
  "statusCode": 400,
  "error": {
    "message": "Validation failed",
    "code": "VALIDATION_FAILED",
    "models": {
      "_": "Invalid input: expected string, received undefined"
    }
  },
  "metadata": {
    "correlationId": "01a0642a-f300-765d-abd3-aac300a772e8"
  }
}

404 Not Found

The requested resource (province, district, commune, or village) doesn't exist with the given ID or postal code.

429 Too Many Requests

You've exceeded your rate limit. See Rate Limits for details.

Lookup postal code GET

Previous Page

Rate Limits

API rate limiting and quota information