> ## Documentation Index
> Fetch the complete documentation index at: https://docs.terminus.app/llms.txt
> Use this file to discover all available pages before exploring further.

# URL field

> An entered field that stores a web address and serves as the base for Tagged URL and Short URL fields.

<Info>
  A URL field stores a single web address. Submitters enter it, and you choose which protocols are accepted. It is the base that link fields build on.
</Info>

## When to use it

* A record needs a destination link: a landing page, a campaign target, or a `mailto:` address.
* You want a clean, validated address to feed into a [Tagged URL](/reference/fields/tagged-url) or [Short URL](/reference/fields/short-url) field.

<Warning>
  Do not use a URL field when you need a short, trackable redirect. The URL field holds the destination. Put a [Short URL](/reference/fields/short-url) field over it to get the tracked link.
</Warning>

## How a value is produced

When a submission is saved, Terminus Hub stores the address the submitter entered, or the `default_value` if the field was left blank. The address is kept as entered. Terminus Hub does not add a protocol for you.

The value is then validated:

* It must parse as a URL.
* Its protocol must be one of the field's `allowed_protocols`.
* It must have an address after the protocol, such as a host, or a recipient for `mailto:`.
* When `validate_url` is on, the host is resolved and rejected if it points only at a private or internal address.

There is no live link checking. Terminus Hub does not fetch the URL to confirm the page exists or returns a successful response. Validation is about the shape of the address and, optionally, the kind of host it resolves to.

## Settings reference

| Setting             | Required | Default             | Description                                                                           |
| ------------------- | -------- | ------------------- | ------------------------------------------------------------------------------------- |
| `allowed_protocols` | No       | `["http", "https"]` | Which schemes are accepted. Any of `http`, `https`, `mailto`.                         |
| `validate_url`      | No       | Off                 | When on, rejects addresses whose host resolves only to a private or internal network. |
| `default_value`     | No       | None                | A URL used to pre-fill the field for a new submission.                                |

URL fields cannot have a prefix or suffix.

## Example

A `destination_url` field in a Campaign URL Builder model:

```yaml theme={null}
name: destination_url
type: url
required: true
settings:
  allowed_protocols: [https]
```

A submitter enters `https://shop.acme.example/deals`, which is stored as entered. Entering `shop.acme.example` with no scheme fails validation with `must start with one of the following protocols: https`. This field then feeds the campaign's Tagged URL and Short URL fields.

## Gotchas

* **No protocol is added for you.** Include `http://`, `https://`, or `mailto:`. A bare host such as `acme.example` fails validation when `allowed_protocols` is set.
* **Narrow the protocols to set policy.** The default accepts `http` and `https`. Set `allowed_protocols: [https]` to require secure links, or add `mailto` for email addresses.
* **`validate_url` blocks internal hosts, not broken links.** With it on, an address that resolves only to a private or internal network is rejected. It does not confirm the page loads. Leave it off unless you have a reason to enforce public hosts.
* **It is the base for other link fields.** A Tagged URL references a URL field as its base, and a Short URL can point at a URL or a Tagged URL field as its destination.

## Related

* [Tagged URL field](/reference/fields/tagged-url): appends query parameters to a URL field.
* [Short URL field](/reference/fields/short-url): a short redirect over a URL or Tagged URL field.
* [Fields](/reference/fields)
