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

# Retrieve a draft

> Returns a single draft. Drafts that have been sent remain retrievable, so the
exact content that was sent stays auditable.




## OpenAPI

````yaml /openapi/source/external/email/email.json get /email_inboxes/{inbox_id}/drafts/{draft_id}
openapi: 3.0.3
info:
  x-latency-category: responsive
  x-endpoint-cost: light
  title: Telnyx API
  description: >-
    Programmable email: sending, templates, validation, events, agent inboxes,
    drafts, threads, domains & DKIM, suppressions and unsubscribe groups.
  version: 2.0.0
  contact:
    name: Telnyx
    url: https://telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - BearerAuth: []
tags:
  - name: Email Validations
    description: Validate email addresses synchronously or in asynchronous batches.
  - name: Email Templates
    description: Create, list, retrieve, update, delete, and render Liquid email templates.
  - name: Email Messages
    description: >-
      Send and manage email messages. Legacy `/v2/emails` routes are aliases for
      these endpoints.
  - name: Email Events
    description: Retrieve account-level email events and event statistics.
  - name: Email Inboxes
    description: >-
      Create and manage agent inboxes, retrieve inbound messages and threads,
      and reply to or forward messages.
  - name: Email Drafts
    description: >-
      Create, list, retrieve, update, delete, and send unsent draft messages
      belonging to an agent inbox.
  - name: Email Threads
    description: >-
      Account-wide conversation threads across every inbox, for agents operating
      many inboxes at once.
  - name: Email Domains
    description: Email domain CRUD operations
  - name: Email Domain DNS Records
    description: DNS verification records for email domains
  - name: Email Webhooks
    description: Per-domain webhook endpoints with event subscriptions
  - name: Email Suppressions
    description: Recipient suppression records (`/v2/email_blocks`).
  - name: Email Suppression Imports
    description: Async CSV import of competitor suppression lists.
  - name: Email Unsubscribe Groups
    description: Named groups and group-scoped suppressions.
paths:
  /email_inboxes/{inbox_id}/drafts/{draft_id}:
    get:
      tags:
        - Email Drafts
      summary: Retrieve a draft
      description: >
        Returns a single draft. Drafts that have been sent remain retrievable,
        so the

        exact content that was sent stays auditable.
      operationId: GetEmailDraft
      parameters:
        - $ref: '#/components/parameters/DraftInboxId'
        - $ref: '#/components/parameters/DraftId'
      responses:
        '200':
          description: The requested draft.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailDraftResponse'
              example:
                data:
                  record_type: email_draft
                  id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  inbox_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  status: draft
                  from: string
                  from_name: string
                  to:
                    - email: string
                      name: string
                  cc:
                    - email: string
                      name: string
                  bcc:
                    - email: string
                      name: string
                  reply_to: string
                  subject: string
                  text_body: string
                  html_body: string
                  attachments: []
                  labels:
                    - string
                  tags:
                    - string
                  reply_to_message_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  thread_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  sent_message_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  sent_at: '2024-01-23T18:10:02.574Z'
                  created_at: '2024-01-23T18:10:02.574Z'
                  updated_at: '2024-01-23T18:10:02.574Z'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
        '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 EmailDraft = await
            client.emailInboxes.drafts.retrieve('inbox_id', 'draft_id');


            console.log(EmailDraft.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
            )
            email_draft = client.email_inboxes.drafts.retrieve(
                "inbox_id",
                "draft_id",
            )
            print(email_draft.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\tdraft, err := client.EmailInboxes.Drafts.Get(\n\t\tcontext.TODO(),\n\t\t\"inbox_id\",\n\t\t\"draft_id\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", draft.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

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

            public final class Main {
                private Main() {}

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

                    var response = client.emailInboxes().drafts().retrieve("inbox_id", "draft_id");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            email_draft = telnyx.email_inboxes.drafts.retrieve("inbox_id",
            "draft_id")


            puts(email_draft)
        - 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 {
              $email_draft = $client->emailInboxes->drafts->retrieve(
                'inbox_id',
                'draft_id',
              );

              var_dump($email_draft);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx email-inboxes:drafts retrieve \
              --api-key 'My API Key' \
              --inbox-id inbox_id \
              --draft-id draft_id
components:
  parameters:
    DraftInboxId:
      name: inbox_id
      in: path
      required: true
      description: Email inbox UUID.
      schema:
        type: string
        format: uuid
    DraftId:
      name: draft_id
      in: path
      required: true
      description: Email draft UUID.
      schema:
        type: string
        format: uuid
  schemas:
    EmailDraftResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/EmailDraft'
      required:
        - data
    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
          nullable: true
          description: >-
            Sender address. Defaults to the inbox address at send time when
            null.
        from_name:
          type: string
          nullable: true
        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
          nullable: true
        subject:
          type: string
          nullable: true
        text_body:
          type: string
          nullable: true
        html_body:
          type: string
          nullable: true
        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
          format: uuid
          nullable: true
          description: >-
            Inbound message this draft replies to. Server-owned; set only on
            reply drafts.
        thread_id:
          type: string
          format: uuid
          nullable: true
          description: Conversation thread inherited from the parent message.
        sent_message_id:
          type: string
          format: uuid
          nullable: true
          description: The email message created when this draft was sent.
        sent_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - record_type
        - id
        - inbox_id
        - status
    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
          additionalProperties: true
          nullable: true
        meta:
          type: object
          additionalProperties: true
          nullable: 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:
    UnauthorizedResponse:
      description: Not authorized (10006).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - code: '10006'
                title: Not authorized
                detail: Invalid API key
                meta:
                  url: https://developers.telnyx.com/docs/overview/errors/10006
    NotFoundResponse:
      description: Resource not found (10001).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - code: '10001'
                title: Not Found
                detail: The requested resource was not found
    DraftUnavailableResponse:
      description: Drafts or the email domain service are temporarily unavailable (10016).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - code: '10016'
                title: Service Unavailable
                detail: Drafts are temporarily unavailable. Please try again later.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Telnyx API key supplied as `Authorization: Bearer <token>`. In
        production, auth may be validated by the API gateway and forwarded via
        Telnyx auth headers.

````