# Step 2: Create the API gateway

To enable the validation to be executed, an API gateway needs to be created and defined. Create the API gateway for the validation and label it the same as “UserName\_Acc\_customers\_validation”.

* To go to the API gateway template, click “API gateway” under the “APIs and integration” menu on the left side panel.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_11/ch11apigtwymenu.png" alt=""><figcaption></figcaption></figure>

* To create a new API gateway, click the \[+ API gateway] button.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_11/ch11addapigtwy.png" alt=""><figcaption></figcaption></figure>

* To define the API gateway, add the following details:
  1. Enter the API gateway as “UserName\_Acc\_customers\_validation”.
  2. Optionally add the description for this API gateway.
  3. By default, the Details tab is selected.\
     From the drop-down, select API as “UserName\_Acc\_AddCustomer”. The user adds customer details in the API, and the details are added into the entity “UserName\_Acc\_customers” after validation.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_11/ch11apigtwynameaddcust.png" alt=""><figcaption></figcaption></figure>

* To save the API gateway, click the \[Save] button.\
  The Delivery URL section displays the selected API URL.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_11/ch11apigtwyurl.png" alt=""><figcaption></figcaption></figure>

* Enable the API gateway by clicking the “Enabled” toggle button.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_11/ch11enableapigtwy.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note: If this button is disabled, the validation will not have an API gateway to be executed through.
{% endhint %}

* To see the Target Entity and Validation pipelines defined for it, go to the Entities tab. Select Validation as “UserName\_Acc\_customers\_validation”.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_11/ch11apigtwyentvalid.png" alt=""><figcaption></figcaption></figure>

* To save the API gateway settings, click the \[Save] button. This API gateway processes the data in the API with the Validation pipeline defined.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_11/ch11saveapigtwy.png" alt=""><figcaption></figcaption></figure>


---

# 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://docs.langstack.com/welcome/get-started/learn-langstack/validation-pipeline/exercise-customer-information/step-2-create-the-api-gateway.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.
