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

# Create DM Templates

> Adds one or more structured DM Templates to Voices. All three fields of each element are required. The LLM chooses when to use a template and adapts it; callers should not pre-resolve variables. Up to 40 Templates per Voice. Returns one result per requested element, in request order: the saved DM Template, or the reason that element was not applied (access, plan cap, not found). Other elements are unaffected. DM Templates feed direct-message generation only — never comments. The change applies to future generations only: an existing DM draft keeps its text until it is refreshed (`dm-conversations_generate-or-improve-reply`).



## OpenAPI

````yaml https://api.goextrovert.com/client/v2/docs-json post /client/v2/voice-dm-templates
openapi: 3.1.0
info:
  title: Extrovert Client API
  description: >-
    Public API for Extrovert platform integration. Use your API key for
    authentication.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.goextrovert.com/
    description: API Server
security: []
tags: []
paths:
  /client/v2/voice-dm-templates:
    post:
      tags:
        - Voice DM Templates
      summary: Create DM Templates
      description: >-
        Adds one or more structured DM Templates to Voices. All three fields of
        each element are required. The LLM chooses when to use a template and
        adapts it; callers should not pre-resolve variables. Up to 40 Templates
        per Voice. Returns one result per requested element, in request order:
        the saved DM Template, or the reason that element was not applied
        (access, plan cap, not found). Other elements are unaffected. DM
        Templates feed direct-message generation only — never comments. The
        change applies to future generations only: an existing DM draft keeps
        its text until it is refreshed
        (`dm-conversations_generate-or-improve-reply`).
      operationId: VoiceDmTemplateClientApiController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRequestDto9'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResponseDto9'
        '401':
          description: Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientApiErrorResponseDto'
      security:
        - api-key: []
components:
  schemas:
    CreateRequestDto9:
      type: object
      properties:
        items:
          type: array
          minItems: 1
          maxItems: 25
          items:
            type: object
            properties:
              voiceId:
                type: string
                format: uuid
                description: >-
                  Shared Voice to attach this DM template to; future DM
                  generations across its campaigns and workspaces can use it.
              text:
                type: string
                minLength: 1
                maxLength: 750
                description: Example DM text. Up to 750 characters.
              whenToUse:
                type: string
                minLength: 1
                maxLength: 250
                description: When this template is useful. Up to 250 characters.
              adaptation:
                type: string
                minLength: 1
                maxLength: 250
                description: How the AI should adapt it. Up to 250 characters.
            required:
              - voiceId
              - text
              - whenToUse
              - adaptation
          description: >-
            Elements to apply, 1 to 25. Each element is applied on its own and
            gets its own result, in the same order; a failed element does not
            affect the others.
      required:
        - items
    CreateResponseDto9:
      type: object
      properties:
        status:
          type: string
          const: success
          description: Response status
        data:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                minimum: 0
                maximum: 9007199254740991
                description: Position of the element in the request list, starting at 0.
              id:
                description: >-
                  Element ID. Present for every updated or deleted element, and
                  for a created element once it was saved.
                type: string
                format: uuid
              item:
                description: The element as saved. Absent when the element failed.
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: DM Template ID
                    examples:
                      - 8d256aa6-9b12-49a7-93ee-bf41634b5b60
                  updatedAt:
                    type: string
                    description: DM Template update timestamp
                    examples:
                      - '2025-06-30T14:02:07.456Z'
                      - '2025-07-03T08:30:00.000Z'
                  createdAt:
                    type: string
                    description: DM Template creation timestamp
                    examples:
                      - '2025-06-30T14:02:07.456Z'
                      - '2025-07-03T08:30:00.000Z'
                  text:
                    type: string
                    description: >-
                      Example DM text the AI may adapt for a matching situation.
                      This is guidance, not a fixed script. Up to 750
                      characters.
                  whenToUse:
                    type: string
                    description: >-
                      Short description of the situation in which this template
                      is useful. Up to 250 characters.
                  adaptation:
                    type: string
                    description: >-
                      Short instruction for how the AI should personalize or
                      alter the template. Up to 250 characters.
                  voiceId:
                    type: string
                    format: uuid
                    description: >-
                      ID of the Voice this DM Template belongs to. See the
                      `voices` config for the full Voice shape. When the Voice
                      is deleted, all its DM Templates are deleted in cascade.
                    examples:
                      - cf33282b-b171-4d23-ae02-848499d793e4
                required:
                  - id
                  - updatedAt
                  - createdAt
                  - text
                  - whenToUse
                  - adaptation
                  - voiceId
              error:
                description: >-
                  Why this element was not applied. Absent when the element
                  succeeded; the other elements are unaffected.
                type: object
                properties:
                  code:
                    type: string
                    description: >-
                      Status name of the failure, e.g. `NOT_FOUND`,
                      `PERMISSION_DENIED`, `INVALID_ARGUMENT`, `INTERNAL`.
                  message:
                    type: string
                    description: Human-readable reason this element was not applied.
                required:
                  - code
                  - message
            required:
              - index
          description: One result per requested DM Template, in request order
        message:
          type: string
          description: Success message
          examples:
            - Operation completed successfully
      required:
        - status
        - data
        - message
    ClientApiErrorResponseDto:
      type: object
      properties:
        status:
          type: string
          description: Response status
          example: error
          enum:
            - error
        data:
          type: object
          description: Response data
          example: null
          nullable: true
        message:
          type: string
          description: Error message
          example: An error occurred while processing the request
      required:
        - status
        - data
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key for authentication

````

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