Profile
Retrieves the profile information for the authenticated user.
Request Headers
AuthorizationstringRequiredBearer token for authentication (e.g., "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...").
Response
statusbooleanIndicates if the request was successful.
codenumberHTTP status code.
data.userobjectUser profile information.
Updates the profile information for the authenticated user.
Request Headers
AuthorizationstringRequiredBearer token for authentication.
Content-TypestringRequiredMust be "multipart/form-data" for file uploads.
Request Body
The request body varies based on the account type (client or lawyer). Below are the common fields and specific fields for each account type.
Common Fields
emailstringRequiredThe user's email address.
phonestringRequiredThe user's phone number.
phone_codestringRequiredThe country code for the phone number.
otpstringRequired if phone changes and phone_code is 966One-time password for phone verification. See Phone Verification for details.
passwordstringOptionalThe user's new password, if they want to change it.
region_idnumberRequiredThe ID of the user's region. Should be fetched from Regions API.
country_idnumberRequiredThe ID of the user's country. Should be fetched from Countries API.
city_idnumberRequiredThe ID of the user's city. Should be fetched from Cities API.
typenumberRequiredThe user's type: 1 (فرد), 2 (موؤسسة), 3 (شزكة), 4 (جهة حكومية), or 5 (هيئة).
account_typestringRequiredMust be either "client" or "lawyer".
profile_photofileOptionalThe user's profile photo.
genderstringRequiredMust be either "Male" or "Female".
longitudenumberRequiredThe user's longitude coordinate.
latitudenumberRequiredThe user's latitude coordinate.
Client-Specific Fields
namestringRequired for clientsThe client's full name.
Lawyer-Specific Fields
first_namestringRequired for lawyersThe lawyer's first name.
second_namestringRequired for lawyersThe lawyer's second name.
third_namestringOptional for lawyersThe lawyer's third name.
fourth_namestringRequired for lawyersThe lawyer's fourth name.
sectionsarrayOptional for lawyersArray of digital guide section IDs. Should be fetched from Digital Guide Categories API.
degreenumberRequired for lawyersThe ID of the lawyer's degree. Should be fetched from Degrees API.
other_degreestringRequired if degree is 4The lawyer's other degree, if degree ID is 4.
degree_certificatefileRequired if degree need_certificate is trueThe lawyer's degree certificate.
aboutstringRequired for lawyersThe lawyer's bio or about text.
national_idstringRequired for lawyersThe lawyer's national ID number.
national_id_imagefileRequired for lawyersThe lawyer's national ID image.
license_noobjectRequired for sectionsObject where keys are section IDs and values are license numbers.
daynumberRequired for lawyersThe lawyer's birth day.
monthnumberRequired for lawyersThe lawyer's birth month.
yearnumberRequired for lawyersThe lawyer's birth year.
general_specialtynumberRequired for lawyersThe ID of the lawyer's general specialty. Should be fetched from General Specialties API.
accurate_specialtynumberRequired for lawyersThe ID of the lawyer's accurate specialty. Should be fetched from Accurate Specialties API.
functional_casesnumberRequired for lawyersThe ID of the lawyer's functional cases. Should be fetched from Functional Cases API.
cv_filefileOptional for lawyersThe lawyer's CV file.
company_namestringRequired if type is 2, 3, 4, or 5The lawyer's company name.
company_license_filefileRequired if type is 2 or 3The lawyer's company license file.
company_licences_nostringRequired if type is 2 or 3The lawyer's company license number.
identity_typenumberRequired for lawyersThe lawyer's identity type: 1 (هوية وطنية), 2 (جواز السفر), or 3 (هوية مقيم).
logofileOptional for lawyersThe lawyer's logo.
languagesarrayRequired for lawyersArray of language IDs. Should be fetched from Languages API.
nationality_idnumberRequiredThe ID of the lawyer's nationality. Should be fetched from Nationalities API.
curl https://api.ymtaz.sa/api/v1/profile \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."Response
{
"status": true,
"code": 200,
"message": "Profile retrieved successfully",
"data": {
"user": {
"id": 123,
"name": "John Doe",
"email": "john@example.com",
"phone": "1234567890",
"phone_code": "1",
"account_type": "client",
"gender": "Male",
"region_id": 1,
"country_id": 1,
"city_id": 40,
"type": 1,
"longitude": 112.23,
"latitude": -35.21
}
}
}