> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sendrealm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview Automation Effects

> Estimate automation starts and resumes without mutating data or delivering messages.

This read-only endpoint requires `resources.read` and an explicitly selected project. Supply the typed `operation` and `input` for an event, contact, audience membership, or topic preference change. Inspect `matched_automations` and `resumable_runs`; the result is an estimate (`exact: false`) and does not authorize or reserve a later mutation. Personal-key mutations default to suppression; explicitly triggering live effects also requires `automations.trigger` and current role access.


## OpenAPI

````yaml api-reference/openapi.json POST /automation-effects/preview
openapi: 3.0.1
info:
  title: Sendrealm API
  description: >-
    API for email, push, audience resources, domains, campaign drafts,
    templates, events, topics, and automations
  license:
    name: MIT
  version: 0.2.0
servers:
  - url: https://api.sendrealm.com
security:
  - bearerAuth: []
paths:
  /automation-effects/preview:
    post:
      summary: Preview potential automation effects without applying any changes.
      parameters:
        - name: X-Sendrealm-Project-Id
          in: header
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Explicit project context. Required for personal-key project resource
            calls; integration keys retain their configured default. MCP clients
            supply project_id in each tool call instead.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/McpEffectsPreviewRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  data:
                    $ref: '#/components/schemas/McpEffectsPreview'
                  metadata:
                    $ref: '#/components/schemas/PaginationMetadata'
                required:
                  - data
                additionalProperties:
                  $ref: '#/components/schemas/JsonValue'
        '400':
          description: Invalid input with field-level issues.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid, expired or revoked credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Scope, grant or current role does not permit this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    McpEffectsPreviewRequest:
      oneOf:
        - type: object
          properties:
            operation:
              type: string
              description: Mutation to preview.
              enum:
                - ingest_event
            input:
              type: object
              properties:
                event:
                  type: string
                  description: Event name.
                  minLength: 1
                contact_id:
                  type: string
                  description: Contact UUID.
                  format: uuid
                email:
                  type: string
                  description: Contact email.
                  format: email
                external_id:
                  type: string
                  description: Application identity.
                  maxLength: 255
                payload:
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/McpJsonValue'
                correlation:
                  type: object
                  properties:
                    key:
                      type: string
                      description: Business correlation key.
                      minLength: 1
                      maxLength: 100
                    value:
                      type: string
                      description: Business correlation value.
                      minLength: 1
                      maxLength: 255
                  required:
                    - key
                    - value
                  additionalProperties: false
                occurred_at:
                  type: string
                  description: ISO 8601 occurrence time.
                  format: date-time
                idempotency_key:
                  type: string
                  description: Stable replay key.
                  maxLength: 255
                contact:
                  type: object
                  properties:
                    mode:
                      type: string
                      description: Existing-only or upsert identity resolution.
                      enum:
                        - existing
                        - upsert
                    fields:
                      $ref: '#/components/schemas/McpContactFields'
                  additionalProperties: false
              required:
                - event
              additionalProperties: false
          required:
            - operation
            - input
          additionalProperties: false
        - type: object
          properties:
            operation:
              type: string
              description: Mutation to preview.
              enum:
                - create_contact
            input:
              type: object
              properties:
                email:
                  type: string
                  description: Contact email.
                  format: email
                fields:
                  $ref: '#/components/schemas/McpContactFields'
              required:
                - email
              additionalProperties: false
          required:
            - operation
            - input
          additionalProperties: false
        - type: object
          properties:
            operation:
              type: string
              description: Mutation to preview.
              enum:
                - upsert_contact
            input:
              type: object
              properties:
                email:
                  type: string
                  description: Contact email.
                  format: email
                fields:
                  $ref: '#/components/schemas/McpContactFields'
              required:
                - email
              additionalProperties: false
          required:
            - operation
            - input
          additionalProperties: false
        - type: object
          properties:
            operation:
              type: string
              description: Mutation to preview.
              enum:
                - update_contact
            input:
              type: object
              properties:
                contact_id:
                  type: string
                  description: Contact UUID.
                  format: uuid
                email:
                  type: string
                  description: Changed email.
                  format: email
                fields:
                  $ref: '#/components/schemas/McpContactFields'
              required:
                - contact_id
              additionalProperties: false
          required:
            - operation
            - input
          additionalProperties: false
        - type: object
          properties:
            operation:
              type: string
              description: Mutation to preview.
              enum:
                - attach_audience
            input:
              type: object
              properties:
                contact_id:
                  type: string
                  description: Contact UUID.
                  format: uuid
                audience_id:
                  type: string
                  description: Static audience UUID.
                  format: uuid
              required:
                - contact_id
                - audience_id
              additionalProperties: false
          required:
            - operation
            - input
          additionalProperties: false
        - type: object
          properties:
            operation:
              type: string
              description: Mutation to preview.
              enum:
                - remove_audience
            input:
              type: object
              properties:
                contact_id:
                  type: string
                  description: Contact UUID.
                  format: uuid
                audience_id:
                  type: string
                  description: Static audience UUID.
                  format: uuid
              required:
                - contact_id
                - audience_id
              additionalProperties: false
          required:
            - operation
            - input
          additionalProperties: false
        - type: object
          properties:
            operation:
              type: string
              description: Mutation to preview.
              enum:
                - set_topic_subscription
            input:
              type: object
              properties:
                contact_id:
                  type: string
                  description: Contact UUID.
                  format: uuid
                topic_id:
                  type: string
                  description: Topic UUID.
                  format: uuid
                is_subscribed:
                  type: boolean
                  description: Desired subscription state.
              required:
                - contact_id
                - topic_id
                - is_subscribed
              additionalProperties: false
          required:
            - operation
            - input
          additionalProperties: false
      x-sendrealm-mcp-contract: true
      description: Read-only preview; does not apply changes or trigger automations.
    McpEffectsPreview:
      type: object
      properties:
        operation:
          type: string
        automation_effects:
          type: string
          enum:
            - suppress
        read_only:
          type: boolean
          enum:
            - true
        events:
          type: array
          items:
            type: object
            properties:
              event:
                type: string
              source:
                type: string
              identity:
                $ref: '#/components/schemas/McpJsonValue'
              correlation:
                $ref: '#/components/schemas/McpJsonValue'
            required:
              - event
              - source
              - identity
              - correlation
            additionalProperties:
              $ref: '#/components/schemas/JsonValue'
        matched_automations:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              name:
                type: string
              version_id:
                type: string
                format: uuid
              potential_actions:
                type: array
                items:
                  type: object
                  properties:
                    step_key:
                      type: string
                    type:
                      type: string
                  required:
                    - step_key
                    - type
                  additionalProperties: false
            required:
              - id
              - name
              - version_id
              - potential_actions
            additionalProperties:
              $ref: '#/components/schemas/JsonValue'
        resumable_runs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              automation_id:
                type: string
                format: uuid
              wait_id:
                type: string
                format: uuid
            required:
              - id
              - automation_id
              - wait_id
            additionalProperties:
              $ref: '#/components/schemas/JsonValue'
        deduplicated:
          type: boolean
        exact:
          type: boolean
          enum:
            - false
        evaluated_at:
          type: string
          format: date-time
      required:
        - operation
        - automation_effects
        - read_only
        - events
        - matched_automations
        - resumable_runs
        - deduplicated
        - exact
        - evaluated_at
      additionalProperties: false
    PaginationMetadata:
      type: object
      required:
        - total
        - items
        - limit
        - after
        - next
        - has_more
      properties:
        total:
          type: integer
        items:
          type: integer
        limit:
          type: integer
        after:
          type: string
          nullable: true
        next:
          type: string
          nullable: true
        has_more:
          type: boolean
    JsonValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
        - type: boolean
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              $ref: '#/components/schemas/JsonValue'
            issues:
              type: array
              items:
                $ref: '#/components/schemas/ValidationIssue'
    McpJsonValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
        - type: boolean
        - type: array
          items:
            $ref: '#/components/schemas/McpJsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/McpJsonValue'
      description: >-
        JSON application data. Do not include credentials or unnecessary
        personal data.
      x-sendrealm-mcp-contract: true
    McpContactFields:
      type: object
      additionalProperties:
        nullable: true
        oneOf:
          - type: string
          - type: number
          - type: boolean
      description: >-
        Existing audience property keys mapped to scalar values. Supplied fields
        merge; null or an empty string removes a field.
      x-sendrealm-mcp-contract: true
    ValidationIssue:
      type: object
      required:
        - code
        - path
        - message
      properties:
        code:
          type: string
        path:
          type: string
          nullable: true
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Integration key for backend workloads, or a scoped personal key
        (sr_user_) for account discovery and supported project operations. MCP
        accepts only personal keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.