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

# Launch email template

> Launch an email template. Resolves a sending method (Mailgun → SMTP → user mailbox), snapshots the recipients, writes an email_bulk_sends record, and (for an immediate send) publishes {send_id} to the send worker. A future-dated launch is recorded only.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /library/email_template/{email_template}/_launch
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /library/email_template/{email_template}/_launch:
    post:
      tags:
        - library
      summary: Launch email template
      description: >-
        Launch an email template. Resolves a sending method (Mailgun → SMTP →
        user mailbox), snapshots the recipients, writes an email_bulk_sends
        record, and (for an immediate send) publishes {send_id} to the send
        worker. A future-dated launch is recorded only.
      parameters:
        - description: Email template ID
          name: email_template
          in: path
          required: true
          schema:
            type: string
        - description: >-
            Opt in to the user-mailbox fallback when no managed method is
            configured
          name: force
          in: query
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/types.EmailSchedule'
        description: Email schedule with recipients
        required: true
      responses:
        '200':
          description: Launch result
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_library_email_templates.LaunchEmailTemplateResponse
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Email template not found or no access
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '428':
          description: No managed sending method; retry with ?force=true
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    types.EmailSchedule:
      type: object
      properties:
        allow_partial:
          description: >-
            Deprecated: read by nothing, and its Outbox behaviour does not exist
            in the

            post-ENG-8318 pipeline. Use StopOnRenderFailure; remove once

            backend-monorepo's generated bindings stop referencing it
            (ENG-8602).
          type: boolean
        cc:
          description: Variables (eg. "contacts:*")
          type: array
          items:
            type: string
        clients:
          type: array
          items:
            type: string
        clients_filter:
          description: Filter instead of predefined list?
          allOf:
            - $ref: '#/components/schemas/types.ClientsFilter'
        file:
          description: Who are we launching it for? (clients/plans)
          type: string
        from:
          description: >-
            Variables to get From, To and Cc from client list or filtered
            clients
          type: string
        plans:
          type: array
          items:
            type: string
        plans_filter:
          $ref: '#/components/schemas/types.PlansFilter'
        stop_on_render_failure:
          description: >-
            Send nothing at all if any target fails to render, rather than
            skipping it

            and mailing the rest. Zero value is the historical skip-and-continue

            behaviour, so older records keep working (ENG-8602).
          type: boolean
        timestamp:
          description: When are we launching it?
          type: string
        to:
          description: Variables (eg. "contacts:[role]")
          type: array
          items:
            type: string
    pkg_routes_library_email_templates.LaunchEmailTemplateResponse:
      type: object
      properties:
        ok:
          type: boolean
        scheduled:
          type: boolean
        send_id:
          type: string
    types.ClientsFilter:
      type: object
      properties:
        assignee:
          type: array
          items:
            type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        status:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
    types.PlansFilter:
      type: object
      properties:
        client:
          type: array
          items:
            type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/types.ListFilterData'
        provisions:
          type: object
          additionalProperties:
            type: string
        pye: {}
        status:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        type:
          type: array
          items:
            type: string
    types.ListFilterData:
      type: object
      properties:
        key:
          type: string
        op:
          type: string
        value: {}
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

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