# IP Whitelisting

#### To Get Started:&#x20;

<table><thead><tr><th width="314">Authorization</th><th>Set value to Bearer {{MERCHANT_AUTH_TOKEN}}</th></tr></thead><tbody><tr><td>Content-type</td><td>Set value to <code>application/json</code></td></tr></tbody></table>

{% hint style="info" %}
To generate `{{MERCHANT_AUTH_TOKEN}}`; Log in to your account via the API.
{% endhint %}

Make a request to the URL below, where the base URL is determined by the environment you are on.

<details>

<summary>BaseUrl</summary>

Sandbox/PROD: <https://api.startbutton.tech&#x20>;

</details>

{% tabs %}
{% tab title="Endpoint" %}
PATCH `{{baseUrl}}/merchant/ip-whitelist/configure`
{% endtab %}
{% endtabs %}

Add your IP(s) to be whitelisted just as in the sample request below.

{% tabs %}
{% tab title="Sample Request" %}

```
{
    "whitelistedIps": ["127.0.0.1"],
    "password": "@mypassword"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Response" %}

<pre><code>{
    "success": true,
    "message": "Whitelisted IPs updated successfully",
    "data": {
                [ ]
<strong>            }
</strong><strong>  {
</strong>        "whitelistedIps": [
            "127.0.0.1"
        ],
    }
}
</code></pre>

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
NOTE: Once you whitelist your IP, the system validates the IP address in your request for all endpoints that require a PRIVATE/SECRET\_KEY Authorization. If it's invalid, the request will Fail.
{% endhint %}

If a request is made with a non-whitelisted IP address you get the response below:

{% tabs %}
{% tab title="403 Error" %}

```
{
    "message": "Access denied: IP not whitelisted",
    "success": false
}
```

{% endtab %}
{% endtabs %}


---

# 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://startbutton.gitbook.io/startbutton-product-api/startbutton-api-doc/security-measures./ip-whitelisting.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.
