# Campayn

Campayn is an email marketing platform that allows users to create, send, and manage email campaigns.

- **Category:** email newsletters
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 14
- **Triggers:** 0
- **Slug:** `CAMPAYN`
- **Version:** 20260313_00

## Tools

### Create Contact

**Slug:** `CAMPAYN_CREATE_CONTACT`

Tool to create a new contact in a specific list. Use when you need to add a contact after gathering details.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `zip` | string | No | ZIP or postal code |
| `city` | string | No | City of the contact |
| `email` | string | Yes | Contact's email address |
| `sites` | array | No | List of website objects for the contact |
| `state` | string | No | State or province of the contact |
| `title` | string | No | Contact's title or position |
| `phones` | array | No | List of phone objects for the contact |
| `social` | array | No | List of social account objects for the contact |
| `address` | string | No | Mailing address of the contact |
| `company` | string | No | Company name of the contact |
| `country` | string | No | Country of the contact |
| `list_id` | integer | Yes | ID of the list to which the contact will be added |
| `last_name` | string | No | Contact's last name |
| `first_name` | string | No | Contact's first name |
| `custom_fields` | array | No | List of custom field objects |
| `failOnDuplicate` | boolean | No | If true, the API will return an error when a duplicate contact exists |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete Contact

**Slug:** `CAMPAYN_DELETE_CONTACT`

Tool to delete a specific contact. Use when you need to remove a contact permanently after confirming it should be deleted. Example: "Delete contact 123".

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `contact_id` | integer | Yes | The unique numeric ID of the contact to delete. Can be obtained from the Get Contacts action. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete List

**Slug:** `CAMPAYN_DELETE_LIST`

Tool to delete a specific contact list. Use when cleaning up unused lists after confirming they are no longer needed. Example: "Delete list 123".

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | integer | Yes | ID of the contact list to delete |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete webform

**Slug:** `CAMPAYN_DELETE_WEBFORM`

Delete a specific webform from a contact list. Use this to permanently remove a webform that is no longer needed. Requires both the list_id and webform_id - use Get Webforms action first to find these values. Note: The API returns success even for non-existent webform IDs (idempotent delete behavior).

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | integer | Yes | ID of the contact list the webform belongs to. Get this from the Get Lists or Get Webforms action. |
| `webform_id` | integer | Yes | ID of the webform to delete. Get this from the Get Webforms action. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Contact

**Slug:** `CAMPAYN_GET_CONTACT`

Tool to retrieve a specific contact by ID. Use when you need to fetch full contact details after confirming the contact ID.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `contact_id` | integer | Yes | ID of the contact to retrieve |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Contacts

**Slug:** `CAMPAYN_GET_CONTACTS`

Retrieves all contacts from a specific contact list in Campayn. Returns contact details including email, name, address, and confirmation status. Use 'Get Lists' action first to obtain the list_id. Supports optional filtering by contact name/email/company.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | integer | Yes | The unique ID of the contact list to retrieve contacts from. Use 'Get Lists' action first to obtain valid list IDs. |
| `filter_contact` | string | No | Optional keyword to filter contacts by name, email, or company. Case-insensitive partial match. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Lists

**Slug:** `CAMPAYN_GET_LISTS`

Tool to retrieve all contact lists. Use when you need to fetch available lists before performing list-specific actions. Example prompt: "List all my contact lists".

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Message Statistics

**Slug:** `CAMPAYN_GET_MESSAGE`

Tool to retrieve engagement statistics for a specific email message by ID. Returns views, positive responses (clicks), and negative responses (unsubscribes/bounces). Use GET_MESSAGES first to get the list of available message IDs.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `message_id` | integer | Yes | The unique ID of the email message to retrieve statistics for. Use GET_MESSAGES to find available message IDs. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Messages

**Slug:** `CAMPAYN_GET_MESSAGES`

Tool to retrieve all email messages. Use when you need to list all messages visible to the authenticated user.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Reports

**Slug:** `CAMPAYN_GET_REPORTS`

Tool to retrieve report URLs and metadata for sent and scheduled emails. Use when you need to fetch email delivery data, optionally filtered by a date range (Unix timestamp in seconds, UTC). Note: scheduled emails will have report_url set to null.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `to` | integer | No | End date filter as Unix timestamp in seconds (microtime), UTC. Corresponds to query parameter 'to'. |
| `from_time` | integer | No | Start date filter as Unix timestamp in seconds (microtime), UTC. Corresponds to query parameter 'from'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Webform

**Slug:** `CAMPAYN_GET_WEBFORM`

Tool to retrieve details of a specific webform by ID. Use after confirming the webform ID when you need to fetch form details like title, type, HTML, and signup count. Example: "Get webform 1550".

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | integer | Yes | The unique identifier of the contact list that contains the webform. Use CAMPAYN_GET_LISTS to find available list IDs. |
| `webform_id` | integer | Yes | The unique identifier of the webform to retrieve. Use CAMPAYN_GET_WEBFORMS to find available webform IDs for a list. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Webforms

**Slug:** `CAMPAYN_GET_WEBFORMS`

Tool to retrieve all webforms for a specific contact list. Use when you need to list forms after confirming the list ID. Example prompt: "List all webforms in list 123".

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `list_id` | integer | Yes | ID of the list to retrieve webforms from. |
| `filter_form_type` | string ("0" | "1" | "2" | "3") | No | Filter forms by type: 0=Signup Page, 1=Embed Signup, 2=WordPress Signup, 3=Facebook Signup. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Unsubscribe Contact

**Slug:** `CAMPAYN_UNSUBSCRIBE_CONTACT`

Tool to unsubscribe contacts from a list by contact id or email address. Use when you need to remove contacts from a mailing list. If id is provided, only that specific contact will be unsubscribed. If email is provided, all contacts on that list with that email will be unsubscribed.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `id` | string | No | The contact ID to unsubscribe. Use this to unsubscribe a specific single contact. Provide either id or email, not both. |
| `email` | string | No | The email address to unsubscribe. Use this to unsubscribe all contacts on the list with this email. Provide either id or email, not both. |
| `list_id` | integer | Yes | The ID of the list from which to unsubscribe contacts |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update List

**Slug:** `CAMPAYN_UPDATE_LIST`

Tool to update a contact list. Use after confirming list ID and desired changes. Example: Update list 123 name to 'Newsletter Subscribers'.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `tags` | string | No | Comma-separated tags to assign to the list. Omit if not changing tags. |
| `list_id` | integer | Yes | ID of the contact list to update. |
| `list_name` | string | No | New name for the contact list. Omit if not changing the name. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
