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

# Get email template

> Get email template details



## OpenAPI

````yaml /api-reference/cx/swagger.json get /library/email_template/{email_template}
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}:
    get:
      tags:
        - library
      summary: Get email template
      description: Get email template details
      parameters:
        - description: Email template ID
          name: email_template
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Email template details
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pkg_routes_library_email_templates.GetEmailTemplateResponse
        '400':
          description: Bad request - invalid email template ID
          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
      security:
        - ApiKeyAuth: []
components:
  schemas:
    pkg_routes_library_email_templates.GetEmailTemplateResponse:
      type: object
      properties:
        email_template:
          $ref: '#/components/schemas/types.EmailTemplate'
        scheduled_sends:
          description: >-
            ScheduledSends are this template's future-dated bulk sends still
            awaiting

            dispatch (email_bulk_sends records with status "scheduled"), soonest
            first.

            Empty once every send has come due, failed, or been cancelled.
          type: array
          items:
            $ref: '#/components/schemas/types.EmailBulkSend'
    types.EmailTemplate:
      type: object
      properties:
        _id:
          type: string
        activity:
          description: For returning
          type: array
          items:
            $ref: '#/components/schemas/types.Activity'
        append_signature:
          type: boolean
        attachments:
          type: array
          items:
            type: string
        body:
          type: string
        branded:
          description: Branded email editing
          allOf:
            - $ref: '#/components/schemas/types.BrandedEmailTemplate'
        created_at:
          type: string
        deleted_at:
          type: string
        locked:
          type: boolean
        n_attachments:
          description: >-
            NumAttachments is len(Attachments). Computed on list/query; not
            stored.
          type: integer
        n_bulk_sends:
          description: >-
            NumBulkSends is the number of email_bulk_sends records for this
            template.
          type: integer
        name:
          type: string
        schedule:
          type: array
          items:
            $ref: '#/components/schemas/types.EmailSchedule'
        secure:
          type: boolean
        subject:
          type: string
        tags:
          type: array
          items:
            type: string
        team:
          type: string
        type:
          description: >-
            Type is "Branded" when the template has branded sections, "Text"
            otherwise.

            Computed on list/query; not stored.
          type: string
    types.EmailBulkSend:
      type: object
      properties:
        _id:
          type: string
        attachments:
          type: array
          items:
            type: string
        capability_id:
          type: string
        created_on:
          type: string
        domain:
          type: string
        domain_id:
          type: string
        from_email:
          type: string
        from_name:
          type: string
        integration_id:
          description: SMTP integration for Provider == "smtp"
          type: string
        provider:
          description: >-
            Resolved sending source — populated at launch by the sending-source

            resolver. Provider is one of the EmailBulkSendProvider* constants.
            The

            remaining fields are the per-provider routing the worker needs:

            SendingDomainID/Domain/Region/FromEmail/FromName for Mailgun,
            IntegrationID

            for SMTP, and User (above) for the legacy user-mailbox path.
          type: string
        published_at:
          description: when handed to the send worker
          type: string
        recipients:
          description: >-
            The launch payload (recipients + scheduling), retained so a
            scheduled send

            can be reconstructed and published when it comes due.
          allOf:
            - $ref: '#/components/schemas/types.BulkEmailRecipients'
        scheduled_time:
          description: set when future-dated
          type: string
        status:
          description: Scheduling / lifecycle
          type: string
        stop_on_render_failure:
          description: >-
            Copied from the launch payload; false means skip-and-continue
            (ENG-8602).
          type: boolean
        team:
          description: Who / what
          type: string
        template:
          type: string
        user:
          type: string
    types.Activity:
      type: object
      properties:
        _id:
          type: string
        action:
          type: string
        changes:
          type: array
          items:
            $ref: '#/components/schemas/types.Change'
        client:
          type: string
        on_id:
          type: string
        on_py:
          type: integer
        on_type:
          type: string
        team:
          type: string
        timestamp:
          type: string
        user:
          type: string
    types.BrandedEmailTemplate:
      type: object
      properties:
        alignment:
          type: string
        background_color:
          description: Not used now, but in case we want them in the future
          type: string
        font_family:
          type: string
        foreground_color:
          type: string
        header_background:
          type: string
        sections:
          type: array
          items:
            $ref: '#/components/schemas/types.EmailSection'
    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
    types.BulkEmailRecipients:
      type: object
      properties:
        bcc:
          type: array
          items:
            type: string
        cc:
          type: array
          items:
            type: string
        clients:
          type: array
          items:
            type: string
        deals:
          type: array
          items:
            type: string
        plans:
          type: array
          items:
            type: string
        to:
          type: array
          items:
            type: string
    types.Change:
      type: object
      properties:
        data:
          type: string
        field:
          type: string
        from:
          type: string
        to:
          type: string
    types.EmailSection:
      type: object
      properties:
        content:
          description: Heading 1, Heading 2, Heading 3, Paragraph, Image, Button, Divider
          type: string
        type:
          type: string
        url:
          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.