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

# Create tents in bulk

> Create up to 25 tents from one approved template in a single request. Admission supports partial success: valid items are accepted and queued, invalid ones are rejected item-by-item. Poll `GET /v1/bulk-jobs/{bulkJobId}` for progress.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/tents/bulk
openapi: 3.1.0
info:
  title: Tented API
  version: 1.0.0
  description: >-
    The Tented public API: generate, publish, and manage AI-built web pages
    (tents), and run the email platform — contacts, reusable emails, one-time
    blasts, and triggered flows.


    ## Authentication

    Authenticate every request with a workspace API key: `Authorization: Bearer
    <api-key>`. Keys are created in **Workspace Settings → API Keys** and are
    scoped to a single workspace.


    ## Asynchronous work

    Tent generation, bulk creation, and email AI generation return `202
    Accepted` immediately. Poll the corresponding status endpoint (`GET
    /v1/tents/{tentId}`, `GET /v1/bulk-jobs/{bulkJobId}`, `GET
    /v1/emails/{emailId}/generations/{generationId}`) — no more than every 10
    seconds.


    ## Pagination

    Email listings use cursor pagination (`cursor`/`next_cursor`). Blast, flow,
    and member listings use page pagination (`page`/`limit` with a `pagination`
    object in the response).


    ## Conventions

    Request and response fields are snake_case, with two exceptions: analytics
    query parameters (`tentIdOrAlias`, `daysBack`) and segment rule trees
    (camelCase keys such as `listId` and `timeWindow`).
  contact:
    name: Tented Support
    email: support@tented.ai
servers:
  - url: https://api.tented.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Tents
    description: >-
      Create, edit, publish, and manage AI-generated pages, including asset
      uploads and bulk creation.
  - name: Analytics
    description: Traffic analytics for single tents and the whole workspace.
  - name: Contacts
    description: >-
      Batch create, update, and delete contacts. Up to 25 items per request with
      per-item results.
  - name: Emails
    description: >-
      Reusable email content: AI generation, direct HTML edits, plain-text
      control, and approval.
  - name: Email Blasts
    description: >-
      One-time sends to an audience: compose, schedule, track engagement, export
      recipients.
  - name: Triggered Flows
    description: >-
      Multi-step automations that enroll contacts on triggers and move them
      through a step graph.
  - name: Contact Imports
  - name: Contact Fields
  - name: Contact Lists
  - name: Email Templates
  - name: Tent Templates
    description: >-
      Reusable, AI-editable tent layouts. Create from HTML or an existing tent,
      iterate with AI, approve, and clone. Approved tent templates seed new
      tents.
paths:
  /v1/tents/bulk:
    post:
      tags:
        - Tents
      summary: Create tents in bulk
      description: >-
        Create up to 25 tents from one approved template in a single request.
        Admission supports partial success: valid items are accepted and queued,
        invalid ones are rejected item-by-item. Poll `GET
        /v1/bulk-jobs/{bulkJobId}` for progress.
      operationId: create-bulk-tents
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  type: string
                  description: Approved template used for every item.
                items:
                  type: array
                  items:
                    type: object
                    properties:
                      client_item_id:
                        type: string
                        description: Your reconciliation ID, echoed back in results.
                      tent_name:
                        type: string
                        description: >-
                          Tent name. When omitted, names derive from
                          `default_tent_name_prefix` (or
                          `client_job_descriptor`) plus a counter.
                      custom_page_alias:
                        type: string
                        maxLength: 100
                        description: >-
                          Custom published alias: max 100 characters; lowercase
                          letters, numbers, hyphens, underscores, and dots; must
                          start with a letter or number; must not be a UUID or a
                          reserved word (`api`, `admin`, `submit`, `assets`, …).
                          Use `/` to publish at the domain root. Requires
                          top-level `auto_publish: true`.
                      token_data:
                        type: object
                        additionalProperties: true
                        description: >-
                          Structured personalization data for this item. Applied
                          before `prompt`.
                      prompt:
                        type: string
                        description: Item-specific generation instructions.
                      input_data:
                        type: object
                        additionalProperties: true
                        description: Deprecated alias of `token_data`.
                        deprecated: true
                      instructions:
                        type: string
                        description: Deprecated alias of `prompt`.
                        deprecated: true
                      include_brand:
                        type: boolean
                        description: Pull workspace branding into this item.
                  minItems: 1
                  maxItems: 25
                  description: >-
                    Items to create (1–25). Each item must provide `token_data`
                    and/or `prompt`.
                client_job_descriptor:
                  type: string
                  description: Label for the bulk job.
                default_tent_name_prefix:
                  type: string
                  description: Name prefix used when an item omits `tent_name`.
                start_index:
                  type: integer
                  minimum: 1
                  default: 1
                  description: Starting counter for generated names.
                auto_publish:
                  type: boolean
                  description: >-
                    Publish every generated tent automatically. Applies to the
                    whole batch.
                reasoning:
                  type: string
                  enum:
                    - min
                    - medium
                    - high
                    - max
                  description: Reasoning effort for the generation pass.
                metadata:
                  type: object
                  additionalProperties: true
                  description: Job-level metadata, echoed back in responses.
              required:
                - template_id
                - items
      responses:
        '202':
          description: Batch admitted (possibly with per-item rejections).
          content:
            application/json:
              schema:
                type: object
                properties:
                  bulk_job_id:
                    type: string
                    description: Bulk job ID — poll `GET /v1/bulk-jobs/{bulkJobId}`.
                  status:
                    type: string
                    description: Always `accepted`.
                  template_id:
                    type: string
                    description: Template used.
                  auto_publish:
                    type: boolean
                    description: Whether the batch auto-publishes.
                  accepted_count:
                    type: integer
                    description: Items admitted.
                  rejected_count:
                    type: integer
                    description: Items rejected at admission.
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/BulkJobItem'
                    description: Admission result per item, in request order.
                  metadata:
                    type: object
                    additionalProperties: true
                    description: Echoed job metadata.
                  created_at:
                    type: string
                    format: date-time
                    description: Job creation time.
                required:
                  - bulk_job_id
                  - status
                  - items
        '400':
          description: >-
            Bad request — invalid parameters or request body. Validation
            failures include `details.issues` with per-field messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized — missing, malformed, revoked, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Not found — the resource does not exist in the workspace tied to
            your API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    BulkJobItem:
      type: object
      properties:
        index:
          type: integer
          description: Zero-based position of the item in the original request.
        client_item_id:
          type: string
          description: Your reconciliation ID, echoed back when supplied.
        tent_id:
          type: string
          format: uuid
          description: Tent created for this item (accepted items only).
        tent_name:
          type: string
          description: Resolved tent name.
        custom_page_alias:
          type: string
          description: Requested alias, echoed back when supplied.
        status:
          type: string
          enum:
            - accepted
            - rejected
            - queued
            - generating
            - completed
            - failed
          description: Item state.
        publication_status:
          type: string
          enum:
            - pending
            - published
            - published_with_warnings
            - failed
          description: Publication state when `auto_publish` is enabled.
        published_url:
          type: string
          description: Public URL once published.
        error_code:
          type: string
          enum:
            - INVALID_ITEM
            - NOT_FOUND
            - INSUFFICIENT_CREDITS
          description: Rejection code.
        message:
          type: string
          description: Human-readable rejection or failure reason.
      required:
        - index
        - status
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
        error_code:
          type: string
          description: >-
            Stable machine-readable error code (present on email, blast, flow,
            and related endpoints, e.g. `campaign_not_ready`,
            `generation_in_progress`).
        message:
          type: string
          description: Additional human-readable context (present on some tent endpoints).
        code:
          type: string
          description: >-
            Machine-readable code used by tent creation errors (e.g.
            `INVALID_PROMPT_INTENT`).
        details:
          type: object
          additionalProperties: true
          description: >-
            Additional error context. Validation errors include `issues`: an
            array of `{ path, message }` objects.
        limit:
          type: integer
          description: Plan limit that was hit (present on `429` publish-limit errors).
        current:
          type: integer
          description: >-
            Current usage against the limit (present on `429` publish-limit
            errors).
      required:
        - error
      description: >-
        Error response. All errors include `error`; the other fields vary by
        endpoint group.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, e.g. `Authorization: Bearer tented_...`. Create keys
        in Workspace Settings → API Keys.

````