PageHub Templates API

The template catalog.

GitHub OpenAPI

Operations 6

GET /api/v1/templates List templates #
POST /api/v1/templates Create a template #
GET /api/v1/templates/{slug} Read a template #
PUT /api/v1/templates/{slug} Update a template #
DELETE /api/v1/templates/{slug} Delete a template #
GET /api/v1/templates/{slug}/audit Audit a template page #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pagehub-dev:pagehub-dev-templates-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pagehub-dev-templates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PageHub Templates API
  version: 1.0.0
  description: 'The public REST API of PageHub, called with a `ph_` API key (`Authorization: Bearer ph_...`), plus the one webhook the platform calls on a white-label tenant''s server (`fetchPage`).


    A site is HTML + Liquid files: its pages are files (`pages/*.liquid`), written through the files API; the page routes manage each page''s record (name, slug, SEO, access). Writes land in the site''s draft; `PUT /api/v1/sites/{id}` with `published: true` makes the draft live.


    The headless content API (`/api/v1/content/...`) is described by its own document (`GET /api/v1/content/openapi.json`); `GET /api/openapi.json` serves this document with it merged in.


    The routes also accept the dashboard''s session cookie from the dashboard itself; only the API key is the public contract.


    Every operation carries two extension fields. `x-auth` says who may call it: `api-key` (a `ph_` key), `session-or-key` (the dashboard''s own session, or a key), `optional-key` (public, a key widens what you see), `admin-key` (a platform admin''s key), `session` (the dashboard session only; an API key is refused) or `public`. `x-rate-limit` names the rate-limit rule (see the rate-limiting guide) when the route has one; most routes limit per user, public routes per IP.'
  contact:
    name: PageHub
    url: https://pagehub.dev/developers
servers:
- url: https://pagehub.dev
  description: PageHub
security:
- bearerAuth: []
tags:
- name: Templates
  description: The template catalog.
paths:
  /api/v1/templates:
    get:
      tags:
      - Templates
      summary: List templates
      description: Public templates; with a key, also the tenant's own (an admin key sees every template). `slugs=a,b,c` fetches those templates in full and ignores the other filters.
      operationId: listTemplates
      parameters:
      - name: category
        in: query
        required: false
        schema:
          type: string
      - name: tag
        in: query
        required: false
        schema:
          type: string
      - name: q
        in: query
        required: false
        schema:
          type: string
        description: Full-text search.
      - name: slugs
        in: query
        required: false
        schema:
          type: string
        description: Comma-separated slugs (up to 100).
      - name: previewLimit
        in: query
        required: false
        schema:
          type: string
          pattern: ^\d+$
        description: Trims how many preview items each template carries.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  templates:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateSummary'
                  authenticated:
                    const: true
                    description: Present when a valid key was sent.
                required:
                - templates
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-auth: optional-key
      security:
      - {}
      - bearerAuth: []
    post:
      tags:
      - Templates
      summary: Create a template
      description: 'A template is its files: send `files` (and `pages`), or `fromSite` to snapshot a site. The thumbnail is captured automatically after the response. Only platform admins publish into the public catalog (`isPublic`); a tenant''s templates stay its own.'
      operationId: createTemplate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                slug:
                  type: string
                title:
                  type: string
                tagline:
                  type: string
                description:
                  type: string
                category:
                  type: string
                tags:
                  type: array
                  items:
                    type: string
                hidden:
                  type: boolean
                isPublic:
                  type: boolean
                sortOrder:
                  type: integer
                files:
                  description: 'The template''s files: `{ path: text }` or `[{ path, text }]`.'
                  oneOf:
                  - type: object
                    additionalProperties:
                      type: string
                  - type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        text:
                          type: string
                      required:
                      - path
                      - text
                pages:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                  description: Page records, as in a site bundle.
                fromSite:
                  type: string
                  description: A site id to snapshot instead of sending `files`.
              required:
              - slug
              - title
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  slug:
                    type: string
                  title:
                    type: string
                  description:
                    type: string
                required:
                - slug
                - title
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: A conflict (`error` says which).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      x-auth: api-key
  /api/v1/templates/{slug}:
    get:
      tags:
      - Templates
      summary: Read a template
      description: A private template is visible only to its tenant or an admin. `fields=theme` answers just the palette and style guide; `format=liquid` answers the files and page records a site made from the template starts with.
      operationId: getTemplate
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
        description: The template's slug.
      - name: fields
        in: query
        required: false
        schema:
          const: theme
      - name: format
        in: query
        required: false
        schema:
          const: liquid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                - type: object
                  properties:
                    slug:
                      type: string
                    title:
                      type: string
                    tagline:
                      type: string
                    description:
                      type: string
                    category:
                      type: string
                    tags:
                      type: array
                      items:
                        type: string
                    format:
                      const: html
                    version:
                      type: integer
                  required:
                  - slug
                  - title
                - type: object
                  properties:
                    slug:
                      type: string
                    theme:
                      type: object
                      properties:
                        palette:
                          type: array
                          items:
                            type: object
                            additionalProperties: true
                        styleGuide:
                          type: object
                          additionalProperties: true
                  required:
                  - slug
                  - theme
                - type: object
                  properties:
                    slug:
                      type: string
                    title:
                      type: string
                    format:
                      const: liquid
                    from:
                      type: string
                    version:
                      type: integer
                    pages:
                      type: array
                      items:
                        type: object
                        additionalProperties: true
                    files:
                      type: array
                      items:
                        type: object
                        properties:
                          path:
                            type: string
                          text:
                            type: string
                        required:
                        - path
                        - text
                  required:
                  - slug
                  - format
                  - files
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-auth: optional-key
      security:
      - {}
      - bearerAuth: []
    put:
      tags:
      - Templates
      summary: Update a template
      description: The tenant's own template, or any for an admin. Send `files` / `pages` / `fromSite` to replace its content (the thumbnail is recaptured). `expectedVersion` guards against a concurrent edit.
      operationId: updateTemplate
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
        description: The template's slug.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                tagline:
                  type: string
                description:
                  type: string
                category:
                  type: string
                tags:
                  type: array
                  items:
                    type: string
                hidden:
                  type: boolean
                sortOrder:
                  type: integer
                expectedVersion:
                  type: integer
                files:
                  oneOf:
                  - type: object
                    additionalProperties:
                      type: string
                  - type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                        text:
                          type: string
                      required:
                      - path
                      - text
                pages:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                fromSite:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  slug:
                    type: string
                  title:
                    type: string
                  description:
                    type: string
                  version:
                    type: integer
                  updatedAt:
                    type: string
                    format: date-time
                required:
                - slug
                - version
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: A conflict (`error` says which).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      x-auth: api-key
    delete:
      tags:
      - Templates
      summary: Delete a template
      operationId: deleteTemplate
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
        description: The template's slug.
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted:
                    type: boolean
                  slug:
                    type: string
                required:
                - deleted
                - slug
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      x-auth: api-key
  /api/v1/templates/{slug}/audit:
    get:
      tags:
      - Templates
      summary: Audit a template page
      description: Renders the template's stored page as its preview does, then runs the SEO or accessibility checks on it. A private template is visible only to its tenant or an admin.
      operationId: auditTemplate
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
        description: The template's slug.
      - name: kind
        in: query
        required: false
        schema:
          type: string
          enum:
          - seo
          - accessibility
          default: seo
      - name: path
        in: query
        required: false
        schema:
          type: string
          default: /
        description: The page's URL path.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-auth: optional-key
      security:
      - {}
      - bearerAuth: []
components:
  responses:
    Unauthorized:
      description: Missing, malformed or invalid `ph_` API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    BadRequest:
      description: The request is malformed or refused (`error`, often `message`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: The key's user lacks the role this needs, or a plan limit applies.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: No such site, or the key has no access to it, or no such resource under it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  schemas:
    AuditResult:
      type: object
      properties:
        path:
          type: string
        status:
          type: integer
        kind:
          type: string
          enum:
          - seo
          - accessibility
        results:
          type: array
          items:
            type: object
            additionalProperties: true
        redirect:
          type: string
          description: 'Present when the page redirects (`status: 302`).'
      required:
      - path
      - status
      - kind
      - results
    TemplateSummary:
      type: object
      description: A template in the catalog.
      additionalProperties: true
      properties:
        slug:
          type: string
        title:
          type: string
    ApiError:
      type: object
      description: The error body of the management routes. The content API uses `Error` instead.
      properties:
        error:
          type: string
          description: A message, or a code such as `version_conflict`, `lint`, `maintenance`, `site_format_changed`.
        message:
          type: string
        code:
          type: string
        upgrade:
          type: boolean
          description: True when the plan is the reason.
      required:
      - error
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A `ph_` API key (a user's key, or a tenant's).
    tenantAuthToken:
      type: apiKey
      in: header
      name: x-pagehub-auth
      description: The tenant's token, sent by PageHub on every webhook call so the tenant can check the request came from PageHub.