Country

The country resource.

Basehttps://rest.carbon.ms/country
GET/country

List countrys

Retrieve a paginated list of countrys. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/country
curl --request GET \
  --url 'https://rest.carbon.ms/country?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "alpha2": "string",
    "name": "Example",
    "alpha3": "string"
  }
]
GET/country

Retrieve a country

Fetch a single country by filtering on `alpha2`.

Query parameters

alpha2string

Match on the country's `alpha2`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/country
curl --request GET \
  --url 'https://rest.carbon.ms/country?alpha2=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "alpha2": "string",
  "name": "Example",
  "alpha3": "string"
}
POST/country

Create a country

Create a new country.

Body parameters

namestringrequired
alpha3stringrequired
POSThttps://rest.carbon.ms/country
curl --request POST \
  --url https://rest.carbon.ms/country \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"name":"Example","alpha3":"string"}'
Response
{
  "alpha2": "string",
  "name": "Example",
  "alpha3": "string"
}
PATCH/country

Update a country

Update an existing country, matched on `alpha2`.

Body parameters

namestringrequired
alpha3stringrequired
PATCHhttps://rest.carbon.ms/country
curl --request PATCH \
  --url 'https://rest.carbon.ms/country?alpha2=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"name":"Example"}'
Response
{
  "alpha2": "string",
  "name": "Example",
  "alpha3": "string"
}
DELETE/country

Delete a country

Delete a country, matched on `alpha2`. Returns 204 No Content.

Query parameters

alpha2string

The `alpha2` of the country to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/country
curl --request DELETE \
  --url 'https://rest.carbon.ms/country?alpha2=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content