App Mail Records

Add a reply to an appmail

Adds an internal reply of the caller on the email and publishes an EAppMailRepliedEvent. Mentions must be of type user, reference users of the tenant and have distinct order values. Returns the updated record.

The record is looked up within the caller's tenant, and the caller must also be allowed to access the entity the email is linked to (employer, customer, lead, workflow or meeting, checked in that order); otherwise that entity's access check rejects the request. The caller also needs the update permission of the linked entity type (employers:write, leads:update, workflows:update, customers:update or meetings:update), checked in the service layer.

Errors: 400 if a mention is invalid; 403 if the update permission is missing; 404 if the record or a mentioned user does not exist.

post/appmail/{id}/replies

Request

  • Base URL
    https://api.surense.com/api/v1
  • URL
    https://api.surense.com/api/v1/appmail/{id}/replies
  • Auth
    OAuth 2
    Client credentials
    Token URL: https://api.surense.com/oauth/token

Path parameters

idstring uuid required

Email record ID (UUID).

Request body

htmlContentstring required

Reply HTML content

Example request

{
  "htmlContent": "Looks good",
  "mentions": [
    {
      "type": "user",
      "entityId": "123e4567-e89b-12d3-a456-426614174000",
      "label": "John Doe",
      "order": 0
    }
  ]
}

Response

OK

tenantIdstring uuid
createdDatestring date-time
createdBystring uuid
creatorNamestring
lastModifiedDatestring date-time
lastModifiedBystring uuid
versioninteger
idstring uuid

Email record ID.

employerIdstring uuid

Employer the email is linked to, if any.

customerIdstring uuid

Customer the email is linked to, if any.

leadIdstring uuid

Lead the email is linked to, if any.

workflowIdstring uuid

Workflow the email is linked to, if any.

meetingIdstring uuid

Meeting the email is linked to, if any.

plainContentstring

Plain-text body of the email.

subjectstring

Email subject.

fromPersonalstring

Display name of the sender.

fromAddressstring

Email address of the sender.

emlSizeinteger

Size of the stored EML file, in bytes.

htmlSizeinteger

Size of the stored HTML file, in bytes.

providerstring

Provider of the connected mailbox the email was sent from through Direct Send; null for any other email.

providerMessageIdstring

The provider's own ID of the sent email, when the provider named one.

providerWebLinkstring

Link opening the sent email in the provider's web client (Outlook only).

Example response

{
  "id": "9b1d4e72-5c3a-4f8b-a6e2-7d0c1b9f3e45",
  "employerId": "0d7e3a92-1f4b-4c8e-b6a5-9e2c7f1d4b38",
  "customerId": "3f2b8c1e-6d4a-4b7e-9a51-2c8e7f0d1a93",
  "leadId": "7c5a1e3b-9d2f-4a68-8b0e-4f6d2a9c1e57",
  "workflowId": "e2b9f4d6-3a1c-4e75-9f08-6b4d1c7a3e92",
  "meetingId": "4a8c2e6f-0b3d-4f19-a7c5-2e9b6d0f4a31",
  "plainContent": "Hello, attached is the renewal offer for your car insurance policy.",
  "subject": "Car insurance renewal offer",
  "fromPersonal": "Dana Levi",
  "fromAddress": "dana@example-agency.co.il",
  "emlSize": 48213,
  "htmlSize": 15872,
  "provider": "gmail"
}

Changes

No recorded changes to this operation across all 1 revision of this API.