Skip to main content

Country

Standardized country codes and names following ISO 3166-1 alpha-2 standard for international country identification.

The ref_country Object

Country collection stores standardized country codes and their corresponding full names for international identification and localization.

Field NameTypeDescription
codestringPrimary key. ISO 3166-1 alpha-2 country code (e.g., "US", "GB", "DE").
user_createdobjectUser who created the country record. Read-only. Links to directus_users.
date_createddatetimeTimestamp in ISO 8601 when the country record was created. Read-only.
user_updatedobjectUser who last updated the country record. Read-only. Links to directus_users.
date_updateddatetimeTimestamp in ISO 8601 when the country record was last updated. Read-only.
country_namestringFull official country name.

List Countries

List existing countries.

GET /items/ref_country

Query Parameters

Supports all global query parameters.

Returns

An array of up to limit country objects. If no items are available, data will be an empty array.


Retrieve a Country

Retrieve a specific country by code.

GET /items/ref_country/:code

Returns

Returns a country object if a valid country code was provided.


Create a Country

Create a new country.

POST /items/ref_country

{
"code": "XX",
"country_name": "Example Country"
}

Query Parameters

Supports all global query parameters.

Request Body

A partial country object.

Returns

Returns the country object for the created country.


Update a Country

Update an existing country.

PATCH /items/ref_country/:code

{
"country_name": "Updated Country Name"
}

Query Parameters

Supports all global query parameters.

Request Body

A partial country object.

Returns

Returns the country object for the updated country.


Delete a Country

Delete an existing country.

DELETE /items/ref_country/:code

Returns

Empty body.


Sample Data

CodeCountry Name
ADAndorra
AEUnited Arab Emirates
AFAfghanistan
AGAntigua and Barbuda
AIAnguilla