// api reference

HTML Pages API

Create, update, and list hosted HTML pages programmatically. Push markup once and get a live URL back. Wire it into your own backend, or use the native Make.com module and n8n node.

Quick Start

Base URL

https://api.app.customjs.io

Get your API key from app.customjs.space. Prefer no code? The HTML Hosting product wraps this API in a UI and Make/n8n modules.

Authentication

Pass your API key in the x-api-key header on every request.

curl https://api.app.customjs.io/pages/api/page \
  -H "x-api-key: YOUR_API_KEY"

GET /pages/api/page

List every page in your workspace. Returns an array of page objects. Use this to find a page's pageId before updating it.

Example

curl https://api.app.customjs.io/pages/api/page \
  -H "x-api-key: YOUR_API_KEY"

Response

[
  {
    "pageId": "pg_8f21",
    "name": "Launch page",
    "htmlFileUrl": "https://pages.customjs.io/launch-page.html"
  }
]

POST /pages/page/upload-html

Create a new hosted page. The response contains the live htmlFileUrl.

Request body

FieldTypeDescription
namestringRequired. A unique name for the page, also used to find it later
htmlContentstringRequired. The full HTML document to host
slugstringOptional custom slug for the page URL

Example

curl -X POST https://api.app.customjs.io/pages/page/upload-html \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Launch page",
    "htmlContent": "<h1>Launch day</h1>"
  }'

Response

{
  "pageId": "pg_8f21",
  "htmlFileUrl": "https://pages.customjs.io/launch-page.html",
  "name": "Launch page",
  "message": "Page created",
  "created": true
}

PUT /pages/api/page/id/{pageId}/update-html

Replace the HTML of an existing page. The live URL stays the same, so the page updates in place.

Request body

FieldTypeDescription
htmlContentstringRequired. The new HTML document
namestringUpdated page name

The pageId comes from the create response or the list endpoint.

Example

curl -X PUT https://api.app.customjs.io/pages/api/page/id/pg_8f21/update-html \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Launch page",
    "htmlContent": "<h1>Launch day v2</h1>"
  }'

Response

{
  "pageId": "pg_8f21",
  "htmlFileUrl": "https://pages.customjs.io/launch-page.html",
  "name": "Launch page",
  "message": "Page updated"
}

Upsert pattern

To publish idempotently, list the pages, match by name, then update or create. This is exactly what the Make module and n8n node do.

// Create the first time, update on every run after
const pages = await api.get('/pages/api/page');
const existing = pages.find(p => p.name === name);

if (existing) {
  await api.put('/pages/api/page/id/' + existing.pageId + '/update-html', { name, htmlContent });
} else {
  await api.post('/pages/page/upload-html', { name, htmlContent });
}

Response object

FieldTypeDescription
pageIdstringUnique ID of the page, used to update it later
htmlFileUrlstringThe live URL where the page is served
namestringThe page name
messagestringHuman-readable status message
createdbooleanOn create: true for a new page (omitted on update)

Error Codes

CodeMeaning
200Success
400Bad request: missing name or htmlContent
401Unauthorized: missing or invalid API key
404Page not found. Check the pageId
500Internal error

// no-code option

Prefer to skip the code?

The HTML Hosting product wraps this API in a UI, one-click custom domains, and native Make.com and n8n modules. Generate pages and forms without touching a request.

upload.curl
curl -X POST https://api.app.customjs.io/pages/page/upload-html \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "name": "Launch page",
    "htmlContent": "<h1>Launch day</h1>"
  }'

Custom domains · SSL · global CDN

HTML Pages API FAQ