Skip to content

Get Countries

GET/web/v1/system/constants/countries None

Description

Returns a list of all supported countries with ISO standard codes and phone codes. The response is localized based on the Accept-Language request header. This endpoint returns approximately 180+ countries and the response is cached for 24 hours due to its large payload size (50-80KB). The UNKNOWN value is excluded from the results.

Request Headers

The following headers must be provided by the caller (frontend / SDK). Other gateway headers (Cloudflare edge, Nginx reverse proxy) are injected automatically by infrastructure and are documented in Required Headers.

HeaderRequiredDescription
X-Workspace-IdOPTIONALWorkspace context for workspace-scoped APIs.
X-Client-HashYESDevice fingerprint hash (browser: FingerprintJS visitorId).
X-LOCALEYESApplication locale (e.g., en-US, zh-Hans).
User-AgentYESClient user-agent.
Accept-LanguageYESLanguage preference per RFC 7231.
X-Request-IdYESPer-request correlation (UUID v4). Frontend SHOULD provide; Nginx auto-generates if absent.

Request Parameters

None — this endpoint accepts no request body or query parameters.

Success Response

Success 200
{
  "version": "2.0.0",
  "timestamp": 1775552585763,
  "success": true,
  "code": "2000",
  "message": "Success",
  "data": [
    {
      "code": "CN",
      "value": 95010301,
      "label": "China",
      "alpha2Code": "CN",
      "alpha3Code": "CHN",
      "numericCode": 156,
      "phoneCode": "86"
    },
    {
      "code": "JP",
      "value": 95010302,
      "label": "Japan",
      "alpha2Code": "JP",
      "alpha3Code": "JPN",
      "numericCode": 392,
      "phoneCode": "81"
    }
  ]
}

Response Fields

FieldTypeExample
codestring"CN"
valueinteger95010301
labelstring"China"
alpha2Codestring"CN"
alpha3Codestring"CHN"
numericCodeinteger156
phoneCodestring"86"

Error Responses

All error responses follow the standard envelope format:

json
{
  "version": "2.0.0",
  "timestamp": 1775551826706,
  "success": false,
  "code": "DOMAIN.ERROR_CODE",
  "message": "Human-readable error description",
  "data": null
}

Common HTTP status codes:

StatusMeaning
400Request validation failed (missing field, wrong type, invalid format)
401Authentication required or token expired
403Gateway denied the request (portal access code, IP block, MFA required, etc.)
404Resource not found
429Rate limit exceeded
500Unexpected server error

SlaunchX Internal Documentation