Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Identity Match


Identity Match compares user-supplied data against authoritative sources, such as name, address, and date of birth. To help determine how closely the user's identity aligns with the information stored by these sources, Identity Match returns match levels and an overall summary score.


Coverage

coverage page anchor

You can use Identity Match for phone numbers in the following countries.

(information)

Some countries require carrier approvals

Identity Match for phone numbers in the United States and Brazil doesn't require carrier registration and approval. Phone numbers from Canada, France, Germany, Italy, Netherlands, Spain, and United Kingdom require additional carrier registration and approval(link takes you to an external page). After you register with the carrier and get approval, Twilio bills all successful queries to your account. Twilio charges Lookup customers for all successful 200 OK responses. If your API response contains "error_code": null, you get billed for that particular query.

To learn more about pricing and discount information, contact Sales(link takes you to an external page).


Attempt to match an identity

attempt-to-match-an-identity page anchor

Make a GET /v2/PhoneNumbers/{PhoneNumber} request with the following as query parameters:

  • Fields=identity_match
  • User-provided information. For example, FirstName=John.
Identity Match LookupLink to code sample: Identity Match Lookup
1
curl -X GET "https://lookups.twilio.com/v2/PhoneNumbers/%2B14159929960?Fields=identity_match&FirstName=John" \
2
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

For detailed implementation examples, see Code examples and responses.


Provide the user-provided information as query parameters. Identity Match will provide match levels for how the given parameters compare against authoritative phone-based data sources.

Most parameters are optional for phone numbers in most countries. Some countries have specific requirements.

Query parameterDescriptionMax lengthExample
FirstNameWrite the user given name.128Abraham
LastNameWrite the user surname.128Lincoln
AddressLine1Write the first line of the user physical address.256The White House
AddressLine2Write the second line of the user physical address.2561600 Pennsylvania Ave NW
CityWrite the city of the user physical address.128Washington
StateWrite the political country subdivision of the user physical address.128DC
PostalCodeWrite the postal or ZIP code of the user physical address.1020500
AddressCountryCodeWrite the country code of the user physical address.2US
NationalId1Write the national ID of the user.128000-00-0000
DateOfBirthWrite the date of birth of the user in YYYYMMDD format.819901213

To learn how to become Twilio KYC approved, see Twilio Trust Hub.

Country-specific requirements

country-specific-requirements page anchor

Some countries require specific parameters and have different data formatting rules. If a required parameter is missing, Error 60617 will be returned.

Australia

australia page anchor
ParameterUsageDescription
AddressLine1OptionalUse only the address formats.
AddressLine2ExcludeAppend this data to AddressLine1.
StateOptionalUse state abbreviations(link takes you to an external page) instead of the full state name.

In the following examples for flats, units, or apartments:

Physical AddressWritten format
Flat 2 at 14 Smith StWrite as Flat 2 14 Smith St, 2/14 Smith St, or F 2 14 Smith St.
Unit 2 at 14 Smith StWrite as Unit 2 14 Smith St, 2/14 Smith St, or U 2 14 Smith St.
Apartment 2 at 14 Smith StWrite as 2/14 Smith or APT 2 14 Smith St.
ParameterUsageDescriptionExample
FirstNameRequiredWrite only the first word.Write Luis for the name Luis Carlos Teixeira Brito Junior.
LastNameRequiredWrite all words after the first.Write Carlos Teixeira Brito Junior for the name Luis Carlos Teixeira Brito Junior.
AddressLine1RequiredWrite user address in this format
{streetName streetNumber BL blNumber APT aptNumber neighborhoodName}.
RUA COSTA ESMERALDA 50 BL 14 APT 22 CENTR
AddressLine2ExcludeAppend this data to AddressLine1.
CityExcludeThis parameter can't be evaluated in Brazil.
AddressCountryCodeExcludeThis parameter can't be evaluated in Brazil.
PostalCodeExcludeThis parameter can't be evaluated in Brazil.
NationalIdOptionalWrite the user national ID.
ParameterUsageDescriptionExample
FirstNameRequiredWrite the user given name.
LastNameRequiredWrite the user surname.
AddressLine1RequiredWrite the street name and house number.Immermannstraße 26 and
Oderbergerstrasse 12
CityRequiredWrite the city of the user address.
PostalCodeRequiredWrite the postal code of the user address.
DateOfBirthOptionalWrite the user date of birth in YYYYMMDD format.20001201
ParameterUsageDescription
FirstNameRequiredWrite the user given name.
LastNameRequiredWrite the user surname.
AddressLine1RequiredWrite the street name and house number or house name. If both the house number and house name are provided, write both.
PostalCodeRequiredWrite the postal code of the user address.
ParameterUsageDescriptionExample
FirstNameRequiredWrite the user given name.
LastNameRequiredWrite the user surname.
AddressLine1RequiredWrite the street type, street name, and building name or number.via Garibaldi 27 or
27 via Garibaldi,
Via Giacomo Quarenghi 34 or
34 Via Giacomo Quarenghi
PostalCodeOptionalWrite the five-digit postal code of the user address.00015
ParameterUsageDescriptionExample
FirstNameOptionalWrite the first initial of the user given name.Write L for the name "Luca".
AddressLine1OptionalWrite the street name and house number.Jaarbeursplein 6A or
Joris van Andringastraat 172
PostalCodeOptionalWrite the postal code as four digits and two characters without spaces.3054SP or 3521AL
DateOfBirthOptionalWrite date of birth of the user in the YYYYMMDD format.19901214

The response includes the identity_match object, which contains match levels for the user's submitted data. The identity_match object also contains a summary score that provides an overall match level for the user's identity.

Match levelDescriptionExample
exact_matchThe user and mobile number data matches exactly.Robert matches Robert.
high_partial_matchThe user and mobile number data almost exactly matches.Robere is a high partial match for Robert.
partial_matchThe user and mobile number data moderately matches.Bob, Rob, or R are partial matches for Robert.
no_matchThe user and mobile number data doesn't match at all.John doesn't match Robert.
no_data_availableNo data is available for comparison.

identity_match attributes and match levels

identity_match-attributes-and-match-levels page anchor
AttributeDescriptionAllowed value set
first_name_matchThe match level for the FirstName attribute assigned to the submitted mobile number.1
last_name_matchThe match level for the LastName attribute assigned to the submitted mobile number.1
address_line_matchThe match level for the AddressLine1 and AddressLine2 attributes assigned to the submitted mobile number.1
city_matchThe match level for the City attribute assigned to the submitted mobile number.2
state_matchThe match level for the State attribute assigned to the submitted mobile number.2
postal_code_matchThe match level for the PostalCode attribute assigned to the submitted mobile number.2
address_country_matchThe match level for the AddressCountryCode attribute assigned to the submitted mobile number.2
date_of_birth_matchThe match level for the DateOfBirth attribute assigned to the submitted mobile number.1 (Canada only), 2
national_id_matchThe match level for the NationalId attribute assigned to the submitted mobile number.3
summary_scoreA single summary score that indicates overall match level.See summary_score

Allowed values enumerated:

  1. exact_match, high_partial_match, partial_match, no_match, no_data_available
  2. exact_match, no_match, no_data_available
  3. exact_match, no_match, no_data_available, null

Summary score calculation

summary-score-calculation page anchor

The summary_score represents the overall match level ranging from 0 (no match) to 100 (exact match). Twilio calculates this score using the match values of the properties as listed in the following table:

first_name_matchlast_name_matchaddress_line_matchsummary_score
PositivePositivePositive100
PositiveNegativePositive80
PositiveNegativeNegative70
PositivePositiveNegative40
NegativePositivePositive20
NegativePositiveNegative20
PositiveNegativeNegative0
NegativeNegativePositive0
NegativeNegativeNegative0
  • Positive matches include exact_match, high_partial_match, or partial_match.
  • Negative matches include no_match, no_data_available.

Code example for Identity Match lookup

code-example-for-identity-match-lookup page anchor
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchPhoneNumber() {
11
const phoneNumber = await client.lookups.v2
12
.phoneNumbers("+14159929960")
13
.fetch({
14
addressCountryCode: "US",
15
addressLine1: "321 Main Street",
16
addressLine2: "Suite 2",
17
city: "New York",
18
dateOfBirth: "19901214",
19
fields: "identity_match",
20
firstName: "John",
21
lastName: "Doe",
22
nationalId: "YZ3456883",
23
postalCode: "10021",
24
state: "NY",
25
});
26
27
console.log(phoneNumber.callingCountryCode);
28
}
29
30
fetchPhoneNumber();

Frequently asked questions

frequently-asked-questions page anchor

How do you recommend I implement Identity Match?

how-do-you-recommend-i-implement-identity-match page anchor

Use Identity Match when onboarding users. When a user signs up for your service, Twilio recommends collecting all available end-user personally identifiable information (PII(link takes you to an external page)). Set FirstName, LastName, and AddressLine1 as the minimum required parameters.

  • To make a quick evaluation, use the minimum required parameters and apply the summary_score.
  • To evaluate with more parameters, create and apply your own match logic.

What's considered a "good match rate?"

whats-considered-a-good-match-rate page anchor

This depends on the attributes you prioritize for your use case and the quality of the data provided.

(information)

Match scenarios

  • An end user signs up for an online bank account. The end user likely provides complete, correct information. When the user's data gets compared with data held within Twilio's authoritative sources, this improves match rates across all data elements.
  • An end user signs up for a social media account. The end user might not provide complete, correct information. This reduces match rates.

The quality of the data you submit directly impacts the match results returned by Identity Match.

Can Identity Match requests contain multiple addresses?

can-identity-match-requests-contain-multiple-addresses page anchor

No. The Identity Match API only supports a single input data set per request. This includes the name, address, date of birth, and national ID associated with the end user's mobile phone number. The API returns a single set of match results in response.

  1. Access to the NationalId field in Identity Match responses is restricted to customers who have completed Twilio's KYC (Know Your Customer) process. Non-KYC customers will receive a null value in this field.