Get a user profile (and their Teams)
GET
/api/v2/user_profile/{user_id}
const url = 'https://api.payhero.africa/api/v2/user_profile/42';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.payhero.africa/api/v2/user_profile/42 \ --header 'Authorization: Basic <credentials>'Returns the profile for a user, including every Team (Account) they belong to, their roles per Team, and the organizations in scope. Use this to enumerate the Teams available to your integration.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”user_id
required
integer
Example
42Responses
Section titled “Responses”The user profile.
Media typeapplication/json
object
user_profile
object
user
object
id
integer
phone_number
string
first_name
string
last_name
string
username
string
email
string
is_admin
boolean
status
string
accounts
Array<object>
object
id
integer
name
string
uuid
string
status
string
email
string
currency
string
phone_number
string
kyc_tier
integer
is_approved
boolean
merchant_id
integer
roles
Map of account_id → role name.
object
key
additional properties
string
status
string
is_pin_set
boolean
is_kyc_verified
boolean
kyc_tier
integer
Example
{ "user_profile": { "user": { "id": 42, "phone_number": "+254712345678", "first_name": "Jane", "last_name": "Doe", "username": "jane", "email": "jane@acme.co", "is_admin": false, "status": "active" }, "accounts": [ { "id": 63, "name": "Vendor A", "status": "active", "email": "vendor-a@acme.co", "currency": "KES", "phone_number": "+254711000111", "kyc_tier": 3, "is_approved": true, "merchant_id": 0 } ], "roles": { "63": "owner" }, "status": "active", "is_pin_set": true, "is_kyc_verified": true, "kyc_tier": 3 }}Missing or invalid Basic auth credentials.
Media typeapplication/json
object
error_code
string
error_message
string
status_code
integer
Example
{ "error_code": "invalid_argument", "error_message": "the transaction amount is insufficient as it wont cater for cost: (4.62)", "status_code": 400}
