Skip to content

MailerAddAgent

POST mailer/agent

Links a CRM manager to their sender identity at the provider. This is what makes an INDIVIDUAL profile work: the module needs to know which From address belongs to the manager sending the email.

It matters for sales correspondence — a reply should reach the manager who wrote, not a shared noreply mailbox.

Access Control

Allowed role: admin. The link belongs to the brand of the caller.

Request

POST https://{broker_domain}/mailer/agent
{
  "managerId": 10,
  "profileId": 5,
  "status": "ENABLED",
  "externalIdentifier": "[email protected]"
}
{
  "command": "MailerAddAgent",
  "extID": "1",
  "data": {
    "managerId": 10,
    "profileId": 5,
    "status": "ENABLED",
    "externalIdentifier": "[email protected]"
  }
}
const res = await platform.MailerAddAgent({
  managerId: 10,
  profileId: 5,
  status: "ENABLED",
  externalIdentifier: "[email protected]"
});

Request Data

Field Type Required Description
managerId int Yes CRM manager id
profileId int Yes Provider profile the link belongs to. The profile must be INDIVIDUAL
status enum Yes ENABLED or DISABLED
externalIdentifier string Yes Sender address of the manager at the provider

Behavior

  • A COMMON profile is rejected: it sends from the profile fromEmail, so a per-manager address there would be silently ignored.
  • One manager has at most one link per profile. A previously deleted link is restored rather than duplicated.

Response Data

{
  "id": 12,
  "brand": "default",
  "managerId": 10,
  "profileId": 5,
  "externalIdentifier": "[email protected]",
  "status": "ENABLED",
  "createdAt": "2026-08-24 13:10:02"
}

Errors

Code Error Description
400 PROFILE_MODE_MISMATCH The profile does not use per-manager sender addresses
404 PROFILE_NOT_FOUND Profile not found in the brand
409 AGENT_EXISTS This manager is already linked to this profile