> ## 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.

# Trigger a flow for a contact

> Fire the flow’s `tented_api` trigger for one contact, enrolling them with optional `tokens` stored as dynamic context and usable as `{{campaign.dynamic.<key>}}` merge tokens. Identify the contact with exactly one of `contact_id`, `email`, or `phone` — `email` and `phone` are looked up against existing contacts (`404 contact_not_found` when no match). Fails with `409 flow_api_trigger_not_configured` when the flow has no `tented_api` trigger, and with `400` when tokens don’t match the trigger’s declared fields (`campaign_flow_trigger_unknown_token`, `campaign_flow_trigger_invalid_token_type`) or the resolved context exceeds 64 KB (`campaign_flow_trigger_payload_too_large`). Enrollment conflicts mirror the add-contact endpoint (`campaign_flow_already_in_flow`, `campaign_flow_reentry_denied`, `campaign_flow_not_active`).



## OpenAPI

````yaml /api-reference/openapi.json post /v1/email-flows/{flowId}/trigger
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/email-flows/{flowId}/trigger:
    post:
      tags:
        - Triggered Flows
      summary: Trigger a flow for a contact
      description: >-
        Fire the flow’s `tented_api` trigger for one contact, enrolling them
        with optional `tokens` stored as dynamic context and usable as
        `{{campaign.dynamic.<key>}}` merge tokens. Identify the contact with
        exactly one of `contact_id`, `email`, or `phone` — `email` and `phone`
        are looked up against existing contacts (`404 contact_not_found` when no
        match). Fails with `409 flow_api_trigger_not_configured` when the flow
        has no `tented_api` trigger, and with `400` when tokens don’t match the
        trigger’s declared fields (`campaign_flow_trigger_unknown_token`,
        `campaign_flow_trigger_invalid_token_type`) or the resolved context
        exceeds 64 KB (`campaign_flow_trigger_payload_too_large`). Enrollment
        conflicts mirror the add-contact endpoint
        (`campaign_flow_already_in_flow`, `campaign_flow_reentry_denied`,
        `campaign_flow_not_active`).
      operationId: trigger-flow
      parameters:
        - name: flowId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Flow ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contact_id:
                  type: string
                  format: uuid
                  description: >-
                    Existing contact ID. Provide exactly one of `contact_id`,
                    `email`, or `phone`.
                email:
                  type: string
                  format: email
                  description: Contact email, looked up against existing contacts.
                phone:
                  type: string
                  description: >-
                    Contact phone, normalized and looked up against existing
                    contacts.
                tokens:
                  type: object
                  additionalProperties:
                    oneOf:
                      - type: string
                      - type: number
                      - type: boolean
                  description: >-
                    Campaign token values keyed by name, validated against the
                    fields declared on the flow’s `tented_api` trigger. Keys
                    must start with a letter and contain only letters, numbers,
                    and underscores; `trigger` is reserved. Values are JSON
                    scalars (`date` fields take ISO 8601 strings).
      responses:
        '201':
          description: Contact enrolled (`entry_source` is `trigger`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    $ref: '#/components/schemas/FlowMembership'
                required:
                  - membership
        '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'
        '409':
          description: Conflict — see `error_code` for the specific reason.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    FlowMembership:
      type: object
      properties:
        membership_id:
          type: string
          format: uuid
          description: Membership (run) ID.
        flow_id:
          type: string
          format: uuid
          description: Flow ID.
        contact_id:
          type: string
          format: uuid
          description: Contact ID.
        status:
          type: string
          enum:
            - active
            - waiting
            - completed
            - dropped
          description: Membership state.
        current_step_id:
          type:
            - string
            - 'null'
          description: Step the contact is currently at.
        waiting_until:
          type:
            - string
            - 'null'
          format: date-time
          description: When a wait step releases the contact.
        entry_source:
          type: string
          description: How the contact entered, e.g. `public_api`.
        entered_at:
          type: string
          format: date-time
          description: Enrollment time.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Completion time.
        dropped_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Drop time.
        drop_reason:
          type:
            - string
            - 'null'
          description: Why the contact was dropped.
        updated_at:
          type: string
          format: date-time
          description: Last update.
      required:
        - membership_id
        - flow_id
        - contact_id
        - 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.

````