# Campayn — how to use (mcp.ai)

Connect your Campayn account and use 14 tools for email newsletters straight from your AI agent. Connect with your own API key. Campayn is an email marketing platform that allows users to create, send, and manage email campaigns.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_campayn?ms=1787296020000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `campayn_create_contact`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/campayn`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/campayn/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/campayn/create/contact` — Tool to create a new contact in a specific list. Use when you need to add a contact after gathering details.
  - body: { zip?: string, city?: string, email: string, sites?: object[], state?: string, title?: string, phones?: object[], social?: object[], address?: string, company?: string, country?: string, list_id: integer, last_name?: string, first_name?: string, custom_fields?: object[], failOnDuplicate?: boolean }
- `POST https://api.mcp.ai/api/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".
  - body: { contact_id: integer }
- `POST https://api.mcp.ai/api/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".
  - body: { list_id: integer }
- `POST https://api.mcp.ai/api/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
  - body: { list_id: integer, webform_id: integer }
- `POST https://api.mcp.ai/api/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.
  - body: { contact_id: integer }
- `POST https://api.mcp.ai/api/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. Sup
  - body: { list_id: integer, filter_contact?: string }
- `POST https://api.mcp.ai/api/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".
- `POST https://api.mcp.ai/api/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 
  - body: { message_id: integer }
- `POST https://api.mcp.ai/api/campayn/get/messages` — Tool to retrieve all email messages. Use when you need to list all messages visible to the authenticated user.
- `POST https://api.mcp.ai/api/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: sch
  - body: { to?: integer, from_time?: integer }
- `POST https://api.mcp.ai/api/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".
  - body: { list_id: integer, webform_id: integer }
- `POST https://api.mcp.ai/api/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".
  - body: { list_id: integer, filter_form_type?: string }
- `POST https://api.mcp.ai/api/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. I
  - body: { id?: string, email?: string, list_id: integer }
- `POST https://api.mcp.ai/api/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'.
  - body: { tags?: string, list_id: integer, list_name?: string }

## Example prompts
- "What can I do in Campayn?"
- "Show me a summary of my Campayn account"

## More
- Page: https://mcp.ai/campayn
- Agent spec (llms.txt): https://mcp.ai/campayn/llms.txt
- Postman collection: https://mcp.ai/campayn/postman.json
