> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce/users/captcha-validation.md).

# Captcha Validation

{% hint style="info" %}
The endpoints on this page unlock an IP address that has been throttled. They are separate from the reCAPTCHA check on registration, OTP code requests and verification codes, where the client sends a `g-recaptcha-response` token in the request body. That check is controlled by the `REGISTER_FORM_RECAPTCHA_CONF` dynamic setting (section 156 of [Dynamic Settings](https://docs.akinon.com/technical-guides/commerce/dynamic-settings)) for registration and OTP login, and by `recaptcha_required` in `VERIFICATION_TOKEN_CONF` (section 142) for verification codes.
{% endhint %}

### `GET` Captcha HTML Form

This endpoint retrieves a CAPTCHA HTML form to verify the authenticity of a user attempting to access or interact with the system. CAPTCHA is used as a security measure to prevent automated bots from performing malicious activities. The HTML response includes the necessary fields and scripts for displaying and submitting the CAPTCHA form.

**Path:** `/users/captcha/`

**Authentication Required:** No

**Headers:**

```
Accept-Language: <iso_language_code>
Accept: application/json
```

**Example Request**

```py
import requests

headers = {
  'Accept-Language': '<iso_language_code>'
}

url = "https://{commerce_url}/users/captcha/"

response = requests.get(url)
print(response.json())
```

**Example Response (200 OK)**

```json
{
  "html": "<h1 class=\"auth__form__title\">\n	DEVAM ETMEK İÇİN\n  </h1>\n<form method=\"post\">\n	<input type='hidden' name='csrfmiddlewaretoken' value=<token> />\n	<div class=\"g-recaptcha\"  data-sitekey=\"\" id=\"id_captcha\" required></div>\n	<script type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api.js\"></script>\n	<input type=\"submit\" value=\"Devam et\">\n</form>"
}
```

**Response Parameters**

| Property | Data Type | Description                                                                                               |
| -------- | --------- | --------------------------------------------------------------------------------------------------------- |
| html     | String    | Contains the CAPTCHA form as an HTML string, including the hidden CSRF token and Google reCAPTCHA widget. |

### `POST` Captcha Validation

This endpoint processes the CAPTCHA form submission to validate that the user is human. It verifies the Google reCAPTCHA response and the CSRF token, ensuring both are correct. Upon successful validation, the throttled IP is authorized to proceed with further actions.

**Path:** `/users/captcha/`

**Authentication Required:** No

**Headers:**

```
Content-Type: application/x-www-form-urlencoded
Accept-Language: <iso_language_code>
x-csrftoken: <token>
```

**Body Parameters**

| Property             | Data Type | Required | Description                                                        |
| -------------------- | --------- | -------- | ------------------------------------------------------------------ |
| csrfmiddlewaretoken  | string    | True     | The token included in the CAPTCHA form for CSRF protection.        |
| g-recaptcha-response | string    | True     | The response token provided by Google after verifying the CAPTCHA. |

**Request Body**

```json
{
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
```

**Example Request**

```py
import requests

url = "https://www.converse.com.tr/users/captcha/"

payload = {
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Accept-Language': '<iso_language_code>'
  'x-csrftoken': '<token>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

**Example Response (302 Found)**

A successful validation that redirects the user to the next step or process.

```json
{}
```

### `GET` Captcha HTML Form for Project Zero

This endpoint retrieves a CAPTCHA HTML form to verify the authenticity of a user attempting to access or interact with the system. CAPTCHA serves as a security measure to prevent automated bots from carrying out malicious activities. The HTML response includes the necessary fields and scripts for displaying and submitting the CAPTCHA form.

**Path:** `/users/pz-captcha/`

**Authentication Required:** No

**Headers:**

```
Accept-Language: <iso_language_code>
Accept: application/json
```

**Example Request**

```py
import requests

headers = {
  'Accept-Language': '<iso_language_code>'
}

url = "https://{commerce_url}/users/pz-captcha/"

response = requests.get(url)
print(response.json())
```

**Example Response (200 OK)**

```json
{
    "html": "<h1 class=\"auth__form__title\">\n    DEVAM ETMEK İÇİN\n  </h1>\n<form method=\"post\">\n    <input type='hidden' name='csrfmiddlewaretoken' value='ZpnY581oNXa1fLa8eE9yOIHB3aUhBXWjNDVyZElJh9kMB7b3QMsoNbxnr8hf2xJs' />\n    <div class=\"g-recaptcha\"  data-sitekey=\"\" id=\"id_captcha\" required></div>\n    <script type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api.js\"></script>\n    <input type=\"submit\" value=\"Devam et\">\n</form>"
}
```

**Response Parameters:**

| Property | Data Type | Description                                                                                                        |
| -------- | --------- | ------------------------------------------------------------------------------------------------------------------ |
| html     | String    | Contains the CAPTCHA form as an HTML string, which includes the hidden CSRF token and the Google reCAPTCHA widget. |

### `POST` Captcha Validation for Project Zero

This endpoint processes the CAPTCHA form submission to validate that the user is human. It verifies both the Google reCAPTCHA response and the CSRF token to ensure they are correct. Upon successful validation, the throttled IP is authorized to proceed with further actions.

**Path:** `/users/pz-captcha/`

**Authentication Required:** No

**Headers:**

```
Content-Type: application/x-www-form-urlencoded
Accept-Language: <iso_language_code>
x-csrftoken: <token>
```

**Body Parameters**

| Property             | Data Type | Required | Description                                                        |
| -------------------- | --------- | -------- | ------------------------------------------------------------------ |
| csrfmiddlewaretoken  | string    | True     | The token included in the CAPTCHA form for CSRF protection.        |
| g-recaptcha-response | string    | True     | The response token provided by Google after verifying the CAPTCHA. |

**Request Body**

```json
{
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
```

**Example Request**

```py
import requests

url = "https://www.converse.com.tr/users/pz-captcha/"

payload = {
	"csrfmiddlewaretoken": "<your csrfmiddlewaretoken>",
	"g-recaptcha-response": "<your recaptcha response>"
}
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Accept-Language': '<iso_language_code>'
  'x-csrftoken': '<token>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

**Example Response (302 Found)**

A successful validation that redirects the user to the next step or process.

```json
{}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce/users/captcha-validation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
