---
title: "Fetch HTML content from a URL."
method: POST
path: "/configurations/fetch-url"
tags: ["Configurations"]
---

# Fetch HTML content from a URL.

`POST /configurations/fetch-url`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/configurations/fetch-url`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/configurations/fetch-url/post.ts> (a function with typed inputs; its response is checked against the schema)

Fetches HTML content from a remote URL for use as an email template. Validates that content is HTML and under 100KB. Admin only.

## Request body

- object
  - `url` string, required: The URL to fetch HTML content from.

## Response `200`

HTML content fetched successfully.

- object
  - `content` string: The fetched HTML content.

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden
- `502`: Failed to fetch content from the URL.
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
