---
title: Get Trusted Preview Hosts
description: Returns the hostname patterns trusted to embed previews for the current team.
docs_index: /docs/llms.txt
lastUpdated: 2026-10-22
badge: "GET"
---

> For an index of all documentation, see [/docs/llms.txt](/docs/llms.txt).

Returns the hostname patterns trusted to embed previews for the current team.

#### `GET /v2/settings/preview-hosts`

## Hostname matching

| Pattern               | Matches                                                                          |
| --------------------- | -------------------------------------------------------------------------------- |
| `preview.example.com` | Only that exact hostname.                                                        |
| `*.example.com`       | Exactly one subdomain level, such as `app.example.com`; not `a.b.example.com`.   |
| `**.example.com`      | One or more subdomain levels, including `app.example.com` and `a.b.example.com`. |

Neither wildcard includes `example.com` itself. Add the root domain as a separate pattern when needed. Wildcards must appear as `*.` or `**.` at the beginning, followed by at least two fixed hostname labels.

Use hostnames only, without a scheme, port, path, user information, query, or fragment. Patterns are normalized to lowercase, and at most 100 can be configured. See [exact hosts and wildcards](/docs/api/v2/guides/accessing-previews#exact-hosts-and-wildcards) for examples and [updating patterns](/docs/api/v2/guides/accessing-previews#update-trusted-hosts) for mutation behavior.

Returns configured patterns, not the individual hostnames covered by wildcards.

## Usage

```typescript
import { v0 } from 'v0'

const result = await v0.settings.getPreviewHosts()

console.log(result)
```

```bash
curl -X GET "https://api.v0.dev/v2/settings/preview-hosts"   -H "Authorization: Bearer $V0_API_KEY"   -H "Content-Type: application/json"
```

## API Signature

### Request

### Response

- `hosts: string[]` Canonicalized hostname patterns trusted to embed previews. Exact hosts match only themselves; \*.example.com matches exactly one subdomain label; \*\*.example.com matches one or more subdomain labels. Wildcards do not include the apex, so list example.com separately when it should also be trusted.

---

For a semantic overview of all documentation, see [/docs/sitemap.md](/docs/sitemap.md)

For an index of all available documentation, see [/docs/llms.txt](/docs/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/docs/agents.md](/docs/agents.md)