Skip to main content

Automatically send Opportunity feedback from Salesforce to Harvestr

Written by Marina Salmon

Opportunities in Salesforce often contain valuable product feedback, whether it’s a Closed Lost reason, a sales objection, or a custom field filled out by sales reps.

You can automatically push this feedback into Harvestr to centralize insights from your sales pipeline, analyze product gaps, and inform prioritization.

This guide explains how to do this using:

Example scenario

We’ll use Closed Lost reasons as an example throughout this guide, but the same logic applies to any Opportunity property where sales reps capture product-related insights (e.g. objection fields, feature requests, internal notes).

Option 1: Using Zapier

Prerequisites

  • Salesforce and Harvestr accounts connected to Zapier

  • A field in Salesforce (e.g. Lost Reason) where feedback is collected

Steps

  1. Trigger: Salesforce → Updated Field on Record

    • App: Salesforce

    • Event: Updated Field on Record

    • Object: Opportunity

    • Filters:

      • Stage = Closed Lost

      • Lost Reason (or any feedback field) is not empty

  2. Action: Harvestr → Create Message

    • App: Harvestr

    • Event: Create Message

    • Set up the action with:

      • Title: Lost Opportunity – {{Opportunity.Account.Name}}

      • Content: {{Opportunity.Lost_Reason__c}}

      • Channel: salesforce

      • Submitter Email: {{Opportunity.Contact.Email}}

      • Requester Email: {{Opportunity.Owner.Email}}

      • (Optional) Add tags like lost-deal, sales-feedback

  3. Test your Zap

    • Update a test Opportunity in Salesforce

    • Confirm that the feedback appears in your Harvestr inbox


Option 2: Using Salesforce Flow + Harvestr API

If your team prefers to automate workflows directly within Salesforce without using third-party tools like Zapier, you can send Opportunity feedback to Harvestr using a Record-Triggered Flow and an HTTP callout.

This method gives you full flexibility to customize when and how feedback is pushed, and can be deployed across multiple fields or Opportunity stages.

Prerequisites

  • Admin access in Salesforce

  • A Harvestr API Access Token with the create_feedback scope (created from your Harvestr API settings)

  • An External Credential and a Named Credential in Salesforce to authenticate the callout securely

  • A custom Flow (created with Flow Builder)

Note on Salesforce Named Credentials

Since Winter ’23, Salesforce splits authenticated callouts into two objects: an External Credential (stores the auth protocol, principal, and headers) and a Named Credential (stores the endpoint URL and references an External Credential). This guide uses that model.

Steps

Step 1: Create a Harvestr API Access Token

Harvestr uses a private-app token passed in a custom header (X-Harvestr-Private-App-Token), not a standard Bearer token.

  1. Create a new token.

  2. Grant it the create_feedback scope (required for the POST /v1/message endpoint).

  3. Copy the token to a password manager. You won't see it again.

📚 Harvestr docs: Quickstart and Required scopes

Step 2: Create an External Credential in Salesforce

The External Credential holds the Harvestr API token and injects it as a custom HTTP header on every callout.

  1. Go to Setup > Security > Named Credentials and open the External Credentials tab.

  2. Click New. Fill in:

    • Label: Harvestr

    • Name: Harvestr

    • Authentication Protocol: Custom

  3. Save.

  4. In the Principals section, click New. Fill in:

    • Parameter Name: Default

    • Sequence Number: 1

    • Identity Type: Named Principal

    • In Authentication Parameters, add:
      Name: token
      Value: paste your Harvestr API Access Token

  5. Save.

  6. Back on the External Credential page, in the Custom Headers section, click New. Add:

    • Name: X-Harvestr-Private-App-Token

    • Value: {!$Credential.Harvestr.token}

    • Sequence Number: 1

  7. Save.

  8. In your Salesforce Permission Sets, grant access to this External Credential to the users or integration principal that will run the Flow.

Step 3: Create a Named Credential

The Named Credential holds the Harvestr API base URL and points to the External Credential you just created.

  1. In Setup > Security > Named Credentials, open the Named Credentials tab.

  2. Click New. Fill in:

    • Label: Harvestr API

    • Name: Harvestr_API

    • URL: https://rest.harvestr.io

    • External Credential: Harvestr

    • Generate Authorization Header: unchecked (Harvestr uses a custom header, not Authorization: Bearer)

    • Allow Formulas in HTTP Body: checked (so the Flow can inject $Record values into the request body)

  3. Save.

Step 4: Create a Record-Triggered Flow

Build a Flow that fires when an Opportunity is updated (e.g., marked as Closed Lost and a feedback field is filled).

📚 Salesforce docs: Create a Record-Triggered Flow

  1. Go to Setup > Flows.

  2. Click New Flow.

  3. Select Record-Triggered Flow.

  4. Object: Opportunity.

  5. Trigger the Flow When a record is updated.

  6. Entry Conditions (example):

    • StageName Equals Closed Lost

    • Lost_Reason__c Is Null = False

  7. Optimize for: Actions and Related Records.

Step 5: Capture the customer's identity

The Harvestr POST /v1/message endpoint requires a requester object with a type (USER or COMPANY) and a name. For type USER, you can also provide an email. If the requester doesn't exist in Harvestr yet, they will be created (upserted).

Make sure you have Salesforce fields you can map to those values, such as:

  • A Contact lookup on the Opportunity, or a formula field that pulls Contact.Name and Contact.Email

  • Or an Account-level field if you want to attach the feedback to a company instead of a person

📚 Salesforce docs: Create or Edit Custom Fields

Step 6: Add an HTTP Callout to Harvestr

Use the Named Credential to POST the feedback to Harvestr.

📚 Salesforce docs: Use HTTP Callout in Flows

  1. In Flow Builder, click + Add Element.

  2. Choose Action → Create HTTP Callout.

  3. Name your callout: Send_Feedback_to_Harvestr.

  4. Select the Harvestr_API Named Credential.

  5. Configure:

    • Method: POST

    • URL Path: /v1/message

    • Request Body (replace with your actual field names):

      {
        "title": "Lost Opportunity – {!$Record.Account.Name}",
        "content": "{!$Record.Lost_Reason__c}",
        "channel": "SALESFORCE",
        "requester": {
          "type": "USER",
          "name": "{!$Record.Contact.Name}",
          "email": "{!$Record.Contact.Email}"
        },
        "submitter": {
          "name": "{!$Record.Owner.Name}",
          "email": "{!$Record.Owner.Email}"
        }
      }

What you don't need to configure

Base URL: handled by the Named Credential (https://rest.harvestr.io). You only set the path (/v1/message).

Auth header: injected automatically from the External Credential's Custom Headers. Do not add X-Harvestr-Private-App-Token manually.

Content-Type header: Salesforce sets application/json automatically when you provide a JSON body.

Reference: the full request/response schema for POST /v1/message is documented at developers.harvestr.io/api/create-a-message. Optional fields include labels, integrationId, and integrationUrl.

Step 7: Activate and test the Flow

📚 Salesforce docs: Activate a Flow

  1. Save and activate your Flow.

  2. Update an Opportunity in Salesforce that meets the conditions.

  3. Confirm the feedback appears in your Harvestr inbox.

  4. If the callout fails, check Setup > Flow Interviews for the failed run and inspect the HTTP response body for the error returned by Harvestr.

Tie feedback to revenue

Once your Salesforce Opportunity feedback is flowing into Harvestr, you can unlock even more value by activating our Salesforce customer data sync. It automatically enriches feedback with revenue data like ARR or deal size, so you can prioritize based on business impact.

Did this answer your question?