API Errors: Where can I find information on the original API request?

I have an app that logs the API response in the event of an error. In the error response I see two fields:

correlationId

and

requestId

like so:

{
 "status":"error",
 "message":"Property values were not valid",	
 "correlationId":"XXX",
 "requestId":"XXX",
}

My question is, where can I find additional information about the original request? Is there an API endpoint I can query with either the

correlationId

or the

requestId

?

Thanks!

Hey @darrinb,

Unfortunately, there is currently no endpoint to query the correlationId or requestId. On our end, it generally require getting engineer to dig through the service logs. That said, I’d love to share with you this similar forum thread: https://community.hubspot.com/t5/APIs-Integrations/Contact-Properties-not-found-via-Contacts-API/td-p/224115 where Isaac mentioned that:

The “Property values were not valid” error generally indicates a mismatch between the property values you are trying to pass and the HubSpot property’s available values. (Rather than the nonexistence of the properties themselves.)

If you’re still seeing the error, could you share the following with me:

1) The full request URL with any hapikey values redacted.
2) The method (e.g. GET, POST, PUT, DELETE).
3) The payload or body if it is a POST or PUT request.
4) The full response, including X-HubSpot-RateLimit headers, error codes, and the full message

Hi Wendy,

Thank you for responding! This isn’t about the error itself though, I know what’s causing it. The challenge I’m facing is the error message HS returns doesn’t reference an object ID at all, so I have no reference to the Contact or Company the API call is trying to update.
This is the scenario:
My client has a web-based app where they manage a membership base of users and associated companies. Those users and companies are mapped to Contacts and Companies on their HS account. When a member updates their profile, the corresponding information is updated on HS.

Sometimes these updates fail and HS sends an error in the API response. When this happens the error response from HS is logged. The problem is, there’s no objectID in the error response from HS, so I have no idea what Contact or Company the error occurred on.
This is an example error message:

{
 "validationResults": [
 {
 "isValid": false,
 "message": "Communication was not one of the allowed options: [label: "Accelerator"
 value: "Accelerator"
 display_order: 1
 hidden: false
 read_only: false
 , label: "Accounting"
 value: "Accounting"
 display_order: 2
 hidden: false
 read_only: false
 , ]",
 "error": "INVALID_OPTION",
 "name": "company_specialty"
 }
 ],
 "status": "error",
 "message": "Property values were not valid",
 "correlationId": "XXX",
 "requestId": "XXX"
}

I also checked the headers HS sends; there’s no reference to the objectID there either.

Hey @darrinb,

Thanks for providing a detailed use case. Could you further provide me the following:

1. The exact endpoint that your client is using

2. An example response body

3. Their portal ID

I’d like to closely understand the exact behavior here and if it’s more comfortable for you, you can send the information via DM.

Hi Wendy,

Thank you for getting back to me. I continued to research yesterday, but am still unable to find anywhere where the objectID of a Company is referenced in an API error response.

The endpoint we’re pinging is:

https://api.hubapi.com/companies/v2/companies/<companyID>?hapikey=<apikey>

It’s outlined here: https://developers.hubspot.com/docs/methods/companies/update_company

I provided a sample response in my previous response. The only thing I truncated was the list of allowed options in the "

message

" property, as it would have been unwieldy to list out.

The portal ID is 362334

Thanks!

Hey @darrinb,

Thanks for sharing these information with me!

While we wouldn’t be able to dig into the objectID, I look into the portal and the following error message that you shared:

{
 "validationResults": [
 {
 "isValid": false,
 "message": "Communication was not one of the allowed options: [label: "Accelerator"
 value: "Accelerator"
 display_order: 1
 hidden: false
 read_only: false
 , label: "Accounting"
 value: "Accounting"
 display_order: 2
 hidden: false
 read_only: false
 , ]",
 "error": "INVALID_OPTION",
 "name": "company_specialty"
 }
 ],
 "status": "error",
 "message": "Property values were not valid",
 "correlationId": "XXX",
 "requestId": "XXX"
}

I believe the underlying issue here is that we are trying to update company property - Company Specialty with the ‘Communication’ option and since ‘Communication’ is not part of the Company Specialty property option, it is throwing the error. You can refer to this documentation to learn more about how to Manage your properties.

Additionally, if you’d like to pull out those companies with Communication set as the value on the Company Specialty property, you can do the following:

1. Add in ‘Communication’ as an option on the Company Specialty property

2. On the Companies dashboard, add filter: Company Specialty is any of ‘Communication’

Hi Wendy,

The issue was never what the error was; I know what’s causing the error. The issue what that the error message in no way references the object we’re attempting to update. The only sort of ID the error message gives is the

correlationId

and the

requestId

. Which is why my original question was : *"Where can I find additional information about the original request? Is there an API endpoint I can query with either the

correlationId

or the

requestId*

?"
An error message that doesn’t refence the object of the error isn’t a very helpful error message.
So there’s no way to reference the original object from the API call based on the error message HupSpot returns?

Hey @darrinb,

I understand your concern and as I mentioned in our earlier respone, unfortunately there currently isn’t an endpoint to to query with either the correlationId or the requestId.

That said, I’m more than happy to help you track down the error based on the error message, post body and request url used.

Moving forward, I do agree that there should be a way for users to better understand where the error message is coming from (in this case, which company). Hence, if you haven’t already, I’d recommend jumping over to the HubSpot Ideas Forum and posting this idea there so that it’s visible to the HubSpot product team and other HubSpot customers and developers. Hopefully this will gather more interest.