Trouble updating sender info in HubSpot email logging API

{
  "details": {
    "timestamp": "Mailshot Timestamp",
    "ownerId": "80123456",
    "direction": "INBOUND",
    "subject": "Email_Topic",
    "content": "Message_Body"
  },
  "links": [
    {
      "target": {
        "identifier": "uniqueId"
      },
      "categories": [
        {
          "group": "SYSTEM_DEFINED",
          "typeCode": 299
        }
      ]
    }
  ],
  "headers": {
    "sender": {
      "address": "[email protected]",
      "name": "Jane"
    }
  }
}

I’m trying to log an email using the HubSpot API’s email creation endpoint. Everything seems to work fine, but for some reason, the “From” field and sender’s email aren’t being updated. Any ideas what I might be doing wrong? I’ve double-checked the JSON structure, but I can’t figure out why these specific fields aren’t being set correctly.

I’ve encountered a similar issue when working with HubSpot’s email logging API. From my experience, the problem might be related to how you’re setting the sender information in the ‘headers’ section.

Try modifying your JSON structure slightly by moving the sender details out of the ‘headers’ object and into the main body of the request. Something like this:

{
  "details": {
    // ... other details ...
  },
  "links": [
    // ... links ...
  ],
  "from": {
    "email": "[email protected]",
    "firstName": "Jane"
  }
}

This approach worked for me when I faced a similar problem. Also, make sure you have the necessary permissions in your HubSpot account to modify sender information. Sometimes, certain API actions are restricted based on user roles or account settings.

If this doesn’t solve the issue, you might want to double-check the API documentation or reach out to HubSpot support directly. They’re usually quite helpful with these kinds of technical queries.