Skip to content
View as Markdown

GET Contacts By Country​

GET
/reports/contacts-by-country

Contact counts grouped by country, highest first.

Country values are normalised in SQL with UPPER(TRIM(...)) before grouping, so casing and stray whitespace do not split a country across rows. Contacts with a null or blank country are excluded, which means the counts here will not add up to the site's total contact count.

Note that country_code reflects whatever is stored on the contact record — it is not validated against ISO 3166, so a site that stores full country names will see those instead of two-letter codes.

Takes no parameters and is not paginated.

Required capability: fcrm_view_dashboard

Enforced by ReportPolicy::verifyRequest(), the policy default for this route group.

Authorizations​

ApplicationPasswords

WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password

Type
API Key (header: Authorization)

Responses​

Counts per country, descending.

application/json
JSON
{
"countries": [
{
"country_code": "string",
"contact_count": 0
}
]
}

Playground​

Authorization

Samples​

Powered by VitePress OpenAPI