Ymtaz Logo

Register

POSThttps://api.ymtaz.sa/api/v1/auth/register

Registers a new user as either a client or a lawyer and initiates the email confirmation process.

Request Body

account_typestringRequired

Must be either "client" or "lawyer".

emailstringRequired

The user's email address.

passwordstringRequired

The user's password.

phonestringRequired

The user's phone number.

phone_codestringRequired

The country code for the phone number.

namestringRequired for clients

The client's full name. Only required if account_type is "client".

first_namestringRequired for lawyers

The lawyer's first name. Only required if account_type is "lawyer".

second_namestringRequired for lawyers

The lawyer's second name. Only required if account_type is "lawyer".

third_namestringOptional for lawyers

The lawyer's third name. Optional if account_type is "lawyer".

fourth_namestringRequired for lawyers

The lawyer's fourth name. Only required if account_type is "lawyer".

referred_bystringOptional

Referral code, if the user was referred.

otpstringRequired for Saudi Arabia

One-time password. Required if phone_code is "966" (Saudi Arabia).

genderstringOptional

Can be "Male", "Female", or null.

accepted_tosstringRequired

Must be "1" to indicate acceptance of terms of service.

Error Responses

422 Unprocessable Entity

This error occurs when there are problems with the submitted form data. It could include validation errors or conflicts with existing data.

{
  "status": false,
  "code": 422,
  "message": "invalid_data",
  "data": {
    "errors": {
      "email": [
        "البريد الإلكتروني مستخدم من قبل"
      ],
      "phone": [
        "رقم الهاتف موجود سابقاً"
      ]
    }
  }
}
curl https://api.ymtaz.sa/api/v1/auth/register \
  -X POST \
  -H "Content-Type: multipart/form-data" \
  -F "account_type=client" \
  -F "name=John Doe" \
  -F "email=john@example.com" \
  -F "password=securepassword" \
  -F "phone=1234567890" \
  -F "phone_code=1" \
  -F "gender=Male" \
  -F "accepted_tos=1"

Response

{
  "status": true,
  "code": 200,
  "message": "تم إرسال رابط تأكيد البريد الإلكتروني على بريدكم بنجاح.
نأمل تأكيد البريد بالضغط على الرابط المرسل لكم.",
  "data": null
}

Registration