Buttondown Documentation
Got a great idea for an email, and want to jot it down quickly? Buttondown’s API makes it possible to create a draft at the drop of a hat.
One thing before we get going: It’s always a good idea to have our API reference doc on hand in case you need it!
Ready to put pen to paper? All you’ll need is a catchy subject line, a fun idea for your body text, and a few lines of code.
Drafts follow a similar set of parameters as regular emails, with just one exception: The “Status” must be set as “Draft.”
You’ve jotted down your draft—but how do you know if your API request was successful? Here are three ways to check:
Want to see how your draft is shaping up? You can conjure it with an email ID, along with a few new lines of code.
Before we get to the code, here are two ways to find your email ID:
Now you're ready to use the following code.
If the editing mood strikes, you can always update the body of your draft using the code below.
Congratulations, your draft is ready to become a fully-fledged email! Go ahead and send it out with just a few more adjustments to your code.
The main change will be to your draft’s “Status.” We’ll switch it from “Draft” to “About to Send.” Once you submit your request, Buttondown will automatically begin the process of sending your email.
(Pro tip: If you spot a typo and want to undo sending your email, you’ll still have a few minutes to do so! All you need to do is change the “Status” back to “Draft.”)
If you’d rather wait a bit to send your draft, you can simply change your draft “Status” to “Scheduled” instead. You’ll also need to add a “Publish date” in the following format: “YYYY-MM-DDTHH:MM:SSZ.”
Our support team is always here to help. Just send us a message and we'll take a look!