API ReferenceReference Data
Countries
List all countries or retrieve a single country by ID
GET /api/v1/countries
Returns all active countries with ISO 3166 codes and dialing prefixes.
Request
curl https://api.octopuscards.io/api/v1/countries \
-H "Authorization: Bearer <token>"No query parameters.
Response
[
{
"id": 1,
"name": "United States",
"official_name": "United States of America",
"alpha_2": "US",
"alpha_3": "USA",
"numeric_code": "840",
"dialing_prefix": "+1"
}
]Response Fields
| Key | Type | Description |
|---|---|---|
id | integer | Unique country identifier |
name | string | Common country name |
official_name | string | Official country name |
alpha_2 | string | ISO 3166-1 alpha-2 code (2 characters, e.g. US) |
alpha_3 | string | ISO 3166-1 alpha-3 code (3 characters, e.g. USA) |
numeric_code | string | ISO 3166-1 numeric code (e.g. 840) |
dialing_prefix | string | International dialing prefix (e.g. +1) |
Errors
GET /api/v1/countries/:id
Returns a single country by its ID.
Request
curl https://api.octopuscards.io/api/v1/countries/1 \
-H "Authorization: Bearer <token>"Request Parameters
| Key | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Country ID (path parameter). Must be between 1 and 2,147,483,647. |
Response
{
"id": 1,
"name": "United States",
"official_name": "United States of America",
"alpha_2": "US",
"alpha_3": "USA",
"numeric_code": "840",
"dialing_prefix": "+1"
}Response fields are identical to the list endpoint above.
Errors
400 Bad Request - ID is not a valid integer or out of range.
{
"error": {
"name": "BadRequestError",
"code": "BAD_REQUEST",
"message": "Invalid country ID"
}
}