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

# Generate or improve reply

> Generate writes a fresh Extrovert reply for a conversation using the campaign Voice, optionally steered by one-off instructions: a conversation without a reviewable reply gets one, an existing reviewable reply is replaced by a new variant. Improve rewrites the current reply text and requires both a reply with text and instructions. One-off instructions never change the Voice. Returns the reply with its exact dmId and text; it never sends. A generation that produces no text is an error, never an empty success.



## OpenAPI

````yaml https://api.goextrovert.com/client/v2/docs-json post /client/v2/dm-conversations/{connectionId}/generate-or-improve-reply
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/dm-conversations/{connectionId}/generate-or-improve-reply:
    post:
      tags:
        - Direct Messages
      summary: Generate or improve reply
      description: >-
        Generate writes a fresh Extrovert reply for a conversation using the
        campaign Voice, optionally steered by one-off instructions: a
        conversation without a reviewable reply gets one, an existing reviewable
        reply is replaced by a new variant. Improve rewrites the current reply
        text and requires both a reply with text and instructions. One-off
        instructions never change the Voice. Returns the reply with its exact
        dmId and text; it never sends. A generation that produces no text is an
        error, never an empty success.
      operationId: DmConversationsClientApiController_generateOrImproveReply
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateOrImproveReplyRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateOrImproveReplyResponseDto'
        '401':
          description: Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientApiErrorResponseDto'
      security:
        - api-key: []
components:
  schemas:
    GenerateOrImproveReplyRequestDto:
      type: object
      properties:
        connectionId:
          type: string
          format: uuid
          description: Conversation (connection) ID the action addresses.
        mode:
          type: string
          enum:
            - Generate
            - Improve
          description: >-
            Generate writes a fresh reply; Improve rewrites the current reply
            text and requires instructions.
        instructions:
          type: string
          description: 'Plain-text direction: optional for Generate, required for Improve.'
          minLength: 1
          maxLength: 1250
        campaignId:
          type: string
          description: >-
            One-call Voice source: an updatable campaign in this workspace
            belonging to the conversation owner. Does not reassign the prospect.
            Omit for implicit selection, which may differ from the
            recommendation.
          format: uuid
      required:
        - connectionId
        - mode
    GenerateOrImproveReplyResponseDto:
      type: object
      properties:
        status:
          type: string
          const: success
          description: Response status
        data:
          type: object
          properties:
            dmId:
              type: string
              format: uuid
              description: Exact reply ID required by Edit, Send, and Recover.
              examples:
                - 8d256aa6-9b12-49a7-93ee-bf41634b5b60
            connectionId:
              type: string
              format: uuid
              description: Conversation this reply belongs to.
              examples:
                - 8d256aa6-9b12-49a7-93ee-bf41634b5b60
            text:
              type: string
              minLength: 1
              description: Effective reply text.
            source:
              type: string
              enum:
                - Extrovert-generated
                - Agent-authored
                - Edited
              description: >-
                Extrovert-generated when no authored override exists;
                Agent-authored when created without generation; Edited when
                custom text overrides a generated reply.
            state:
              type: string
              enum:
                - No draft
                - Suggested
                - Draft ready
                - Generating
                - Sending
                - Sent
                - History changed
                - Error
                - Paused
                - Skipped
            allowedActions:
              type: array
              items:
                type: string
                enum:
                  - prepare-reply
                  - generate-or-improve-reply
                  - edit-reply
                  - send-reply
                  - recover-draft
              description: Actions valid for the current state.
            reason:
              anyOf:
                - type: string
                  enum:
                    - Relevant post
                    - Follow-up
                    - First outreach
                    - Manual
                - type: 'null'
              description: >-
                Why Extrovert recommended this conversation, or null when no
                automatic reason applies.
            followUpNumber:
              anyOf:
                - type: integer
                  minimum: 1
                  maximum: 9007199254740991
                - type: 'null'
              description: >-
                Which follow-up of the unanswered series is due, counting from
                1. Null outside a follow-up series.
              examples:
                - 1
                - 3
            relevantPost:
              anyOf:
                - type: object
                  properties:
                    summary:
                      anyOf:
                        - type: string
                        - type: 'null'
                      description: Stored post summary, or null when none was persisted.
                    linkedInUrl:
                      type: string
                      format: uri
                      description: LinkedIn URL of the post the reply was written on.
                    publishedAt:
                      type: string
                      description: When the post was published on LinkedIn.
                      examples:
                        - '2025-06-30T14:02:07.456Z'
                        - '2025-07-03T08:30:00.000Z'
                  required:
                    - summary
                    - linkedInUrl
                    - publishedAt
                - type: 'null'
              description: >-
                Post the reply text was written on, or null when it was not
                written on a post.
            error:
              anyOf:
                - type: object
                  properties:
                    code:
                      type: string
                      description: >-
                        Stable public error code suitable for branching. It is
                        not a raw provider or backend status.
                    message:
                      type: string
                      description: >-
                        Safe explanation of what failed and what the caller
                        should do next.
                    retryable:
                      type: boolean
                      description: >-
                        Whether retrying may succeed after the stated condition
                        is resolved.
                    occurredAt:
                      anyOf:
                        - type: string
                          description: Date and time in ISO 8601 format
                          examples:
                            - '2025-06-30T14:02:07.456Z'
                            - '2025-07-03T08:30:00.000Z'
                        - type: 'null'
                      description: >-
                        When this failure was recorded, or null when no reliable
                        timestamp exists.
                  required:
                    - code
                    - message
                    - retryable
                    - occurredAt
                - type: 'null'
              description: >-
                Current send/workflow failure, or null when no failure is
                active.
            createdAt:
              type: string
              description: Date and time in ISO 8601 format
              examples:
                - '2025-06-30T14:02:07.456Z'
                - '2025-07-03T08:30:00.000Z'
            updatedAt:
              type: string
              description: Date and time in ISO 8601 format
              examples:
                - '2025-06-30T14:02:07.456Z'
                - '2025-07-03T08:30:00.000Z'
            sentAt:
              anyOf:
                - type: string
                  description: Date and time in ISO 8601 format
                  examples:
                    - '2025-06-30T14:02:07.456Z'
                    - '2025-07-03T08:30:00.000Z'
                - type: 'null'
              description: LinkedIn send time, or null before successful delivery.
          required:
            - dmId
            - connectionId
            - text
            - source
            - state
            - allowedActions
            - reason
            - followUpNumber
            - relevantPost
            - error
            - createdAt
            - updatedAt
            - sentAt
        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.