User Scopes
Scopes are pieces of information that represent user data within the Didit Protocol. Understanding these scopes is crucial for effectively implementing the Auth + Data solution.
Types of Data
-
Verified Data: Data that has been verified by Didit, such as:
- Email address
- Phone number
- Identity document details
-
Unverified Data: Data that has not been verified by Didit, including:
- Addresses
- User preferences
- Bank account details
Available User Scopes
The following table provides a comprehensive list of all available user scopes, along with descriptions and examples:
Attribute | Description | Type | Verification Type |
---|---|---|---|
user_id | A unique ID that represents the user's identity in your application | string | Verified |
picture | Temporary URL of the user's profile picture | string | Unverified |
names | First name, Last name, and Full name of the user | object | Verified |
Primary email of the user | object | Verified | |
phone | Primary phone number of the user | object | Verified |
gender | Gender of the user | object | Verified |
document_detail | Detailed information about the user's identity document | object | Verified |
birthdate | Birthdate of the user | object | Verified |
address | Structured address of the user | object | Verified/Unverified |
bank_account | Primary bank account of the user | object | Verified/Unverified |
preferences | User preferences (language, currency, time zone) | object | Unverified |
is_verified | Indicates if the user has verified their identity | boolean | Verified |
is_over_18 | Indicates if the user is over 18 years old | boolean | Verified |
is_over_21 | Indicates if the user is over 21 years old | boolean | Verified |
instagram_account | Instagram account information of the user | object | Verified |
x_account | X account information of the user | object | Verified |
tiktok_account | TikTok account information of the user | object | Verified |
Some scopes, such as emails, phone numbers, or addresses, can have multiple values. In these cases, the user selects which specific value to share with the application during the data sharing request. Also, the user_id is always mandatory and returned in any case.
Example Response
Here's an example of a full response containing user scopes:
{
"user_id": "212a7ef2-f934-47e2-94eb-907b94c9d443",
"picture": "https://example.com/picture.png",
"names": {
"first_name": "Alejandro",
"family_name": "Rosas Garcia",
"full_name": "Alejandro Rosas Garcia"
},
"email": {
"email": "alejandro@example.com",
"is_verified": true
},
"phone": {
"phone_number": "+34123456789",
"is_verified": true
},
"gender": {
"gender": "MALE", // MALE, FEMALE, UNKNOWN
"is_verified": true
},
"document_detail": {
"type": "P", // P (Passport), ID (ID Card), DL (Driver License), RP (Residence Permit)
"issuing_country": "ESP",
"document_number": "123456789",
"personal_number": "123456789",
"expiration_date": "2022-12-31",
"date_of_issue": "2016-06-02",
"front_image": "https://example.com/front.png",
"back_image": "https://example.com/back.png",
"portrait_image": "https://example.com/portrait.png",
"date_of_birth": "1990-01-01",
"full_name": "Alejandro Rosas Garcia",
"gender": "M", // M (Male), F (Female), U (Unknown)
"is_nfc_verified": true
},
"birthdate": {
"date": "1990-01-01",
"is_verified": true
},
"address": {
"full_address": "Calle Viladomat, 2, 08023 Barcelona, Barcelona, Spain",
"street_1": "Calle Viladomat 2",
"street_2": "3-1",
"postal_code": "08023",
"city": "Barcelona",
"region": "Catalunya",
"country": "ES",
"is_verified": true
},
"bank_account": {
"number": "GB03SDNO58754297408866",
"swift": "SSTTGBX9",
"country": "GB",
"is_verified": true
},
"preferences": {
"language": "en",
"currency": "usd",
"time_zone": "GMT+1"
},
"is_verified": true,
"is_over_18": true,
"is_over_21": true,
"instagram_account": {
"uid": "123456789",
"username": "alejandro",
"email": "alejandro@example.com",
"profile_url": "https://instagram.com/alejandro",
"profile_image_url": "https://example.com/profile.png",
"public_metrics": {
"followers": 1000,
"following": 1000,
"posts": 1000
},
"is_verified": true
},
"x_account": {
"uid": "123456789",
"username": "alejandro",
"email": "alejandro@example.com",
"profile_url": "https://x.com/alejandro",
"profile_image_url": "https://example.com/profile.png",
"public_metrics": {
"followers": 1000,
"following": 1000,
"posts": 1000
},
"is_verified": true
},
"tiktok_account": {
"uid": "123456789",
"username": "alejandro",
"email": "alejandro@example.com",
"profile_url": "https://tiktok.com/alejandro",
"profile_image_url": "https://example.com/profile.png",
"public_metrics": {
"followers": 1000,
"following": 1000,
"posts": 1000
},
"is_verified": true
}
}
Requesting User Scopes
To request user scopes, create a data session specifying the desired scopes. The user will be prompted to approve sharing these scopes with your application.
If you are requesting the document_detail attribute, but the user has not verified their identity, they will be prompted to complete the verification process before sharing this information. Check out our Identity Verification guide for more details.