(Looking to send a draft through the Buttondown app, not programmatically? Check out Previewing your email in an email inbox .)
Sample requests These sample requests are autogenerated by the OpenAPI spec. This endpoint requires one or more parameters in the URL: those are offset in curly-braces.
import requests
url = "https://api.buttondown.com/v1/emails/ {id} /send-draft"
payload = {
"subscribers" : [ "bc5601f4-b180-4e02-8501-c18080662376" , "24ee3338-daaf-42b0-bf7b-0cab38972fe5" ],
"recipients" : [ "telemachus@buttondown.email" ]
}
headers = {
"accept" : "application/json" ,
"authorization" : "Token $BUTTONDOWN_API_KEY" ,
"content-type" : "application/json"
}
response = requests.post(url, json =payload, headers =headers)
print (response.text)
Sample responses The IDs and values referenced in these responses are fake; please only rely on these responses for overall structure.
OK (200)
Bad Request (400)
Forbidden (403)
Not Found (404)
Conflict (409)
Body parameters All parameters are optional unless explicitly specified.
subscribers Type
array
Description
A list of subscriber ids to which to send the email.
Example
[
"bc5601f4-b180-4e02-8501-c18080662376",
"24ee3338-daaf-42b0-bf7b-0cab38972fe5"
]
recipients Type
array
Description
A list of email addresses to send the email to.
Example
[
"telemachus@buttondown.email"
]