Ymtaz Logo

Profile

GEThttps://api.ymtaz.sa/api/v1/profile

Retrieves the profile information for the authenticated user.

Request Headers

AuthorizationstringRequired

Bearer token for authentication (e.g., "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...").

Response

statusboolean

Indicates if the request was successful.

codenumber

HTTP status code.

data.userobject

User profile information.

POSThttps://api.ymtaz.sa/api/v1/profile

Updates the profile information for the authenticated user.

Request Headers

AuthorizationstringRequired

Bearer token for authentication.

Content-TypestringRequired

Must 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

emailstringRequired

The user's email address.

phonestringRequired

The user's phone number.

phone_codestringRequired

The country code for the phone number.

otpstringRequired if phone changes and phone_code is 966

One-time password for phone verification. See Phone Verification for details.

passwordstringOptional

The user's new password, if they want to change it.

region_idnumberRequired

The ID of the user's region. Should be fetched from Regions API.

country_idnumberRequired

The ID of the user's country. Should be fetched from Countries API.

city_idnumberRequired

The ID of the user's city. Should be fetched from Cities API.

typenumberRequired

The user's type: 1 (فرد), 2 (موؤسسة), 3 (شزكة), 4 (جهة حكومية), or 5 (هيئة).

account_typestringRequired

Must be either "client" or "lawyer".

profile_photofileOptional

The user's profile photo.

genderstringRequired

Must be either "Male" or "Female".

longitudenumberRequired

The user's longitude coordinate.

latitudenumberRequired

The user's latitude coordinate.

Client-Specific Fields

namestringRequired for clients

The client's full name.

Lawyer-Specific Fields

first_namestringRequired for lawyers

The lawyer's first name.

second_namestringRequired for lawyers

The lawyer's second name.

third_namestringOptional for lawyers

The lawyer's third name.

fourth_namestringRequired for lawyers

The lawyer's fourth name.

sectionsarrayOptional for lawyers

Array of digital guide section IDs. Should be fetched from Digital Guide Categories API.

degreenumberRequired for lawyers

The ID of the lawyer's degree. Should be fetched from Degrees API.

other_degreestringRequired if degree is 4

The lawyer's other degree, if degree ID is 4.

degree_certificatefileRequired if degree need_certificate is true

The lawyer's degree certificate.

aboutstringRequired for lawyers

The lawyer's bio or about text.

national_idstringRequired for lawyers

The lawyer's national ID number.

national_id_imagefileRequired for lawyers

The lawyer's national ID image.

license_noobjectRequired for sections

Object where keys are section IDs and values are license numbers.

daynumberRequired for lawyers

The lawyer's birth day.

monthnumberRequired for lawyers

The lawyer's birth month.

yearnumberRequired for lawyers

The lawyer's birth year.

general_specialtynumberRequired for lawyers

The ID of the lawyer's general specialty. Should be fetched from General Specialties API.

accurate_specialtynumberRequired for lawyers

The ID of the lawyer's accurate specialty. Should be fetched from Accurate Specialties API.

functional_casesnumberRequired for lawyers

The ID of the lawyer's functional cases. Should be fetched from Functional Cases API.

cv_filefileOptional for lawyers

The lawyer's CV file.

company_namestringRequired if type is 2, 3, 4, or 5

The lawyer's company name.

company_license_filefileRequired if type is 2 or 3

The lawyer's company license file.

company_licences_nostringRequired if type is 2 or 3

The lawyer's company license number.

identity_typenumberRequired for lawyers

The lawyer's identity type: 1 (هوية وطنية), 2 (جواز السفر), or 3 (هوية مقيم).

logofileOptional for lawyers

The lawyer's logo.

languagesarrayRequired for lawyers

Array of language IDs. Should be fetched from Languages API.

nationality_idnumberRequired

The 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
    }
  }
}

Try it out