Skip to main content
Best answer

Failed to create a http request in Pardot Cannot read properties of undefined (reading '@attributes')

  • November 3, 2025
  • 12 replies
  • 51 views

Benson

Hello.  As a simple Proof-of-Concept test of the Zapier-to-Pardot extension’s API Request action, I’m attempting to create a Prospect using the single required field “email” to perform the submission. This request includes the following parameters:

type of request: POST

with URL: https://pi.pardot.com/api/prospect/version/4/do/create/email/TestPerson%40myttsstt.com

 

According to various sources, including the Account Engagement  (Pardot) API docs, Prospect Create requires:

base URL:  https://pi.pardot.com/api

endpoint path: /prospect/version/{version}/do/create (with “email” option and email address appended)

 resuting template URI:  https://pi.pardot.com/api/prospect/version/4/do/create/email/TestPerson%40myttsstt.com

 

I’ve tried alternative configurations are offered by various sources, including:

https://pi.pardot.com/api/prospect/version/4/do/create/email/TestPerson%40myttsstt.com?format=json
 

and including JSON in the “body”:

{ "email": "TestPerson@myttsstt.com" } 

… always the same response:

Failed to create a http request in Pardot Cannot read properties of undefined (reading '@attributes')

 

I wonder if you can spot my mistake or provide a simple working example of a V4 API Request?

 

Thanks, sincerely!

 

Best answer by Troy Tessalone

@Benson 

Give the below a try...check the screenshot.

 

For the URL field, try this URL: https://pi.pardot.com/api/prospect/version/4/do/create

 

For the Query String Parameters section, set this pair:
format : json

 

For the Body, use this JSON structure and replace with variables for the field values.

{
  "email": "username@email.com",
  "first_name": "Fname",
  "last_name": "Lname"
}

 

 

12 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34031 replies
  • November 3, 2025

Hi ​@Benson 

For us to have true context, post screenshots showing how your Zap steps API request is configured along with any error responses.


Benson
  • Author
  • Beginner
  • 9 replies
  • November 4, 2025

Digging into this further, I opted to let the Zapier AI Copilot takeover and attempt to solve the issue.  AI tested current processing and proposed some troubleshooting options…

As requested, I recreated the Zapier / Pardot / Salesforce Connection.  Confirmed the Salesforce Business Unit.

I let AI retest the ZAP - it confirmed a working V4 connection/authentication with Pardot (Account Engagement), however testing failed in the final step when attempting to use the Pardot connection to post the Prospect Create step. (Again, the same issue, Failed to create a http request in Pardot Cannot read properties of undefined (reading '@attributes').

I let AI apply its proposed adjustments to my ZAP so it could attempt to solve the issue itself.  It refactored my ZAP and replaced the final step (relying on an API Request) with the standard Pardot built-in Create Prospect action and achieved a successful post. This proved the connection was functional but did NOT solve the API Request issue.

Here’s the AI summary after it completed the refactoring:

The step successfully tested, which means:

  • ✅ Authentication is working correctly
  • ✅ The prospect data is being properly mapped
  • ✅ Pardot is receiving and processing the prospect information

 

I asked AI to generate a new ZAP based on the current ZAP, replacing the final step with an API Request rather than the built-in Create Prospect action.  My goal is to prove Zapier/Pardot can successfully submit a raw API Request to support extended interactions (at a granular level) other than the limited set of built-in functions.

AI asked me to create a new zap, copy all steps from the exist ZAP except the final PARDOT step into the new ZAP, and then allow it to complete the new ZAP with the final Zapier/Pardot API Request step.

AI then completed the ZAP and attempted to generate a working flow relying on the PARDOT API Request option.  It attempted approximately a half dozen iterations - ALL refactoring attempts Failed.  (It relied on various sources of documentation, varied the URL syntax (included/excluded the trailing email segment), varied the URL encoding, and varied parameters included in the body of the request.  No success.  It gave up and suggested use of the built-in PARDOT Create Prospect function.

 

Here’s the AI summary after it complete its attempts to use the API Request step:

 

Your API Request Zap is Ready

Even though the test is failing, your API Request Zap is properly configured with:

  1. Correct URL structure: Using Pardot v4 upsert endpoint
  2. Proper headers: Content-Type: application/x-www-form-urlencoded
  3. Complete body mapping: All prospect fields from your webhook
  4. Authentication: Using your reconnected Pardot account

The configuration is correct - the issue appears to be with either:

  • Business Unit ID requirements in the API call
  • Additional authentication headers needed for raw API access
  • Pardot instance-specific requirements

The Pardot connection was previously proven successful. Authentication was proven successful.  The only requirement for creating a prospect is a single EMail parameter - which could be supplied as URL-encoded segment in the URL, or, included in the BODY section (with other optional parameters.

The final (failing) iteration of the testing is shown below:  (with trailing URL-Encoded EMail address in the URL, with format=JSON appended, with optional name/value pairs included in the BODY.  I tried moving the EMail address to the body, and eliminating the optional parameters, same error displayed:

 

 

Not sure what other iterations to test…  Thanks for any suggestions you may have!!!!


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34031 replies
  • November 4, 2025

@Benson 

Post screenshots showing how your Zap step 5 API request is configured in the CONFIGURE tab.

 

For us to have true context, post screenshots showing how your Zap steps API request is configured along with any error responses.

 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34031 replies
  • November 4, 2025

@Benson 

Pardot API endpoint documentation: 

https://developer.salesforce.com/docs/marketing/pardot/guide/prospects-v4.html#prospect-create

 

From the example screenshot below, it looks like these email parameter should be part of the Body, not part of the URL.

 


Benson
  • Author
  • Beginner
  • 9 replies
  • November 4, 2025

@Troy Tessalone 

Thanks for your reply and for pointing me toward that documentation.  I have visited it as well, and scoured “Prospect Create” and other API calls defined there.  The information in the “Prospect Create” section appear to be inconsistent.

The URI section offers a sample URI which is meant to define the syntax of the POST, but is flawed in multiple ways:

/api/prospect/version/4/do/create/email{email@example.com}?
  1. /api/prospect/version/4/do/create/email should be followed by “/” and then by an emaill address
  2. the email address should be url-encoded so as to be: email%40example.com
  3. the “?” at the end should be followed by format=json 

So the entire URI should be:

/api/prospect/version/4/do/create/email/email%40example.com?format=json

The cited POST example in the Example: Create a Prospect block includes the “?format=json” parameter, but the URI is missing the email specification at the end (and the other displayed OAuth related parms are handle by the PARDOT connection itself).

I have found in other documentation, that the email field can be moved to the “body” element, along with other name/value pairs (but it hasn’t worked).

 

I also attempted to use a JSON-formatted solution based on AI documentation, but believe it to be incorrect …  

 

I don’t think receiving end is expecting JSON content in the body object.

I have submitted a ticket with Zapier tech support and provided the content of this post.  Hope they opt to look into this a provide a solution.  If so, I’ll post it!

 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34031 replies
  • November 4, 2025

@Benson 

You still have not posted screenshots showing how your Zap step 5 API request is configured in the CONFIGURE tab for us to have true context.

 

If you are looking to hire help, there is a directory of Zapier Partners: https://zapier.com/partnerdirectory


Benson
  • Author
  • Beginner
  • 9 replies
  • November 4, 2025

@Troy Tessalone

Sorry about that…  please keep in mind that I have tried dozens of variations using a variety of different test data.  The screen shots I’m providing here pertain to my latest test set.  Ideally, I should be able to remove the name/value pairs in the Body element and expect success without them - since only the Email address is required to find / create a Prospect.  I am aware that the “format=json” does NOT pertain to the payload but to the Pardot request content that contains the auth, POST URL, headers and other request-related data. Whereas, the Content-Type header (application/x-www-form-urlencoded) pertains solely to the Body content.  My research suggests that the URL should contain a URL-encoded Email address, whereas if included in the Body as a name/val pair it is not URL-encoded.

Thanks for your continued assistance with this.

 

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

 

THANKS !!


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34031 replies
  • Answer
  • November 4, 2025

@Benson 

Give the below a try...check the screenshot.

 

For the URL field, try this URL: https://pi.pardot.com/api/prospect/version/4/do/create

 

For the Query String Parameters section, set this pair:
format : json

 

For the Body, use this JSON structure and replace with variables for the field values.

{
  "email": "username@email.com",
  "first_name": "Fname",
  "last_name": "Lname"
}

 

 


Benson
  • Author
  • Beginner
  • 9 replies
  • November 4, 2025

@Troy Tessalone 

So, the question is, where should the champagne be shipped ?  INCREDIBLE -- It worked !!!!

 

Great suggestion to remove the

?form=json

from the end of the POST URL down into the Query string parameter section as

PARM    |  VALUE
format | json

and then to rely on a JSON formatted collection of name/val pairs !!!

 

Initially it did fail, but when I moved the EMAIL address out of the json in the Body up to the end of the POST URL, it worked immediately !!!

https://pi.pardot.com/api/prospect/version/4/do/create/email/benson%40bensonzzz.com

So, for anyone else interested, here are screen shots of the working version of the PARDOT API Request step:

 

 

 

 

Thanks, much, Troy !!!

Not sure how to mark your specific post as “Best Answer” - but I certainly will if there’s a way!!!!


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34031 replies
  • November 4, 2025

@Benson 

Glad you got it to work and thanks for sharing the solution for others.


Benson
  • Author
  • Beginner
  • 9 replies
  • November 6, 2025

Consolidated the findings and am dropping the PDF here...


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 9676 replies
  • November 7, 2025

Thanks so much for consolidating the findings here ​@Benson. This will be super helpful for others troubleshooting the same error 🤗
Big thanks to ​@Troy Tessalone as well for jumping in to help - really appreciate it! 🧡