Dokumentasi API
API hdply memungkinkan skrip dan agen AI mengelola situs Anda secara terprogram: melihat daftar proyek, membaca HTML, menerbitkan pembaruan, dan membuat situs baru. API REST yang kecil dan mudah ditebak — kalau bisa pakai curl, bisa pakai hdply.
Autentikasi
Buat kunci API pribadi Anda di dasbor konsol (kartu "Kunci API"). Kirim sebagai token bearer pada setiap permintaan:
Authorization: Bearer hdply_sk_…
Kunci hanya ditampilkan sekali saat dibuat; membuat ulang akan menggantinya, menghapus akan mencabutnya seketika. Rahasiakan — kunci ini memberi akses ke semua proyek Anda.
URL dasar
https://api.app.hdply.com
Endpoint
GET /v1/projects— daftar proyek Anda.POST /v1/projects— membuat proyek. Body JSON:{"name": "opsional", "html": "opsional"}. Jikahtmldisertakan, situs langsung tayang; tanpa nama, dipakai<title>dari HTML. Subdomain ditetapkan server secara acak.GET /v1/projects/{id}— satu proyek.{id}menerima id numerik atau subdomain (mis.k3v9x2m7q1).GET /v1/projects/{id}/html— HTML yang sedang tayang.PUT /v1/projects/{id}/html— menerbitkan HTML baru (bodytext/htmlmentah, tayang begitu respons kembali).GET /v1/projects/{id}/deployments— riwayat deploy (deploy via API bertanda"source": "api").
Tidak ada DELETE. Menghapus situs sengaja hanya bisa lewat web, sehingga agen otomatis tidak akan pernah bisa menghancurkan karya Anda. Setiap deploy API memiliki versi — pulihkan versi mana pun dari konsol.
Mulai cepat
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
Batasan dan galat
- HTML dibatasi 1 MB per situs (satu file mandiri paling optimal).
- Paket gratis mencakup 20 situs; Pro tanpa batas.
- Galat berupa JSON:
{"code": "…", "error": "pesan"}. Kode umum:unauthorized(401),project_not_found(404),project_limit(403),file_too_large(413).
Claude & MCP
hdply dilengkapi server MCP bawaan, sehingga Claude Code dan Claude Desktop dapat memakai situs Anda sebagai alat native (list_sites, create_site, get_site_html, deploy_site, get_deploy_history). Hubungkan Claude Code dengan satu perintah:
claude mcp add --transport http hdply https://api.app.hdply.com/mcp \ --header "Authorization: Bearer hdply_sk_…"
Untuk Claude Desktop, tambahkan ini ke pengaturan MCP Anda (claude_desktop_config.json):
{
"mcpServers": {
"hdply": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.app.hdply.com/mcp",
"--header", "Authorization: Bearer hdply_sk_…"]
}
}
}
Menggunakan dengan agen AI
Tempel blok di bawah ke ChatGPT, Claude, atau agen apa pun dengan akses shell, bersama kunci Anda. Setelah itu cukup katakan "perbarui situs saya".
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.
Ringkasan yang dapat dibaca mesin untuk crawler dan agen: hdply.com/llms.txt