How to Automatically Mirror HubSpot Campaigns in Oktopost Using Agent Builder

Use a Custom Agent in Agent Builder to receive HubSpot campaign data through a webhook and create matching campaigns in Oktopost automatically.

Set up Oktopost Agent Builder

Create a webhook listener in Oktopost to capture incoming campaign data from HubSpot.

Create a custom agent

  1. Go to AI Management > Custom Agents in your Oktopost account.
  2. Click Create agent, or open your existing HubSpot campaign creation agent.

Configure the webhook trigger node

  1. Add a Webhook node as the first step in the workflow.
  2. Enter a label for the node (for example, HubSpot Campaign Creation).
  3. Under Vendor, select Generic.
  4. Copy the Webhook URL generated by the system (for example, https://flows.app.oktopost.com/api/webhooks/custom/...).
  5. Copy the Secret / API Key shown below the URL.

Set up the Oktopost Action node (placeholder)

  1. Connect an Oktopost Action node to your Webhook node.
  2. Set the action function to create_campaign.
  3. Do not map payload fields yet. Your agent needs to receive a real data structure from HubSpot before you can map fields.
  4. Save the agent and set it to Active so it is ready for your HubSpot test.

Set up HubSpot workflow automation

Configure HubSpot to send campaign details to Oktopost with the correct authentication header.

Initialize the workflow trigger

  1. Create a new workflow in HubSpot.
  2. Set the enrollment trigger to run when a new campaign is created or when a specific property value changes (for example, Property value changed).
  3. Optionally, add a short delay stage after the trigger if your workflow needs time to populate campaign properties before sending data.

Add the webhook action

  1. Add a Trigger a webhook action to the workflow.
  2. Set Method to POST.
  3. Paste the Webhook URL you copied from Oktopost Agent Builder into the URL field.

Configure header authentication

Authentication header name
Oktopost requires the API key header to be named exactly x-webhook-secret. If you use a generic name (such as "Oktopost"), HubSpot returns a 401 Unauthorized error: "Invalid or missing webhook authentication."
  1. Set Authentication Type to API Key.
  2. Click Add Secret.
  3. Set API Key Name to x-webhook-secret.
  4. In the value field, paste the Secret / API Key you copied from the Oktopost agent.
  5. Set API Key Location to Request Header.
Setting Value
Authentication Type API Key
API Key Name x-webhook-secret
API Key Location Request Header
Method POST

Define payload data

  1. Select Include all triggered campaign properties so all fields are included in the webhook payload.
  2. Save the action.

Test and map fields

Send a test payload from HubSpot, then map the verified fields in Oktopost.

Fire the test payload

  1. In the HubSpot webhook action configuration, choose a recent campaign and click Test.
  2. Confirm the response shows Success with status code 200 OK (not 401 Unauthorized).

Map mirror fields in Oktopost

  1. Return to Agent Builder in Oktopost.
  2. Set the agent to Draft so you can edit the workflow.
  3. Open the Oktopost Action node with the create_campaign function.
  4. After a successful test, sample data fields from HubSpot appear (for example, portalId, objectId, or campaign names).
  5. Drag and map the verified HubSpot payload fields to the corresponding Oktopost campaign creation fields.
  6. Set the agent back to Active. New HubSpot campaigns are mirrored in your Oktopost campaign library automatically.
Was this article helpful?
0 out of 0 found this helpful