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

# Salesforce: Add Campaign Member

> Add a Salesforce lead or contact to a campaign, or update its campaign member status (for example mark event attendance), idempotently.

Add a Salesforce lead or contact to a campaign, or update its campaign member status (for example mark event attendance), idempotently.

<Info>
  Tool ID: `salesforce_add_campaign_member`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'salesforce_add_campaign_member',
  {
    "campaign_id": "campaign_123"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute salesforce_add_campaign_member --input '{
  "campaign_id": "campaign_123"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "id": "id_123",
    "created": true,
    "success": true,
    "status": "example"
  }
}
```

Use `deepline tools get salesforce_add_campaign_member --json` for the latest machine-readable contract.

## Input reference

Add a lead or contact to a Salesforce campaign, or update its member status if it is already a member.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.campaign_id` | `string` | Yes | — | Salesforce Campaign ID (15 or 18 characters, starts with 701). |
| `payload.lead_id` | `string` | No | — | Salesforce Lead ID (15 or 18 characters, starts with 00Q). Pass exactly one of lead\_id or contact\_id. |
| `payload.contact_id` | `string` | No | — | Salesforce Contact ID (15 or 18 characters, starts with 003). Pass exactly one of lead\_id or contact\_id. |
| `payload.status` | `string` | No | — | Campaign member status label, for example `Attended`. Must be one of the campaign's CampaignMemberStatus labels. Omit to keep an existing member's status, or to use the campaign default for a new member. Minimum length: 1. |
| `payload.fields` | `record` | No | — | Salesforce field API names to write directly, including custom fields like `Deepline_Score__c`. Values may be strings, numbers, booleans, or null to clear a field. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Add a lead or contact to a Salesforce campaign, or update its member status if it is already a member.",
    "properties": {
      "campaign_id": {
        "type": "string",
        "description": "Salesforce Campaign ID (15 or 18 characters, starts with 701)."
      },
      "lead_id": {
        "type": "string",
        "description": "Salesforce Lead ID (15 or 18 characters, starts with 00Q). Pass exactly one of lead_id or contact_id."
      },
      "contact_id": {
        "type": "string",
        "description": "Salesforce Contact ID (15 or 18 characters, starts with 003). Pass exactly one of lead_id or contact_id."
      },
      "status": {
        "type": "string",
        "description": "Campaign member status label, for example `Attended`. Must be one of the campaign's CampaignMemberStatus labels. Omit to keep an existing member's status, or to use the campaign default for a new member.",
        "minLength": 1
      },
      "fields": {
        "type": "object",
        "description": "Salesforce field API names to write directly, including custom fields like `Deepline_Score__c`. Values may be strings, numbers, booleans, or null to clear a field.",
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "required": [
      "campaign_id"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.id` | `string` | Yes | — | — |
| `result.data.created` | `boolean` | Yes | — | True when a new CampaignMember was inserted; false when an existing member was updated. |
| `result.data.success` | `boolean` | Yes | — | — |
| `result.data.status` | `string \| unknown` | Yes | — | — |
| `result.meta` | `record` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "id": {
            "type": "string"
          },
          "created": {
            "type": "boolean",
            "description": "True when a new CampaignMember was inserted; false when an existing member was updated."
          },
          "success": {
            "type": "boolean"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {}
            ]
          }
        },
        "required": [
          "id",
          "created",
          "success",
          "status"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Salesforce provider guide](/docs/providers/salesforce/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.