API for AI Agents

Your agent creates
websites in seconds

One API call. Your AI agent gets a live URL back. Publish Figma designs, share documents, or deploy static sites — programmatically, with no human in the loop.

agent.py
# Your AI agent creates a live website
response = requests.post("https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={"mode": "figma", "figmaUrl": url})

# → { "url": "https://my-design.hirohost.site" }

How it works

Three steps. Zero friction.

01

Get your API key

Grab your workspace API key from the organization settings page. One key per workspace.

02

Agent calls the API

POST to /external/projects with a mode (figma, viewer, or static) and optional config. A subdomain is auto-generated if you skip it.

03

Get a live URL back

The response includes a live URL your agent can share, embed, or hand off to the user. Update the project anytime via PATCH.

API Examples

Every project type, one endpoint.

Figma embeds, document viewers, static websites — all created through the same POST request. Your agent picks the mode.

Publish a Figma designpython
import requests

resp = requests.post(
    "https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={
        "mode": "figma",
        "figmaUrl": "https://www.figma.com/design/abc/My-Design",
    },
)
print(resp.json()["url"])
# → https://cedar-drift-bloom.hirohost.site
Create a document sitepython
resp = requests.post(
    "https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={
        "mode": "viewer",
        "subdomain": "quarterly-report",
    },
)
# Upload files to the project separately
print(resp.json()["url"])
# → https://quarterly-report.hirohost.site
Deploy a static sitepython
resp = requests.post(
    "https://api.hiro.host/api/v1/external/projects",
    headers={"X-API-Key": API_KEY},
    json={
        "mode": "static",
        "subdomain": "docs-preview",
        "spaFallback": True,
    },
)
# Upload ZIP/HTML to the project separately
print(resp.json()["url"])
# → https://docs-preview.hirohost.site
Update a projectpython
requests.patch(
    f"https://api.hiro.host/api/v1/external/projects/{uid}",
    headers={"X-API-Key": API_KEY},
    json={
        "password": "secret123",
        "isActive": True,
        "locale": "fr",
    },
)

Claude Code Skill

One click to teach
your agent.

Copy the skill below and save it as a SKILL.md file. Your Claude Code agent will know how to create and manage HIRO host websites automatically.

1

Create ~/.claude/skills/hiro-publish/

2

Paste the copied content into SKILL.md

3

Use /hiro-publish in Claude Code or let it activate automatically

~/.claude/skills/hiro-publish/SKILL.md
---
name: hiro-publish
description: >-
  Create and manage websites on HIRO host via API.
  Use when the user wants to publish a Figma design, share a document,
  or deploy a static site to a live URL.
allowed-tools: Bash(curl *)
---

# HIRO host — Publish to web

You can create and manage live websites using the HIRO host API.

## Setup

The user must provide their API key. Ask for it if not provided.
Set it as a variable for the session:

```bash
export HIRO_API_KEY="<the user's API key>"
```

## Base URL

```
https://api.hiro.host/api/v1/external/projects
```

## Create a project

POST to the base URL. Supported modes: `figma`, `viewer`, `static`.

**Figma design:**
```bash
curl -s -X POST "$HIRO_BASE/api/v1/external/projects" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode": "figma", "figmaUrl": "<figma_url>"}'
```

**Document (viewer):**
```bash
curl -s -X POST "$HIRO_BASE/api/v1/external/projects" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode": "viewer", "subdomain": "<optional-name>"}'
```

**Static website:**
```bash
curl -s -X POST "$HIRO_BASE/api/v1/external/projects" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode": "static", "subdomain": "<optional-name>", "spaFallback": true}'
```

Omit `subdomain` to auto-generate a random one (e.g. cedar-drift-bloom).

## Update a project

PATCH with the project UID:

```bash
curl -s -X PATCH "$HIRO_BASE/api/v1/external/projects/<project_uid>" \
  -H "X-API-Key: $HIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"isActive": false, "password": "secret"}'
```

## Available fields

Create: `mode`, `subdomain`, `figmaUrl`, `isActive`, `locale`, `password`,
`emailCollectionEnabled`, `downloadsDisabled`, `spaFallback`, `actionMenu`.

Update: all of the above except `mode` and `subdomain`, plus `removePassword`.

## Response

Both endpoints return:
```json
{
  "uid": "...",
  "url": "https://<subdomain>.hirohost.site",
  "host": "...",
  "mode": "...",
  "isActive": true,
  ...
}
```

Always show the user the `url` from the response so they can visit their site.

Ready to automate?

Sign up, grab your API key from organization settings, and let your agents start publishing.