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

# Create a reply draft

> Creates an unsent reply draft for an inbound message. Unlike the
`/actions/reply` endpoint, which sends immediately, this stores a draft that can
be reviewed and edited before sending.

`reply_to_message_id` and `thread_id` are inherited from the parent message and
cannot be set by the caller. The recipient, `Re:` subject and
`In-Reply-To`/`References` headers are pre-filled from the parent using the same
rules as a live reply, so sending the draft threads identically. Supplying `to`
or `subject` explicitly overrides the pre-filled value.




## OpenAPI

````yaml /openapi/generated/email/inboxes.yml post /email_inboxes/{inbox_id}/messages/{message_id}/drafts
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: API for managing email inboxes, drafts, messages, filters, and threads.
  title: Telnyx Email Inboxes API
  version: 2.0.0
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /email_inboxes/{inbox_id}/messages/{message_id}/drafts:
    post:
      tags:
        - Email Drafts
      summary: Create a reply draft
      description: >
        Creates an unsent reply draft for an inbound message. Unlike the

        `/actions/reply` endpoint, which sends immediately, this stores a draft
        that can

        be reviewed and edited before sending.


        `reply_to_message_id` and `thread_id` are inherited from the parent
        message and

        cannot be set by the caller. The recipient, `Re:` subject and

        `In-Reply-To`/`References` headers are pre-filled from the parent using
        the same

        rules as a live reply, so sending the draft threads identically.
        Supplying `to`

        or `subject` explicitly overrides the pre-filled value.
      operationId: CreateEmailReplyDraft
      parameters:
        - $ref: '#/components/parameters/DraftInboxId'
        - name: message_id
          in: path
          required: true
          description: Inbound message UUID to reply to.
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailDraftRequest'
            example:
              text_body: Thanks for the update — I will review today.
      responses:
        '201':
          description: The created reply draft.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailDraftResponse'
        '401':
          $ref: '#/components/responses/email_UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/email_NotFoundResponse'
        '422':
          $ref: '#/components/responses/ValidationErrorResponse'
        '503':
          $ref: '#/components/responses/DraftUnavailableResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.emailInboxes.messages.drafts('inbox_id', 'message_id');


            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.email_inboxes.messages.drafts(
                inbox_id="inbox_id",
                message_id="message_id",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.EmailInboxes.Messages.Drafts(\n\t\tcontext.TODO(),\n\t\t\"inbox_id\",\n\t\t\"message_id\",\n\t\ttelnyx.EmailInboxeMessageDraftsParams{\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.emailInboxes.messages.MessageDraftsParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    MessageDraftsParams params = MessageDraftsParams.builder()
                        .build();
                    var response = client.emailInboxes().messages().drafts("inbox_id", "message_id", params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            response = telnyx.email_inboxes.messages.drafts("inbox_id",
            "message_id")


            puts(response)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $response = $client->emailInboxes->messages->drafts(
                'inbox_id',
                'message_id',
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx email-inboxes:messages drafts \
              --api-key 'My API Key' \
              --inbox-id inbox_id \
              --message-id message_id
components:
  parameters:
    DraftInboxId:
      name: inbox_id
      in: path
      required: true
      description: Email inbox UUID.
      schema:
        type: string
        format: uuid
  schemas:
    EmailDraftRequest:
      type: object
      description: >
        All fields are optional — a draft may be saved incomplete. `account_id`,

        `inbox_id`, `status`, `sent_at`, `sent_message_id`,
        `reply_to_message_id` and

        `thread_id` are server-owned and ignored if supplied.
      properties:
        from_email:
          type: string
        from_name:
          type: string
        to:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddressInput'
        cc:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddressInput'
        bcc:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddressInput'
        reply_to:
          type: string
        subject:
          type: string
          maxLength: 255
        text_body:
          type: string
        html_body:
          type: string
        text:
          type: string
          description: Alias for `text_body`, matching the send endpoint.
        html:
          type: string
          description: Alias for `html_body`, matching the send endpoint.
        headers:
          type: object
          additionalProperties:
            type: string
        attachments:
          type: array
          items:
            type: object
        labels:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        metadata:
          type: object
    EmailDraftResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/EmailDraft'
      required:
        - data
    EmailAddressInput:
      oneOf:
        - type: string
        - $ref: '#/components/schemas/EmailAddress'
    EmailDraft:
      type: object
      description: An unsent, mutable draft message belonging to an inbox.
      properties:
        record_type:
          type: string
          enum:
            - email_draft
        id:
          type: string
          format: uuid
        inbox_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - draft
            - sending
            - sent
          description: >
            `draft` until the draft is sent. A sent draft is retained for audit
            and

            becomes immutable.
        from:
          type:
            - string
            - 'null'
          description: >-
            Sender address. Defaults to the inbox address at send time when
            null.
        from_name:
          type:
            - string
            - 'null'
        to:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
        cc:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
        bcc:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
        reply_to:
          type:
            - string
            - 'null'
        subject:
          type:
            - string
            - 'null'
        text_body:
          type:
            - string
            - 'null'
        html_body:
          type:
            - string
            - 'null'
        headers:
          type: object
          additionalProperties:
            type: string
          description: Custom headers. Reply drafts carry `In-Reply-To` and `References`.
        attachments:
          type: array
          items:
            type: object
        labels:
          type: array
          items:
            type: string
          description: >-
            Mutable mailbox-state labels. Not propagated to Email Detail
            Records.
        tags:
          type: array
          items:
            type: string
          description: >-
            Transport/reporting attribution tags, propagated to Email Detail
            Records at send time.
        metadata:
          type: object
          description: Arbitrary customer-defined metadata.
        reply_to_message_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Inbound message this draft replies to. Server-owned; set only on
            reply drafts.
        thread_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Conversation thread inherited from the parent message.
        sent_message_id:
          type:
            - string
            - 'null'
          format: uuid
          description: The email message created when this draft was sent.
        sent_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - record_type
        - id
        - inbox_id
        - status
    email_ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorObject'
        suppressed:
          type: array
          description: >-
            Present when every recipient is suppressed, so the request is
            rejected and no message is created.
          items:
            $ref: '#/components/schemas/SuppressedRecipient'
      required:
        - errors
    EmailAddress:
      type: object
      properties:
        email:
          type: string
        name:
          type: string
      required:
        - email
    ErrorObject:
      type: object
      properties:
        code:
          type: string
          description: >-
            Telnyx error code. Edge idempotency errors use 10027 or 10036.
            Fallback 404/500 responses from the framework may use string status
            codes ('404', '500') instead.
          enum:
            - '10001'
            - '10006'
            - '10007'
            - '10015'
            - '10016'
            - '10019'
            - recipient_suppressed
            - reputation_suspended
            - '404'
            - '500'
            - '10027'
            - '10036'
        title:
          type: string
        detail:
          description: >-
            Human-readable error detail. Changeset responses may return a
            structured object.
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
        source:
          type:
            - object
            - 'null'
          additionalProperties: true
        meta:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Additional metadata. Present on 401 errors with a documentation URL.
      required:
        - code
        - title
        - detail
    SuppressedRecipient:
      type: object
      properties:
        to:
          type: string
          format: email
          description: Suppressed recipient email address.
        reason:
          type: string
          description: Suppression reason returned by the recipient suppression service.
        scope:
          type: string
          description: Scope at which the suppression applies.
        override_allowed:
          type: boolean
          description: Whether an authorized send may override this suppression.
      required:
        - to
        - reason
        - scope
        - override_allowed
  responses:
    email_UnauthorizedResponse:
      description: Not authorized (10006).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/email_ErrorResponse'
          example:
            errors:
              - code: '10006'
                title: Not authorized
                detail: Invalid API key
                meta:
                  url: https://developers.telnyx.com/docs/overview/errors/10006
    email_NotFoundResponse:
      description: Resource not found (10001).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/email_ErrorResponse'
          example:
            errors:
              - code: '10001'
                title: Not Found
                detail: The requested resource was not found
    ValidationErrorResponse:
      description: Validation Failed (10015) or changeset validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/email_ErrorResponse'
          example:
            errors:
              - code: '10015'
                title: Validation Failed
                detail: subject can't be blank
                source:
                  pointer: /data/attributes/subject
    DraftUnavailableResponse:
      description: Drafts or the email domain service are temporarily unavailable (10016).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/email_ErrorResponse'
          example:
            errors:
              - code: '10016'
                title: Service Unavailable
                detail: Drafts are temporarily unavailable. Please try again later.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````