Skip to main content
GET
/
v1
/
email-messages
/
{emailMessageId}
/
guardian
Run Guardian checks on an email message
curl --request GET \
  --url https://app.loops.so/api/v1/email-messages/{emailMessageId}/guardian \
  --header 'Authorization: Bearer <token>'
{
  "errors": [
    {
      "rule": "missingFallbackContactProperties",
      "title": "Missing contact property fallback",
      "description": "Emails won't be sent to contacts without fallback values",
      "items": [
        {
          "label": "firstName",
          "codeName": "firstName"
        }
      ]
    },
    {
      "rule": "missingButtonHrefs",
      "title": "Missing button link",
      "description": "Buttons won't work without href value",
      "items": [
        {
          "label": "Add your button text"
        }
      ]
    },
    {
      "rule": "missingLinkHrefs",
      "title": "Missing text link",
      "description": "Links won't work without href value",
      "items": [
        {
          "label": "else, now is the perfect time to get it."
        }
      ]
    }
  ],
  "warnings": []
}
Run the same Guardian checks that run in the Loops editor on a saved email message. Use this to validate campaign, workflow, and transactional email content before publishing or sending. Checks depend on the email message’s parent type:
  • Campaign validates contact properties and rendered links and buttons.
  • Workflow validates contact properties, event properties from the workflow’s event trigger, and rendered links and buttons.
  • Transactional validates data variables and rendered links and buttons.
  • System transactional validates required data variables and rendered links and buttons.
This will not work on MJML email messages, as they are not supported in the API.

Request

Path parameters

emailMessageId
string
required
The ID of the email message.

Response

Success

errors
array
required
Guardian rules that failed as errors. Empty when all error checks pass.
warnings
array
required
Guardian rules that failed as warnings. Empty when all warning checks pass. Each entry uses the same shape as entries in errors.
Only rules with at least one matching item are included. When both arrays are empty, all Guardian checks passed.

Error

A 400 Bad Request is returned when emailMessageId is missing or invalid. A 404 Not Found is returned if the email message does not exist. A 409 Conflict is returned when the email message uses MJML format. If the API key is invalid (or content API is not enabled for your team), a 401 Unauthorized is returned.
message
string
required
An error message describing what went wrong.
{
  "errors": [
    {
      "rule": "missingFallbackContactProperties",
      "title": "Missing contact property fallback",
      "description": "Emails won't be sent to contacts without fallback values",
      "items": [
        {
          "label": "firstName",
          "codeName": "firstName"
        }
      ]
    },
    {
      "rule": "missingButtonHrefs",
      "title": "Missing button link",
      "description": "Buttons won't work without href value",
      "items": [
        {
          "label": "Add your button text"
        }
      ]
    },
    {
      "rule": "missingLinkHrefs",
      "title": "Missing text link",
      "description": "Links won't work without href value",
      "items": [
        {
          "label": "else, now is the perfect time to get it."
        }
      ]
    }
  ],
  "warnings": []
}
Last modified on July 2, 2026