Emails

Email a vendor

Sends an email to a vendor at the address on their record.

POST
https://api.portal.magicdoor.com/company-app/emails/vendors/{vendorId}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

vendorIdstringrequired

The vendor to email.

example: 1825337204880932864

Body

application/json

subjectstringrequired

The subject line.

example: Water shut-off Thursday
bodystringrequired

The body of the email. MagicDoor wraps it in the company template.

example: <p>Water will be off Thursday 9am to 1pm for a repair.</p>
attachmentSessionIdsstring[]

Upload sessions to attach, from the email attachment upload session endpoint.

documentTemplateIdsstring[]

Letter templates to render for this recipient and attach as PDFs.

Response

200 · The email that was sent.

idstring

The email.

subjectstring

The subject line.

bodystring

The body as it was sent.

sentstring · date-time

When it was sent.

templateenum<string>

Which MagicDoor template wrapped the body. Emails sent through this API use companyGeneric.

emptycompanyGenericmagicDoor
targetsobject[]

Everyone it went to, with the record behind each address.

filesFile[]

The attachments that were sent with it.

propertyManagerobject

The property manager who sent it. Absent when MagicDoor sent it automatically.

metadataobject

Free-form key/value data MagicDoor stored with the email.

401 · The access token is missing, expired, or not valid.

404 · No vendor with that id belongs to your company.

422 · The vendor record is deactivated, the vendor has no usable email address, or the company has all outbound communications switched off.

This sends a real email

The email leaves immediately, to the vendor's email address. There is no draft step and no way to recall it.

Upload each file through the email attachment upload session endpoint first, then pass the session ids in attachmentSessionIds. Letter templates named in documentTemplateIds are rendered for the vendor and attached as PDFs.

This endpoint and the JSON one share a URL. MagicDoor picks between them on the request's Content-Type.