Skip to content

Profile Endpoint

To get the complete user profile, use the endpoint below.

URLs

MethodURLActionDescription
GET/api/profile/{clientId}?identity={identity}ViewDisplays 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

FieldTypeDescription
codigonumberResponse status code
msgstringStatus message

data

FieldTypeDescription
fanIdstringUnique user ID
profilePicstringProfile photo URL
name1stringFirst name
name2string/nullLast name
socialNamestringSocial name
cpfstringUser's CPF
verifiedCpfbooleanIndicates if CPF was verified
otherdocstring/nullOther document
doctypestringDocument type
registertypestringRegistration type
lastupdatestringLast update date
birthdatestringBirth date
genderstringGender (M/F)
emailsarrayEmail list
phonesarrayPhone list
addressobjectComplete address
optinsarrayUser's opt-ins list

emails

FieldTypeDescription
valuestringEmail address
verifiedbooleanIndicates if email was verified

phones

FieldTypeDescription
valuestringPhone number
verifiedbooleanIndicates if phone was verified

address

FieldTypeDescription
streetstringStreet and number
citystringCity
statestringState
countrystringCountry

optins

FieldTypeDescription
optinNamestringOpt-in name
optinCodestringOpt-in code
optinDatestringOpt-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;
  }
}

Fanbase API Documentation