Manage custom sheet templates from any HTTP client, script, or IDE. No AI assistant required — just standard REST calls with your API key.
All API requests require an API key sent as a Bearer token. Generate a key from Connected Apps in your account settings. API access requires a paid plan.
Authorization: Bearer ph_...
All responses are JSON. Errors return { "error": "..." } with an appropriate HTTP status code.
GET /api/custom-sheet-templatesList all custom sheet templates owned by the authenticated user.
curl https://polyhedral.co/api/custom-sheet-templates \ -H "Authorization: Bearer ph_..."
Returns an array of template objects.
POST /api/custom-sheet-templatesCreate a new template. Required fields: name, code, buildType.
curl -X POST https://polyhedral.co/api/custom-sheet-templates \
-H "Authorization: Bearer ph_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Sci-Fi Character",
"code": "<Section title=\"Stats\"><Field name=\"hp\" type=\"number\" /></Section>",
"buildType": "in-app",
"description": "A sci-fi RPG character sheet",
"fieldSchema": [
{ "name": "hp", "type": "number", "label": "Hit Points", "default": 10 }
]
}'name (string, required) — display namecode (string, required) — JSX source codebuildType (string, required) — "in-app" or "external"description (string, optional)source (string, optional) — attribution or originfieldSchema (array, optional) — typed field definitionsnameField (string | null, optional) — field used as character namethumbnailUrl (string, optional)Returns the created template object.
GET /api/custom-sheet-templates/{id}Fetch a single template by ID.
curl https://polyhedral.co/api/custom-sheet-templates/TEMPLATE_ID \ -H "Authorization: Bearer ph_..."
PATCH /api/custom-sheet-templates/{id}Update one or more fields on an existing template. Only include the fields you want to change.
curl -X PATCH https://polyhedral.co/api/custom-sheet-templates/TEMPLATE_ID \
-H "Authorization: Bearer ph_..." \
-H "Content-Type: application/json" \
-d '{ "code": "<Section title=\"Stats\">...</Section>" }'DELETE /api/custom-sheet-templates/{id}Delete a template and its thumbnail.
curl -X DELETE https://polyhedral.co/api/custom-sheet-templates/TEMPLATE_ID \ -H "Authorization: Bearer ph_..."
Returns { "success": true }.
POST /api/custom-sheet-templates/validateValidate JSX syntax without creating or updating a template. Useful for checking code before pushing it.
curl -X POST https://polyhedral.co/api/custom-sheet-templates/validate \
-H "Authorization: Bearer ph_..." \
-H "Content-Type: application/json" \
-d '{ "code": "<Section title=\"Stats\"><Field name=\"hp\" type=\"number\" /></Section>" }'Returns { "valid": true } on success, or { "valid": false, "error": "...", "line": 1, "column": 5 } on failure.
# Validate first
curl -X POST https://polyhedral.co/api/custom-sheet-templates/validate \
-H "Authorization: Bearer ph_..." \
-H "Content-Type: application/json" \
-d "$(jq -n --arg code "$(cat my-sheet.jsx)" '{ code: $code }')"
# Create
curl -X POST https://polyhedral.co/api/custom-sheet-templates \
-H "Authorization: Bearer ph_..." \
-H "Content-Type: application/json" \
-d "$(jq -n \
--arg name "My Custom Sheet" \
--arg code "$(cat my-sheet.jsx)" \
'{ name: $name, code: $code, buildType: "in-app" }'
)"TEMPLATE_ID="your-template-id"
curl -X PATCH "https://polyhedral.co/api/custom-sheet-templates/$TEMPLATE_ID" \
-H "Authorization: Bearer ph_..." \
-H "Content-Type: application/json" \
-d "$(jq -n --arg code "$(cat my-sheet.jsx)" '{ code: $code }')"After creating or updating a template, open it in the browser to preview:
https://polyhedral.co/home/sheets/preview/TEMPLATE_ID