# 1. Check existing user

<figure><img src="/files/XmdN55gwjGkcPNcOvJVr" alt=""><figcaption></figcaption></figure>

## **Description**

ตรวจสอบว่าผู้ใช้งานที่ร้องขอ มีอยู่ในระบบของท่านแล้วหรือยัง?

Check if the user who made the request already exists in your system.

## **Endpoint URL**

`GET` /  `endpoint-tch/check-`existing`-user/{userId}`&#x20;

(สามารถตั้งชื่อ endpoint url เป็นชื่ออื่นได้; You can name the endpoint URL something else if desired.)

## **Request Parameters**

* **userId** (string, required): รหัสผู้ใช้งานที่ต้องการตรวจสอบ (The user ID you want to verify.)

### **Success Response**

* **HTTP Status Code**: `200`
* **Structure**:

  ```typescript
  {
    "status": "success",
    "code" : 200,
    "message": "User already exist.",
    "data": {
      "is_available": boolean (true | false)
      //true = The user exists.
      //false = The user does not exist and must be created.
    }
  }
  ```

### **Error Responses**

* **500 Internal Server Error**: error นอกเหนือจากที่กำหนดไว้ เช่น error try catch (Errors other than those specified, such as try-catch errors.)

  ```typescript
  {
    "status": "error",
    "code": 500,
    "message": string,
  }
  ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://document.thaicasino.tech/getting-started/step-3-setup-url-endpoint/1.-check-existing-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
