Documentação da API
A API do hdply permite que scripts e agentes de IA gerenciem seus sites de forma programática: listar projetos, ler HTML, publicar atualizações e criar sites novos. É uma API REST pequena e previsível — se você sabe usar curl, sabe usar hdply.
Autenticação
Crie sua chave de API pessoal no painel do console (cartão "Chave de API"). Envie-a como token bearer em toda requisição:
Authorization: Bearer hdply_sk_…
A chave é exibida uma única vez na criação; regenerar a substitui, excluir a revoga na hora. Mantenha-a em segredo — ela dá acesso a todos os seus projetos.
URL base
https://api.app.hdply.com
Endpoints
GET /v1/projects— lista seus projetos.POST /v1/projects— cria um projeto. Corpo JSON:{"name": "opcional", "html": "opcional"}. Comhtml, o site fica no ar imediatamente; sem nome, usa-se o<title>do HTML. O servidor atribui um subdomínio aleatório.GET /v1/projects/{id}— um projeto.{id}aceita o id numérico ou o subdomínio (ex.:k3v9x2m7q1).GET /v1/projects/{id}/html— o HTML atualmente no ar.PUT /v1/projects/{id}/html— publica HTML novo (corpotext/htmlbruto, no ar assim que a resposta retorna).GET /v1/projects/{id}/deployments— histórico de deploys (deploys via API levam a tag"source": "api").
Não há DELETE. Remover um site é intencionalmente só pela web, então um agente automatizado nunca pode destruir seu trabalho. Cada deploy via API é versionado — restaure qualquer versão anterior pelo console.
Início rápido
export HDPLY_KEY=hdply_sk_…
# create a site and go live in one call
curl -X POST https://api.app.hdply.com/v1/projects \
-H "Authorization: Bearer $HDPLY_KEY" \
-H "Content-Type: application/json" \
-d '{"html": "<!doctype html><title>Hello</title><h1>Hi!</h1>"}'
# → {"project": {"subroute": "k3v9x2m7q1", "url": "https://k3v9x2m7q1.hdply.com", …}}
# read the live HTML
curl https://api.app.hdply.com/v1/projects/k3v9x2m7q1/html \
-H "Authorization: Bearer $HDPLY_KEY"
# publish an update
curl -X PUT https://api.app.hdply.com/v1/projects/k3v9x2m7q1/html \
-H "Authorization: Bearer $HDPLY_KEY" \
-H "Content-Type: text/html" \
--data-binary @index.html
Limites e erros
- O HTML é limitado a 1 MB por site (um único arquivo autocontido funciona melhor).
- O plano grátis inclui 20 sites; o Pro é ilimitado.
- Erros são JSON:
{"code": "…", "error": "mensagem"}. Códigos comuns:unauthorized(401),project_not_found(404),project_limit(403),file_too_large(413).
Claude e MCP
O hdply traz um servidor MCP embutido, então Claude Code e Claude Desktop podem usar seus sites como ferramentas nativas (list_sites, create_site, get_site_html, deploy_site, get_deploy_history). Conecte o Claude Code com um comando:
claude mcp add --transport http hdply https://api.app.hdply.com/mcp \ --header "Authorization: Bearer hdply_sk_…"
Para o Claude Desktop, adicione isto às suas configurações MCP (claude_desktop_config.json):
{
"mcpServers": {
"hdply": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.app.hdply.com/mcp",
"--header", "Authorization: Bearer hdply_sk_…"]
}
}
}
Uso com agentes de IA
Cole o bloco abaixo no ChatGPT, Claude ou qualquer agente com acesso a shell, junto com sua chave. Daí em diante basta dizer "atualize meu site" que ele saberá como.
You can manage my hdply websites via its REST API.
Base URL: https://api.app.hdply.com
Auth header on every request: "Authorization: Bearer <MY_KEY>"
Endpoints:
- GET /v1/projects -> list my sites
- POST /v1/projects -> create; JSON {"name"?, "html"?}; html goes live instantly
- GET /v1/projects/{id}/html -> current HTML ({id} = numeric id or subdomain)
- PUT /v1/projects/{id}/html -> publish new HTML (raw text/html body)
- GET /v1/projects/{id}/deployments -> version history
Rules: HTML max 1MB, single self-contained file preferred (inline CSS/JS).
There is no delete endpoint. Every deploy is versioned and restorable.
After publishing, the site is live at https://{subroute}.hdply.com immediately.
Resumo legível por máquina para crawlers e agentes: hdply.com/llms.txt