You'll notice that the endpoint is /subscribers/{id_or_email}
, not {id}
. This is because you can retrieve a subscriber by either their ID or their email address, so you don't have to store or remember the ID if you don't want to.
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/subscribers/ {id_or_email} "
payload = {
"email_address" : "telemachus@buttondown.email" ,
"notes" : "One of our first subscribers!"
}
headers = {
"accept" : "application/json" ,
"authorization" : "Token $BUTTONDOWN_API_KEY" ,
"content-type" : "application/json"
}
response = requests.patch(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)
{
"id" : "13121cd6-0dfc-424c-bb12-988b0a32fcb3" ,
"creation_date" : "2020-09-29T00:00:00+00:00" ,
"email_address" : "telemachus@buttondown.email" ,
"notes" : "" ,
"metadata" : {
"name" : "Telemachus"
},
"tags" : [],
"referrer_url" : "" ,
"secondary_id" : 1 ,
"type" : "unactivated" ,
"source" : "organic" ,
"utm_campaign" : "" ,
"utm_medium" : "" ,
"utm_source" : "" ,
"referral_code" : "" ,
"avatar_url" : "" ,
"stripe_coupon" : null ,
"unsubscription_date" : null ,
"churn_date" : null ,
"unsubscription_reason" : "" ,
"transitions" : [],
"ip_address" : null ,
"last_open_date" : null ,
"last_click_date" : null ,
"stripe_customer_id" : null ,
"subscriber_import_id" : null ,
"stripe_customer" : null
}
Body parameters All parameters are optional unless explicitly specified.
email_address Type
string
Example
"telemachus@buttondown.email"
notes Type
string
Example
"One of our first subscribers!"
unsubscription_reason Type
string