# Connect your AI agent to EQLEM CRM

> Connect EQLEM CRM to Claude, ChatGPT, Gemini, Copilot Studio, VS Code and Cursor. Step-by-step setup per provider; OAuth, your own permissions, approved sending.

Source: https://www.eqlem.com/en/features/ai-agent-connection

This guide shows, provider by provider, how to connect EQLEM CRM to the AI agent you use. The connection uses OAuth and the agent works with only your own EQLEM permissions. For an overview see the [CRM module](https://www.eqlem.com/en/modules/crm).

## Before you start

1. In EQLEM open **AI connections** and copy the **MCP URL**. If you pick your agent in the **Connect your agent** panel, provider-specific steps and a ready-to-copy command/configuration are shown. Every provider below uses this URL. The address always starts with `https://` (e.g. `https://api.yourcompany.com/api/v2/mcp`). The `http` you see in commands and settings is the name of the MCP transport (Streamable HTTP), not the URL scheme.
2. On first connection the **EQLEM sign-in and consent screen** opens in your browser. Sign in, review the permissions the agent requests, and approve.
3. You can revoke the connection at any time from **AI connections**.
4. For setups that need an enterprise client (Gemini Enterprise, Copilot Studio Manual) an **Admin** does the work: create an enterprise OAuth client in **AI connections** and take the `client id` and `client secret` from there.

After connecting, try it by asking your agent "who am I connected as in EQLEM?".

> Release note: Tool names were updated. On agents that were connected earlier, refresh the tool list (reload the connector or reconnect). Contact group tools (`crm_contact_group_read`, `crm_contact_group_write`) were added. Task plan and template tools, 14 activity types, automatic activities and reminders, activity and task plan reports, and additional CRM tools (quotes, labels, account merge, setting definitions and more) were added.

> Lead source update: the `consent_create` mode was added to `crm_compliance_write` and the `lead_source_roi` mode to `crm_report_read`; there is no new tool. Refresh your tool list.

## What can your agent do?

The agent covers all CRM processes; your own EQLEM permissions apply to every action.

- **Sales:** prospects and customers (search, create, update, lead stage, labels and groups), contacts and **contact groups** (member counts, bulk add / remove), notes, **activities** (14 types), **task plans and templates**, opportunities (mark won / lost), price quotes, calendar, group board, territories, contracts and renewal tracking.
- **Service:** service requests (lines, assignment, rescheduling, satisfaction, SLA evaluation), assets, incoming calls, periodic transactions, knowledge base.
- **Outreach:** templates, sent messages and tracking events, inbox, campaigns (draft, audience, variants, comparison).
- **Sequence:** sequences, enrolling a prospect, enrollment contact list, engaged accounts, send schedule, per-step performance, touch queue, marking replies, outcome and stage, AI reply drafts, sending due emails.
- **Insights:** sales, outreach, service and executive reports, **activity and task plan summaries**, the **lead source return report**, health scores, **reading compliance status** and **reading settings**.
- **Common:** **Projects** (`common_project_read`) and **Cost centers** (`common_cost_center_read`) with list, search and detail (document permission "Project & Cost Center"); **Send mail (non-account)** (`common_mail_send`).

### Choose permission groups on the consent screen

1. After you sign in, the consent screen lists the permission groups as collapsible groups: **Sales, Service, Outreach, Sequence, Insights**; each is split into read, write and (where applicable) send. Every group and every permission has an on/off switch. Two common permissions come alongside them: `common.definitions.read` (**Shared definitions**: read projects and cost centers) and `common.mail.send` (**Mail sending**: direct mail).
2. Choose the groups and permissions you want the agent to use, one by one; switch off the ones you do not want (all are on by default; at least one permission must stay on to approve).
3. The agent sees only the tools in the groups you chose that your license covers and your EQLEM document permissions allow. To change the scope later, revoke the connection and approve again.
4. Check the **trust badge** on the consent screen: **Verified** (your company's enterprise client), **Domain verified** (e.g. `claude.ai`; the app identifies itself from this domain) or **Unverified** (automatic registration; allow only apps you recognize). Do not approve if the redirect address does not belong to a provider you recognize.
5. The **MCP address you are connecting to** is shown on the screen; it must match the address on the **AI connections** page.
6. The approval request is valid for **10 minutes**; if it expires, restart the process from the AI app.
7. If you have no EQLEM session or it has expired, you are redirected to the sign-in screen and return to the same approval after signing in. If the B2B buyer form appears, use the **"Sign in as an EQLEM user"** link below it.

### AI connections page

- **My connections:** each connection is a card (app, trust badge, permissions, last refresh, expiry). Up to 20 connections per user; the counter warns as you approach the limit.
- **Revoke:** the app can no longer make new requests or renew its session; the access key it already holds may stay valid for up to 15 more minutes.
- **Agent capabilities:** the tools your agent can use are listed in module tabs, with search and a type filter. Tools outside your license or permissions show a "Not in your license" / "You lack permission" badge.
- Tools may appear in your agent with titles in your language; this depends on whether the agent shows titles (some agents show the technical tool name).

### Actions that need two-step approval

For actions with outside effect the agent first shows the preview and the compliance result, and acts only after you approve: email and WhatsApp sending, sequence enrollment, sending pending sequence emails, AI draft approval, service notifications, inbox replies, campaign scheduling and non-account mail. Automatic activities and task plan steps that the system sends at their due time, and applying a template to accounts, also need your approval. Changes to a sequence send window or a business calendar day (`crm_settings_write`) also work in two steps: preview first, then a confirmation token.

### Sender mail account

All mail sent through MCP goes out only from the mail account assigned to you. Covered tools: `common_mail_send`, `crm_outreach_send` (mail), `crm_inbox_reply` (mail), sequence reply-draft approval, `crm_sequence_enroll`, `crm_sequence_send_pending`, `crm_campaign_schedule` and service request notification. WhatsApp and sending from the web app are unchanged.

- **If no account is assigned, nothing is sent.** The agent relays: "No mail account is assigned to you in your company. Ask your administrator to assign one so you can send mail."
- With **one account**, it is selected automatically. With **several**, the agent sees your accounts via `eqlem_whoami` and picks one.
- **For administrators:** assign the account to a person in the **Employee** field of the "Mail settings" screen. The employee's user link is set on the employee card.

### Send mail (non-account)

Sends individual email through your agent to people who have no account record.

- **Requirements:** the company feature "Can use email sending tool" must be on and you must have the CRM Outreach add permission. Otherwise the tool is hidden and **Agent capabilities** shows "Not in your license".
- **Two-step sending:** a preview comes first (recipients, skipped ones, subject, body, links, attachments). You approve, then it is sent. If the recipients, content or attachments change after approval, the approval becomes invalid.
- **Recipients:** free-form email addresses; no account record needed. Each recipient gets a separate message and recipients cannot see each other. There is no CC/BCC, template or open tracking.
- **Individual-sending record:** if a recipient has no consent record, one with source "MCP - individual sending" is created automatically. It permits individual sending through this tool only; it does not count as consent for commercial sending such as campaigns, sequences and outreach. The preview shows "An individual-sending record will be created for X recipients".
- **Blocked recipients:** recipients on the opt-out or block list are not sent to. They are listed with the reason in the preview and result; sending continues for the others.
- **Sender:** mail goes out from the mail account assigned to you (see "Sender mail account"); the preview shows the sender address.
- **Send interval:** the agent sets the gap in the call (`sendIntervalSeconds`, 5-600 s; 15 s if omitted). The value is shown in the preview and depends on your approval. It exists to prevent spam, and the gap is kept between consecutive sends from the same mailbox.
- **Daily limit:** this is the existing daily sending limit defined in the mailbox's mail settings, shared with sequences and campaigns. If no limit is defined, there is no cap. Recipients over the quota are skipped and listed with the reason "daily limit".
- **Result:** the tool returns immediately with "queued: N recipients, estimated completion". Messages appear in the outreach message list as "Queued"; sent ones are updated to sent, skipped ones become "Skipped" and failed ones "Failed".
- **Limits:** up to 200 recipients per call; body up to 4,000 characters; up to 2 attachments (only files already uploaded to EQLEM CRM). If a mailbox queue is backed up for more than 24 hours, new sends are rejected. If the system restarts, messages not yet sent may be lost; check the outreach list.

> Legal notice: This tool is for individual and transactional correspondence. Under Turkish Law No. 6563 / IYS, commercial electronic messages (advertising, campaigns, bulk promotion) cannot be sent to recipients without consent; responsibility lies with the sending user and company. Use CRM campaigns and sequences for commercial sending.

### Reading sequence data

Ask your agent to pull sequence performance and enrollment data. In every mode you only get the records your permissions allow.

- **Enrollment contact list** (`crm_sequence_enrollment_read`, `contacts`): the sequence's enrolled prospects with account, contact, email, phone, stage and engagement; up to 30 per page.
- **Engaged accounts** (`crm_sequence_read`, `engaged_accounts`): accounts that opened, clicked, replied or bounced, one row per account.
- **Send schedule** (`crm_sequence_read`, `send_schedule`): the data behind the Send Schedule screen, including the recipient's phone; email only, up to 30 per page.
- **Send batch status** (`crm_sequence_read`, `send_batch`): the outcome of the pending-email send described below.
- **Pending email count** (`crm_sequence_read`, `pending_mail_count`): pending email counts per sequence plus the daily limit and what remains; a fast count.
- **Per-step performance** (`crm_sequence_read`, `metrics`): sent, opened, clicked, replied and bounced counts for each step (`byStep`).
- **Send window** (`crm_sequence_read`, `send_window`): `id` = sequence. The window text, time zone, per-day ranges, daily limits, linked business calendar and mailbox status; template text is not returned. See "Business calendar and send window" below.
- **Window check** (`crm_sequence_read`, `send_window_check`): `id` = sequence; optional `touchId`, `enrollmentId`, `at` (UTC; now if empty). Returns whether that moment is inside the window and why; changes nothing.
- **Business calendar detail** (`crm_settings_read`, `mode=business_calendars` + `id`): the calendar's days (date, kind, effect, active) and the linked sequences. The linked sequence list is filled only if you have the Outreach list permission. Without `id` the calendar list is returned.
- **Today's touches** (`crm_sequence_read`, `due_touches`): rows include the recipient's email, `overdueDays` and `blockedReason`. If `ownerUserId` is empty, your own touches are returned.
- **Channel worklist** (`crm_sequence_read`, `due_worklist`): `channel` is required; overdue items are sorted oldest first; up to 6 per page (see the flow below).
- **Message compose** (`crm_sequence_enrollment_read`, `compose`): with `enrollmentId` + `touchId`, returns the `body`, `whatsAppLink` and `linkedInUrl` to send.
- **Message search** (`crm_outreach_message_read`, `search`): `sequenceId`, `enrollmentId` and date filters (used together with a sequence); `view=compact` for short rows.

Example prompts:

- "List the companies that clicked a link in this sequence, with their phone numbers."
- "Give me the emails and phone numbers for my touches today."
- "Preview the overdue emails that have not been sent yet, then send them."

### Sending pending sequence emails

`crm_sequence_send_pending` lets you preview due automatic sequence emails and send them through your agent without waiting for the scheduler.

- **Scope:** only automatic emails that are due; ones stuck on an error are included if they are due. Records waiting for a manual touch, paused records and records with a scheduled start are not processed. Email only, and only touch-based (playbook) sequences.
- **Two-step approval:** the first call sends nothing; it shows how many will be queued, what is skipped and why. If you approve, the second call is made with a confirmation code. The code is single-use, valid for 5 minutes and tied to the slice limit from the preview and to the sending account; it becomes invalid if the sending account changes.
- **Pending email count:** `crm_sequence_read` `mode=pending_mail_count` quickly returns, per sequence, the overdue, due today, sendable now, waiting-manual, paused and failed counts, plus the daily limit and what remains.
- **Count only and send without preview:** `dryRun` returns only counts and samples and sends nothing. `confirmSend=true` skips the preview and confirmation code and queues directly; it is an externally effective action, so the agent should use it only when you explicitly ask for it.
- **Slice:** at most 500 touches are queued per call (`limit` can narrow it, 1-500). The remaining count is reported in the response; call the tool again to take the next slice.
- **Daily limit:** the queued count never exceeds the defined daily sending limits; the remainder goes out on following days through the scheduler. If today's daily limit is fully used, the call returns a "daily limit reached" error (`error.crm-sequence.send-pending-daily-limit-reached`).
- **Sending account and compliance:** sending is rejected if no mail account is assigned to you. Unsubscribe, block and consent rules are applied per touch at send time; a blocked touch is skipped.
- **Sending and tracking:** sending runs in the background, emails go out one by one from a queue; follow the result with `crm_sequence_read` `send_batch`. Only one batch runs at a time per sequence; while a batch is open, a new call returns a "send in progress" error with the `batchId`, and no duplicate email is sent.
- **Deferred emails:** `deferredByReason` in the `send_batch` response counts deferred emails by reason; `expectedDeferredByReason` in the preview/send response tells you in advance how many will wait if you are currently outside the sending window (`outside-window`). Reasons: `outside-window` outside the sending-hours window; `daily-limit` the mailbox's daily limit is used up; `sequence-daily-limit` the sequence's daily limit is used up; `rate-limit` sending rate limit (interval between emails, per-minute slice, recipient domain); `paused` the automatic brake paused sending temporarily; `lock-conflict` another process held the slot at the same time. A deferred email is not lost; it goes out automatically at the first suitable time.
- **Pull deferred emails now (`includeDeferred=true`):** also treats touches deferred for reasons such as outside-window as candidates; on approval they are moved to now and queued in the same batch. The preview shows the `deferredEligible` count. If the window is closed right now, the call is rejected with `error.crm-sequence.send-window-closed` and nothing changes. Only touches deferred after this release can be pulled. Default is `false`; behavior is unchanged. The preview response also carries `windowStart`, `windowEnd`, `nextWindowOpensAt` (UTC) and `deferredReasonDetail` for deferred items.
- **Timeouts:** if the call times out, the agent must not repeat the same call right away; it should first check with `crm_sequence_read` `mode=send_batch` whether an open send batch exists.
  While a batch is open, a new approval is rejected with `error.crm-sequence.send-pending-in-progress` (it frees up when the batch completes or after 2 hours); the system prevents the same touch from being sent twice.
- **Records with a scheduled start:** records in the "Start scheduled" state have their starts spread across days according to the daily sending limit. You can start them manually in the web app with **Start now**; this is not possible if the sequence start date has not arrived yet. There is no manual start through MCP.
- **Required permissions:** edit permission on corporate outreach and view permission on Today's Touches. The MCP scope `crm.outreach.send` is sufficient (also for `crm_sequence_reschedule_stuck`).
  A sender mail account must be assigned to you (account assignment is done in the EQLEM web app). Unsubscribe/consent rules and the send window always apply.
- **Limits:** outside-effect calls are limited to 20 per hour. With multiple server instances, send order is not guaranteed.

#### Sequential fast send (`mode=send_now_sequential`)

The default `mode=queue` is unchanged. `send_now_sequential` sends due touches one by one, oldest plan first, at the mailbox's real sending speed.

- **Flow:** preview → confirmation token → sequential send. The response gives the estimated first send time (`etaFirstSendAt`), estimated completion (`estimatedCompletionAt`) and hourly rate (`estimatedSendRatePerHour`; `ratePerHour` on confirmation).
  The preview also returns the expected number of rate-limit deferrals (`expectedRateLimitDeferredCount`) and a breakdown by type (`rateLimitByType`).
- **No send without preview:** `confirmSend=true` is not available in this mode (`error.validation.invalid`). Up to 500 touches per call.
- **Queueing:** while a batch is open, a new approval is not rejected; the batch waits with status `waiting` and a `queuePosition`, and starts automatically when the earlier ones finish. A stale waiting approval expires without sending anything.

#### Rescheduling stuck touches (`crm_sequence_reschedule_stuck`)

Moves automatic sequence mail touches whose slot is in the past, that have no slot at all, or that were deferred and are now overdue, to the first available slots of today. It does not send mail.

- **Scope:** `sequenceId` or `mailSettingId` (your own account) is required; otherwise `error.validation.required`. If nothing is stuck: `error.crm-sequence.reschedule-none-stuck`.
- **Two-step approval:** preview (`stuckCount`, `bySequence`, `firstNewSlotAt`, `lastNewSlotAt`) + confirmation token; on confirmation `rescheduledCount` and `skippedCount`. Up to 500 touches per call.

#### Mailbox limits and rate-limit types

`crm_sequence_read` `mode=mailbox_limits` returns only your own mail accounts: daily limit and effective cap (including warmup), sent/remaining today, mail interval, per-minute and recipient-domain limits,
paused state, last rate-limit type and the next available send time (`nextAvailableSendAt`). `eqlem_whoami` also shows the remaining quota per account today (`remainingToday`).

`send_batch` now also returns `mode`, `status` (including `waiting`), `queuePosition`, `rateLimitByType`, `deferredReasonDetail` (most frequent type) and `nextAttemptAt`; the `deferredByReason` keys are unchanged.

| Type | Meaning |
|------|---------|
| `provider-quota` | The provider returned a temporary quota response; the touch is deferred (fails after 3 consecutive responses) |
| `mailbox-hourly` | The mailbox's short-window/hourly limit |
| `recipient-domain-hourly` | Hourly limit per recipient domain |
| `daily-limit` | The mailbox's daily limit is reached |
| `warmup` | The warmup plan sets the effective cap |
| `min-interval` | Waiting for the minimum interval between mails |
| `unknown` | Type could not be determined |

#### Example agent flow

1. `crm_sequence_read` `mode=mailbox_limits`: remaining quota, paused state, next available time.
2. If touches are stuck, `crm_sequence_reschedule_stuck`: preview, approve.
3. `crm_sequence_send_pending` `mode=send_now_sequential`: preview (ETA, rate), then send sequentially with the confirmation token.
4. `crm_sequence_read` `mode=send_batch`: follow progress via `rateLimitByType` and `nextAttemptAt`.

### Business calendar and send window

The sequence's send window and its linked business calendar decide when emails go out.

- **Window and time zone are set per sequence;** the business calendar has no time zone or window field. The window is evaluated in the sequence's time zone.
- **`SendWindows` format:** `ISO-day:HH:mm-HH:mm`, comma-separated (1 = Monday ... 7 = Sunday); e.g. `1:09:00-18:00,2:09:00-18:00`.
- **Empty field means no restriction;** when it is filled, a day not in the list means no sending.
- **Weekends are always closed;** even if `6:` or `7:` appears in `SendWindows`, nothing is sent.
- **Business calendar:** `Holiday` and `Eve` days are closed all day. `Busy` period affects only new starts; touches already in progress still go out.
- **Timestamps:** `plannedAt` and `sentAt` are stored in UTC; the window is evaluated in the sequence's time zone.

**Changing the window (`crm_settings_write`):** two steps, no delete.

- `action=sequence_send_window_update`: `id` + the fields to change (`timeZoneId`, `sendWindows`, `phoneWindows`, `dailySendLimit`, `businessCalendarId`, `skipLastWeekOfMonth`); only the fields you pass change. Empty `sendWindows` = no restriction; `dailySendLimit` 0 = unlimited.
- `action=business_calendar_day_upsert`: `calendarId`, for a new day `dateFrom`/`dateTo` (**`yyyy-MM-dd` only**, no time or `Z`), `kind` (`Holiday`, `Eve`, `Busy`), `busyEffect` (required for `Busy`), `name`; `dayId` to update an existing day. Set `isActive=false` to disable a day.
- **Preview:** the first call writes nothing; it returns `changes` (field, old, new), `affectedSequences`, `pendingDueCount`, `deferredCount`, `windowOpenNowBefore/After` and a `confirmationToken`. `affectedSequences` has at most 30 items; `affectedSequencesTruncated` is set if there are more.
- **Apply:** a second call with the same arguments + `confirmationToken`. The response carries `previous` with the old values; to roll back, write the old value with the same tool. The token is single-use, valid for 5 minutes and bound to the arguments.
- **Permissions and account:** you need sequence edit permission, and the sequence's sender mail account must be assigned to you. For a calendar day change, the account of every sequence linked to the calendar must be yours.
- A window or calendar change does not pull deferred touches forward by itself; use `includeDeferred` for that.

**Error keys:** `error.crm-sequence.send-window-closed` (window closed right now on an `includeDeferred` call), `error.crm-sequence.invalid-window` (malformed `sendWindows` / `phoneWindows`), `error.mcp.mail-account-not-owned` (the sequence's mail account, or that of a sequence linked to the calendar, is not assigned to you), `error.mcp.confirmation-invalid` (token expired or arguments changed).

**Troubleshooting: emails deferred as "outside-window"**

1. `crm_sequence_read` `mode=send_window_check` (`id`, plus `at` if needed): `reasonKey` and `reasonDetail` give the cause (`before-start`, `after-end`, `between-windows`, `no-window-for-day`, `weekend`, `holiday`, `eve`). `calendarMatches` shows the matching calendar day (at most 30; `calendarMatchesTruncated` if more) and `nextWindowOpensAtLocal` shows when the window next opens. If the time zone cannot be resolved, `timeZoneFallback` is flagged.
2. If needed, read the window text and time zone with `mode=send_window`; a common cause is that the day is missing from `SendWindows` or the range ends early.
3. Fix the window or calendar day with `crm_settings_write`: preview first, then apply with the token.
4. `crm_sequence_send_pending` `includeDeferred=true`: preview first (`deferredEligible`), then queue with the confirmation token.

> Note: `includeDeferred` pulls only touches deferred after this release; earlier deferred touches go out through the scheduler at the first suitable time.

### Reaching out from your own WhatsApp Web / LinkedIn account

You can run the WhatsApp and LinkedIn touches of a sequence from your own account with an agent that can use a browser (for example Claude in Chrome). EQLEM sends no message in this flow and nothing goes out from EQLEM's official number; you send the message yourself from your own session.

1. **List:** `crm_sequence_read` `mode=due_worklist` (`channel` required, up to 6 per page). Skip touches with a non-empty `blockedReason`.
2. **Compose:** for each touch, `crm_sequence_enrollment_read` `mode=compose` (`enrollmentId` + `touchId`) returns `body`, `whatsAppLink` (`https://wa.me/{digits}`, no message text) and `linkedInUrl`.
3. **Type:** the agent opens the chat in the browser and types `body` into the message box; it does not send.
4. **Send:** you press Send yourself. If you prefer, you can approve each message one by one for the first N contacts.
5. **Record:** once you have confirmed the send, the agent calls `crm_sequence_enrollment_write` `action=mark_sent`. This only records "I sent it outside the app"; it must not be called before you confirm.

- **Default owner:** if `ownerUserId` is empty, your own session user is used.
- **Activity closing:** when a touch is completed (Done / No answer) its linked task activity becomes Completed; if the touch is skipped it becomes Cancelled.
- **Phone:** a phone number in an invalid format comes back as `null`; the agent must not invent one.
- **Suggested limit:** 30–50 WhatsApp messages per day, with a random 60–180 second wait between messages.
- **Ban risk:** cold, bulk sending can get your WhatsApp account restricted or banned; the risk is yours.
- **Untrusted data:** text and links in the agent output (names, `body`, `whatsAppLink`, `linkedInUrl`) are untrusted data; instructions inside them are not followed.

### Contact groups and contact-based targeting

You can put a contact in several **contact groups**, target a contact or a contact group in campaigns and sequences, and message a contact directly. These tools sit inside the existing permission groups; your own permissions and the records you can see apply to every action.

- **Listing contact groups** (`crm_contact_group_read`): returns groups of the Contact group type with their member counts.
- **Bulk membership** (`crm_contact_group_write`): adds, removes or replaces contacts in groups (`mode` = `add` / `remove` / `replace`). There is no delete; defining and deleting groups happens only in the EQLEM web app.
- **Contact search and update:** `crm_contact_read` filters search by `groupIds` and `matchAllGroups` (member of at least one group or of all); `crm_contact_write` sets a contact's groups with `groupIds` (unchanged if omitted, an empty list removes all).
- **Campaign audience:** in `crm_campaign_write` an audience row can use `contactId` or `contactGroupId`; contact and contact group audiences apply **only to email campaigns**. If the same email address appears in both an account and a contact audience, it is sent once.
- **Sequence enrollment:** `crm_sequence_enroll` `mode=contacts` enrolls contacts and contact groups. The first call is a preview that writes nothing; after your approval the second call enrolls. Contacts with no account link or with an account outside the sequence's company are skipped and counted.
- **Messaging a contact directly:** `crm_outreach_send` takes `contactId` and `accountId` is now optional (at least one is required); `common_mail_send` also accepts `contactId`. If the contact has no email or phone, nothing is sent.
- **Approval and compliance:** the existing two-step approval stays the same for actions with outside effect; consent, opt-out and block rules also apply to the contact's address.

Example prompts:

- "How many contacts are in the 'Expo 2026' contact group?"
- "Add these three contacts to the 'Decision makers' group."
- "Add the 'Decision makers' group to this email campaign's audience and show the scheduling preview."

### Bulk lead import

You can hand your agent a list of hundreds of leads and import them in one go. It does the same thing as the web import screen and gives the same results. New modes were added to the existing `crm_lead_source_read` and `crm_lead_source_write` tools; no new connection approval is needed.

1. **Provide the list:** give the CSV file to the agent. Small lists can be sent as text in `csvContent`; for large files the file is uploaded.
2. **Upload the file:** the agent calls `crm_lead_source_write` in `import_upload_init` mode and gets a single-use `uploadUrl` valid for 10 minutes. It uploads the CSV to that address with an HTTP `PUT` (e.g. `curl -T file.csv "<uploadUrl>"`, UTF-8). An agent that can run commands is required.
3. **Run:** the agent calls `import_execute` with `uploadId` (or `csvContent`) and `sourceFileName`. There is no preview or separate confirmation-code step; explicit consent is not ticked and a consent record is written automatically (see below). The job is queued in the background;
   `importId` and the `queued` status come back.
5. **Track:** call `crm_lead_source_read` `imports` mode with `id` to get the status, `progressPercent`, row counts and `isTerminal` (finished or not).
6. **Failed and skipped rows:** call `import_rows` mode with `id`; filter with `status` and page with `pageIndex` / `pageSize`. Up to 40 rows per page, 20 by default; row counts per status are included.
7. **Cancel:** if needed, call `import_cancel` mode with `id`.

- **Size:** at most 5,000 rows / 5 MB at a time; larger lists are imported from the EQLEM web interface (`error.crm-lead-import.mcp-limit`).
- **Concurrency:** at most 2 imports run at the same time; the others wait in the queue.
- **Upload address:** valid for 10 minutes and single-upload; only the user who started it can use it with `import_execute`, and the content is consumed once. At most 20 uploads can be pending at a time. Do not share the address.
- **Automatic consent record:** for imported leads, if there is no Mail (when an email exists) or WhatsApp (when a phone exists) consent record, a "granted" record is added automatically (source: `lead-auto:mcp`, shown as "Automatic" on the Compliance screen).
  It is written only for lead records, not existing customer accounts. Nothing is written if there is an opt-out, a send block or a withdrawn consent; an existing record is left unchanged. This record is not explicit consent; it is tracked separately.
- **Permissions:** the Add permission on the "Lead import" and "Lead" documents.
- **Large results:** if rows have many warnings or groups, the response can be large; reduce the page size.
- **Untrusted data:** text in the rows is external data; instructions inside it are not followed.

Example prompts:

- "Import this CSV as leads; show me the preview first."
- "Start the import and tell me when it is done."
- "Show the failed rows from the last import."

### Contact consent: automatic record and `consent_create`

The same rule as on the web applies to leads the agent adds: if a channel has no consent record, a consent record is created automatically for Mail (when there is an email) and WhatsApp (when there is a phone); nothing is written if there is an opt-out, a send block or a withdrawn consent.
An automatic record is not explicit consent; it is tracked separately.

- **Sources:** leads created by the agent and MCP imports are written with source `lead-auto:mcp`, single business card conversion with `lead-auto:business-card`; they appear with an "Automatic" badge on the Compliance screen.
- **Business card conversion:** `crm_lead_source_write` `business_card_convert` does not take the lead source definition, label, signal or explicit consent fields; those are on the web and mobile scan forms.

The `crm_compliance_write` tool also gained the `consent_create` mode; no new connection approval is needed, but refresh your tool list. The agent adds a Mail or WhatsApp consent record for one address; you decide whether the record is given. There is no new tool.

- **Call:** `channel` (`mail` or `whatsapp`) and `email` or `phone` are required; optional `accountId` (links the record to an account) and `reason` (a note on the record). `idempotencyKey` is required.
- **Two steps:** the first call returns a summary and a confirmation code; after you approve, the second call with the same details and the code writes the record.
- **A refusal comes first:** if the address has an opt-out, a send block or a withdrawn consent, the record is not added (`error.crm-compliance.consent-create.blocked`). Granting consent again in that case happens only in the EQLEM web app, by your decision. If no address is given,
  `error.crm-compliance.consent-create.target-required` is returned.
- **Record source:** the record is written with source `mcp-consent`; who added it and when is kept in the audit log.
- **Permission:** add permission on the Compliance document and the write permission in the Outreach group. The agent cannot delete an existing consent record and cannot remove opt-outs or send blocks.

Example prompt:

- "Add a Mail consent record for this address; show me the summary first."

### Lead source return report

The `crm_report_read` tool gained the `lead_source_roi` mode (read-only). It is the same query as the "Lead source return" tab on the web; you ask your agent what sources such as trade fairs, field visits and campaigns returned.

- **Parameters:** `dateFrom` and `dateTo` (last 30 days if omitted; at most 366 days), `groupBy` (`source` by default, `type`, `owner`), optional `sourceType` and `leadSourceDefinitionId`.
- **Result:** per row, leads, leads that replied, number of opportunities, opportunity amount and won amount; when a cost is defined, cost, cost per lead and return ratio (`roiRatio`).
- **Currency:** amounts sum only opportunities in `amountCurrency` (the company's main currency); opportunities in other currencies are counted in `otherCurrencyOpportunityCount`. There is no exchange-rate conversion. `roiRatio` is calculated only when the cost currency equals `amountCurrency`.
- **Cost visibility:** if you may not list lead source definitions, cost fields come back empty and `costHidden` is true at the root of the response. In the owner breakdown cost is not allocated.
- **Permission:** CRM analytics view permission and the read permission in the Insights group; only records your permissions allow are counted.

Example prompts:

- "Show this month's lead source return report by source."
- "Compare cost per lead and return ratio by source type, and tell me if there are opportunities in other currencies."

### Activity types, task plans and automatic execution

Activities come in 14 types: task, phone call, meeting, email, WhatsApp, SMS, LinkedIn (connection request and message), demo, field visit, quote follow-up, onboarding / training, collection follow-up and reminder. Each type carries its own fields (for example call result, meeting link, linked quote or invoice). Your agent lists today's and overdue activities, completes them with an outcome and opens the next step.

- **Task plan:** a step-by-step follow-up plan for one account or prospect. The agent creates the plan, completes, skips or postpones steps, pauses it, closes it with an outcome and saves it as a template. Plan steps appear in Today's Touches with a "Plan" badge.
- **Template:** you can apply a template to one or many accounts. Before applying, a **preview** shows how many plans will be created, who is skipped and which steps are automatic; you can also preview a message with the real account details.
- **Automatic execution:** if you switch on "run automatically" for email and WhatsApp activities and plan steps, the system sends the message at its due time from the account or line you chose. You must approve the agent's summary first. At send time consent, opt-out and block rules are checked again; without consent nothing is sent. A failed item lands in Today's Touches as manual work. There is no automatic SMS.
- **Reminder:** you can set a reminder for teammates by email, in-app notification or (with an approved template) WhatsApp; it never reaches customers, so it needs no approval. A participant reminder email for meetings and demos does need approval.
- **Reports:** an activity summary (by type and owner, split automatic / manual) and a task plan summary (started, completed, replied and won per template).
- **Confirmation code and retries:** for approved actions the agent first shows the summary, then makes the second call with the same details and a single-use code valid for 5 minutes. For actions that create records the agent sends a unique `idempotencyKey`; if the connection drops, retrying the same call does not create a duplicate.
- **More CRM actions:** creating and updating price quotes, label definitions, removing records from a group, account merge, and setting definitions such as sales stages, SLA, scoring and automation rules; all work within your permissions and, where a summary is required, with your approval. There is no delete.

Example prompts:

- "Apply the 'New signup follow-up' template to this account; show the preview first."
- "List my activities due today and overdue."
- "Create an automatic WhatsApp activity for this contact tomorrow at 10:00; show which line it will go from."
- "How many plans started last month per template, and how many got a reply?"

### What the agent cannot do

- It cannot delete records or cancel prospects; it cannot define or delete contact groups (it only changes contacts' group membership).
- It cannot delete an existing consent record, and it cannot remove opt-outs or send blocks. Only with a confirmation code can it **add** a channel consent record for an address (`consent_create`), and add opt-outs and blocks, which close sending.
  If the address has an opt-out, a send block or a withdrawn consent, the consent record is not added. The automatic consent record in imports and lead creation is separate from this.
- There is no automatic SMS or SMS reminder; an SMS activity is done manually and only keeps a record.
- It cannot convert a price quote into an order or invoice, or generate documents from a service request.
- Account merge (irreversible), generating documents from periodic transactions and setting-definition changes work only with a confirmation code; webhook secrets and portal API keys are never given to the agent.
- It cannot see actions in groups you did not select, outside your license, or beyond your document permissions.

## Claude (claude.ai and Desktop)

1. In Claude open the connector settings and choose **add custom connector**.
2. Enter the MCP URL you got from EQLEM **AI connections**.
3. Connect, then approve on the EQLEM sign-in and consent screen that opens.
4. The connector is now available in chats.

> Note: adding a custom connector in claude.ai requires a paid plan; on Team/Enterprise plans an administrator's permission may be needed.

## Claude Code

1. Run this in a terminal (replace `<MCP URL>` with the URL from **AI connections**):

   ```bash
   claude mcp add --transport http -s user eqlem https://api.yourcompany.com/api/v2/mcp
   ```

   `--transport http` is the transport name; the address starts with `https://`. `-s user` adds the server at user scope, so `eqlem` is visible in every folder.
2. Run `claude` in the terminal, type `/mcp`, select the `eqlem` server and start **Authenticate**; the EQLEM sign-in and consent screen opens in the browser.
3. After approval the tools appear in the session.

## ChatGPT

1. In ChatGPT settings turn on developer mode (as far as your plan and workspace admin allow).
2. Add a new app or connector and enter the MCP URL from EQLEM **AI connections**.
3. Choose OAuth for authentication, then approve on the EQLEM sign-in and consent screen.
4. Enable the app in a chat and use it.

> Note: adding a custom MCP app in ChatGPT requires developer mode and a suitable plan.

## Gemini CLI

1. Add the server under `mcpServers` in the Gemini CLI `settings.json`:

   ```json
   {
     "mcpServers": {
       "eqlem": {
         "httpUrl": "https://api.yourcompany.com/api/v2/mcp"
       }
     }
   }
   ```
2. Start Gemini CLI and run MCP authentication. You need a browser on the same machine; the EQLEM sign-in and consent screen opens there.
3. Gemini CLI registers itself automatically. If the connection fails, tell your EQLEM administrator.

## Gemini Enterprise (Admin setup)

Gemini Enterprise does not register clients on its own; an administrator sets it up.

1. In EQLEM **AI connections** (Admin) create an **enterprise OAuth client**.
2. Set the client's redirect URI to: `https://vertexaisearch.cloud.google.com/oauth-redirect`
3. Note the generated `client id` and `client secret`.
4. In the Gemini Enterprise admin console add a **Custom MCP Server** data store. Enter the MCP URL, the `client id` and `client secret`, and EQLEM's authorization and token URLs (see the provider setup link in **AI connections** for the URLs).
5. Users see the EQLEM sign-in and consent screen on first use.

## Microsoft Copilot Studio

1. In Copilot Studio add an MCP tool to your agent and enter the MCP URL (only Streamable HTTP is supported).
2. For authentication try **Dynamic discovery** first. If it connects, approve on the EQLEM sign-in and consent screen.
3. If not, choose **Manual**:
   1. An Admin creates an enterprise OAuth client in EQLEM.
   2. The Admin adds the exact callback URL shown by Copilot Studio (shaped like `https://global.consent.azure-apim.net/redirect/...`, ending with the connector name) to that client in EQLEM.
   3. Enter the `client id` and `client secret` in Copilot Studio.

## VS Code / GitHub Copilot

1. Add the HTTP server to `mcp.json` (`.vscode/mcp.json` in a workspace, or at user level):

   ```json
   {
     "servers": {
       "eqlem": {
         "type": "http",
         "url": "https://api.yourcompany.com/api/v2/mcp"
       }
     }
   }
   ```
2. Start the server; VS Code asks you to authenticate and the EQLEM sign-in and consent screen opens in the browser.
3. In Copilot chat (agent mode) select the EQLEM tools.

## Cursor

1. Add the server to Cursor's `mcp.json`:

   ```json
   {
     "mcpServers": {
       "eqlem": {
         "url": "https://api.yourcompany.com/api/v2/mcp"
       }
     }
   }
   ```
2. Enable the server in Cursor; the EQLEM sign-in and consent screen opens.
3. Cursor registers itself automatically. If the connection fails, tell your EQLEM administrator.

## B2B buyer (purchasing assistant)

If you have a buyer account in your supplier's B2B portal, you can connect your AI agent with **your own buyer identity**. The agent does part of what you do in the portal on your behalf: catalog search, cart preparation, ordering, account and statement checks, status tracking. This connection is separate from the CRM connection: a buyer session sees only `b2b_*` tools, and CRM tools are closed to it. Use depends on the supplier's B2B Management license and your B2B portal access.

### What can the buyer assistant do?

- **Read:** catalog (product search and detail, categories, brands, saved lists), orders and shipments, account balance and credit limit summary, statement summary (totals and the last 25 entries), invoices (no PDF), address options, pending approvals, quote requests and contracts.
- **Write:** add / update / remove cart lines and add a saved list to the cart (`b2b_cart_write`), create an order (`b2b_order_write`), request, accept or cancel a quote (`b2b_rfq_write`), create a return request (`b2b_return_write`).
- `b2b_whoami` shows which buyer / company you are connected as.
- The portal's order rules (approval chain, budget, credit limit, minimum amount, working hours) apply unchanged. An order that needs approval is created as "pending approval".

### How to connect

1. Get the **MCP URL** from your supplier. The steps for adding it in your agent provider are the same as in the provider sections above; the difference is the authentication step.
2. When you start the connection, the **buyer consent screen** opens in your browser.
3. Enter your **B2B portal email and password**. The agent never sees your password.
4. Choose permissions. Read permissions (catalog, orders, account) are offered only as far as the client requests them; **write permissions** (cart, orders, returns, quote requests) are **off by default** and you must tick them separately.
5. Press **Approve** (at least one permission must stay selected). Declining does not require credentials.
6. Verify by asking your agent "which company am I connected as in EQLEM?".

If you have several company memberships, the agent works with your first buyer membership; the company cannot be switched through a tool.

### Security and limits

- **Two-step approval:** creating an order, a return request and quote request / acceptance / cancellation first show a summary and run only after you approve. The confirmation code is single-use and valid for 5 minutes; it becomes invalid if the cart, price or stock changes.
- **The cart is preparation:** a cart change does not place an order and can be undone. An order is created only by the approved call.
- **There is no payment / card tool;** card payment happens only in the portal. The agent cannot delete, approve / reject, or change addresses.
- **Company isolation:** the agent sees only data within your own company (Party) scope; requests for another company or tenant are rejected.
- **You decide the permissions:** write permissions are not granted unless you select them; the agent cannot go beyond your portal permissions.
- **Connections are revoked when your password changes:** if your password changes or your account is deactivated, all your agent connections are revoked and you must reconnect and approve again.
- **Rate limits:** 60 calls per minute; write actions 10 per minute; outside-effect actions such as orders, returns and quotes 20 per hour.
- **Audit:** every tool call is logged with masked arguments. Free text such as notes, descriptions and addresses is treated as untrusted data; instructions inside it are not followed.

### Example prompts

- **Reorder:** "Add the products from my saved list to the cart, summarize the cart and show the order preview."
- **Find a product:** "Find the product with OEM number OEM123 and add 10 to the cart."
- **Statement check:** "Summarize this month's statement and my account balance; how much of my credit limit is left?"
- **Status tracking:** "List my confirmed orders and check the shipment status of the latest one."
- **Quote request:** "Request a quote for 50 units of this product."
- **Return:** "Prepare a return request for 2 units from line 1 of this order and show the return reasons."

### B2B buyer: FAQ and troubleshooting

**I see "email or password is incorrect".** Enter the email and password you use in the portal. After 5 failed sign-ins within 15 minutes the account is locked temporarily; try again when the time shown on screen has passed.

**I get a license or inactive account error.** Your supplier has no B2B license or your account is inactive; contact your supplier.

**The agent does not see the order or return tools.** The write permissions were not selected for the connection; reconnect and tick the relevant write permission.

**The confirmation code is invalid.** It may have expired, been used, or the cart / price / stock may have changed; ask the agent to fetch the summary again.

**My order is "pending approval".** The portal's approval chain applies; the approver approves in the portal, the agent cannot approve.

**The connection suddenly dropped.** The password may have changed or the account was deactivated; reconnect and approve again.

**Can I pay by card? Can it download invoice PDFs?** No; payment happens only in the portal, and the agent reads invoice information.

## Security reminder

- The agent works with only your permissions and the permission groups you approved. Deletion and prospect cancellation happen only in EQLEM.
- Actions with outside effect need your approval, and CRM compliance rules apply to every send.
- Do not share an enterprise client's `client secret`. An Admin renews it in **AI connections**.
- To remove an agent connection, revoke it in **AI connections**.

## FAQ

**Where do I get the MCP URL?** From **AI connections** in EQLEM.

**I cannot connect. What should I do?** Check the URL and the browser sign-in and consent step first. If it still fails, tell your EQLEM administrator. For Gemini Enterprise and Copilot Studio (Manual) the administrator creates an enterprise client.

**The tools do not appear.** Ask your agent to call the `eqlem_whoami` tool; its output shows how many tools are hidden, by reason (permission selection, license, authorization), and which permissions are missing.

**I see "active connection limit reached".** Revoke an unused connection on the **AI connections** page and try again; incomplete attempts no longer fill the limit.

**I see "the MCP address does not belong to your account".** Use the address on the **AI connections** page or sign in with the correct account.

**I see "API connection address not found".** Contact your EQLEM administrator.

**The labels in my provider's interface look different.** Providers may rename menus; the steps above describe the general flow.

## Next step

Explore the [CRM module](https://www.eqlem.com/en/modules/crm) or start with **Try Free**.
