Solved

Unable to send mail using template API

  • 14 December 2020
  • 2 replies
  • 1226 views

Badge +2

{

    "status": 401,

    "message": "Your account must be verified to perform this request. Please email success@klaviyo.com to verify your account."

}
I have getting the above response when using this API https://a.klaviyo.com/api/v1/email-template/SDSfDm/send.
I have already got the account verified mail from Klaviyo but still the same response message from the API.
 

this is my request

curl --location --request POST 'https://a.klaviyo.com/api/v1/email-template/SDSfDm/send' \

--header 'Content-Type: application/x-www-form-urlencoded' \

--data-urlencode 'api_key=pk_****************************' \

--data-urlencode 'from_email=myMail@gmail.com' \

--data-urlencode 'from_name=Test' \

--data-urlencode 'subject=Your Weekly Summary' \

--data-urlencode 'to=[{ "email" : "example@mailinator.com", "name" : "Test" }]' \

--data-urlencode 'context={ "organization": {"name":"xxxxx","full_address":"xxxxx" } }'

Does anyone have any Idea on this:sweat: ??

icon

Best answer by retention 15 December 2020, 01:08

View original

2 replies

Userlevel 7
Badge +57

@Mridul Raj - Are these transactional emails you want to send via the API?  In the past, when we wanted to send emails directly via the API, we had to get approval from Klaviyo for the exact templates first since the recipients may not have opted in for “marketing.”  I think you have a “Verified Account” but not verified to send transactional emails for specific email templates.  

As you can imagine, this method to send emails can be highly abused to use Klaviyo as a “dumb pipe” for spam emails since you can put any email address in there at runtime - so I imagine they want to make sure the templates you send are above board.  

Klaviyo has some basic documentation here:
Ability to Send Transactional Emails with Klaviyo

 

Userlevel 6
Badge +9

@Mridul Raj just echoing what @retention mentioned here - curious to know what the use case is? The API endpoint is meant for testing, rather than for sending emails because there is a hard cap on how many sends one accounts gets to use it for. 

There are more details in this Klaviyo API doc, but specifically, if you’re looking to render templates and send emails, the API is intended to test templates only, and is rate limited to the following thresholds:

  • 100 / hour
  • 1,000 / day

Reply