> For the complete documentation index, see [llms.txt](https://developers.make.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.make.com/custom-apps-documentation/app-components/base/base-url.md).

# Base URL

Base URL is the main URL to a web service that should be used for every module and remote procedure in an app, e.g. `https://mywebservice.com/api/v1.`

There might be situations when you need to have a variable base URL. For example, if the web service uses multiple domains you may want to let your users have access to the one they use.

## Base URL example: two types of accounts

This is an example of how to handle two types of accounts - `sandbox` and `production`.

{% stepper %}
{% step %}
Add a checkbox in your connection parameters that can be checked when the condition is met:

```json
[
   {
      "name": "sandbox",
      "type": "boolean",
      "label": "Sandbox"
   },
   ...
]
```

{% endstep %}

{% step %}
Implement a condition in both the connection and the base:

```json
{
    "baseUrl": "https://{{if(connection.sandbox,'sandbox.', '')}}yourapi.com/api"
}
```

{% endstep %}
{% endstepper %}

All modules and remote procedures can then use hard-coded `"url": "/uniqueEndpoint"`

## Base URL example: two environments

This is an example of how to handle two types of accounts - `eu` and `us`.

{% stepper %}
{% step %}
Set up `select` in your connection parameters, where you let your users choose from available environments:

```json
[
    {
        "name": "environment",
        "type": "select",
        "label": "Environment",
        "options": [
            {
                "label": "EU",
                "value": "eu"
            },
            {
                "label": "US",
                "value": "us"
            }
        ],
        "default": "production"
    },
    ...
]
```

{% endstep %}

{% step %}
Map the environment in both the connection and the base.

```json
{
    "baseUrl": "https://{{connection.environment}}.yourapi.com",
    ...
}
```

{% endstep %}
{% endstepper %}

All modules and remote procedures can then use hard-coded `"url": "/uniqueEndpoint"`

{% hint style="info" %}
See the [best practices for Base URL](/custom-apps-documentation/best-practices/base.md#base-url) for more information.
{% endhint %}


---

# 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 dynamically by asking a question.

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

```
GET https://developers.make.com/custom-apps-documentation/app-components/base/base-url.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
