Delete a country
Deletes the country. This is a HARD delete — GORM's Delete on models.Country removes the row, because nothing in the model chain (Country -> StrictNameModelV2 -> BaseModelV2) carries a gorm.DeletedAt. The manual previously described it as a deactivation. Answers 200 with the standard success envelope, not 204.
Authorization
bearerAuth In: header
Path Parameters
Country id.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/v1/countries/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"status": 200,
"message": "OK"
}{
"status": 404,
"message": "Country not found",
"code": "countries_m.country_not_found",
"class": "business",
"retryable": true,
"details": [
{
"field": "string",
"rule": "string",
"param": "string",
"message": "string"
}
]
}{
"status": 404,
"message": "Country not found",
"code": "countries_m.country_not_found",
"class": "business",
"retryable": true,
"details": [
{
"field": "string",
"rule": "string",
"param": "string",
"message": "string"
}
]
}{
"status": 404,
"message": "Country not found",
"code": "countries_m.country_not_found",
"class": "business",
"retryable": true,
"details": [
{
"field": "string",
"rule": "string",
"param": "string",
"message": "string"
}
]
}{
"status": 404,
"message": "Country not found",
"code": "countries_m.country_not_found",
"class": "business",
"retryable": true,
"details": [
{
"field": "string",
"rule": "string",
"param": "string",
"message": "string"
}
]
}{
"status": 429,
"message": "rate limit exceeded",
"code": "rate_limits_m.exceeded",
"class": "temporary",
"retryable": true
}{
"status": 404,
"message": "Country not found",
"code": "countries_m.country_not_found",
"class": "business",
"retryable": true,
"details": [
{
"field": "string",
"rule": "string",
"param": "string",
"message": "string"
}
]
}{
"overall_status": "unhealthy",
"message": "Service is shutting down",
"timestamp": "2026-08-27T15:04:05.123456789+02:00"
}Updates a country. The ISO codes are not writable. The body is MERGED onto the stored row and which fields survive omission depends on their type — strings and pointers are retained, while tags, metadata, order and active are overwritten with their zero values. See UpdateCountryInput.
Returns countries in the standard paginated envelope through the shared query parser. Filterable and sortable fields: id, iso_alpha_2, iso_alpha_3, iso_numeric, icon, emoji, phone_prefix, order, iban_length, name, description, tags, created_at, created_by, modified_at, modified_by, active. Free-text search covers iso_alpha_2, iso_alpha_3, iso_numeric, icon, emoji, phone_prefix, name and description. Two fields are deliberately NOT listed. metadata is not in validFieldsV2 at all, so querying it answers 500 query_m.invalid_search_field — NOT a 400, and not query_m.invalid_field. validateFieldName builds MsgInvalidSearchField with no WithCode, and an empty Code sends HandleAppErrorWithCode to 500. Do not confuse it with query_m.invalid_field: that one has two unrelated sources, both answering 400 — validateFieldName raises it when the name fails the character regex, and the stack parser raises it for an unknown stack field. An unknown SORT field is query_m.invalid_sort_field, 400. icon_url IS in validFieldsV2 but has no column behind it (models.Country marks it gorm:"-"), so filtering or sorting on it builds SQL referencing a column that does not exist and returns 500 — a pre-existing defect in validFieldsV2, not something to rely on. Sorting on it is subject to the same data-pass caveat as any other sort key: see the sort parameter. NO RECORD-LEVEL PERMISSION FILTER APPLIES. The service passes UserID: uuid.Nil (its own comment calls this a guest route), and the shared getAll path short-circuits on uuid.Nil before the permitted-records lookup, merging a nil scope. So any caller with a valid token receives every row and unfiltered total/total_unfiltered counts, regardless of record grants. RbacRecordType is passed but unused on this path. The v1 list has no record scoping either.