hostdocs API
API Reference

Pages

List pages

GET
/api/v1/pages
AuthorizationBearer <token>

A hostdocs developer API key (an opaque token issued by Clerk; create one in the dashboard under API keys).

In: header

Header Parameters

x-hostdocs-account-id?string

Target workspace id. Defaults to the key’s workspace.

Formatuuid
x-hostdocs-site-id?string

Target site id. Defaults to the workspace’s default site.

Formatuuid

Response Body

curl -X GET "https://api.hostdocs.io/api/v1/pages" \  -H "x-hostdocs-account-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "x-hostdocs-site-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "success": true,
  "data": [
    {}
  ]
}

Create and publish a page

Requires the write scope.

POST
/api/v1/pages
AuthorizationBearer <token>

A hostdocs developer API key (an opaque token issued by Clerk; create one in the dashboard under API keys).

In: header

Header Parameters

x-hostdocs-account-id?string

Target workspace id. Defaults to the key’s workspace.

Formatuuid
x-hostdocs-site-id?string

Target site id. Defaults to the workspace’s default site.

Formatuuid
pathstring
Length1 <= length <= 2048
html?string
Length1 <= length
templateId?string
Length1 <= length
title?string
Lengthlength <= 255
siteId?string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Response Body

curl -X POST "https://api.hostdocs.io/api/v1/pages" \  -H "x-hostdocs-account-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "x-hostdocs-site-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "path": "string"  }'
{
  "success": true,
  "data": {}
}

Get a page

GET
/api/v1/pages/{id}
AuthorizationBearer <token>

A hostdocs developer API key (an opaque token issued by Clerk; create one in the dashboard under API keys).

In: header

Path Parameters

idstring
Formatuuid

Header Parameters

x-hostdocs-account-id?string

Target workspace id. Defaults to the key’s workspace.

Formatuuid

Response Body

curl -X GET "https://api.hostdocs.io/api/v1/pages/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "x-hostdocs-account-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "success": true,
  "data": {}
}

Delete (unpublish) a page

Requires the write scope.

DELETE
/api/v1/pages/{id}
AuthorizationBearer <token>

A hostdocs developer API key (an opaque token issued by Clerk; create one in the dashboard under API keys).

In: header

Path Parameters

idstring
Formatuuid

Header Parameters

x-hostdocs-account-id?string

Target workspace id. Defaults to the key’s workspace.

Formatuuid

Response Body

curl -X DELETE "https://api.hostdocs.io/api/v1/pages/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "x-hostdocs-account-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "success": true,
  "data": {}
}

Replace a page’s HTML (new version)

Requires the write scope.

PUT
/api/v1/pages/{id}/content
AuthorizationBearer <token>

A hostdocs developer API key (an opaque token issued by Clerk; create one in the dashboard under API keys).

In: header

Path Parameters

idstring
Formatuuid

Header Parameters

x-hostdocs-account-id?string

Target workspace id. Defaults to the key’s workspace.

Formatuuid
htmlstring
Length1 <= length

Response Body

curl -X PUT "https://api.hostdocs.io/api/v1/pages/497f6eca-6276-4993-bfeb-53cbbbba6f08/content" \  -H "x-hostdocs-account-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "html": "string"  }'
{
  "success": true,
  "data": {}
}