> ## Documentation Index
> Fetch the complete documentation index at: https://docs.1club.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a website from a Website Template

> Builds a new website from a template in `GET /templates`, as the admin's template gallery does: the template's pages, sections and look, with its sample copy rewritten for the business from its own data. A figure or claim the data cannot support is left out. The website is created offline, so nothing is public, and publishing it leaves it offline: taking it online and connecting a domain happen in the admin. Review it with `previewUrl`.
Asking again for the same template and club, before anyone has edited the website it built, returns that website as it is, its name included, with `created: false` and a 200, rather than building another. While one is being built, asking again is answered 409. The organization's other websites are left as they are. Building takes up to a minute, and an organization can build 30 websites an hour. Requires the website:write scope.




## OpenAPI

````yaml /openapi-platform.json post /v1/platform/website/sites
openapi: 3.0.0
info:
  title: 1club Platform API
  version: 1.0.0
  description: >-
    The 1club Platform API lets you programmatically access and manage your
    organization's data.


    ## Official API Contract


    This documentation is the official source of truth for the 1club Platform
    API.

    If an integration relies on undocumented endpoints, fields, response shapes,
    or internal behavior outside this spec, we can't guarantee backward
    compatibility.

    Build against what's documented here to stay stable as the platform evolves.


    ## Authentication


    All requests require a customer API key passed as a Bearer token:


    ```

    Authorization: Bearer 1club_sk_live_...

    ```


    Generate API keys from the admin portal under **Settings > API Tokens**.

    The key is tied to your organization - all responses are scoped to your
    org's data.


    Agents and MCP connectors can instead send an OAuth access token (the
    `platformOAuth` scheme), requesting only the scopes the task needs.


    ## Rate Limiting


    - **100 requests per minute** per API key

    - When exceeded, the API returns `429 Too Many Requests` with a
    `Retry-After` header

    - Rate limit headers are included in every response:
      - `X-RateLimit-Limit` - max requests per window
      - `X-RateLimit-Remaining` - requests remaining
      - `X-RateLimit-Reset` - seconds until the window resets

    ## Errors


    | Status | Meaning |

    |--------|---------|

    | `400` | Invalid request parameters |

    | `401` | Missing or invalid API key |

    | `404` | Resource not found (or doesn't belong to your organization) |

    | `429` | Rate limit exceeded |

    | `500` | Internal server error |


    ## Versioning and deprecation


    The API is versioned in the path (`/v1`). Changes within a version are
    additive: new endpoints, new optional parameters and new response fields can
    appear at any time, so clients should ignore fields they do not recognise.

    A breaking change ships as a new version.

    An operation due to be removed is first marked `deprecated: true` in this
    spec and announced in the changelog at https://docs.1club.ai/changelog, with
    advance notice before it is withdrawn.
  contact:
    name: 1club API Support
    email: support@1club.ai
servers:
  - url: https://api.1club.ai
    description: Production API
security:
  - customerApiAuth: []
  - platformOAuth: []
tags: []
paths:
  /v1/platform/website/sites:
    post:
      tags:
        - Website
      summary: Create a website from a Website Template
      description: >
        Builds a new website from a template in `GET /templates`, as the admin's
        template gallery does: the template's pages, sections and look, with its
        sample copy rewritten for the business from its own data. A figure or
        claim the data cannot support is left out. The website is created
        offline, so nothing is public, and publishing it leaves it offline:
        taking it online and connecting a domain happen in the admin. Review it
        with `previewUrl`.

        Asking again for the same template and club, before anyone has edited
        the website it built, returns that website as it is, its name included,
        with `created: false` and a 200, rather than building another. While one
        is being built, asking again is answered 409. The organization's other
        websites are left as they are. Building takes up to a minute, and an
        organization can build 30 websites an hour. Requires the website:write
        scope.
      operationId: createWebsiteSite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - templateKey
              properties:
                templateKey:
                  type: string
                  description: A key from GET /templates, e.g. "gym-forge".
                name:
                  type: string
                  description: >-
                    The website's name in the admin. Defaults to the template's
                    name.
                clubId:
                  type: integer
                  description: >-
                    Builds the website for this club: binds it and keeps its
                    copy to that club. Omit for the whole organization.
      responses:
        '200':
          description: >-
            The untouched website this template already built for this club,
            with `created` false
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformWebsite'
        '201':
          description: The new website, its pages and its layout, with `created` true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformWebsite'
        '400':
          description: No template of that name, or a club that is not in this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformError'
        '401':
          $ref: '#/components/responses/PlatformUnauthorized'
        '403':
          description: API key is missing the required `website:write` scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformError'
        '409':
          $ref: '#/components/responses/PlatformConflict'
        '429':
          $ref: '#/components/responses/PlatformRateLimited'
      security:
        - customerApiAuth: []
components:
  schemas:
    PlatformWebsite:
      type: object
      description: >-
        A website belonging to the organization. Page content, layout and theme
        tokens describe the **draft**. `url`, `published`,
        `activeReleaseVersion` and `lastPublishedAt` describe what the public is
        currently being served. `name` and `clubId` are live row fields — they
        take effect without a publish.
      properties:
        id:
          type: integer
        name:
          type: string
        slug:
          type: string
          description: Platform host label - the site answers on `<slug>.1club.me`.
        domain:
          type: string
          nullable: true
          description: Custom domain, when one is pointed at this site.
        isDefault:
          type: boolean
          description: >-
            True for the site an organization-wide caller means by "the
            website". Exactly one per organization.
        isActive:
          type: boolean
          description: >-
            False means the site is switched off and serves nothing publicly,
            whatever the draft contains.
        clubId:
          type: integer
          nullable: true
          description: >-
            Club this website represents. When set, the header and footer use
            that club's logo instead of the organization's. Live, like `name`.
        url:
          type: string
          description: Public URL - the custom domain when set, else the platform host.
        previewUrl:
          type: string
          description: >-
            The same site rendered from the unpublished draft - the link to
            review edits before publishing. Carries a signed grant that expires
            24 hours after this response was generated; read the website again
            for a fresh one. Anyone holding the link can view the draft, so it
            is shareable without a login but should be treated as sensitive.
        published:
          type: boolean
          description: >-
            Whether the site has ever been published. False means nothing is
            publicly reachable yet.
        activeReleaseVersion:
          type: integer
          nullable: true
        lastPublishedAt:
          type: string
          format: date-time
          nullable: true
        themeSupport:
          type: string
          enum:
            - both
            - light
            - dark
          nullable: true
        defaultTheme:
          type: string
          enum:
            - light
            - dark
            - system
          nullable: true
        supportedLocales:
          type: array
          nullable: true
          items:
            type: string
          description: >-
            Locales the site serves, which is what its `hreflang` alternates and
            `sitemap.xml` advertise. Organization-level - see `PATCH
            /v1/platform/website`.
        defaultLocale:
          type: string
          nullable: true
          description: Locale served at the site root. Organization-level.
        seoSettings:
          type: object
          description: >-
            Site-wide SEO defaults. Each field is a fallback a page can
            override.
          additionalProperties: false
          properties:
            siteDescription:
              type: string
              description: >-
                Meta-description fallback, and the `description` in the site's
                structured data.
            defaultOgImage:
              type: string
              description: Social-share image for pages with no `ogImage` of their own.
            verification:
              type: object
              description: >-
                Search-console ownership tokens, rendered as meta tags on every
                page.
              properties:
                google:
                  type: string
                bing:
                  type: string
        pages:
          type: array
          description: Present when fetching one website; omitted from the site list.
          items:
            $ref: '#/components/schemas/PlatformWebsitePage'
        layout:
          type: object
          description: Header and footer, rendered on every page.
          properties:
            header:
              $ref: '#/components/schemas/PlatformWebsiteSection'
            footer:
              $ref: '#/components/schemas/PlatformWebsiteSection'
        hasCustomCss:
          type: boolean
        updatedAt:
          type: string
          format: date-time
    PlatformError:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: >-
            A stable, machine-readable reason, when the error has one (e.g.
            `CONTACT_EXISTS`).
        details:
          type: object
          additionalProperties: true
          description: >-
            Structured values behind the error. A 409 naming an existing record
            carries its id here, e.g. `contactId`.
    PlatformWebsitePage:
      type: object
      description: A page on the website draft.
      properties:
        slug:
          type: string
          description: >-
            URL path segment. The homepage is served at "/" regardless of its
            slug.
        title:
          type: string
        isHomepage:
          type: boolean
        sectionCount:
          type: integer
        sectionTypes:
          type: array
          items:
            type: string
        sections:
          type: array
          description: Present when fetching a single page; omitted from list responses.
          items:
            $ref: '#/components/schemas/PlatformWebsiteSection'
        metaTitle:
          type: string
          nullable: true
        metaDescription:
          type: string
          nullable: true
        ogImage:
          type: string
          nullable: true
        noindex:
          type: boolean
          description: >-
            True when the page asks search engines not to index it and is left
            out of `sitemap.xml`.
        translations:
          type: object
          nullable: true
          description: >-
            Per-locale `metaTitle`/`metaDescription` overrides, keyed by locale:
            { "bg": { "metaTitle": "…" } }. Present when fetching a single page.
          additionalProperties:
            type: object
            properties:
              metaTitle:
                type: string
              metaDescription:
                type: string
        seo:
          $ref: '#/components/schemas/PlatformWebsitePageSeo'
        url:
          type: string
          description: The page's public URL once published.
    PlatformWebsiteSection:
      type: object
      description: >-
        One section of a page or of the site layout. `config` fields depend on
        `type` - see GET /v1/platform/website/section-types for the definitions.
      properties:
        type:
          type: string
          description: Section type, e.g. "hero", "plans", "faq", "header".
        htmlId:
          type: string
          pattern: ^[a-z][a-z0-9-]*$
          description: >-
            The section's anchor on the page (`#<htmlId>`), unique within the
            page. Send back the value a read returned to keep it; omit it and
            one is derived from the type.
        config:
          type: object
          additionalProperties: true
        translations:
          type: object
          additionalProperties: true
          description: >-
            Per-locale overrides for the section's translatable string fields,
            keyed by locale then field: { "bg": { "headline": "…" } }. Config
            values themselves stay in the default language.
    PlatformWebsitePageSeo:
      type: object
      description: >-
        What the published page will actually put in its `<head>`, after every
        fallback has been applied - the authored fields alone do not answer "is
        my SEO right?". Present when fetching a single page. Read-only.
      properties:
        metaTitle:
          type: string
          description: The `<title>`, after falling back to the page title.
        metaDescription:
          type: string
          nullable: true
          description: After falling back to `seoSettings.siteDescription`.
        ogImage:
          type: string
          nullable: true
          description: After falling back to `seoSettings.defaultOgImage`.
        canonicalUrl:
          type: string
          description: >-
            The `rel=canonical` the default-locale render emits, locale prefix
            included.
        indexable:
          type: boolean
          description: Whether search engines are asked to index this page.
        notIndexableReason:
          type: string
          nullable: true
          enum:
            - page_noindex
            - site_unpublished
            - site_inactive
          description: >-
            Why `indexable` is false. An unpublished or switched-off site is not
            indexable however the page is configured.
        localizedLocales:
          type: array
          items:
            type: string
          description: Locales carrying their own metaTitle/metaDescription overrides.
  responses:
    PlatformUnauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformError'
    PlatformConflict:
      description: >-
        The request conflicts with existing state, or reuses an Idempotency-Key
        with a different body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformError'
    PlatformRateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformError'
  securitySchemes:
    customerApiAuth:
      type: http
      scheme: bearer
      description: >-
        Organization-scoped bearer credential: a customer API key
        (1club_sk_live_...) or an MCP OAuth access token.
    platformOAuth:
      type: oauth2
      description: >-
        OAuth 2.1 authorization code flow with PKCE (S256), as used by MCP
        connectors. Register a client dynamically (RFC 7591) at
        https://api.1club.ai/v1/mcp/oauth/register. Each scope grants one
        capability; request only what the integration needs.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.1club.ai/oauth/authorize
          tokenUrl: https://api.1club.ai/v1/mcp/oauth/token
          scopes:
            '*': >-
              Full access - read and manage everything in this organization,
              including capabilities added later
            classes:read: View classes, class types, schedules and progression tracks
            classes:write: >-
              Create, reschedule, and cancel classes, and maintain the class
              types they are run as
            checkins:read: View check-ins
            checkins:write: Check people in, to a booking or on their membership
            content:read: View published content
            content:write: >-
              Create, edit and delete content - posts, FAQs, documents and
              reusable blocks
            website:read: >-
              View your website: pages, sections, layout, styles and publish
              history
            website:write: >-
              Edit your website - pages, sections, navigation and styles. Edits
              stay unpublished until published.
            website:publish: >-
              Publish your website, making unpublished edits visible to the
              public, and roll back to an earlier version
            media:read: View your media library
            media:write: >-
              Add images and videos to your media library and edit their names
              and descriptions
            media:delete: Permanently delete files from your media library
            clubs:read: View club information
            clubs:write: >-
              Edit your clubs' details - name, contact details, address, opening
              hours, amenities and sports. Live on your website, member portal,
              app and 1club.me at once; a club listed on 1club.me sends its
              listing's changes for review.
            transactions:read: >-
              View transactions, who owes you and for how long, the sales behind
              your tax report and your chart of accounts
            transactions:write: >-
              Record revenue collected outside 1club, such as a marketplace
              payout for your bookings, and refunds of it. Nothing is charged to
              anyone.
            transactions:delete: >-
              Void unpaid charges so they are no longer owed, and delete ones
              raised by mistake. A never-paid pass whose last charge goes is
              cancelled with it. Paid charges cannot be voided or deleted, and
              an API key reaches only the charges of bookings it made.
            payments:write: >-
              Record a payment against what a member owes, with one of your own
              payment methods such as cash or a bank transfer, and charge a
              member's saved card for a charge. An API key reaches only the
              charges of bookings it made.
            invoices:read: >-
              View your invoices - who they were issued to, their amounts and
              status - and how much was invoiced over a period
            areas:read: View areas, area types, blocks and availability
            areas:write: >-
              Create and update areas and area types, and block or unblock an
              area
            bookings:read: >-
              View bookings, and every booking of a period with where its
              payment stands (the booking audit)
            bookings:write: >-
              Create, change, reschedule and cancel bookings, add or remove
              participants, and waive what a cancelled or missed booking still
              owes
            bookings:delete: >-
              Permanently delete bookings entered by mistake, with their unpaid
              charges, check-ins and players. A paid or invoiced booking cannot
              be deleted - cancel and refund it instead.
            contacts:read: >-
              View contacts, their tags and custom field values, and your sales
              pipeline stages and sources, and who is behind your people reports
              (at risk, renewals, promotions, cancellations)
            contacts:write: >-
              Create and update contacts and tag them, and maintain your tags,
              smart tag rules and contact custom fields
            contacts:delete: >-
              Archive contacts, which cancels their active memberships and all
              their future bookings. Separate from creating and updating because
              those cancellations are not undone by restoring the contact.
            instructors:read: >-
              View instructors, their availability, the staff roster and their
              time off
            instructors:write: >-
              Create and update instructors (coaches) and the instructor types
              they are grouped by, including what members pay for a one-to-one
              session and how you pay the coach, and manage the staff roster
              (shifts, rotations) and their time off. Does not grant
              admin-portal access: an instructor created this way has no login
              and is never invited to your staff portal.
            plans:read: View plans and pricing
            plans:write: Create, edit and delete plans and plan categories
            memberships:read: View memberships
            memberships:write: >-
              Sell memberships, set their price and whether they are paid, and
              pause, resume or cancel them
            products:read: >-
              View the product catalogue and its categories, including prices
              and how many are left to sell
            products:write: Create and edit products and product categories
            forms:read: >-
              View your forms and their questions, and how many people have
              completed each. Not the answers themselves.
            forms:write: >-
              Create and edit forms and their questions, including sign-up forms
              that sell your plans and products. Forms are public as soon as
              they are created or changed. Does not delete forms.
            organization:write: >-
              Change organization-wide settings, which take effect immediately.
              That includes which languages you offer, across your website, the
              member portal, the mobile app and email, and what your clubs call
              their booking cards (private training, group activities, areas)
              wherever members book.
            revenue-accounts:write: >-
              Add accounts to your chart of accounts and edit them, including
              which one sales post to by default. Reading the chart needs no
              scope of its own - any of plans, products or transactions admits
              it.
            pricing-rules:read: >-
              View pricing rules - the surcharges, discounts and set prices
              applied when a booking is priced - and quote what a booking would
              cost
            pricing-rules:write: >-
              Create, edit, turn off and delete pricing rules. Changes apply to
              every booking priced afterwards.
            booking-policies:read: >-
              View booking policies: cancellation and refund rules, payment
              timing and booking windows
            booking-policies:write: >-
              Create, edit, duplicate and delete booking policies. Changes apply
              to every booking they cover from then on.
            document-rules:read: >-
              View document rules - which members are asked to sign or accept
              which documents, such as waivers
            document-rules:write: >-
              Create, edit and delete document rules, which decide who must sign
              or accept a document and whether it is required for entry
            external-programs:read: >-
              View external programs - third parties such as MultiSport or a
              corporate wellness scheme that pay for members' visits - and what
              each covers
            external-programs:write: >-
              Create, edit and remove external programs, including what each
              pays per visit and which classes, areas and coaches it can be used
              for
            templates:read: View your email and SMS templates
            templates:write: Create, edit and delete email and SMS templates
            events:read: View events, their tickets and how many are sold
            events:write: >-
              Create, edit, duplicate and delete events, and publish, unpublish
              or cancel them. Cancelling an event also cancels its attendees'
              bookings.
            messages:read: >-
              View messages sent to and received from your members, and their
              delivery status
            messages:write: >-
              Prepare draft messages to members. Drafts are never sent from
              here: someone at your club reviews and sends them from 1club.
            analytics:read: >-
              View statistics over a period - revenue, tax, bookings, check-ins,
              how full your classes, courts and coaches were, memberships added
              and cancelled, and new members - as totals, never the people or
              sales behind them
            payment-methods:write: >-
              Add, rename and remove the payment methods staff record by hand,
              such as cash or a bank transfer, and choose which ones members may
              pick when paying for a booking. Reading them needs no scope of its
              own - transactions:read admits it.
            staff:read: >-
              View your staff accounts, their roles, and what each role is
              allowed to do
            staff:write: >-
              Change a staff member's role, and what the manager, front desk and
              instructor roles are allowed to do. Only a signed-in person can
              use it, with the same limits as in 1club: an API key is always
              refused.
            notifications:read: >-
              View which notifications each role gets by default, and on which
              channels
            notifications:write: >-
              Change which notifications each role gets and on which channels,
              and apply those defaults to everyone in a role, replacing their
              own choices
            competitors:read: >-
              View the competitors you follow, their prices and Google ratings,
              and how your prices compare with the market
            competitors:write: >-
              Add, edit and remove the competitors you follow, and have their
              websites read again
            promotions:read: >-
              View your promotions - discounts and vouchers, their promo codes,
              dates and how often they were redeemed
            promotions:write: >-
              Create, edit and delete promotions - discounts and vouchers and
              their promo codes. A promotion is offered to members as soon as
              its dates allow.
            reviews:read: >-
              View your reviews - ratings, what members wrote, your replies and
              the private notes reviewers left for you
            automations:read: >-
              View your automations - what starts each one, its steps and the
              messages it sends

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.