Try for Free

To The Top

{ "openapi": "3.0.4", "info": { "title": "Elastic Email MCP Server", "description": "OpenAPI style documentation describing Elastic Email MCP tools", "version": "v1" }, "servers": [ { "url": "https://mcp.elasticemail.com" } ], "paths": { "/CreateCampaign": { "post": { "tags": [ "Campaign management" ], "description": "Use to create a campaign for selected lists or segments; do not use it to send an ad-hoc email or modify an existing campaign. Returns the created campaign. Creating an Active campaign can start delivery immediately; create a Draft or Paused campaign when review or delayed sending is required. Requires a unique name, recipients, and content. If validation or the API rejects the request, correct the reported field and retry.", "operationId": "create_campaign", "requestBody": { "content": { "application/json": { "schema": { "required": [ "campaignData" ], "type": "object", "properties": { "campaignData": { "required": [ "Name", "Recipients" ], "type": "object", "properties": { "Content": { "type": "array", "items": { "required": [ "From" ], "type": "object", "properties": { "Poolname": { "type": "string", "description": "Optional account pool name used to send this content variant." }, "From": { "type": "string", "description": "Verified sender address, optionally with a display name." }, "ReplyTo": { "type": "string", "description": "Reply-to address, optionally with a display name. Defaults to From when omitted." }, "Subject": { "type": "string", "description": "Email subject line for this content variant." }, "TemplateName": { "type": "string", "description": "Existing template name to apply to this content variant, when one is required." }, "AttachFiles": { "type": "array", "items": { "type": "string" }, "description": "Names of previously uploaded files to include as downloadable attachments." }, "Utm": { "type": "object", "properties": { "Source": { "type": "string" }, "Medium": { "type": "string" }, "Campaign": { "type": "string" }, "Content": { "type": "string" } }, "description": "UTM marketing values added to links in this content variant." } }, "description": "One email content variant used by a campaign." }, "description": "Email content variants for the campaign. Provide one item for a normal campaign or multiple items for a split campaign." }, "Name": { "type": "string", "description": "Unique campaign name. It identifies an existing campaign during updates and cannot rename it." }, "Status": { "enum": [ "Active", "Processing", "Sending", "Completed", "Paused", "Cancelled", "Draft", "Deleted" ], "type": "string", "description": "Current lifecycle status. Use Draft or Paused to prevent an editable campaign from sending immediately. Allowed values: Deleted: hidden; Active: ready to process; Processing: preparing delivery; Sending: sending now; Completed: finished and immutable; Paused: not sending; Cancelled: stopped and immutable; Draft: saved without processing or sending." }, "Recipients": { "type": "object", "properties": { "ListNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account list names whose contacts are selected." }, "SegmentNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account segment names whose matching contacts are selected." } }, "description": "Lists or segments whose contacts receive the campaign. At least one list or segment is required." }, "ExcludedRecipients": { "type": "object", "properties": { "ListNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account list names whose contacts are selected." }, "SegmentNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account segment names whose matching contacts are selected." } }, "description": "Lists or segments whose contacts are excluded even when included by Recipients." }, "Options": { "type": "object", "properties": { "DeliveryOptimization": { "enum": [ "None", "ToEngagedFirst", "ByOpenTime" ], "type": "string", "description": "How to order delivery. Allowed values: None: send without optimization; ToEngagedFirst: prioritize recipients with stronger recent engagement; ByOpenTime: prioritize each recipient's usual email open time." }, "TrackOpens": { "type": "boolean", "description": "Whether to record email opens for this campaign." }, "TrackClicks": { "type": "boolean", "description": "Whether to record link clicks for this campaign." }, "ScheduleFor": { "type": "string", "description": "UTC date and time when the campaign is scheduled to send.", "format": "date-time" }, "TriggerFrequency": { "type": "number", "description": "Interval in minutes between recurring campaign sends.", "format": "double" }, "TriggerCount": { "type": "integer", "description": "Maximum number of recurring campaign sends.", "format": "int32" }, "SplitOptions": { "type": "object", "properties": { "OptimizePeriodMinutes": { "type": "integer", "description": "Number of minutes to measure results before selecting the winning content variant.", "format": "int32" }, "OptimizeFor": { "enum": [ "Opens", "Clicks" ], "type": "string", "description": "Metric used to choose the winning content variant. Allowed values: Opens: most opens; Clicks: most link clicks." } }, "description": "Split-test settings. Ignored unless the campaign has multiple content variants." } }, "description": "Delivery, tracking, schedule, recurring trigger, and split-test options." } }, "description": "Full campaign definition. Requires a unique name, at least one recipient list or segment, and at least one content item with From and Subject. Use status Draft or Paused to prevent immediate delivery." } } } } } }, "responses": { } } }, "/DeleteCampaign": { "post": { "tags": [ "Campaign management" ], "description": "Use to permanently delete one campaign; do not use it to pause a sending campaign. Returns a deletion confirmation and removes the campaign. If the name is unknown or deletion is rejected, use ListCampaigns, resolve the returned error, and retry.", "operationId": "delete_campaign", "requestBody": { "content": { "application/json": { "schema": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "Name of the campaign to delete. Use ListCampaigns to look one up." } } } } } }, "responses": { } } }, "/ListCampaigns": { "post": { "tags": [ "Campaign management" ], "description": "Use to list campaigns on the account; do not use it to retrieve full details or statistics for one campaign. Returns campaign records and has no side effects. If the request fails, resolve the returned API error and retry.", "operationId": "list_campaigns", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { } } }, "/GetCampaign": { "post": { "tags": [ "Campaign management" ], "description": "Use to retrieve one campaign by name; do not use it to list campaigns or modify its definition. Returns the campaign record and has no side effects. If the name is unknown, use ListCampaigns, then retry with its exact name.", "operationId": "get_campaign", "requestBody": { "content": { "application/json": { "schema": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "Name of an existing campaign. Use ListCampaigns to look one up." } } } } } }, "responses": { } } }, "/PauseCampaign": { "post": { "tags": [ "Campaign management" ], "description": "Use to pause an Active or Sending campaign; do not use it for a Draft, because the API would cancel it permanently. Returns a pause confirmation and stops further processing. If the campaign is Draft, update its status or delete it; otherwise resolve the returned API error and retry.", "operationId": "pause_campaign", "requestBody": { "content": { "application/json": { "schema": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "Name of the campaign to pause." } } } } } }, "responses": { } } }, "/UpdateCampaign": { "post": { "tags": [ "Campaign management" ], "description": "Use to replace the definition of an existing editable campaign; do not use it to rename a campaign or change a completed or cancelled one. Returns the updated campaign. It writes the full replacement definition; the Name identifies the campaign and remains unchanged. Provide the full valid campaign definition. If the campaign is not editable or validation fails, fetch it, correct the data or status, and retry.", "operationId": "update_campaign", "requestBody": { "content": { "application/json": { "schema": { "required": [ "campaignData" ], "type": "object", "properties": { "campaignData": { "required": [ "Name", "Recipients" ], "type": "object", "properties": { "Content": { "type": "array", "items": { "required": [ "From" ], "type": "object", "properties": { "Poolname": { "type": "string", "description": "Optional account pool name used to send this content variant." }, "From": { "type": "string", "description": "Verified sender address, optionally with a display name." }, "ReplyTo": { "type": "string", "description": "Reply-to address, optionally with a display name. Defaults to From when omitted." }, "Subject": { "type": "string", "description": "Email subject line for this content variant." }, "TemplateName": { "type": "string", "description": "Existing template name to apply to this content variant, when one is required." }, "AttachFiles": { "type": "array", "items": { "type": "string" }, "description": "Names of previously uploaded files to include as downloadable attachments." }, "Utm": { "type": "object", "properties": { "Source": { "type": "string" }, "Medium": { "type": "string" }, "Campaign": { "type": "string" }, "Content": { "type": "string" } }, "description": "UTM marketing values added to links in this content variant." } }, "description": "One email content variant used by a campaign." }, "description": "Email content variants for the campaign. Provide one item for a normal campaign or multiple items for a split campaign." }, "Name": { "type": "string", "description": "Unique campaign name. It identifies an existing campaign during updates and cannot rename it." }, "Status": { "enum": [ "Active", "Processing", "Sending", "Completed", "Paused", "Cancelled", "Draft", "Deleted" ], "type": "string", "description": "Current lifecycle status. Use Draft or Paused to prevent an editable campaign from sending immediately. Allowed values: Deleted: hidden; Active: ready to process; Processing: preparing delivery; Sending: sending now; Completed: finished and immutable; Paused: not sending; Cancelled: stopped and immutable; Draft: saved without processing or sending." }, "Recipients": { "type": "object", "properties": { "ListNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account list names whose contacts are selected." }, "SegmentNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account segment names whose matching contacts are selected." } }, "description": "Lists or segments whose contacts receive the campaign. At least one list or segment is required." }, "ExcludedRecipients": { "type": "object", "properties": { "ListNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account list names whose contacts are selected." }, "SegmentNames": { "type": "array", "items": { "type": "string" }, "description": "Existing account segment names whose matching contacts are selected." } }, "description": "Lists or segments whose contacts are excluded even when included by Recipients." }, "Options": { "type": "object", "properties": { "DeliveryOptimization": { "enum": [ "None", "ToEngagedFirst", "ByOpenTime" ], "type": "string", "description": "How to order delivery. Allowed values: None: send without optimization; ToEngagedFirst: prioritize recipients with stronger recent engagement; ByOpenTime: prioritize each recipient's usual email open time." }, "TrackOpens": { "type": "boolean", "description": "Whether to record email opens for this campaign." }, "TrackClicks": { "type": "boolean", "description": "Whether to record link clicks for this campaign." }, "ScheduleFor": { "type": "string", "description": "UTC date and time when the campaign is scheduled to send.", "format": "date-time" }, "TriggerFrequency": { "type": "number", "description": "Interval in minutes between recurring campaign sends.", "format": "double" }, "TriggerCount": { "type": "integer", "description": "Maximum number of recurring campaign sends.", "format": "int32" }, "SplitOptions": { "type": "object", "properties": { "OptimizePeriodMinutes": { "type": "integer", "description": "Number of minutes to measure results before selecting the winning content variant.", "format": "int32" }, "OptimizeFor": { "enum": [ "Opens", "Clicks" ], "type": "string", "description": "Metric used to choose the winning content variant. Allowed values: Opens: most opens; Clicks: most link clicks." } }, "description": "Split-test settings. Ignored unless the campaign has multiple content variants." } }, "description": "Delivery, tracking, schedule, recurring trigger, and split-test options." } }, "description": "Full replacement definition for an existing editable campaign. Name selects the existing campaign and cannot rename it; retain required recipients and content when changing only one field." } } } } } }, "responses": { } } }, "/GetCampaignStatistics": { "post": { "tags": [ "Statistics" ], "description": "Use to retrieve delivery statistics for one campaign; do not use it to retrieve or modify the campaign definition. Returns that campaign's statistics and has no side effects. If the name is unknown, use ListCampaigns, then retry with its exact name.", "operationId": "get_campaign_statistics", "requestBody": { "content": { "application/json": { "schema": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "Name of an existing campaign." } } } } } }, "responses": { } } }, "/GetAllCampaignStatistics": { "post": { "tags": [ "Statistics" ], "description": "Use to retrieve aggregate statistics for all campaigns; do not use it to retrieve one campaign's full definition. Returns campaign statistics and has no side effects. If the request fails, resolve the returned API error and retry.", "operationId": "get_all_campaign_statistics", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { } } }, "/FetchContacts": { "post": { "tags": [ "Contacts management" ], "description": "Use to list contacts on the account; do not use it to retrieve a contact's event history or modify contacts. Returns up to the requested number of contact records and has no side effects. If the limit is invalid or the request fails, correct it or resolve the returned API error and retry.", "operationId": "fetch_contacts", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "limit": { "type": "integer", "description": "How many contacts to return. Defaults to 20.", "format": "int32" } } } } } }, "responses": { } } }, "/FetchContactHistory": { "post": { "tags": [ "Statistics" ], "description": "Use to inspect the recorded history for one known contact; do not use it to find contacts by name or list. Returns that contact's history when history is available. It has no side effects and does not change the contact. If the email is empty or unknown, provide a valid address or use FetchContacts to locate it.", "operationId": "fetch_contact_history", "requestBody": { "content": { "application/json": { "schema": { "required": [ "email" ], "type": "object", "properties": { "email": { "type": "string", "description": "Exact contact email address whose history to return. Use FetchContacts or FetchListContacts when the address is not known." } } } } } }, "responses": { } } }, "/FetchLists": { "post": { "tags": [ "Contacts management" ], "description": "Use to list contact lists on the account; do not use it to retrieve contacts from one known list. Returns list records and has no side effects. If the request fails, resolve the returned API error and retry.", "operationId": "fetch_lists", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { } } }, "/FetchList": { "post": { "tags": [ "Contacts management" ], "description": "Use to inspect one contact list by name; do not use it to list all lists or retrieve its contacts. Returns that list record and has no side effects. If the name is unknown, use FetchLists, then retry with its exact name.", "operationId": "fetch_list", "requestBody": { "content": { "application/json": { "schema": { "required": [ "listName" ], "type": "object", "properties": { "listName": { "type": "string", "description": "Exact name of the list. Use FetchLists to look one up." } } } } } }, "responses": { } } }, "/FetchListContacts": { "post": { "tags": [ "Contacts management" ], "description": "Use to list contacts belonging to one known list; do not use it to retrieve all account contacts. Returns that list's contacts and has no side effects. If the list name is unknown, use FetchLists, then retry with its exact name.", "operationId": "fetch_list_contacts", "requestBody": { "content": { "application/json": { "schema": { "required": [ "listName" ], "type": "object", "properties": { "listName": { "type": "string", "description": "Exact name of the list. Use FetchLists to look one up." } } } } } }, "responses": { } } }, "/AddContactsToList": { "post": { "tags": [ "Contacts management" ], "description": "Use to add existing contacts to one list; do not use it to create contacts or create a list. Returns the API result and changes list membership. Provide a known list and at least one address; use FetchLists or correct the reported API error before retrying.", "operationId": "add_contacts_to_list", "requestBody": { "content": { "application/json": { "schema": { "required": [ "listName", "emails" ], "type": "object", "properties": { "listName": { "type": "string", "description": "Exact name of an existing list. Use FetchLists to look one up, or CreateList to make one." }, "emails": { "type": "array", "items": { "type": "string" }, "description": "Email addresses to add to the list." } } } } } }, "responses": { } } }, "/RemoveContactsFromList": { "post": { "tags": [ "Contacts management" ], "description": "Use to remove selected contacts from one list; do not use it to delete contacts from the account. Returns a removal confirmation and changes only list membership. Provide exactly one of contacts or rule; correct that selection or use FetchLists when the list name is unknown.", "operationId": "remove_contacts_from_list", "requestBody": { "content": { "application/json": { "schema": { "required": [ "listName" ], "type": "object", "properties": { "listName": { "type": "string", "description": "Exact name of the list to remove contacts from. Use FetchLists to look one up." }, "contacts": { "type": "array", "items": { "type": "string" }, "description": "Email addresses to remove. Leave out when using rule." }, "rule": { "type": "string", "description": "SQL-like rule selecting the contacts to remove, or 'All' for every contact on the list. Leave out when using contacts." } } } } } }, "responses": { } } }, "/CreateList": { "post": { "tags": [ "Contacts management" ], "description": "Use to create a contact list, optionally with existing contacts; do not use it to import or create contacts. Returns the created list and changes account list configuration. Provide a unique name; correct a duplicate name or reported API error and retry.", "operationId": "create_list", "requestBody": { "content": { "application/json": { "schema": { "required": [ "listName", "emails" ], "type": "object", "properties": { "listName": { "type": "string", "description": "Name for the new list." }, "emails": { "type": "array", "items": { "type": "string" }, "description": "Email addresses of existing contacts to put on the list. Pass an empty array to create an empty list." } } } } } }, "responses": { } } }, "/DeleteList": { "post": { "tags": [ "Contacts management" ], "description": "Use to delete one contact list; do not use it to delete the contacts on that list. Returns a deletion confirmation and permanently removes only the list. If the name is unknown, use FetchLists; use DeleteContacts when account contacts must be removed.", "operationId": "delete_list", "requestBody": { "content": { "application/json": { "schema": { "required": [ "listName" ], "type": "object", "properties": { "listName": { "type": "string", "description": "Exact name of the list to delete. Use FetchLists to look one up." } } } } } }, "responses": { } } }, "/AddContact": { "post": { "tags": [ "Contacts management" ], "description": "Use to add one contact with an email address and optional name; do not use it for file imports or for adding contacts to an existing list. Returns the created contact. This writes to the account but does not assign a list. If the address is empty, invalid, or already rejected by the API, correct it and retry.", "operationId": "add_contact", "requestBody": { "content": { "application/json": { "schema": { "required": [ "email" ], "type": "object", "properties": { "email": { "type": "string", "description": "Email address for the new contact. Must be a non-empty, valid email address." }, "firstName": { "type": "string", "description": "Optional first name." }, "lastName": { "type": "string", "description": "Optional last name." } } } } } }, "responses": { } } }, "/DeleteContacts": { "post": { "tags": [ "Contacts management" ], "description": "Use to permanently delete contacts from the account; do not use it to remove contacts only from a list. Returns a deletion confirmation and removes selected contacts from the account. Provide exactly one of contacts or rule; correct that selection or use RemoveContactsFromList for list-only removal.", "operationId": "delete_contacts", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "contacts": { "type": "array", "items": { "type": "string" }, "description": "Email addresses to delete. Leave out when using rule." }, "rule": { "type": "string", "description": "SQL-like rule selecting the contacts to delete, or 'All' for every contact. Leave out when using contacts." } } } } } }, "responses": { } } }, "/UploadContacts": { "post": { "tags": [ "Contacts management" ], "description": "Use to import many contacts from a CSV, TXT, JSON, or ZIP file; do not use it to add a single contact. Returns Success after the import is accepted. It writes contacts and creates the requested list if it does not exist; omit listName to import without a list. The file name selects a supported content type and content must be valid base64. Correct the file or encoding reported by an error and retry.", "operationId": "upload_contacts", "requestBody": { "content": { "application/json": { "schema": { "required": [ "fileName", "base64Content" ], "type": "object", "properties": { "fileName": { "type": "string", "description": "File name with a supported extension: .csv, .txt, .json, or .zip. The extension selects the import content type, for example contacts.csv." }, "base64Content": { "type": "string", "description": "File bytes encoded as base64. For CSV, the first row is a header and must contain an Email column." }, "listName": { "type": "string", "description": "List to import the contacts into, created if missing. Leave out to import without adding to a list." } } } } } }, "responses": { } } }, "/GetDomains": { "post": { "tags": [ "Domain management" ], "description": "Use to list domains configured for the account; do not use it to inspect or verify one known domain. Returns the configured domain records and has no side effects. If the request fails, resolve the returned API error and retry.", "operationId": "get_domains", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { } } }, "/GetDomain": { "post": { "tags": [ "Domain management" ], "description": "Use to inspect one configured domain by name; do not use it to list all domains or verify DNS. Returns that domain record and has no side effects. If the name is unknown, use GetDomains, then retry with its exact name.", "operationId": "get_domain", "requestBody": { "content": { "application/json": { "schema": { "required": [ "domain" ], "type": "object", "properties": { "domain": { "type": "string", "description": "Name of the domain, e.g. yourdomain.com. Use GetDomains to list them." } } } } } }, "responses": { } } }, "/AddDomain": { "post": { "tags": [ "Domain management" ], "description": "Use to add a new sending domain to the account; do not use it to verify DNS records or change the default sender. Returns the created domain record - the Spf/Dkim/MX/DMARC verification flags, the tracking Type, and DKIMRecord (HostName and RecordValue) when Elastic Email holds the DKIM key for this domain; DKIMRecord is null when it does not. It writes the domain configuration but does not publish DNS records. If creation is rejected, correct the domain or request and retry. The domain is not usable until the required DNS records are published and VerifyDomain succeeds.", "operationId": "add_domain", "requestBody": { "content": { "application/json": { "schema": { "required": [ "domainRequest" ], "type": "object", "properties": { "domainRequest": { "type": "object", "properties": { "Domain": { "type": "string", "description": "Domain name to add, without a protocol or subdomain prefix, e.g. yourdomain.com" }, "SetAsDefault": { "type": "boolean", "description": "Whether to make this the Account's default sending domain once it verifies." } }, "description": "The domain to add, and whether it should become the default sending domain." } } } } } }, "responses": { } } }, "/SetDomainAsDefault": { "post": { "tags": [ "Domain management" ], "description": "Use to set the account's default sender address; do not use it to add or verify a domain. Returns the updated domain record. It changes the account default sender and requires a full email address at a verified domain, for example sender@yourdomain.com; a bare domain name is rejected. If the address is invalid or its domain is unverified, correct it and retry.", "operationId": "set_domain_as_default", "requestBody": { "content": { "application/json": { "schema": { "required": [ "email" ], "type": "object", "properties": { "email": { "type": "string", "description": "Email address to become the default sender, e.g. sender@yourdomain.com. Its domain must already be verified on this Account - use GetDomains to list them." } } } } } }, "responses": { } } }, "/DeleteDomain": { "post": { "tags": [ "Domain management" ], "description": "Use to delete one configured domain; do not use it to change the default sender or remove contacts. Returns a deletion confirmation and permanently removes the domain configuration. If the name is unknown or deletion is rejected, use GetDomains, resolve the returned error, and retry.", "operationId": "delete_domain", "requestBody": { "content": { "application/json": { "schema": { "required": [ "domain" ], "type": "object", "properties": { "domain": { "type": "string", "description": "Name of the domain to delete, e.g. yourdomain.com. Use GetDomains to list them." } } } } } }, "responses": { } } }, "/VerifyDomain": { "post": { "tags": [ "Domain management" ], "description": "Use to verify a domain after publishing the DNS records returned by AddDomain; do not use it before the records are publicly resolvable or to add a domain. Returns the verification result. It has no side effects: it checks DNS and does not publish records for you. Choose the tracking protocol that matches the available certificate. If records are missing, publish or correct them, wait for DNS propagation, and retry.", "operationId": "verify_domain", "requestBody": { "content": { "application/json": { "schema": { "required": [ "domain" ], "type": "object", "properties": { "domain": { "type": "string", "description": "Name of the domain to verify, e.g. yourdomain.com. Use GetDomains to list them." }, "trackingType": { "enum": [ "Http", "ExternalHttps", "InternalCertHttps", "LetsEncryptCert" ], "type": "string", "description": "Link-tracking protocol to verify. Allowed values: Http: unencrypted links; ExternalHttps: customer-supplied certificate; InternalCertHttps: Elastic Email-issued certificate; LetsEncryptCert: Let's Encrypt certificate issued for the account." } } } } } }, "responses": { } } }, "/GetSentEmails": { "post": { "tags": [ "Emails sending" ], "description": "Use to list sent-email events in an optional UTC time range; do not use it to inspect a message body or send email. Returns matching sent events and has no side effects. If the request fails, correct the range or resolve the returned API error and retry.", "operationId": "get_sent_emails", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "from": { "type": "string", "description": "Start of the range, inclusive. Converted to UTC before the query is made.", "format": "date-time" }, "to": { "type": "string", "description": "End of the range, inclusive. Converted to UTC before the query is made.", "format": "date-time" } } } } } }, "responses": { } } }, "/ViewEmail": { "post": { "tags": [ "Emails sending" ], "description": "Use to inspect the rendered content of one sent email by MsgID; do not use it to send, edit, or search emails. Returns the email, including its body. It has no side effects. Use the MsgID returned by SendTransactionalEmail or GetSentEmails; if it is missing or not found, obtain a valid ID and retry.", "operationId": "view_email", "requestBody": { "content": { "application/json": { "schema": { "required": [ "msgId" ], "type": "object", "properties": { "msgId": { "type": "string", "description": "MsgID of the sent email, as returned by SendTransactionalEmail or GetSentEmails." } } } } } }, "responses": { } } }, "/GetSentEmailsByTransactionID": { "post": { "tags": [ "Emails sending" ], "description": "Use to retrieve send events for one transaction ID; do not use it to search by recipient or inspect a message body. Returns matching events and has no side effects. If the transaction ID is unknown, obtain it from a send result or GetSentEmails and retry.", "operationId": "get_sent_emails_by_transaction_id", "requestBody": { "content": { "application/json": { "schema": { "required": [ "transactionId" ], "type": "object", "properties": { "transactionId": { "type": "string", "description": "Transaction ID that was returned when the email was sent." } } } } } }, "responses": { } } }, "/SendBulkEmails": { "post": { "tags": [ "Emails sending" ], "description": "Use to send one bulk email to a recipient list; do not use it when each recipient needs an individual transactional message. Returns the API send result. It sends externally and requires at least one recipient plus content or a usable template. If the sender, recipients, or template cannot be resolved, correct the reported input and retry.", "operationId": "send_bulk_emails", "requestBody": { "content": { "application/json": { "schema": { "required": [ "emailData" ], "type": "object", "properties": { "emailData": { "type": "object", "properties": { "Content": { "type": "string", "description": "Email body content as plain text or HTML. Provide this or TemplateName." }, "Subject": { "type": "string", "description": "Email subject. A template can supply it when omitted." }, "To": { "type": "array", "items": { "type": "string" }, "description": "Primary recipient email addresses. At least one is required." }, "Cc": { "type": "array", "items": { "type": "string" }, "description": "Optional CC recipient email addresses. Include only when the user explicitly requests copies." }, "From": { "type": "string", "description": "Verified sender address. The account default sender is used when omitted." }, "TemplateName": { "type": "string", "description": "Optional existing template name. It is resolved before sending and can supply content and subject." }, "Attachments": { "type": "array", "items": { "type": "object", "properties": { "FileName": { "type": "string", "description": "Attachment file name, including its extension." }, "Data": { "type": "array", "items": { "type": "integer", "format": "int32" }, "description": "Attachment bytes. Provide base64-encoded content in JSON." } }, "description": "A file attachment supplied with an email." }, "description": "Files attached to this email. Each file needs a name and base64-encoded data." } }, "description": "Bulk email definition. Provide at least one To recipient and content or TemplateName; From falls back to the account default sender when available. Use Cc only when requested." } } } } } }, "responses": { } } }, "/SendTransactionalEmail": { "post": { "tags": [ "Emails sending" ], "description": "Use to send a transactional email, especially when recipients should receive separate messages; do not use it for a campaign. Returns the API send result. It sends externally. With multiple recipients it asks whether to split the send when elicitation is supported; otherwise it sends one email addressed to all recipients. Requires a recipient and content or a usable template. If sender resolution, template lookup, or multi-recipient confirmation fails, correct the input or retry with one recipient.", "operationId": "send_transactional_email", "requestBody": { "content": { "application/json": { "schema": { "required": [ "data" ], "type": "object", "properties": { "data": { "type": "object", "properties": { "Content": { "type": "string", "description": "Email body content as plain text or HTML. Provide this or TemplateName." }, "Subject": { "type": "string", "description": "Email subject. A template can supply it when omitted." }, "To": { "type": "array", "items": { "type": "string" }, "description": "Primary recipient email addresses. At least one is required." }, "Cc": { "type": "array", "items": { "type": "string" }, "description": "Optional CC recipient email addresses. Include only when the user explicitly requests copies." }, "From": { "type": "string", "description": "Verified sender address. The account default sender is used when omitted." }, "TemplateName": { "type": "string", "description": "Optional existing template name. It is resolved before sending and can supply content and subject." }, "Attachments": { "type": "array", "items": { "type": "object", "properties": { "FileName": { "type": "string", "description": "Attachment file name, including its extension." }, "Data": { "type": "array", "items": { "type": "integer", "format": "int32" }, "description": "Attachment bytes. Provide base64-encoded content in JSON." } }, "description": "A file attachment supplied with an email." }, "description": "Files attached to this email. Each file needs a name and base64-encoded data." } }, "description": "Transactional email definition. Provide at least one To recipient and content or TemplateName; From falls back to the account default sender when available. Use Cc only when requested." } } } } } }, "responses": { } } }, "/IsReady": { "post": { "tags": [ "MCP Tools" ], "description": "Use to check whether this MCP server can reach the Elastic Email API; do not use it to validate credentials, send email, or inspect account data. Returns healthy, an API connectivity status, or not healthy. It has no side effects; retry after resolving the reported service or network issue.", "operationId": "is_ready", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { } } }, "/CreateSegment": { "post": { "tags": [ "Contacts management" ], "description": "Use to create a reusable contact segment from an SQL-like rule; do not use it to add contacts to a list. Returns the created segment and changes which contacts future segment-based sends select. A name and rule are required; correct an invalid rule or duplicate name and retry.", "operationId": "create_segment", "requestBody": { "content": { "application/json": { "schema": { "required": [ "segmentData" ], "type": "object", "properties": { "segmentData": { "required": [ "Name", "Rule" ], "type": "object", "properties": { "Name": { "type": "string", "description": "Unique segment name used when selecting campaign recipients." }, "Rule": { "type": "string", "description": "SQL-like expression selecting the contacts in this segment, for example Status = 1." } }, "description": "Segment to create: a name and an SQL-like rule selecting the contacts it contains." } } } } } }, "responses": { } } }, "/DeleteSegment": { "post": { "tags": [ "Contacts management" ], "description": "Use to delete a segment definition; do not use it to delete the contacts selected by that segment. Returns a deletion confirmation and permanently removes only the segment. If the name is unknown, use GetSegments, then retry with its exact name.", "operationId": "delete_segment", "requestBody": { "content": { "application/json": { "schema": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "Exact name of the segment to delete. Use GetSegments to look one up." } } } } } }, "responses": { } } }, "/GetSegments": { "post": { "tags": [ "Contacts management" ], "description": "Use to list configured contact segments; do not use it to inspect or delete one known segment. Returns segment records and has no side effects. If the request fails, resolve the returned API error and retry.", "operationId": "get_segments", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { } } }, "/GetSegment": { "post": { "tags": [ "Contacts management" ], "description": "Use to inspect one segment by name; do not use it to list all segments or change its rule. Returns that segment record and has no side effects. If the name is unknown, use GetSegments, then retry with its exact name.", "operationId": "get_segment", "requestBody": { "content": { "application/json": { "schema": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "Exact name of the segment. Use GetSegments to list them." } } } } } }, "responses": { } } }, "/AddContactToSuppressionList": { "post": { "tags": [ "Suppressions management" ], "description": "Use to prevent up to 1,000 known addresses from receiving mail for a specified suppression reason; do not use it to delete contacts or remove a suppression. Returns the API result. It changes delivery eligibility for the supplied addresses. Use the reason that matches the event. If the list is empty, exceeds 1,000 entries, or the API rejects an address, correct it and retry.", "operationId": "add_contact_to_suppression_list", "requestBody": { "content": { "application/json": { "schema": { "required": [ "emails", "type" ], "type": "object", "properties": { "emails": { "type": "array", "items": { "type": "string" }, "description": "Email addresses to suppress, with a maximum of 1,000 addresses per request." }, "type": { "enum": [ "Bounced", "Unsubscribed", "Complained" ], "type": "string", "description": "Reason to suppress every supplied address. Allowed values: Bounced: delivery failed; Unsubscribed: recipient opted out; Complained: recipient reported spam or abuse." } } } } } }, "responses": { } } }, "/DeleteSuppression": { "post": { "tags": [ "Suppressions management" ], "description": "Use to remove one address from the suppression list; do not use it to delete the contact. Returns the API result and changes delivery eligibility by restoring delivery when successful. If the address is unknown, obtain it from GetSuppressionList and retry.", "operationId": "delete_suppression", "requestBody": { "content": { "application/json": { "schema": { "required": [ "email" ], "type": "object", "properties": { "email": { "type": "string", "description": "Email address to remove from the suppression list." } } } } } }, "responses": { } } }, "/GetSuppressionList": { "post": { "tags": [ "Suppressions management" ], "description": "Use to list existing contact suppressions; do not use it to add or remove one. Returns the current suppression records and has no side effects. If the API request fails, retry after resolving the returned error.", "operationId": "get_suppression_list", "requestBody": { "content": { "application/json": { "schema": { "type": "object" } } } }, "responses": { } } }, "/FetchTemplate": { "post": { "tags": [ "Emails sending" ], "description": "Use to retrieve the full definition of a known template; do not use it to list or create templates. Returns the template definition and has no side effects. If the name is empty or absent, use FetchTemplates to obtain an exact name, then retry.", "operationId": "fetch_template", "requestBody": { "content": { "application/json": { "schema": { "required": [ "name" ], "type": "object", "properties": { "name": { "type": "string", "description": "Exact name of the template. Use FetchTemplates to list the names on this account." } } } } } }, "responses": { } } }, "/FetchTemplates": { "post": { "tags": [ "Emails sending" ], "description": "Use to list available templates by scope and optional editor type; do not use it to retrieve one template's full content. Returns matching template records and has no side effects. Provide at least one scope; correct invalid filters or resolve the returned API error and retry.", "operationId": "fetch_templates", "requestBody": { "content": { "application/json": { "schema": { "required": [ "scopes" ], "type": "object", "properties": { "scopes": { "type": "array", "items": { "enum": [ "Personal", "Global" ], "type": "string", "description": "Where a template is available. Allowed values: Personal: owned by the current account; Global: shared across accounts. Allowed values: Personal: Templates owned by the current account.; Global: Templates shared globally across accounts." }, "description": "Which template scopes to list. Allowed values: Personal: this account's own templates; Global: templates shared across accounts." }, "templateTypes": { "type": "array", "items": { "enum": [ "RawHTML", "DragDropEditor", "TemplateEditor" ], "type": "string", "description": "Editor format of an email template. Allowed values: RawHTML: editable HTML; DragDropEditor: drag-and-drop email editor; TemplateEditor: block-based template editor. Allowed values: RawHTML: A template containing editable HTML.; DragDropEditor: A template edited with the drag-and-drop email editor.; TemplateEditor: A template edited with the block-based template editor." }, "description": "Optional filter on template type. Allowed values: RawHTML: editable HTML; DragDropEditor: drag-and-drop editor; TemplateEditor: block-based editor. Defaults to all three types." } } } } } }, "responses": { } } } }, "components": { } }