---
updatedAt: 2026-05-26T23:01:16.000Z
agentTools:
  projectIndex: https://developer.servicem8.com/llms.txt
---

# Send an Email

Send an email through the ServiceM8 Messaging API.

## Email Signature

You can include a staff member's email signature in your message by using the `<platform-user-signature />` tag in your `htmlBody` or `textBody`. When this tag is present, the specified staff member's signature will be inserted at that location.

**Important**: When using the `<platform-user-signature />` tag, you must include the `x-impersonate-uuid` header with the UUID of the staff member whose signature you want to include. Without this header, the API will return an error.

### Example:
```html
<p>Hello,</p>
<p>This is the main content of the email.</p>
<platform-user-signature />
<p>Additional footer information</p>
```

Note: The tag is case-insensitive.

Note: you must supply one of `htmlBody` or `textBody` in order to send a message, or you may specify
both parameters. If you don't have a HTML-formatted or text-formatted version available, then simply
supply the version that you do have and omit the other parameter. Submitting an empty string
for either `htmlBody` or `textBody` will result in messages that cannot be viewed on some email clients.

You may specify a **Reply To** address, but the **From** address is controlled by ServiceM8.


# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "version": "1.0.0",
    "title": "Messaging API",
    "description": "The ServiceM8 platform provides add-ons with messaging services. The advantage of sending messages via the platform is consistency. Your emails will take on email signatures users have pre-setup within their account, and Premium SMS services that users have enabled will be immediately available to your app.\n\n# Public Applications Only\nThe ServiceM8 Messaging API is only available to [Public Applications](/docs/authentication). You will need to implement OAuth 2.0 Authentication and obtain an access token before you can use the Messaging API.\n\n# Message Sending Quota\nYour ServiceM8 Email and SMS Services have a set of sending limits to regulate the number of email & sms messages that you can send and the rate at which you can send them. Sending limits benefit all ServiceM8 customers because they help to maintain the trusted relationship between ServiceM8, customers and addons.\n\nSending limits help you to gradually ramp up your sending activity and decrease the likelihood that a mis-configuration will send messages to customers incorrectly.\n\nThe ServiceM8 sending limits are:\n* **Sending Quota** – The maximum number of email/SMS messages that you can send in a 24-hour period. The sending quota reflects a rolling time period. Every time you try to send an email/SMS, ServiceM8 checks how many emails you sent in the previous 24 hours. As long as the total number of emails that you have sent is less than your quota, your send request will be accepted and your message will be sent. If you have already sent your full quota, your send request will be rejected with a throttling exception. For example, if your email sending quota is 500, and you sent 100 emails in the previous 24 hours, then you can send another 400 emails right away. If you have already sent 500 emails in the previous 24 hours, you will not be able to send more emails until some of the previous sending rolls out of its 24-hour window.\n* **Maximum Send Rate** – The maximum number of email/SMS messages that you can send per minute. You can exceed this limit for short bursts, but not for a sustained period of time.\n\n# What Happens When You Reach Your Sending Limits\nIf you reach your sending limits you will receive one of the following errors:\n* 429 Too Many Requests: Maximum sending rate exceeded\n* 429 Too Many Requests: Daily message quota exceeded\n\n# Increasing Your Quota\nYour sending limits will increase if you are sending high-quality messages and we detect that your utilisation is approaching your current limits. Often, the system will automatically increase your quota before you actually need it, and no further action is needed.\n\nIf your existing quota is not adequate for your needs and the system has not automatically increased your quota, you can open an Sending Quota Increase ticket in Support Center to increase your sending quota.\n"
  },
  "servers": [
    {
      "url": "https://api.servicem8.com"
    }
  ],
  "tags": [
    {
      "name": "Email",
      "description": "Operations related to sending email messages"
    }
  ],
  "paths": {
    "/platform_service_email": {
      "post": {
        "tags": [
          "Email"
        ],
        "operationId": "send_email",
        "summary": "Send an Email",
        "description": "Send an email through the ServiceM8 Messaging API.\n\n## Email Signature\n\nYou can include a staff member's email signature in your message by using the `<platform-user-signature />` tag in your `htmlBody` or `textBody`. When this tag is present, the specified staff member's signature will be inserted at that location.\n\n**Important**: When using the `<platform-user-signature />` tag, you must include the `x-impersonate-uuid` header with the UUID of the staff member whose signature you want to include. Without this header, the API will return an error.\n\n### Example:\n```html\n<p>Hello,</p>\n<p>This is the main content of the email.</p>\n<platform-user-signature />\n<p>Additional footer information</p>\n```\n\nNote: The tag is case-insensitive.\n\nNote: you must supply one of `htmlBody` or `textBody` in order to send a message, or you may specify\nboth parameters. If you don't have a HTML-formatted or text-formatted version available, then simply\nsupply the version that you do have and omit the other parameter. Submitting an empty string\nfor either `htmlBody` or `textBody` will result in messages that cannot be viewed on some email clients.\n\nYou may specify a **Reply To** address, but the **From** address is controlled by ServiceM8.\n",
        "parameters": [
          {
            "name": "x-impersonate-uuid",
            "in": "header",
            "required": false,
            "description": "UUID of the staff member to impersonate when using the `<platform-user-signature />` tag. This header is required if you include the signature tag in your email body.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailMessage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "examples": {
                  "success": {
                    "value": {
                      "errorCode": 0,
                      "message": "OK",
                      "messageID": "ABC1234",
                      "submittedAt": "2017-02-12T15:19:21+00:00",
                      "to": "example@example.com"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "examples": {
                  "error": {
                    "value": {
                      "errorCode": 400,
                      "message": "Invalid email address",
                      "submittedAt": "2017-02-12T15:19:21+00:00"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResult"
                },
                "examples": {
                  "rate-limit": {
                    "summary": "Maximum sending rate exceeded",
                    "value": {
                      "errorCode": 429,
                      "message": "Maximum sending rate exceeded"
                    }
                  },
                  "quota-exceeded": {
                    "summary": "Daily message quota exceeded",
                    "value": {
                      "errorCode": 429,
                      "message": "Daily message quota exceeded"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EmailMessage": {
        "type": "object",
        "required": [
          "to",
          "subject"
        ],
        "properties": {
          "to": {
            "type": "string",
            "format": "email",
            "description": "Recipient email address"
          },
          "cc": {
            "type": "string",
            "format": "email",
            "description": "Carbon copy recipient email address"
          },
          "replyTo": {
            "type": "string",
            "format": "email",
            "description": "Reply-to email address"
          },
          "subject": {
            "type": "string",
            "description": "Email subject line"
          },
          "htmlBody": {
            "type": "string",
            "description": "HTML-formatted email body. At least one of htmlBody or textBody must be provided. You can use the `<platform-user-signature />` tag to include a staff member's email signature at a specific location. When using the signature tag, you must include the x-impersonate-uuid header."
          },
          "textBody": {
            "type": "string",
            "description": "Plain text email body. At least one of htmlBody or textBody must be provided. You can use the `<platform-user-signature />` tag to include a staff member's email signature at a specific location (it will be converted to plain text). When using the signature tag, you must include the x-impersonate-uuid header."
          },
          "regardingJobUUID": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the job that this message is regarding. This is used to link the message to the job in ServiceM8, causing the email to appear in the job diary. If you do not specify a job UUID, the message will not be linked to any job."
          },
          "attachments": {
            "type": "array",
            "description": "Array of attachment UUIDs to include with the email. Each UUID must reference an existing attachment in the system.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "SendResult": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "integer",
            "description": "Integer error code (0 for success)"
          },
          "message": {
            "type": "string",
            "description": "Human-readable description of the result of the Sending operation"
          },
          "messageID": {
            "type": "string",
            "description": "Unique reference number identifying the message that was sent"
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 formatted date at which the message was submitted"
          },
          "to": {
            "type": "string",
            "description": "Recipient of the message that was sent (phone number or email address)"
          }
        }
      }
    }
  }
}
````