API Documentation
Email Campaigns ¶
Overview
There are several models associated with emails which are similar and must not be confused.
Email Campaign
It’s a collection of 1 or more emails sent withing a campaign so they could be tracked together. Emails can have multiple recipients including email addresses, tags or lists.
They can also be scheduled to be sent in the future.
Data model
An email_campaign object will look like this:
| Field | Type | association |
|---|---|---|
| id | uuid | |
| created_at | number | |
| updated_at | number | |
| deleted_at | number | |
| created_by | uuid | |
| brand | uuid | |
| due_at | number | |
| executed_at | number | |
| subject | string | |
| html | string | |
| text | string | |
| headers | json | |
| include_signature | boolean | |
| individual | boolean | |
| google_credential | uuid | |
| microsoft_credential | uuid | |
| accepted | number | |
| clicked | number | |
| complained | number | |
| delivered | number | |
| failed | number | |
| opened | number | |
| rejected | number | |
| sent | number | |
| stored | number | |
| unsubscribed | number | |
| deal | Deal | email_campaign.deal |
| from | User | email_campaign.from |
| attachments | EmailCampaignAttachment[] | email_campaign.attachments |
| recipients | EmailCampaignRecipient[] | email_campaign.recipients |
| emails | EmailCampaignEmail[] | email_campaign.emails |
| template | TemplateInstance | email_campaign.template |
Email Campaign Recipient
Each email campaign can container 1 or more recipients.
Each recipient could be any of the following:
-
All contacts
-
An pair of (email, contact) where contact id is optional
-
A CRM list
-
A CRM tag
-
A MLS agent from agent network
-
A brand to send to all its agents
Data model
An email_campaign_recipient object type looks like this:
| Field | Type | association | Description |
|---|---|---|---|
| id | uuid | ||
| created_at | number | ||
| deleted_at | number | ||
| updated_at | number | ||
| campaign | uuid | ||
| agent | Agent | ||
| brand | Brand | ||
| contact | Contact | ||
| string | |||
| id | uuid | ||
| list | CrmList | ||
| recipient_type | Enum * | ||
| send_type | Enum * | ||
| tag | string |
List of possible values for recipient_type:
-
Tag: campaign will be sent to the primary email of all contacts matching a tag -
List: campaign will be sent to the primary email of all contacts in a crm list -
Brand: campaign will be sent to all of agent users in the brand -
AllContacts: campaign will be sent to the primary email of all contacts in the brand -
Email: campaign will be sent to the specified email address and optionally associated with the provided contact -
Agent: campaign will be sent to the mls agent from the agent network
List of possible values for send_type:
-
To -
CC -
BCC
One individual email which has already been sent.
Email Campaign Email
A model that connects Email Campaigns with Emails.
Google Credential
A model that connects Email Campaigns with Google_Credentials.
Microsoft Credential
A model that connects Email Campaigns with Microsoft_Credentials.
Email Campaign Attachments
A model that connects Email Campaigns with Email_Campaign_Attachments
-
It is not allowed to send both file and url alongside each other.
-
Combination of url and name is mandatory.
Data model
An email_campaign_attachments object type looks like this:
| Field | Type | association | Description |
|---|---|---|---|
| id | uuid | NOT NULL | |
| campaign | uuid | NOT NULL | |
| file | uuid | NOT NULL | |
| is_inline | boolean | NOT NULL | |
| content_id | text | ||
| created_at | timestamp | ||
| updated_at | timestamp | ||
| deleted_at | timestamp |
Upload an Attachment ¶
Upload an AttachmentPOST/emails/attachments
-
Tip:
originquery parameter can be either ofgmail,outlook, ormailgun. -
Gmail limit: 26 MB (Single Attachment up to 26MB or Several attachments with the sum of file sizes up to 26MB)
-
Outlook limit: Same as Gmail
-
Mailgun limit: 15 MB
Example URI
- origin
string(required) Example: gmail
200Body
{
"code": "OK",
"data": {
"id": "33d0630e-3d5a-4301-b712-3605ce68ed54",
"created_at": 1765163538.002203,
"updated_at": 1765163538.002203,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"path": "80a227b2-29a0-11e7-b636-e4a7a08e15d4/b4085fd0-d3e3-11f0-a2d4-1bcac3894d4e.png",
"name": "logo.png",
"public": false,
"type": "file",
"url": "https://private-cdn.irish.rechat.com/80a227b2-29a0-11e7-b636-e4a7a08e15d4/b4085fd0-d3e3-11f0-a2d4-1bcac3894d4e.png?Expires=1765249938007&Key-Pair-Id=APKAIIRG223GKFAC4MHA&Signature=VxtXuh3YqoCHu85WhBWkNzVSpiBA759ZJEDdnHaCOY6nyLA8ETOWhJdHqXW4j1BxwsQKT-izqQwKMIzR-3yaW~~pdkHJ~bcZEuWtg0rMUfxcowdKo5M9469FCgrKZ3s46vAEy4zcklLIOYfwhd74FADD-6BpaBrWucZkzYRb9ogt8~mbpvWEsHyagCa62InZXq4~-vOdR83w-eu8GYrFvsd7i8Xao1Y12z9TL9XmuQC1rt~SWYZF0XXKA2WWEArSa5zFMegxzWXoB0~uQohOqoQNNET1J3u0~I9f0OEnCVVtGqY0suGbNEm6-BpENrzB0e-eKra9ZPLzm5H7nAo6Ww__",
"preview_url": "https://private-cdn.irish.rechat.com/80a227b2-29a0-11e7-b636-e4a7a08e15d4/b4085fd0-d3e3-11f0-a2d4-1bcac3894d4e.png?Expires=1765249938007&Key-Pair-Id=APKAIIRG223GKFAC4MHA&Signature=VxtXuh3YqoCHu85WhBWkNzVSpiBA759ZJEDdnHaCOY6nyLA8ETOWhJdHqXW4j1BxwsQKT-izqQwKMIzR-3yaW~~pdkHJ~bcZEuWtg0rMUfxcowdKo5M9469FCgrKZ3s46vAEy4zcklLIOYfwhd74FADD-6BpaBrWucZkzYRb9ogt8~mbpvWEsHyagCa62InZXq4~-vOdR83w-eu8GYrFvsd7i8Xao1Y12z9TL9XmuQC1rt~SWYZF0XXKA2WWEArSa5zFMegxzWXoB0~uQohOqoQNNET1J3u0~I9f0OEnCVVtGqY0suGbNEm6-BpENrzB0e-eKra9ZPLzm5H7nAo6Ww__",
"mime": "image/png"
}
}Schedule an email campaign ¶
Schedule an email campaignPOST/emails
Example URI
Body
{
"to": [
{
"email": "[email protected]",
"recipient_type": "Email"
}
],
"tags": [
"mailGunTag"
],
"due_at": "2025-12-08T03:12:12.026Z",
"html": "<div>Hi\n <img src=\"https://cdn.rechat.com/test.jpg\" />,<img src=\"https://listing.cdn.rechat.com/test.jpg\" />,<img src=\"https://d1rchfjmtfqq3r.cloudfront.net/test.jpg\" />,<img src=\"https://d2j29n432zojb.cloudfront.net/test.jpg\" />\n</div>",
"subject": "Email Subject",
"notifications_enabled": false,
"from": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"headers": {},
"text": "Hi ,,,",
"id": "7f80e918-dcb6-42e0-8118-47e1f1348d27"
}200Body
{
"code": "OK",
"data": {
"id": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"created_at": 1765163535.756061,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Email Subject",
"include_signature": false,
"html": "<div>Hi\n <img src=\"https://cdn.rechat.com/test.jpg\" />,<img src=\"https://listing.cdn.rechat.com/test.jpg\" />,<img src=\"https://d1rchfjmtfqq3r.cloudfront.net/test.jpg\" />,<img src=\"https://d2j29n432zojb.cloudfront.net/test.jpg\" />\n</div>",
"due_at": 1765163532.026,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi ,,,",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": false,
"archive": false,
"tags": [
"mailGunTag"
],
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0
}
}Update an email campaign ¶
Update an email campaignPUT/emails/:id
Example URI
- id
string(required) Example: 9a27c341-2e99-4b21-b198-27a6cf667873- associations
string(required) Example: email_campaign.recipients
Body
{
"id": "9a27c341-2e99-4b21-b198-27a6cf667873",
"to": [
{
"email": "[email protected]",
"recipient_type": "Email"
}
],
"tags": [
"updatedCampaignTag"
],
"due_at": "2025-12-08T03:12:12.026Z",
"html": "<div>\n From: {{sender.display_name or \"me\"}}\n </div>\n <div>\n To: {{recipient.display_name or \"there\"}}\n </div>",
"subject": "Individual Email From {{sender.display_name}}",
"notifications_enabled": false,
"from": "80a227b2-29a0-11e7-b636-e4a7a08e15d4"
}200Body
{
"code": "OK",
"data": {
"id": "9a27c341-2e99-4b21-b198-27a6cf667873",
"created_at": 1765163535.880235,
"updated_at": 1765163532.051436,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Individual Email From {{sender.display_name}}",
"include_signature": false,
"html": "<div>\n From: {{sender.display_name or \"me\"}}\n </div>\n <div>\n To: {{recipient.display_name or \"there\"}}\n </div>",
"due_at": 1765163532.026,
"executed_at": null,
"individual": true,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "From: {{sender.display_name or \"me\"}}\nTo: {{recipient.display_name or \"there\"}}",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": false,
"archive": false,
"tags": [
"updatedCampaignTag"
],
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0,
"recipients": [
{
"id": "026cb66b-b1fa-4de1-90b5-e45bcb8b63f8",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "9a27c341-2e99-4b21-b198-27a6cf667873",
"tag": null,
"email": "[email protected]",
"send_type": "To",
"recipient_type": "Email",
"type": "email_campaign_recipient"
}
]
}
}Update an email campaign's notifications_enabled ¶
Update an email campaign's notifications_enabledPUT/emails/:id/notifications
Example URI
- id
string(required) Example: 9a27c341-2e99-4b21-b198-27a6cf667873
Body
{
"status": false
}200Get an email campaign ¶
Get an email campaignGET/emails/:id?associations[]=email_campaign.emails
Example URI
- id
string(required) Example: 7f80e918-dcb6-42e0-8118-47e1f1348d27- associations
string(required) Example: email_campaign.emails,email_campaign.recipients,email_campaign_email.email
200Body
{
"code": "OK",
"data": {
"id": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"created_at": 1765163535.756061,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Email Subject",
"include_signature": false,
"html": "<div>Hi\n <img src=\"https://cdn.rechat.com/test.jpg\" />,<img src=\"https://listing.cdn.rechat.com/test.jpg\" />,<img src=\"https://d1rchfjmtfqq3r.cloudfront.net/test.jpg\" />,<img src=\"https://d2j29n432zojb.cloudfront.net/test.jpg\" />\n</div>",
"due_at": 1765163532.026,
"executed_at": 1765163532.051436,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 1,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi ,,,",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": false,
"archive": false,
"tags": [
"mailGunTag"
],
"recipients_count": 1,
"listed": true,
"type": "email_campaign",
"sent": 1,
"recipients": [
{
"id": "f819a6a9-07f6-422e-bac3-5932e571134c",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"tag": null,
"email": "[email protected]",
"send_type": "To",
"recipient_type": "Email",
"type": "email_campaign_recipient"
}
],
"emails": [
{
"id": "8056048f-d461-4e43-9c60-3b0b6cce2ea7",
"campaign": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"email": {
"id": "bdb5c615-565e-452d-95c3-0b7f4ed06c5a",
"created_at": 1765163536.407303,
"from": "Unit Test <[email protected]>",
"to": [
"[email protected]"
],
"subject": "Email Subject",
"headers": {
"Feedback-ID": "rechat:e5bddc63-401f-4711-81a7-34c4668e4907:rechat"
},
"mailgun_id": "example-mailgun-id-email-1",
"domain": "mg.rechat.com",
"campaign": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"cc": [],
"bcc": [],
"accepted": 0,
"rejected": 0,
"delivered": 1,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"tags": [
"e5bddc63-401f-4711-81a7-34c4668e4907",
"7f80e918-dcb6-42e0-8118-47e1f1348d27",
"mailGunTag"
],
"google_id": null,
"microsoft_id": null,
"tracking_id": "5037d1b4-82ed-43d0-aff6-b98fba6b1649",
"google_credential": null,
"microsoft_credential": null,
"sent_at": "2025-12-08T03:12:16.753Z",
"type": "email"
},
"send_type": "To",
"email_address": "[email protected]",
"accepted": 0,
"rejected": 0,
"delivered": 1,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"agent": null,
"error": null,
"campaign_executed_at": "2025-12-08T03:12:12.051Z",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"type": "email_campaign_email",
"full_name": null,
"profile_image_url": null
}
]
}
}Get all campaigns by brand ¶
Get all campaigns by brandGET/brands/:brand/emails/campaigns
Example URI
- brand
string(required) Example: e5bddc63-401f-4711-81a7-34c4668e4907- associations
string(required) Example: email_campaign.recipients
200Body
{
"code": "OK",
"data": [
{
"id": "2d8b7720-2fab-48df-94c4-092d7b30e4d8",
"created_at": 1765163537.466559,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Email Subject",
"include_signature": false,
"html": "<div>Hi\n <img src=\"https://cdn.rechat.com/test.jpg\" />,<img src=\"https://listing.cdn.rechat.com/test.jpg\" />,<img src=\"https://d1rchfjmtfqq3r.cloudfront.net/test.jpg\" />,<img src=\"https://d2j29n432zojb.cloudfront.net/test.jpg\" />\n</div>",
"due_at": 1765163532.026,
"executed_at": 1765163532.051436,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi ,,,",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": false,
"archive": false,
"tags": [
"mailGunTag"
],
"recipients_count": 1,
"listed": true,
"type": "email_campaign",
"sent": 1,
"recipients": [
{
"id": "cd2c2c76-4d4c-42da-a6ea-7d16017bbae7",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "2d8b7720-2fab-48df-94c4-092d7b30e4d8",
"tag": null,
"email": null,
"send_type": "To",
"recipient_type": "Contact",
"type": "email_campaign_recipient"
}
]
},
{
"id": "f7f991d6-bdca-488c-9d00-df5b148a5408",
"created_at": 1765163536.014939,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Campaign using a template",
"include_signature": false,
"html": "SOME HTML",
"due_at": 1765163532.026,
"executed_at": 1765163532.051436,
"individual": true,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "SOME HTML",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": [
"scheduledCampaignTag"
],
"recipients_count": 2,
"listed": true,
"type": "email_campaign",
"sent": 2,
"recipients": [
{
"id": "e1ac3a77-4136-41c8-93f1-fde8f7f6e329",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "f7f991d6-bdca-488c-9d00-df5b148a5408",
"tag": null,
"email": null,
"send_type": "To",
"recipient_type": "Brand",
"type": "email_campaign_recipient"
},
{
"id": "349be2ac-bcbd-496a-aa89-014d2ea2738d",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "f7f991d6-bdca-488c-9d00-df5b148a5408",
"tag": null,
"email": null,
"send_type": "To",
"recipient_type": "Agent",
"type": "email_campaign_recipient"
}
]
},
{
"id": "13bfca6d-7fae-484a-81ae-8ccf47c9ad47",
"created_at": 1765163535.953092,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Brand Campaign To {{recipient.email}}",
"include_signature": false,
"html": "<div>Hi\n <img src=\"https://cdn.rechat.com/test.jpg\" />,<img src=\"https://listing.cdn.rechat.com/test.jpg\" />,<img src=\"https://d1rchfjmtfqq3r.cloudfront.net/test.jpg\" />,<img src=\"https://d2j29n432zojb.cloudfront.net/test.jpg\" />\n</div>",
"due_at": 1765163532.026,
"executed_at": 1765163532.051436,
"individual": true,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi ,,,",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": [
"campaignTag"
],
"recipients_count": 2,
"listed": true,
"type": "email_campaign",
"sent": 2,
"recipients": [
{
"id": "7f664947-2512-4262-a5c0-9a4f947eff2b",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "13bfca6d-7fae-484a-81ae-8ccf47c9ad47",
"tag": null,
"email": null,
"send_type": "To",
"recipient_type": "Brand",
"type": "email_campaign_recipient"
},
{
"id": "57ef71e6-80f8-408a-8210-c7807935cd04",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "13bfca6d-7fae-484a-81ae-8ccf47c9ad47",
"tag": null,
"email": null,
"send_type": "To",
"recipient_type": "Agent",
"type": "email_campaign_recipient"
}
]
},
{
"id": "9a27c341-2e99-4b21-b198-27a6cf667873",
"created_at": 1765163535.880235,
"updated_at": 1765163532.051436,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Individual Email From {{sender.display_name}}",
"include_signature": false,
"html": "<div>\n From: {{sender.display_name or \"me\"}}\n </div>\n <div>\n To: {{recipient.display_name or \"there\"}}\n </div>",
"due_at": 1765163532.026,
"executed_at": 1765163532.051436,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "From: {{sender.display_name or \"me\"}}\nTo: {{recipient.display_name or \"there\"}}",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": false,
"archive": false,
"tags": [
"mailGunTag"
],
"recipients_count": 1,
"listed": true,
"type": "email_campaign",
"sent": 1,
"recipients": [
{
"id": "d08141f9-eb5e-41e8-bfdd-870b0f7c01cb",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "9a27c341-2e99-4b21-b198-27a6cf667873",
"tag": null,
"email": "[email protected]",
"send_type": "To",
"recipient_type": "Email",
"type": "email_campaign_recipient"
}
]
},
{
"id": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"created_at": 1765163535.756061,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"subject": "Email Subject",
"include_signature": false,
"html": "<div>Hi\n <img src=\"https://cdn.rechat.com/test.jpg\" />,<img src=\"https://listing.cdn.rechat.com/test.jpg\" />,<img src=\"https://d1rchfjmtfqq3r.cloudfront.net/test.jpg\" />,<img src=\"https://d2j29n432zojb.cloudfront.net/test.jpg\" />\n</div>",
"due_at": 1765163532.026,
"executed_at": 1765163532.051436,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 1,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi ,,,",
"headers": {},
"google_credential": null,
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": false,
"archive": false,
"tags": [
"mailGunTag"
],
"recipients_count": 1,
"listed": true,
"type": "email_campaign",
"sent": 1,
"recipients": [
{
"id": "f819a6a9-07f6-422e-bac3-5932e571134c",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"tag": null,
"email": "[email protected]",
"send_type": "To",
"recipient_type": "Email",
"type": "email_campaign_recipient"
}
]
}
],
"info": {
"count": 5,
"total": 5
}
}Schedule a gmail message ¶
Schedule a gmail messagePOST/emails
If either of credential.deleted_at is not null or credentila.revoked is true is met, then credential is disconnected.
So it should not be allowed to send or read an email if user’s connected account is disconnected.
When a user wants to send an email through Gmail or Outlook, two conditions should be met.
-
credential.deleted_at is nullandcredentila.revoked is false -
credential.scope_summaryincludesmail.send
Every Google and Microsoft connected account has a field with the name scope_summary.
This is all of our avaailable scopes: ["profile", "contacts", "mail.read", "mail.send", "mail.modify", "calendar"]
When a user wants to update email IsRead flag, two conditions should be met.
-
credential.deleted_at is nullandcredentila.revoked is false -
credential.scope_summaryincludesmail.send and mail.modify
Example URI
Body
{
"to": [
{
"email": "[email protected]",
"recipient_type": "Email"
}
],
"cc": [
{
"recipient_type": "Email",
"email": "[email protected]"
}
],
"bcc": [
{
"recipient_type": "Email",
"email": "[email protected]"
}
],
"due_at": "2025-12-08T03:02:18.015Z",
"html": "<div>Hi</div>",
"subject": "schedule gmail message",
"from": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"google_credential": "010aec5c-2dc5-48f1-b0cc-ac58561284ac",
"microsoft_credential": null,
"attachments": [],
"headers": {},
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "fa6706e7-b895-4142-a8c8-5b80e2627076",
"text": "Hi",
"id": "cb45615f-9fb0-4d20-ad46-7561f18e2527"
}200Body
{
"code": "OK",
"data": {
"id": "cb45615f-9fb0-4d20-ad46-7561f18e2527",
"created_at": 1765163538.051799,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "fa6706e7-b895-4142-a8c8-5b80e2627076",
"subject": "schedule gmail message",
"include_signature": false,
"html": "<div>Hi</div>",
"due_at": 1765162938.015,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi",
"headers": {},
"google_credential": "010aec5c-2dc5-48f1-b0cc-ac58561284ac",
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": null,
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0
}
}Schedule a gmail message with attachments ¶
Schedule a gmail message with attachmentsPOST/emails
Example URI
Body
{
"to": [
{
"email": "[email protected]",
"recipient_type": "Email"
}
],
"cc": [
{
"recipient_type": "Email",
"email": "[email protected]"
}
],
"bcc": [
{
"recipient_type": "Email",
"email": "[email protected]"
}
],
"due_at": "2025-12-08T03:12:18.232Z",
"html": "<div>Hi</div>",
"subject": "Email Subject",
"from": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"google_credential": "010aec5c-2dc5-48f1-b0cc-ac58561284ac",
"microsoft_credential": null,
"attachments": [
{
"file": "33d0630e-3d5a-4301-b712-3605ce68ed54",
"is_inline": true,
"content_id": "content_id"
},
{
"url": "https://private-cdn.irish.rechat.com/80a227b2-29a0-11e7-b636-e4a7a08e15d4/b4085fd0-d3e3-11f0-a2d4-1bcac3894d4e.png?Expires=1765249938007&Key-Pair-Id=APKAIIRG223GKFAC4MHA&Signature=VxtXuh3YqoCHu85WhBWkNzVSpiBA759ZJEDdnHaCOY6nyLA8ETOWhJdHqXW4j1BxwsQKT-izqQwKMIzR-3yaW~~pdkHJ~bcZEuWtg0rMUfxcowdKo5M9469FCgrKZ3s46vAEy4zcklLIOYfwhd74FADD-6BpaBrWucZkzYRb9ogt8~mbpvWEsHyagCa62InZXq4~-vOdR83w-eu8GYrFvsd7i8Xao1Y12z9TL9XmuQC1rt~SWYZF0XXKA2WWEArSa5zFMegxzWXoB0~uQohOqoQNNET1J3u0~I9f0OEnCVVtGqY0suGbNEm6-BpENrzB0e-eKra9ZPLzm5H7nAo6Ww__",
"is_inline": true,
"name": "custom_name.jpg",
"content_id": "content_id"
}
],
"headers": {
"in_reply_to": "in_reply_to_id",
"thread_id": "thread_id"
},
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "fa6706e7-b895-4142-a8c8-5b80e2627076",
"text": "Hi",
"id": "99b4de6e-0e2a-4e03-9c0c-181ef8155dae"
}200Body
{
"code": "OK",
"data": {
"id": "99b4de6e-0e2a-4e03-9c0c-181ef8155dae",
"created_at": 1765163538.278055,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "fa6706e7-b895-4142-a8c8-5b80e2627076",
"subject": "Email Subject",
"include_signature": false,
"html": "<div>Hi</div>",
"due_at": 1765163538.232,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi",
"headers": {
"in_reply_to": "in_reply_to_id",
"thread_id": "thread_id"
},
"google_credential": "010aec5c-2dc5-48f1-b0cc-ac58561284ac",
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": null,
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0
}
}Schedule an outlook message ¶
Schedule an outlook messagePOST/emails
Example URI
Body
{
"to": [
{
"email": "[email protected]",
"recipient_type": "Email"
}
],
"due_at": "2025-12-08T03:12:18.077Z",
"html": "<div>Hi</div>",
"subject": "schedule outlook message",
"from": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"google_credential": null,
"microsoft_credential": "82ce8080-544c-4b55-a7c0-91998a8d6b1b",
"attachments": [],
"headers": {},
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "9bb6379b-2919-4df3-b0e6-2592e6dfffa3",
"text": "Hi",
"id": "6aef8d6d-c7b7-4b3b-be00-15f6cac3e142"
}200Body
{
"code": "OK",
"data": {
"id": "6aef8d6d-c7b7-4b3b-be00-15f6cac3e142",
"created_at": 1765163538.108226,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "9bb6379b-2919-4df3-b0e6-2592e6dfffa3",
"subject": "schedule outlook message",
"include_signature": false,
"html": "<div>Hi</div>",
"due_at": 1765163538.077,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi",
"headers": {},
"google_credential": null,
"microsoft_credential": "82ce8080-544c-4b55-a7c0-91998a8d6b1b",
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": null,
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0
}
}Schedule a reply to gmail message ¶
Schedule a reply to gmail messagePOST/emails
- Tip: Use
message_ob.internet_message_idfor setting theheaders.in_reply_to. You are replying to current message, so thein_reply_toof new reply-message should be ainternet_message_idof previous message.
Example URI
Body
{
"to": [
{
"email": "[email protected]",
"recipient_type": "Email"
}
],
"cc": [
{
"recipient_type": "Email",
"email": "[email protected]"
}
],
"bcc": [
{
"recipient_type": "Email",
"email": "[email protected]"
}
],
"due_at": "2025-12-08T03:12:18.129Z",
"html": "<div>Hi</div>",
"subject": "schedule reply to gmail message",
"from": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"google_credential": "010aec5c-2dc5-48f1-b0cc-ac58561284ac",
"microsoft_credential": null,
"attachments": [],
"headers": {
"in_reply_to": "in_reply_to_id",
"thread_id": "thread_id"
},
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "fa6706e7-b895-4142-a8c8-5b80e2627076",
"text": "Hi",
"id": "0247165c-bb20-4155-84f8-d17de2d4bcab"
}200Body
{
"code": "OK",
"data": {
"id": "0247165c-bb20-4155-84f8-d17de2d4bcab",
"created_at": 1765163538.161203,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "fa6706e7-b895-4142-a8c8-5b80e2627076",
"subject": "schedule reply to gmail message",
"include_signature": false,
"html": "<div>Hi</div>",
"due_at": 1765163538.129,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi",
"headers": {
"in_reply_to": "in_reply_to_id",
"thread_id": "thread_id"
},
"google_credential": "010aec5c-2dc5-48f1-b0cc-ac58561284ac",
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": null,
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0
}
}Schedule a reply to outlook message ¶
Schedule a reply to outlook messagePOST/emails
Example URI
Body
{
"to": [
{
"email": "[email protected]",
"recipient_type": "Email"
}
],
"due_at": "2025-12-08T03:12:18.180Z",
"html": "<div>Hi</div>",
"subject": "schedule reply to outlook message",
"from": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"google_credential": null,
"microsoft_credential": "82ce8080-544c-4b55-a7c0-91998a8d6b1b",
"attachments": [],
"headers": {
"message_id": "message_id"
},
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "9bb6379b-2919-4df3-b0e6-2592e6dfffa3",
"text": "Hi",
"id": "a3cbde97-e2e4-43c0-86d3-a7a68c767653"
}200Body
{
"code": "OK",
"data": {
"id": "a3cbde97-e2e4-43c0-86d3-a7a68c767653",
"created_at": 1765163538.217149,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "9bb6379b-2919-4df3-b0e6-2592e6dfffa3",
"subject": "schedule reply to outlook message",
"include_signature": false,
"html": "<div>Hi</div>",
"due_at": 1765163538.18,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi",
"headers": {
"message_id": "message_id"
},
"google_credential": null,
"microsoft_credential": "82ce8080-544c-4b55-a7c0-91998a8d6b1b",
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": null,
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0
}
}Get a gmail campaign ¶
Get a gmail campaignGET/emails/:id?associations[]=email_campaign.emails&associations[]=email_campaign.recipients&associations[]=email_campaign.attachments
Example URI
- id
string(required) Example: cb45615f-9fb0-4d20-ad46-7561f18e2527- associations
string(required) Example: email_campaign.emails,email_campaign.recipients,email_campaign.attachments
200Body
{
"code": "OK",
"data": {
"id": "cb45615f-9fb0-4d20-ad46-7561f18e2527",
"created_at": 1765163538.051799,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "fa6706e7-b895-4142-a8c8-5b80e2627076",
"subject": "schedule gmail message",
"include_signature": false,
"html": "<div>Hi</div>",
"due_at": 1765162938.015,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi",
"headers": {},
"google_credential": "010aec5c-2dc5-48f1-b0cc-ac58561284ac",
"microsoft_credential": null,
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": null,
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0,
"recipients": [
{
"id": "305290fd-0b2b-4858-8fc3-d4dd3fcb4870",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "cb45615f-9fb0-4d20-ad46-7561f18e2527",
"tag": null,
"email": "[email protected]",
"send_type": "To",
"recipient_type": "Email",
"type": "email_campaign_recipient"
},
{
"id": "d2061459-f15f-4e82-9159-c1486d349622",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "cb45615f-9fb0-4d20-ad46-7561f18e2527",
"tag": null,
"email": "[email protected]",
"send_type": "CC",
"recipient_type": "Email",
"type": "email_campaign_recipient"
},
{
"id": "22751dc5-d053-4025-8a7f-0c5923af1c3e",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "cb45615f-9fb0-4d20-ad46-7561f18e2527",
"tag": null,
"email": "[email protected]",
"send_type": "BCC",
"recipient_type": "Email",
"type": "email_campaign_recipient"
}
],
"attachments": null,
"emails": null
}
}Get an outlook campaign ¶
Get an outlook campaignGET/emails/:id
Example URI
- id
string(required) Example: a3cbde97-e2e4-43c0-86d3-a7a68c767653- associations
string(required) Example: email_campaign.emails,email_campaign.recipients
200Body
{
"code": "OK",
"data": {
"id": "a3cbde97-e2e4-43c0-86d3-a7a68c767653",
"created_at": 1765163538.217149,
"updated_at": null,
"deleted_at": null,
"created_by": "80a227b2-29a0-11e7-b636-e4a7a08e15d4",
"brand": "9bb6379b-2919-4df3-b0e6-2592e6dfffa3",
"subject": "schedule reply to outlook message",
"include_signature": false,
"html": "<div>Hi</div>",
"due_at": 1765163538.18,
"executed_at": null,
"individual": false,
"accepted": 0,
"rejected": 0,
"delivered": 0,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"text": "Hi",
"headers": {
"message_id": "message_id"
},
"google_credential": null,
"microsoft_credential": "82ce8080-544c-4b55-a7c0-91998a8d6b1b",
"thread_key": null,
"failed_at": null,
"failed_within": null,
"failure": null,
"notifications_enabled": true,
"archive": false,
"tags": null,
"recipients_count": null,
"listed": true,
"type": "email_campaign",
"sent": 0,
"recipients": [
{
"id": "80ee8ad4-05b0-468a-ba64-bce638da3df0",
"created_at": 1765163532.051436,
"updated_at": null,
"deleted_at": null,
"campaign": "a3cbde97-e2e4-43c0-86d3-a7a68c767653",
"tag": null,
"email": "[email protected]",
"send_type": "To",
"recipient_type": "Email",
"type": "email_campaign_recipient"
}
],
"emails": null
}
}Update message's IsRead status ¶
Update message's IsRead statusPUT/emails/google/:credentialId/messages/:messageId
Example URI
- gcid
string(required) Example: 010aec5c-2dc5-48f1-b0cc-ac58561284ac- mid
string(required) Example: cdd5d515-cfd6-4aaf-9185-4866b9aa7670
Body
{
"status": false
}202Batch update some messages IsRead status ¶
Batch update some messages IsRead statusPUT/emails/google/:credentialId/messages
Example URI
- gcid
string(required) Example: 010aec5c-2dc5-48f1-b0cc-ac58561284ac
Body
{
"status": false,
"messageIds": [
"cdd5d515-cfd6-4aaf-9185-4866b9aa7670"
]
}202Batch move to trash ¶
Batch move to trashPOST/emails/google/:credentialId/trash
Example URI
- gcid
string(required) Example: 010aec5c-2dc5-48f1-b0cc-ac58561284ac
Body
{
"status": false,
"messageIds": [
"cdd5d515-cfd6-4aaf-9185-4866b9aa7670"
]
}202Batch archive ¶
Batch archivePOST/emails/google/:credentialId/archive
Example URI
- gcid
string(required) Example: 010aec5c-2dc5-48f1-b0cc-ac58561284ac
Body
{
"status": false,
"messageIds": [
"cdd5d515-cfd6-4aaf-9185-4866b9aa7670"
]
}202Get User Email Quota by brand ¶
Get User Email Quota by brandGET/brands/:brand/emails/quota
Example URI
- brand
string(required) Example: e5bddc63-401f-4711-81a7-34c4668e4907
200Body
{
"code": "OK",
"data": {
"executed": 0,
"scheduled": 0,
"quota": 30000
}
}Get emails of a campaign ¶
Get emails of a campaignGET/emails/:campaign/emails
start (number) number of rows to skip before starting to return rows
limit (number) limited number of records
order (clicked | opened | unsubscribed | failed | full_name) eg: -failed (optional)
Example URI
- id
string(required) Example: 7f80e918-dcb6-42e0-8118-47e1f1348d27- order
string(required) Example: full_name
200Body
{
"code": "OK",
"data": [
{
"id": "8056048f-d461-4e43-9c60-3b0b6cce2ea7",
"campaign": "7f80e918-dcb6-42e0-8118-47e1f1348d27",
"send_type": "To",
"email_address": "[email protected]",
"accepted": 0,
"rejected": 0,
"delivered": 1,
"failed": 0,
"opened": 0,
"clicked": 0,
"unsubscribed": 0,
"complained": 0,
"stored": 0,
"agent": null,
"error": null,
"campaign_executed_at": "2025-12-08T03:12:12.051Z",
"brand": "e5bddc63-401f-4711-81a7-34c4668e4907",
"type": "email_campaign_email",
"full_name": null,
"profile_image_url": null
}
],
"info": {
"count": 1,
"total": 0
}
}Get information about the domain of the current user ¶
Get information about the domain of the current userGET/emails/domain
When calling this endpoint 3 things may happen:
-
You will receive an error 400. That means the user’s email address is not verified. In that case the whole Email Authentication step must be hidden.
-
You will receive a 404 error. That would mean that the domain for this user is not setup yet.
-
You will receive an object like this:
Example URI
200Body
{
"code": "OK",
"data": {
"id": "ffd17755-aee1-4295-a14f-e3b943966420",
"mailgun_domain": "rechat-mail.rechat.com",
"domain": "rechat.com",
"created_at": "2025-12-08T03:12:12.051Z",
"enabled_at": "2025-12-08T03:12:12.051Z",
"risks": "{low,medium,unknown}"
}
}Attempt at verifying user's domain ¶
Attempt at verifying user's domainPUT/emails/domain/verify
This endpoint will try to verify the domain for the current user and will return the DNS Records necessary for the domain authorization
Example URI
200Body
{
"code": "OK",
"data": [
{
"is_active": true,
"name": "_dmarc.rechat.com",
"record_type": "TXT",
"desired_value": "v=DMARC1; p=none"
}
],
"info": {
"count": 1,
"total": 0
}
}