Docs

REST Endpoint

1 min readUpdated October 19, 2026

Check and format one phone number over the WordPress REST API, from your own JavaScript or from another app.

GET  /wp-json/smart-phone-field/v1/check?phone=07400123456&country=gb
POST /wp-json/smart-phone-field/v1/check

Parameters#

ParameterRequiredNotes
phoneYesThe number to check. Up to 40 characters.
countryNoTwo-letter country code, for numbers typed without a country code.

Response#

{
  "phone": "07400123456",
  "country": "gb",
  "valid": true,
  "international": "+447400123456",
  "readable": "+44 7400 123456",
  "message": ""
}

When the number isn’t valid, valid is false and message explains why, in the site’s language. An empty phone returns a 400 error.

Privacy and access#

The endpoint only checks the number it’s given and stores nothing. It’s public by default.

// Turn it off.
add_filter( 'nahnu_spf_rest_enabled', '__return_false' );

// Only logged-in users.
add_filter( 'nahnu_spf_rest_permission', 'is_user_logged_in' );

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only