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

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

```
GET https://developers.make.com/custom-apps-documentation/app-components/base/base-url.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.
