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

# Get the active AI conversation for a template

> The active conversation for a template, used to restore an in-progress chat. Returns `conversationId: null` when none has been started. Messages are retained for at most 90 days.



## OpenAPI

````yaml /openapi.json get /marketing/ai/conversations/{templateId}
openapi: 3.0.0
info:
  title: JetEmail API
  version: 1.0.0
  description: API documentation for JetEmail's transactional email service.
servers:
  - url: https://api.jetemail.com
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Email
    description: Send transactional email
  - name: Outbound
    description: 'Outbound sending: keys, SMTP users, domains, logs, suppression'
  - name: Inbound
    description: Inbound routing, domains and forward destinations
  - name: DMARC
    description: DMARC aggregate-report domain setup, DNS verification and analytics
  - name: Marketing
    description: >-
      Marketing suite: templates, audiences, contacts, broadcasts, themes,
      assets and signup forms
  - name: Signup Forms
    description: Hosted signup pages and form submissions
externalDocs:
  description: Download OpenAPI Specification
  url: /openapi.json
paths:
  /marketing/ai/conversations/{templateId}:
    parameters:
      - name: templateId
        in: path
        required: true
        schema:
          type: string
        description: Template the conversation belongs to. Must be owned by the caller.
    get:
      tags:
        - Marketing
      summary: Get the active AI conversation for a template
      description: >-
        The active conversation for a template, used to restore an in-progress
        chat. Returns `conversationId: null` when none has been started.
        Messages are retained for at most 90 days.
      responses:
        '200':
          description: Conversation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  conversationId:
                    type: string
                    nullable: true
                  messages:
                    type: array
                    description: Oldest first.
                    items:
                      $ref: '#/components/schemas/MarketingAiMessage'
        '401':
          description: Unauthorized
        '404':
          description: Template not found, or not owned by the caller
        '500':
          description: Could not load AI conversation
components:
  schemas:
    MarketingAiMessage:
      type: object
      description: One stored turn of a template-scoped conversation.
      properties:
        id:
          type: string
        requestId:
          type: string
          description: Ties the user turn to its assistant reply.
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          type: string
        result:
          allOf:
            - $ref: '#/components/schemas/MarketingAiResult'
          description: Present only on succeeded assistant turns.
        status:
          type: string
          enum:
            - pending
            - succeeded
            - failed
        creditCost:
          type: integer
        errorCode:
          type: string
          description: Empty unless status is failed.
        createdAt:
          type: integer
          description: Unix seconds
        completedAt:
          type: integer
          nullable: true
          description: Unix seconds
    MarketingAiResult:
      type: object
      description: >-
        Validated AI output. Always a draft: applying it is a separate user
        action, and nothing here is saved or sent. `kind` selects the shape.
      required:
        - kind
        - message
      properties:
        kind:
          type: string
          enum:
            - subject_variants
            - block
            - template
        message:
          type: string
          description: Short plaintext summary of what changed.
        variants:
          type: array
          description: kind=subject_variants only.
          items:
            type: object
            properties:
              subject:
                type: string
              previewText:
                type: string
        blockId:
          type: string
          description: 'kind=block only: the rewritten block.'
        content:
          type: string
          description: 'kind=block only: escaped inline content.'
        html:
          type: string
          description: 'kind=block only: rendered block HTML.'
        subject:
          type: string
          description: kind=template only.
        previewText:
          type: string
          description: kind=template only.
        blocks:
          type: array
          description: >-
            kind=template only: builder blocks, reduced to the supported block
            allowlist.
          items:
            type: object
        styles:
          type: object
          description: 'kind=template only: EmailStyles.'
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: API key for account management endpoints. Use your api_ prefixed token.

````