Failing to post comments through the API


We are displaying blog posts in a custom site retrieving the blog posts through the API which works fine.

However we are trying to implement the comment API for posting comments but are getting stuck at the following:

We are sending the following data to:

portalId=_REDACTED_ (taken from top right hubspot portal)
contentId=_REDACTED_ (the blog post ID taken from the API)
collectionId=_REDACTED_ (the blog post group ID taken from the API)
contentPermalink=_REDACTED_ (the blog post url)
contentAuthorName=_REDACTED_ (the blog post author name)
contentAuthorEmail=_REDACTED_ (the blog post author email)
hs_context=_REDACTED_ (taken from the hubspot cookie)

But we are getting a 400 HTTP error with the following message:

    "status": "error",
    "message": "Unable to deduce portalId from this request.",
    "correlationId": "c2e2f43a-64b8-485d-bfbe-___",
    "requestId": "00dd251f22bed29ad8d392___"

Can you guys point us in the right direction? In the documentation is no mention of the portalId parameter so we added it ourselfs to see if that would help but that doesn’t change the error.


Hi @stayallive

Are you making this request using an API key or an access token? If you’re using an access token, is this an OAuth2 token (using the Authorization header) or an old token (using the access_token= query parameter?


Hey @dadams,

We are using an API key (hapikey parameter) in the URL the same way we are retrieving comments.

So the full URL we are posting to is:

I just tried to fiddle arround again and now we are getting a 500 response internal error (we had the parameters in the post body for testing).

So something changed… but it’s still not working as expected :slight_smile:


I'm getting exact same issue. Can anyone please identify the issue here?

I'm sending these data in API and using this api url.

URL : _key&portalId=_id

Data: var form = {
contentPermalink, contentTitle,


Hey, @Krina.

This endpoint requires a JSON-formatted payload. Additionally, no portalId parameter should be included in the request URL.

I successfully created comments on my own blog posts with the following format:


"comment" : "This is a test comment.",
"contentId": "5340056079",
"collectionId": "4623992565",
"contentAuthorEmail": "",
"contentAuthor": "Sample HubSpot User",
"contentPermalink": "",
"userEmail": "",
"userName": "John Doe"


I'm sendind this in json format and also same data, There's still confusion in one thing here, I'm getting collectionId same as contentId in detail API and you seems to have different. Kindly guide me for this.

As well, If I send the same things, I'm getting following error:

{"status":"error","message":"Unable to deduce portalId from this request.","correlationId":"25d471cd-0881-4743-828c-38a10c92e36e","requestId":"e998b2953ed817065fefd9f2f3f3e9e4"}

Krina Soni


Hi, @Krina.

Can you share the actual JSON you are sending so I can take a closer look?