Skip to main content
PUT
/
email
/
drafts
/
{draft_id}
Update Draft
curl --request PUT \
  --url https://api.decodahealth.com/email/drafts/{draft_id} \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "to": [
    "<string>"
  ],
  "subject": "<string>",
  "bodyHtml": "<string>",
  "bodyText": "<string>"
}
'
{
  "id": "<string>",
  "threadId": "<string>",
  "subject": "<string>",
  "bodyText": "<string>",
  "bodyHtml": "<string>",
  "snippet": "<string>",
  "status": "DRAFT",
  "direction": "INBOUND",
  "sentDate": "2023-11-07T05:31:56Z",
  "deliveredDate": "2023-11-07T05:31:56Z",
  "isRead": true,
  "isStarred": true,
  "isDraft": true,
  "createdDate": "2023-11-07T05:31:56Z",
  "updatedDate": "2023-11-07T05:31:56Z",
  "participants": [],
  "attachments": [],
  "openCount": 0,
  "uniqueOpenCount": 0,
  "clickCount": 0,
  "uniqueClickCount": 0,
  "firstOpenedDate": "2023-11-07T05:31:56Z",
  "lastOpenedDate": "2023-11-07T05:31:56Z"
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Path Parameters

draft_id
string
required

Body

application/json

Request to update an existing draft.

to
string[] | null
subject
string | null
bodyHtml
string | null
bodyText
string | null

Response

Successful Response

Email message in API responses.

id
string
required
threadId
string
required
subject
string | null
required
bodyText
string | null
required
bodyHtml
string | null
required
snippet
string | null
required
status
enum<string>
required

Status of an email message through its lifecycle.

Available options:
DRAFT,
QUEUED,
SENDING,
SENT,
DELIVERED,
RECEIVED,
FAILED,
BOUNCED,
COMPLAINED
direction
enum<string>
required

Direction of an email message.

Available options:
INBOUND,
OUTBOUND
sentDate
string<date-time> | null
required
deliveredDate
string<date-time> | null
required
isRead
boolean
required
isStarred
boolean
required
isDraft
boolean
required
createdDate
string<date-time>
required
updatedDate
string<date-time> | null
required
participants
EmailParticipantResponse · object[]
attachments
EmailAttachmentResponse · object[]
openCount
integer
default:0
uniqueOpenCount
integer
default:0
clickCount
integer
default:0
uniqueClickCount
integer
default:0
firstOpenedDate
string<date-time> | null
lastOpenedDate
string<date-time> | null