> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heyoo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# campaign.shared

> Occurs when a campaign is shared by a user.

export const WebhookResponseBodyParameters = ({type, children}) => <div>
    <h2>Response body parameters</h2>
    <p>
      All webhook payloads follow a consistent top-level structure with
      event-specific data nested within the <code>data</code> object.
    </p>
    <ParamField body="id" type="string">
      The event ID.
    </ParamField>
    <ParamField body="event" type="string">
      The event type that triggered the webhook (e.g., <code>{type}</code>).
    </ParamField>
    <ParamField body="timestamp" type="string">
      ISO 8601 timestamp when the webhook event was triggered.
    </ParamField>
    <ParamField body="data" type="object">
      Event-specific data containing detailed information about the event. The
      data object for the <code>{type}</code> event contains the following
      parameters:
      <Expandable defaultOpen title="object parameters">
        {children}
      </Expandable>
    </ParamField>
  </div>;

The `campaign.shared` event is triggered when a user shares a campaign link to a social platform or directly. The payload contains details about the share operation and the campaign.

<WebhookResponseBodyParameters type="campaign.shared">
  <ParamField body="share" type="object" required>
    <Expandable title="properties">
      <ParamField body="id" type="string" required>
        The unique ID of the share.
      </ParamField>

      <ParamField body="campaignId" type="string" required>
        The unique ID of the associated campaign.
      </ParamField>

      <ParamField body="campaignName" type="string" required>
        The name of the shared campaign.
      </ParamField>

      <ParamField body="userId" type="string" required>
        The unique ID of the user that performed the share.
      </ParamField>

      <ParamField body="userName" type="string">
        The name of the user that performed the share.
      </ParamField>

      <ParamField body="userEmail" type="string" required>
        The email of the user that performed the share.
      </ParamField>

      <ParamField body="userImage" type="string">
        The avatar image of the user.
      </ParamField>

      <ParamField body="postId" type="string">
        The local unique identifier for the post inside Heyoo.
      </ParamField>

      <ParamField body="postUrl" type="string">
        The absolute URL to the post on the external platform.
      </ParamField>

      <ParamField body="platform" type="string" required>
        The target platform of the share (e.g. `linkedin`).
      </ParamField>

      <ParamField body="timestamp" type="string" required>
        ISO 8601 timestamp of when the share occurred.
      </ParamField>

      <ParamField body="method" type="string" required>
        The method used to execute the share.
      </ParamField>

      <ParamField body="createdAt" type="string" required>
        ISO 8601 timestamp when the share entity was created.
      </ParamField>
    </Expandable>
  </ParamField>

  <ParamField body="campaign" type="object" required>
    Details about the campaign that was shared.

    <Expandable title="properties">
      <ParamField body="id" type="string" required>
        The unique ID of the campaign.
      </ParamField>

      <ParamField body="name" type="string" required>
        The name of the campaign.
      </ParamField>

      <ParamField body="objective" type="string" required>
        The objective of the campaign (e.g., `increase_awareness`).
      </ParamField>

      <ParamField body="description" type="string" required>
        A description of the campaign payload.
      </ParamField>

      <ParamField body="domain" type="string" required>
        The domain associated with the campaign.
      </ParamField>

      <ParamField body="destinationUrl" type="string" required>
        The destination URL where clicks should be redirected.
      </ParamField>

      <ParamField body="utm_source" type="string">
        The UTM source parameter.
      </ParamField>

      <ParamField body="utm_medium" type="string">
        The UTM medium parameter.
      </ParamField>

      <ParamField body="utm_campaign" type="string">
        The UTM campaign parameter.
      </ParamField>

      <ParamField body="utm_term" type="string">
        The UTM term parameter.
      </ParamField>

      <ParamField body="utm_content" type="string">
        The UTM content parameter.
      </ParamField>

      <ParamField body="ref" type="string">
        Referral identifier.
      </ParamField>

      <ParamField body="clicks" type="integer" required>
        Number of clicks received.
      </ParamField>

      <ParamField body="shares" type="integer" required>
        Number of shares.
      </ParamField>

      <ParamField body="targetShares" type="integer">
        Target number of shares.
      </ParamField>

      <ParamField body="startDate" type="string" required>
        Campaign start date.
      </ParamField>

      <ParamField body="endDate" type="string" required>
        Campaign end date.
      </ParamField>

      <ParamField body="shareRewardAmount" type="number" required>
        Reward amount per share.
      </ParamField>

      <ParamField body="clickRewardAmount" type="number" required>
        Reward amount per click.
      </ParamField>

      <ParamField body="rewardType" type="string" required>
        Type of reward given.
      </ParamField>

      <ParamField body="maxRewardPerEmployee" type="number">
        Maximum reward per employee.
      </ParamField>

      <ParamField body="totalBudget" type="number">
        Total budget allocated to the campaign.
      </ParamField>

      <ParamField body="consumedBudget" type="number" required>
        Budget consumed so far.
      </ParamField>

      <ParamField body="minimumClicksForReward" type="integer">
        Minimum clicks required for a reward.
      </ParamField>

      <ParamField body="uniqueClicksOnly" type="boolean">
        Whether only unique clicks are rewarded.
      </ParamField>

      <ParamField body="status" type="string" required>
        Current status of the campaign.
      </ParamField>

      <ParamField body="creatorId" type="string" required>
        The unique ID of the user who created the campaign.
      </ParamField>

      <ParamField body="workspaceId" type="string" required>
        The unique ID of the workspace.
      </ParamField>

      <ParamField body="workspaceSlug" type="string" required>
        The slug of the workspace.
      </ParamField>

      <ParamField body="contentPillarName" type="string">
        The content pillar name.
      </ParamField>

      <ParamField body="createdAt" type="string" required>
        ISO 8601 timestamp when the campaign was created.
      </ParamField>

      <ParamField body="updatedAt" type="string" required>
        ISO 8601 timestamp when the campaign was last updated.
      </ParamField>
    </Expandable>
  </ParamField>
</WebhookResponseBodyParameters>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "evt_...",
    "event": "campaign.shared",
    "timestamp": "2024-08-26T16:41:52.346Z",
    "data": {
      "share": {
        "id": "shr_...",
        "campaignId": "cm11...",
        "campaignName": "Summer Referral Push",
        "userId": "usr_...",
        "userName": "John Doe",
        "userEmail": "john@example.com",
        "userImage": "https://example.com/avatar.jpg",
        "postId": "post_...",
        "postUrl": "https://linkedin.com/posts/...",
        "platform": "linkedin",
        "timestamp": "2024-08-26T16:41:52.346Z",
        "method": "direct",
        "createdAt": "2024-08-26T16:41:52.346Z"
      },
      "campaign": {
        "id": "cm11...",
        "name": "Summer Referral Push",
        "shareContext": "Check out this amazing opportunity!",
        "objective": "increase_awareness",
        "description": "Our main summer campaign",
        "domain": "heyoo.ai",
        "destinationUrl": "https://heyoo.ai/summer",
        "utm_source": "heyoo",
        "utm_medium": "referral",
        "utm_campaign": "summer_2024",
        "utm_term": null,
        "utm_content": null,
        "ref": null,
        "clicks": 0,
        "shares": 1,
        "targetShares": 100,
        "startDate": "2024-06-01T00:00:00.000Z",
        "endDate": "2024-08-31T23:59:59.999Z",
        "shareRewardAmount": 10,
        "clickRewardAmount": 1,
        "rewardType": "points",
        "maxRewardPerEmployee": 500,
        "totalBudget": 5000,
        "consumedBudget": 0,
        "minimumClicksForReward": 5,
        "uniqueClicksOnly": true,
        "status": "active",
        "creatorId": "usr_...",
        "workspaceId": "ws_...",
        "workspaceSlug": "acme",
        "contentPillarName": "Promotions",
        "createdAt": "2024-08-26T16:40:00.000Z",
        "updatedAt": "2024-08-26T17:00:00.000Z"
      }
    }
  }
  ```
</ResponseExample>
