Automation

An automation is a one-to-one mapping between an external RSS feed and an action to be performed when new items are detected in that feed. Right now, Buttondown offers two actions:

  • Send an email
  • Create an email but save it as a draft to be sent out manually

The automation is configured with a cadence, which is the frequency at which the automation will be run. The cadence can be one of the following:

  • Run the automation every time a new item is detected in the feed
  • Run the automation once per week
  • Run the automation once per month

Basic automation

{
"creation_date": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "active",
"behavior": "emails",
"cadence": "every",
"subject": "New post: {{ item.title }}",
"body": "I just published a new post: {{ item.url }}"
}
fieldtypedescription
idstring
creation_datestring
statusAutomationStatus
behaviorAutomationBehavior
cadenceAutomationCadence
cadence_metadataobject
urlstring
subjectstring
bodystring

Behavior (AutomationBehavior)

An enumeration.


typeidentifierdescription
Create draft
draftCreate a draft email
Send email
emailsSend emails to subscribers

Status (AutomationStatus)

An enumeration.


typeidentifierdescription
Active
activeActive
Inactive
inactiveInactive

Cadence (AutomationCadence)

An enumeration.


typeidentifierdescription
Every new item
everyAct every single time a new item is added to the RSS feed
Weekly
weeklyAct every week, compiling a digest of new items
Monthly
monthlyAct every month, compiling a digest of new items

Create Automation

$ curl -X POST https://api.buttondown.email/v1/automations

Parameters

parametertypedescriptionoptional
urlstring
behavior
cadence
cadence_metadataobject
subjectstring
bodystring

Responses

StatusDescriptionSample Response
201Created
{
"creation_date": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "active",
"behavior": "emails",
"cadence": "every",
"subject": "New post: {{ item.title }}",
"body": "I just published a new post: {{ item.url }}"
}
400Bad Request
{
"code": "something_went_wrong",
"detail": "Your call is very important to us."
}
403Forbidden
{
"code": "something_went_wrong",
"detail": "Your call is very important to us."
}

List Automations

$ curl -X GET https://api.buttondown.email/v1/automations

Responses

StatusDescriptionSample Response
200OK
{
"results": [
{
"creation_date": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "active",
"behavior": "emails",
"cadence": "every",
"subject": "New post: {{ item.title }}",
"body": "I just published a new post: {{ item.url }}"
}
],
"count": 1
}
403Forbidden
{
"code": "something_went_wrong",
"detail": "Your call is very important to us."
}

Update Automation

$ curl -X PATCH https://api.buttondown.email/v1/automations/{pk}

Responses

StatusDescriptionSample Response
200OK
{
"creation_date": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "active",
"behavior": "emails",
"cadence": "every",
"subject": "New post: {{ item.title }}",
"body": "I just published a new post: {{ item.url }}"
}
400Bad Request
{
"code": "something_went_wrong",
"detail": "Your call is very important to us."
}
403Forbidden
{
"code": "something_went_wrong",
"detail": "Your call is very important to us."
}

Delete Automation

$ curl -X DELETE https://api.buttondown.email/v1/automations/{pk}

Responses

StatusDescriptionSample Response
204No Content
{}
403Forbidden
{
"code": "something_went_wrong",
"detail": "Your call is very important to us."
}

Retrieve Automation

$ curl -X GET https://api.buttondown.email/v1/automations/{pk}

Responses

StatusDescriptionSample Response
200OK
{
"creation_date": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"status": "active",
"behavior": "emails",
"cadence": "every",
"subject": "New post: {{ item.title }}",
"body": "I just published a new post: {{ item.url }}"
}
403Forbidden
{
"code": "something_went_wrong",
"detail": "Your call is very important to us."
}