saveDraft
Requires permission sales:quote:update.
Creates an email draft, or updates one of the caller's own when an ID is given. A draft belongs to its author: another user's draft, or an unknown ID, is treated as missing. Requires permission to update quotes.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SaveDraft($input: SaveDraftInput!) {
saveDraft(input: $input) {
id
type
createdAt
bodyHtml
ccEmails
inReplyToId
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SaveDraft($input: SaveDraftInput!) {\n saveDraft(input: $input) {\n id\n type\n createdAt\n bodyHtml\n ccEmails\n inReplyToId\n }\n}",
"variables": {
"input": {}
}
}
EOF
Variables:
{
"input": {}
}
Response:
{
"data": {
"saveDraft": {
"id": "id",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"bodyHtml": "string",
"ccEmails": [
"string"
],
"inReplyToId": "string"
}
}
}
saveDraft(
input: SaveDraftInput!
): EmailDraft!
Arguments
saveDraft.input ● SaveDraftInput! non-null input
The draft's recipients, subject and body, the quote or order it relates to, and its ID when updating.
Type
EmailDraft object
A saved email draft.