Profile Endpoint
To get the complete user profile, use the endpoint below.
URLs
| Method | URL | Action | Description |
|---|---|---|---|
| GET | /api/profile/{clientId}?identity={identity} | View | Displays the complete user profile by ID |
Production:
{security-producao}/api/profile/{clientId}?identity={identity}Staging:
{security-homologacao}/api/profile/{clientId}?identity={identity}Parameters
- clientId: Required.
- identity: Optional if using JWT in Authorization header. Required if using AccessToken in AccessToken header.
Authentication (Headers)
- With JWT:
Authorization: Bearer <token> - With AccessToken:
AccessToken: <token>
Request Example with JWT
javascript
const response = await fetch(`{security-producao}/api/profile/${clientId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${jwtToken}`
}
});
const profile = await response.json();Request Example with AccessToken
javascript
const userId = '000001';
const response = await fetch(`{security-producao}/api/profile/${clientId}?identity=${userId}`, {
method: 'GET',
headers: {
'AccessToken': accessToken
}
});
const profile = await response.json();Expected Response
json
{
"header": {
"codigo": 1,
"msg": "Ok."
},
"data": {
"fanId": "000001",
"profilePic": "",
"name1": "XXXXX",
"name2": null,
"socialName": "XXX",
"cpf": "00000000001",
"verifiedCpf": true,
"otherdoc": null,
"doctype": "CPF",
"registertype": "standard",
"lastupdate": "14/10/2025 10:58",
"birthdate": "06/09/2000",
"gender": "M",
"emails": [
{
"value": "xxxxx@xxxx.com",
"verified": true
}
],
"phones": [
{
"value": "+55 (11) 111111111",
"verified": false
}
],
"address": {
"street": "XXXXX",
"city": "XXXXX",
"state": "XXX",
"country": "BR"
},
"optins": [
{
"optinName": "xxxxxxxx",
"optinCode": "xxxxxxxx",
"optinDate": "2025-10-14T10:58:26"
}
]
}
}Response Structure
header
| Field | Type | Description |
|---|---|---|
codigo | number | Response status code |
msg | string | Status message |
data
| Field | Type | Description |
|---|---|---|
fanId | string | Unique user ID |
profilePic | string | Profile photo URL |
name1 | string | First name |
name2 | string/null | Last name |
socialName | string | Social name |
cpf | string | User's CPF |
verifiedCpf | boolean | Indicates if CPF was verified |
otherdoc | string/null | Other document |
doctype | string | Document type |
registertype | string | Registration type |
lastupdate | string | Last update date |
birthdate | string | Birth date |
gender | string | Gender (M/F) |
emails | array | Email list |
phones | array | Phone list |
address | object | Complete address |
optins | array | User's opt-ins list |
emails
| Field | Type | Description |
|---|---|---|
value | string | Email address |
verified | boolean | Indicates if email was verified |
phones
| Field | Type | Description |
|---|---|---|
value | string | Phone number |
verified | boolean | Indicates if phone was verified |
address
| Field | Type | Description |
|---|---|---|
street | string | Street and number |
city | string | City |
state | string | State |
country | string | Country |
optins
| Field | Type | Description |
|---|---|---|
optinName | string | Opt-in name |
optinCode | string | Opt-in code |
optinDate | string | Opt-in date (ISO 8601) |
Complete Example
javascript
async function getCompleteProfile(clientId, jwtToken) {
try {
const response = await fetch(`{security-producao}/api/profile/${clientId}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${jwtToken}`
}
});
if (!response.ok) {
throw new Error(`Error ${response.status}: ${response.statusText}`);
}
const result = await response.json();
if (result.header.codigo !== 1) {
throw new Error(result.header.msg);
}
return result.data;
} catch (error) {
console.error('Error getting profile:', error);
throw error;
}
}