Issue sending transactional email with API with VALIDATION_FAILED send result

We had a working implementation of sending transactional emails over the HubSpot API though we’re now seeing an issue in which the emails are posted to the API successfully and the response status displays as “PENDING”. The problem is that the emails are never actually delivered and when I check the status of one of these emails using the send status API (https://api.hubapi.com/marketing/v3/email/send-statuses), the response shows the email as “COMPLETE” status and the send result as “VALIDATION_FAILED”. Here is an example:

{

“statusId”: “*******”,

“sendResult”: “VALIDATION_FAILED”,

“requestedAt”: “2023-01-11T23:51:59.343Z”,

“startedAt”: “2023-01-11T23:51:59.860Z”,

“completedAt”: “2023-01-11T23:52:00.001Z”,

“status”: “COMPLETE”,

“eventId”: {

“created”: “2023-01-11T23:51:59.915Z”,

“id”: “***”

}

}

There isn’t a lot of information about that VALIDATION_FAILED send result. The email addresses we’re sending to are valid.

Wondering if it anyone might be able to please point me in the right direction on this?

Thanks so much!,

Eliot

Hi, @eliotk :waving_hand: Thanks for reaching out! One question? Have you filed a HubSpot support ticket for this issue? I ask because accounts that have the transactional email add-on also have access to support. If you already did that and were bounced back here, I apologize. Either way, I am happy to help :blush:

This error message and the documentation are a bit vague — “VALIDATION_ERROR” for any errors resulting from invalid data being included in the request.

My suggestion is to share an example request body that threw this error and see if our internal resources can provide some insight into what the root cause is or what is being included that shouldn’t. Aka “can we spot the agitation?”

Best,

Jaycee

Thanks Jaycee! This is for a development account of ours that we use for staging that has the transactional api connected so I don’t see the ability to file a support ticket there though we did reach out to our account rep. The odd thing is email was sending a-ok up until recently and it doesn’t look like any of our send handling code had changed.
I’ll work on getting a request body example together and post back here. Thank you!

So here is the request we’re making:

curl --location --request POST ‘https://api.hubapi.com/marketing/v3/transactional/single-email/send’ \

--header ‘Authorization: Bearer ****’ \

--header ‘Content-Type: application/json’ \

--data-raw '{

“emailId”: ***,

“message”: {

“to”: “***@***.com”

},

“customProperties”: {}

}’

I’ve obfuscated the auth token, email id and to addresss for privacy though I can assure you those are all valid (also, we encounter this same issue for any to address and any template in our account).

Here’s the response to that with a 200:

{

“statusId”: “***”,

“requestedAt”: “2023-01-12T19:49:38.697Z”,

“status”: “PENDING”

}

Then if we query the send status endpoint using that statusId that comes back with:

curl --location --request GET ‘https://api.hubapi.com/marketing/v3/email/send-statuses/\*\*\*’ \

--header ‘Authorization: Bearer ***’

The response is:

{

“statusId”: “***”,

“sendResult”: “VALIDATION_FAILED”,

“requestedAt”: “2023-01-12T19:49:38.697Z”,

“startedAt”: “2023-01-12T19:49:42.805Z”,

“completedAt”: “2023-01-12T19:49:42.934Z”,

“status”: “COMPLETE”,

“eventId”: {

“created”: “2023-01-12T19:49:42.921Z”,

“id”: “***”

}

}

Appreciate your help working through this!

As Eliot wrote here already, we also use API to send transactional single-send emails and it is also in our development account. For some reason for a particular contact/email address, we are seeing the error he described. So not all contacts are affected.

I tested with my personal Gmail address and I got the same result. Previously my email address wasn’t in contacts.

When viewing contact activities, I can see an error record:

“There was an issue sending an email to this contact. This email wasn’t sent. Learn more.”

and Learn more link takes me here:

I have gone through this list and I am pretty sure neither of these conditions is met. It must be something else here.

Again, these are API transactional emails, and as such, they shouldn’t require any sending/marketing permissions.

here is anAPI error response:

{

"message": "Email not allowed to be sent to the specified recipient in a sandbox portal",

"status": "error",

"emailAddress": "\*\*\*@\*\*\*.com",

"sendResult": "VALIDATION\_FAILED",

"eventId": {

    "id": "\*\*\*",

    "created": \*\*\*

}

}

Any ideas what may be wrong here?

RESOLVED!

The issue in my case was that in the Sandbox account, we can’t send emails to a standard Contact.

Question: Is this a standard practice or there is some kind of a workaround here?

Once I added a new user from settings, I was able to send the transactional email via API to that email address.

Wow Igor! Great find bravo! I just confirmed on my end the same behavior that the transactional email does go through if there is a corresponding user in the development account with that email address.
The interesting thing about this though is I’m quite sure that that wasn’t the requirement/expected behavior a week and a half ago. Looking at our past transactional email history, we were able to send these emails to standard contacts with the corresponding account user.
So I wonder if either a) there was a regression that needs to be fixed on the HubSpot side to again be able to send these to standard contacts or b) this is the expected newly implemented behavior?

I’m glad you confirmed the fix and I agree with you - this wasn’t a default behavior up until recently.

It would be great if HubSpot representatives chime in and add some clarity to this issue.

- Is this a newly implemented behavior or

- A bug, which needs to be addressed

@IgorP I had this exact problem too! Thanks for the answer.