{
  "openapi": "3.1.0",
  "info": {
    "title": "Motorical Public API: Communications API (marketing email)",
    "version": "1.12.0",
    "description": "Communications API (marketing email). Part of the full specification at https://docs.motorical.com/openapi.json (same version, same operationIds). Transactional email HTTP API and analytics for Motorical Sending SMTP — same job class as SendGrid/Postmark-style send APIs. One Motor Block per project: an isolated sending stream with its own domain, auth, keys, SMTP credentials, rates, logs, webhooks, and automation. Developer sandbox: unpaid agent onboarding uses a Motorical-owned `.sandbox` domain (instant, no DNS) or a sandbox Motor Block on your own fully verified domain (on a Free account, created automatically once DKIM and SPF pass when automatic provisioning is enabled; otherwise call the provision route), with outbound locked to an allowlist until convert + Motorical Plan. Onboarding auth: register → verify-code (returns a single-use setupToken) → set-password {email, password, setupToken} → dashboard JWT (~15m) + refreshToken (7d). Agents store refreshToken and POST /api/auth/refresh with JSON body (cookies optional). After domain ownership verify, call POST /api/public/v1/domains/{id}/check-dns (or re-call verify) to flip dkim_configured/spf_configured before /v1/send. Domains are account-wide, not Motor-Block-scoped (a Motor Block is created from a verified domain, not the reverse) — GET/POST /api/public/v1/domains* need no motorBlockId. Public API covers email sending, analytics, logs, configuration, domain management, domain health, webhooks, and exports. SMTP submission is an out-of-band protocol on mail.motorical.com:2587 (STARTTLS) or :2465 (implicit TLS) using password, OAuth 2.0 access token as SMTP password (or XOAUTH2), or mTLS + password — see https://docs.motorical.com/smtp-integration/authentication-methods. Do not use OAuth access tokens or Bearer tokens on POST /v1/send (Motor Block ApiKey mk_live_ only)."
  },
  "servers": [
    {
      "url": "https://api.motorical.com",
      "description": "Motorical production API. The only host that serves the HTTP Send API (/v1/*); also serves the Public API (/api/public/v1/*) and the dashboard/auth API (/api/*). Use this host for every API call except the Communications API (/comm-api/*): those operations name https://motorical.com as their own server, and api.motorical.com answers 404 for /comm-api."
    },
    {
      "url": "https://motorical.com",
      "description": "Dashboard host — OAuth AS endpoints. Also answers /api/* and /api/public/v1/*, but POST /v1/send is NOT served here (nginx answers 405)."
    }
  ],
  "tags": [
    {
      "name": "Communications",
      "description": "Communications Block lists, templates, campaigns, suppressions, and analytics"
    }
  ],
  "paths": {
    "/api/comm/tenant": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Discover or provision Communications workspaces",
        "servers": [
          {
            "url": "https://api.motorical.com",
            "description": "Motorical production API"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant entitlement required"
          },
          "404": {
            "description": "Not found"
          }
        },
        "operationId": "getCommsTenant"
      }
    },
    "/comm-api/api/health": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Communications API health",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "commsHealth"
      }
    },
    "/comm-api/api/workspaces": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List Communications workspaces",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 22",
                      "slug": "default",
                      "isDefault": true,
                      "status": "active",
                      "createdAt": "2025-09-08T18:18:59.385Z",
                      "updatedAt": "2026-11-24T22:39:32.697Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "commsListWorkspaces"
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create a Communications workspace",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "operationId": "commsCreateWorkspace"
      }
    },
    "/comm-api/api/workspaces/{id}": {
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update a Communications workspace",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "operationId": "commsUpdateWorkspace"
      },
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Delete a Communications workspace and everything in it (irreversible)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`. Permanently deletes the workspace and everything in it: its people, lists, templates, campaigns and webhooks. This cannot be undone. Call it first with { \"dryRun\": true } to get the counts that would go (willDelete: people, lists, templates, campaigns) and nothing is deleted. The real call must repeat the workspace name exactly: { \"confirmName\": \"<name>\" } (400 CONFIRM_NAME_MISMATCH). Refused with 409 WORKSPACE_IS_DEFAULT for the default workspace (make another workspace the default first) and with 409 WORKSPACE_HAS_ACTIVE_CAMPAIGNS, listing the campaigns, while any campaign is scheduled or sending. Account suppressions are shared by every workspace and are not touched, and the sending Motor Block stays in your account. Another account's workspace answers 404. This is a dashboard-grade action: an MCP assistant can never delete a workspace.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "CONFIRM_NAME_MISMATCH",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Workspace not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "WORKSPACE_IS_DEFAULT or WORKSPACE_HAS_ACTIVE_CAMPAIGNS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "commsDeleteWorkspace"
      }
    },
    "/comm-api/api/workspaces/{id}/motor-blocks": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List Motor Blocks assigned to a workspace",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "motorBlockId": "00000000-0000-4000-8000-000000000001",
                      "assignedAt": "2026-10-11T17:27:52.318Z",
                      "name": "Example 12",
                      "type": "marketing",
                      "active": true,
                      "domain": "example.com",
                      "missing": false,
                      "isCommsCompanion": true
                    },
                    {
                      "motorBlockId": "00000000-0000-4000-8000-000000000002",
                      "assignedAt": "2026-10-11T17:27:52.318Z",
                      "name": "Example 45",
                      "type": "marketing",
                      "active": true,
                      "domain": "example2.com",
                      "missing": false,
                      "isCommsCompanion": true
                    },
                    {
                      "motorBlockId": "00000000-0000-4000-8000-000000000003",
                      "assignedAt": "2026-10-11T17:27:52.318Z",
                      "name": "Example 17",
                      "type": "marketing",
                      "active": true,
                      "domain": "example.com",
                      "missing": false,
                      "isCommsCompanion": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "commsListWorkspaceMotorBlocks"
      },
      "put": {
        "tags": [
          "Communications"
        ],
        "summary": "Replace workspace Motor Block assignments",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "operationId": "commsSetWorkspaceMotorBlocks"
      }
    },
    "/comm-api/api/workspaces/{id}/motor-blocks/from-domain": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Resolve a sending domain to a companion marketing Motor Block",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "operationId": "commsAddSendingIdentity"
      }
    },
    "/comm-api/api/workspaces/{id}/settings/consent": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get workspace consent settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "click_consent_enabled": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "commsGetWorkspaceConsentSettings"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update workspace consent settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "operationId": "commsUpdateWorkspaceConsentSettings"
      }
    },
    "/comm-api/api/workspaces/{id}/settings/open-tracking": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get workspace open-tracking settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "open_tracking_enabled": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "commsGetWorkspaceOpenTrackingSettings"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update workspace open-tracking settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "operationId": "commsUpdateWorkspaceOpenTrackingSettings"
      }
    },
    "/comm-api/api/workspaces/{id}/settings/unsubscribe": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get workspace unsubscribe landing page",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "unsubscribe_landing_url": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "commsGetWorkspaceUnsubscribeSettings"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update workspace unsubscribe landing page",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Account-scoped Communications Block endpoint. Requires caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...`. Does not require `X-Tenant-Id`. The same setting as PATCH /settings/unsubscribe, for any workspace of your account without switching X-Tenant-Id. Another account's workspace answers 404 before anything is checked or saved. Body: { \"unsubscribe_landing_url\": \"https://...\" }, or null to use the default Motorical page. The URL must be https, at most 2048 characters, without credentials, on a domain verified in your account or a subdomain of one (400 LANDING_URL_INVALID, 400 LANDING_DOMAIN_NOT_VERIFIED).",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "LANDING_URL_INVALID or LANDING_DOMAIN_NOT_VERIFIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Workspace not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "operationId": "commsUpdateWorkspaceUnsubscribeSettings"
      }
    },
    "/comm-api/api/lists": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List contact lists",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Each list is returned as a card: description, kind, source_label, provenance, snapshot and computed counts (see GET /lists/{id}), plus description_check.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "contact_count": 442,
                      "suppressed_count": 0,
                      "filter_definition": null,
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 23",
                      "description": "Example content",
                      "type": "user",
                      "kind": "customers",
                      "source_label": "Example content",
                      "created_at": "2026-11-04T15:27:52.010Z",
                      "updated_at": "2026-11-04T15:29:06.596Z",
                      "archived_at": null,
                      "provenance": {
                        "notes": [
                          {
                            "at": "2026-11-04T15:29:06.596Z",
                            "by": "api",
                            "text": "Example content"
                          }
                        ],
                        "origin": "manual",
                        "created_at": "2026-11-04T15:27:52.010Z",
                        "created_by": "api",
                        "notes_total": 1
                      },
                      "member_count": 442,
                      "eligible_count": 442,
                      "unsubscribed_count": 0,
                      "bounced_count": 0,
                      "other_inactive_count": 0,
                      "suppressed_active_count": 0,
                      "last_changed_at": "2026-11-04T15:29:06.596Z",
                      "used_by": [],
                      "used_by_count": 0,
                      "snapshot": false,
                      "snapshot_at": null,
                      "description_check": {
                        "ok": true,
                        "warnings": []
                      }
                    },
                    {
                      "contact_count": 1123,
                      "suppressed_count": 0,
                      "filter_definition": null,
                      "id": "00000000-0000-4000-8000-000000000002",
                      "name": "Example 24",
                      "description": "Example content",
                      "type": "user",
                      "kind": "customers",
                      "source_label": "Example content",
                      "created_at": "2026-11-04T15:21:09.200Z",
                      "updated_at": "2026-11-04T15:50:21.366Z",
                      "archived_at": null,
                      "provenance": {
                        "notes": [
                          {
                            "at": "2026-11-04T15:22:32.410Z",
                            "by": "api",
                            "text": "Example content"
                          },
                          {
                            "at": "2026-11-04T15:23:54.989Z",
                            "by": "api",
                            "text": "Example content"
                          },
                          {
                            "at": "2026-11-04T15:24:31.308Z",
                            "by": "api",
                            "text": "Example content"
                          },
                          {
                            "at": "2026-11-04T15:50:21.366Z",
                            "by": "api",
                            "text": "Example content"
                          }
                        ],
                        "origin": "manual",
                        "created_at": "2026-11-04T15:21:09.200Z",
                        "created_by": "api",
                        "notes_total": 4
                      },
                      "member_count": 1123,
                      "eligible_count": 1123,
                      "unsubscribed_count": 0,
                      "bounced_count": 0,
                      "other_inactive_count": 0,
                      "suppressed_active_count": 0,
                      "last_changed_at": "2026-11-04T15:50:21.366Z",
                      "used_by": [],
                      "used_by_count": 0,
                      "snapshot": false,
                      "snapshot_at": null,
                      "description_check": {
                        "ok": true,
                        "warnings": []
                      }
                    },
                    {
                      "contact_count": 3,
                      "suppressed_count": 1,
                      "filter_definition": null,
                      "id": "00000000-0000-4000-8000-000000000003",
                      "name": "Example 25",
                      "description": "Example content",
                      "type": "user",
                      "kind": null,
                      "source_label": null,
                      "created_at": "2026-07-11T13:08:44.142Z",
                      "updated_at": "2026-10-26T18:36:02.048Z",
                      "archived_at": null,
                      "provenance": {
                        "notes": [],
                        "notes_total": 0
                      },
                      "member_count": 3,
                      "eligible_count": 2,
                      "unsubscribed_count": 0,
                      "bounced_count": 1,
                      "other_inactive_count": 0,
                      "suppressed_active_count": 0,
                      "last_changed_at": "2026-10-26T18:36:02.048Z",
                      "used_by": [],
                      "used_by_count": 0,
                      "snapshot": false,
                      "snapshot_at": null,
                      "description_check": {
                        "ok": false,
                        "warnings": [
                          {
                            "type": "description_boilerplate",
                            "message": "This description was generated by the system and says nothing about the purpose. Replace it with what the list is for, who is in it and where it came from."
                          }
                        ]
                      }
                    },
                    {
                      "contact_count": 5,
                      "suppressed_count": 1,
                      "filter_definition": null,
                      "id": "00000000-0000-4000-8000-000000000004",
                      "name": "Example 26",
                      "description": "Example content",
                      "type": "user",
                      "kind": null,
                      "source_label": null,
                      "created_at": "2025-12-12T14:33:07.407Z",
                      "updated_at": "2026-10-26T18:36:02.048Z",
                      "archived_at": null,
                      "provenance": {
                        "notes": [],
                        "notes_total": 0
                      },
                      "member_count": 5,
                      "eligible_count": 4,
                      "unsubscribed_count": 0,
                      "bounced_count": 1,
                      "other_inactive_count": 0,
                      "suppressed_active_count": 0,
                      "last_changed_at": "2026-10-26T18:36:02.048Z",
                      "used_by": [],
                      "used_by_count": 0,
                      "snapshot": false,
                      "snapshot_at": null,
                      "description_check": {
                        "ok": false,
                        "warnings": [
                          {
                            "type": "description_boilerplate",
                            "message": "This description was generated by the system and says nothing about the purpose. Replace it with what the list is for, who is in it and where it came from."
                          }
                        ]
                      }
                    },
                    {
                      "contact_count": 6,
                      "suppressed_count": 1,
                      "filter_definition": null,
                      "id": "00000000-0000-4000-8000-000000000005",
                      "name": "Example 27",
                      "description": "Example content",
                      "type": "user",
                      "kind": null,
                      "source_label": null,
                      "created_at": "2025-12-12T14:16:28.356Z",
                      "updated_at": "2026-11-04T20:26:31.878Z",
                      "archived_at": null,
                      "provenance": {
                        "notes": [
                          {
                            "at": "2026-11-04T20:26:31.878Z",
                            "by": "api",
                            "text": "Example content"
                          }
                        ],
                        "notes_total": 1
                      },
                      "member_count": 6,
                      "eligible_count": 5,
                      "unsubscribed_count": 0,
                      "bounced_count": 1,
                      "other_inactive_count": 0,
                      "suppressed_active_count": 0,
                      "last_changed_at": "2026-11-04T20:26:31.878Z",
                      "used_by": [
                        {
                          "id": "00000000-0000-4000-8000-000000000006",
                          "name": "Example 28",
                          "status": "draft",
                          "role": "include",
                          "in_recycle_bin": true
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000007",
                          "name": "Example 29",
                          "status": "draft",
                          "role": "include",
                          "in_recycle_bin": false
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000008",
                          "name": "Example 30",
                          "status": "completed",
                          "role": "include",
                          "in_recycle_bin": false
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000009",
                          "name": "Example 31",
                          "status": "draft",
                          "role": "include",
                          "in_recycle_bin": true
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000010",
                          "name": "Example 32",
                          "status": "completed",
                          "role": "include",
                          "in_recycle_bin": false
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000011",
                          "name": "Example 33",
                          "status": "completed",
                          "role": "include",
                          "in_recycle_bin": false
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000012",
                          "name": "Example 34",
                          "status": "completed",
                          "role": "include",
                          "in_recycle_bin": false
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000013",
                          "name": "Example 35",
                          "status": "completed",
                          "role": "include",
                          "in_recycle_bin": false
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000014",
                          "name": "Example 36",
                          "status": "completed",
                          "role": "include",
                          "in_recycle_bin": false
                        },
                        {
                          "id": "00000000-0000-4000-8000-000000000015",
                          "name": "Example 37",
                          "status": "completed",
                          "role": "include",
                          "in_recycle_bin": false
                        }
                      ],
                      "used_by_count": 13,
                      "snapshot": false,
                      "snapshot_at": null,
                      "description_check": {
                        "ok": false,
                        "warnings": [
                          {
                            "type": "description_too_short",
                            "message": "The description is too short to be useful (at least 30 characters). Say what the list is for, who is in it and where it came from."
                          }
                        ]
                      }
                    },
                    {
                      "contact_count": 14,
                      "suppressed_count": 7,
                      "filter_definition": {},
                      "id": "00000000-0000-4000-8000-000000000016",
                      "name": "Example 38",
                      "description": "Example content",
                      "type": "smart",
                      "kind": "derived",
                      "source_label": null,
                      "created_at": "2025-11-25T14:00:25.018Z",
                      "updated_at": "2026-10-26T18:36:02.048Z",
                      "archived_at": null,
                      "provenance": {
                        "filter": {},
                        "origin": "filter",
                        "created_at": "2025-11-25T14:00:25Z",
                        "created_by": "dashboard",
                        "snapshot_at": "2025-11-25T14:00:25Z",
                        "notes": [],
                        "notes_total": 0
                      },
                      "member_count": 14,
                      "eligible_count": 7,
                      "unsubscribed_count": 5,
                      "bounced_count": 2,
                      "other_inactive_count": 0,
                      "suppressed_active_count": 0,
                      "last_changed_at": "2026-10-26T18:36:02.048Z",
                      "used_by": [],
                      "used_by_count": 0,
                      "snapshot": true,
                      "snapshot_at": "2025-11-25T14:00:25Z",
                      "description_check": {
                        "ok": false,
                        "warnings": [
                          {
                            "type": "description_boilerplate",
                            "message": "This description was generated by the system and says nothing about the purpose. Replace it with what the list is for, who is in it and where it came from."
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListLists"
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create a contact list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). A list explains itself. Card fields: description (what it is for, max 1000, no counts), kind (one of subscribers, customers, leads, event, test, reengagement, derived, system_view, other) and source_label (where the contacts came from, max 200). The API only warns about a thin description (description_check); the MCP and the dashboard insist on a good one. Send X-Motorical-Actor: agent, dashboard or api to record who made it (informational, never a permission).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "X-Motorical-Actor",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "dashboard",
                "api"
              ]
            },
            "description": "Optional. Who is acting; recorded on the list card (provenance.created_by). Informational: it never grants or limits anything. Defaults to api."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "INVALID_KIND or INVALID_FIELD",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCreateList"
      },
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Bulk delete contact lists",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Lists in use are refused and named in failed[] with reason LIST_IN_USE (same rule as the single delete); the rest are deleted. Takes the same contacts (keep or delete_orphans) and dry_run fields as the single delete. If every list is in use the answer is 409 LIST_IN_USE.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "LIST_IN_USE for every list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteLists"
      }
    },
    "/comm-api/api/lists/from-filter": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create a smart list from filters",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Copies the matching contacts into a new list ONCE (max 10000): a snapshot, which does not follow the filter later. The card says so (snapshot: true) and records the filter. Accepts the same card fields as POST /lists.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "X-Motorical-Actor",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "dashboard",
                "api"
              ]
            },
            "description": "Optional. Who is acting; recorded on the list card (provenance.created_by). Informational: it never grants or limits anything. Defaults to api."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCreateListFromFilter"
      }
    },
    "/comm-api/api/lists/{id}": {
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update a contact list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). This is a partial update: only the fields you send change (name, description, kind, source_label); null clears one. The card keeps its provenance (who made the list, how, when, with dated notes). Warnings about a thin description come back in description_check, never as a refusal.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Motorical-Actor",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "dashboard",
                "api"
              ]
            },
            "description": "Optional. Who is acting; recorded on the list card (provenance.created_by). Informational: it never grants or limits anything. Defaults to api."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "INVALID_KIND or INVALID_FIELD",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpdateList"
      },
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Delete a contact list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). A list that a draft, scheduled or sending campaign sends to, or that ANY campaign excludes (finished or not), cannot be deleted: 409 LIST_IN_USE names the campaigns (used_by with role include or exclude, used_by_count). Deleting it would silently change who those campaigns reach. Query or body field contacts: keep (default) leaves the people in the workspace; delete_orphans also erases the people who are on no other list. People who unsubscribed, bounced, complained or are suppressed are always kept. dry_run=true returns the numbers (candidates, would_delete, kept) and changes nothing. The answer carries contacts: { mode, candidates, deleted, kept }.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "LIST_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteList"
      },
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get one contact list as a card",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). One list as a card. Written by you: name, description, kind, source_label. Recorded: provenance (created_by, origin, sources, excludes, filter, snapshot_at and dated notes). Computed on every read, never stored: member_count, eligible_count (active, not deleted, not suppressed), unsubscribed_count, bounced_count, other_inactive_count, suppressed_count; used_by and used_by_count (campaigns that send to OR exclude it, each with role include or exclude, recycle bin included); snapshot (true when the membership was copied once and will not follow its source); description_check (warnings only).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "filter_definition": null,
                    "id": "00000000-0000-4000-8000-000000000001",
                    "name": "Example 23",
                    "description": "Example content",
                    "type": "user",
                    "kind": "customers",
                    "source_label": "Example content",
                    "created_at": "2026-11-04T15:27:52.010Z",
                    "updated_at": "2026-11-04T15:29:06.596Z",
                    "archived_at": null,
                    "provenance": {
                      "notes": [
                        {
                          "at": "2026-11-04T15:29:06.596Z",
                          "by": "api",
                          "text": "Example content"
                        }
                      ],
                      "origin": "manual",
                      "created_at": "2026-11-04T15:27:52.010Z",
                      "created_by": "api",
                      "notes_total": 1
                    },
                    "member_count": 442,
                    "eligible_count": 442,
                    "unsubscribed_count": 0,
                    "bounced_count": 0,
                    "other_inactive_count": 0,
                    "suppressed_active_count": 0,
                    "last_changed_at": "2026-11-04T15:29:06.596Z",
                    "used_by": [],
                    "used_by_count": 0,
                    "snapshot": false,
                    "snapshot_at": null,
                    "description_check": {
                      "ok": true,
                      "warnings": []
                    },
                    "contact_count": 442,
                    "suppressed_count": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "List not found in this workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetList"
      }
    },
    "/comm-api/api/lists/{id}/contacts": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List contacts in a list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "items": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "email": "recipient@example.com",
                        "name": "Example 137",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "email": "recipient@example.com",
                        "name": "Example 138",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "email": "recipient@example.com",
                        "name": "Example 139",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000004",
                        "email": "recipient@example.com",
                        "name": "Example 140",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "email": "recipient@example.com",
                        "name": "Example 141",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000006",
                        "email": "recipient@example.com",
                        "name": "Example 142",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "email": "recipient@example.com",
                        "name": "Example 143",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000008",
                        "email": "recipient@example.com",
                        "name": "Example 144",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "email": "recipient@example.com",
                        "name": "Example 145",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000010",
                        "email": "recipient@example.com",
                        "name": "Example 146",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000011",
                        "email": "recipient@example.com",
                        "name": "Example 147",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "email": "recipient@example.com",
                        "name": "Example 148",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000013",
                        "email": "recipient@example.com",
                        "name": "Example 149",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000014",
                        "email": "recipient@example.com",
                        "name": "Example 150",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000015",
                        "email": "recipient@example.com",
                        "name": "Example 151",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000016",
                        "email": "recipient@example.com",
                        "name": "Example 152",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000017",
                        "email": "recipient@example.com",
                        "name": "Example 153",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000018",
                        "email": "recipient@example.com",
                        "name": "Example 154",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000019",
                        "email": "recipient@example.com",
                        "name": "Example 155",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000020",
                        "email": "recipient@example.com",
                        "name": "Example 156",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000021",
                        "email": "recipient@example.com",
                        "name": "Example 157",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000022",
                        "email": "recipient@example.com",
                        "name": "Example 158",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000023",
                        "email": "recipient@example.com",
                        "name": "Example 159",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000024",
                        "email": "recipient@example.com",
                        "name": "Example 160",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000025",
                        "email": "recipient@example.com",
                        "name": "Example 161",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000026",
                        "email": "recipient@example.com",
                        "name": "Example 162",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000027",
                        "email": "recipient@example.com",
                        "name": "Example 163",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000028",
                        "email": "recipient@example.com",
                        "name": "Example 164",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000029",
                        "email": "recipient@example.com",
                        "name": "Example 165",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000030",
                        "email": "recipient@example.com",
                        "name": "Example 166",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000031",
                        "email": "recipient@example.com",
                        "name": "Example 167",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000032",
                        "email": "recipient@example.com",
                        "name": "Example 168",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000033",
                        "email": "recipient@example.com",
                        "name": "Example 169",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000034",
                        "email": "recipient@example.com",
                        "name": "Example 170",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000035",
                        "email": "recipient@example.com",
                        "name": "Example 171",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000036",
                        "email": "recipient@example.com",
                        "name": "Example 172",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000037",
                        "email": "recipient@example.com",
                        "name": "Example 173",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000038",
                        "email": "recipient@example.com",
                        "name": "Example 174",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000039",
                        "email": "recipient@example.com",
                        "name": "Example 175",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000040",
                        "email": "recipient@example.com",
                        "name": "Example 176",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000041",
                        "email": "recipient@example.com",
                        "name": "Example 177",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000042",
                        "email": "recipient@example.com",
                        "name": "Example 178",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000043",
                        "email": "recipient@example.com",
                        "name": "Example 179",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000044",
                        "email": "recipient@example.com",
                        "name": "Example 180",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000045",
                        "email": "recipient@example.com",
                        "name": "Example 181",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000046",
                        "email": "recipient@example.com",
                        "name": "Example 182",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000047",
                        "email": "recipient@example.com",
                        "name": "Example 183",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000048",
                        "email": "recipient@example.com",
                        "name": "Example 184",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000049",
                        "email": "recipient@example.com",
                        "name": "Example 185",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000050",
                        "email": "recipient@example.com",
                        "name": "Example 186",
                        "phone": null,
                        "identity_type": null,
                        "identity_name": null,
                        "status": "active",
                        "quality_index": 50,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null
                      }
                    ],
                    "total": 442
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListListContacts"
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Add contacts to a list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsAddListContact"
      }
    },
    "/comm-api/api/lists/{id}/contacts/{contactId}": {
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Remove a contact from a list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsRemoveFromList"
      }
    },
    "/comm-api/api/lists/{id}/contacts/import": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Import list contacts from CSV",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Imports a CSV file (multipart field file, at most 10 MB). Query or form fields: dryRun=true validates without writing; consentGiven=true is the list owner's own statement that these people agreed to receive marketing email. Tolerates a UTF-8 BOM, a semicolon delimiter, a title row above the header and common header aliases (for example Email Address). An unsubscribed or bounced contact is never re-activated or given consent. A name or company value that looks like a spreadsheet formula rejects the whole file (400, with the rows named); the JSON route rejects only that row. At most 10 uploads per 15 minutes per workspace. For up to 1001 rows prefer the JSON route (per-row results).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Motorical-Actor",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "dashboard",
                "api"
              ]
            },
            "description": "Optional. Who is acting; recorded on the list card (provenance.created_by). Informational: it never grants or limits anything. Defaults to api."
          },
          {
            "name": "dryRun",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "consentGiven",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Import (or dry run) result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "processed": {
                          "type": "integer"
                        },
                        "added": {
                          "type": "integer",
                          "description": "Put on the list"
                        },
                        "upserts": {
                          "type": "integer",
                          "description": "Already on the list"
                        },
                        "errors": {
                          "type": "integer"
                        },
                        "errorSamples": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "duplicatesCollapsed": {
                          "type": "integer"
                        },
                        "skippedTitleRow": {
                          "type": "boolean"
                        },
                        "delimiter": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No email column found (the detected columns are listed), invalid CSV, or CSV injection detected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "List not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "413": {
            "description": "File larger than 10 MB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "More than 10 CSV uploads in 15 minutes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "dryRun": {
                    "type": "boolean"
                  },
                  "consentGiven": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsImportContacts"
      }
    },
    "/comm-api/api/lists/{id}/contacts/export": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Export list contacts",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsExportListContacts"
      }
    },
    "/comm-api/api/contacts/upsert": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create or update a contact",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpsertContact"
      }
    },
    "/comm-api/api/contacts/{id}": {
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Delete a contact",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteContact"
      }
    },
    "/comm-api/api/contacts/{id}/erase-impact": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "What erasing a contact would remove (lists, campaign statistics, consent records), before you confirm",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). What DELETE /contacts/{id} would remove, without removing anything: the contact (email, whether it has a name, status), lists[] it is on, campaign_events_unlinked, consent_records_deleted, and whether a suppression exists (it stays). Read-only.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Contact not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetContactEraseImpact"
      }
    },
    "/comm-api/api/contacts/{id}/unsubscribe": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Unsubscribe a contact",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUnsubscribeContact"
      }
    },
    "/comm-api/api/contacts/{id}/resubscribe": {
      "put": {
        "tags": [
          "Communications"
        ],
        "summary": "Resubscribe a contact",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsResubscribeContact"
      }
    },
    "/comm-api/api/templates": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List templates",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Each template also carries description, kind, derived_from and description_check. Lists the workspace templates (no bodies). Each carries used_by_count: how many campaigns use it, including finished campaigns and campaigns in the recycle bin.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 39",
                      "subject": "Your receipt",
                      "type": "html",
                      "description": "Example content",
                      "kind": "test",
                      "derived_from": null,
                      "created_at": "2026-11-04T19:57:20.286Z",
                      "updated_at": "2026-11-23T14:24:00.882Z",
                      "used_by_count": 2,
                      "description_check": {
                        "ok": true,
                        "warnings": []
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000002",
                      "name": "Example 40",
                      "subject": "Your receipt",
                      "type": "html",
                      "description": "Example content",
                      "kind": "announcement",
                      "derived_from": null,
                      "created_at": "2026-11-04T18:29:37.731Z",
                      "updated_at": "2026-11-04T18:29:37.731Z",
                      "used_by_count": 3,
                      "description_check": {
                        "ok": true,
                        "warnings": []
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000003",
                      "name": "Example 41",
                      "subject": "Your receipt",
                      "type": "html",
                      "description": "Example content",
                      "kind": "announcement",
                      "derived_from": null,
                      "created_at": "2026-11-04T16:01:36.177Z",
                      "updated_at": "2026-11-04T16:01:36.177Z",
                      "used_by_count": 1,
                      "description_check": {
                        "ok": true,
                        "warnings": []
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000004",
                      "name": "Example 42",
                      "subject": "Your receipt",
                      "type": "html",
                      "description": null,
                      "kind": null,
                      "derived_from": null,
                      "created_at": "2026-09-12T20:18:52.019Z",
                      "updated_at": "2026-09-13T11:57:09.723Z",
                      "used_by_count": 7,
                      "description_check": {
                        "ok": false,
                        "warnings": [
                          {
                            "type": "description_missing",
                            "message": "This template has no description. Say what it is for and when to use it, so nobody (and no agent) has to guess from the name."
                          }
                        ]
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000005",
                      "name": "Example 43",
                      "subject": "Your receipt",
                      "type": "html",
                      "description": null,
                      "kind": null,
                      "derived_from": null,
                      "created_at": "2025-11-14T14:04:42.032Z",
                      "updated_at": "2026-07-21T20:57:07.619Z",
                      "used_by_count": 0,
                      "description_check": {
                        "ok": false,
                        "warnings": [
                          {
                            "type": "description_missing",
                            "message": "This template has no description. Say what it is for and when to use it, so nobody (and no agent) has to guess from the name."
                          }
                        ]
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000006",
                      "name": "Example 44",
                      "subject": "Your receipt",
                      "type": "html",
                      "description": null,
                      "kind": null,
                      "derived_from": null,
                      "created_at": "2025-11-14T13:01:50.106Z",
                      "updated_at": "2025-11-14T13:01:50.106Z",
                      "used_by_count": 0,
                      "description_check": {
                        "ok": false,
                        "warnings": [
                          {
                            "type": "description_missing",
                            "message": "This template has no description. Say what it is for and when to use it, so nobody (and no agent) has to guess from the name."
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListTemplates"
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create a template",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Card fields: description (max 1000; what it is for and when to use it), kind (one of newsletter, promotion, announcement, welcome, reengagement, event, notice, test, other) and derived_from (the id of a template of this workspace it was copied from). The response carries description_check (warnings only). Creates a template after the same validation as templates/validate; any error is refused (422 TEMPLATE_INVALID, with the full validation result in validation). Warnings do not block saving a draft template, but those marked blocksScheduling: true will block scheduling. Name at most 200 characters. type is html or text and cannot be changed later.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "INVALID_KIND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "TEMPLATE_NOT_FOUND (derived_from)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "TEMPLATE_INVALID: validation errors; the response carries validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCreateTemplate"
      },
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Bulk delete templates",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Deletes several templates: body { \"ids\": [...] }, at most 100 (400 IDS_REQUIRED, 400 TOO_MANY_IDS). Every id gets its own result: deleted[] lists the ones deleted; failed[] lists the rest with a reason: INVALID_ID, NOT_FOUND (never reported as deleted) or TEMPLATE_IN_USE (with used_by and used_by_count). When nothing was deleted the status is 409 (in use), 404 (all not found) or 400.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "IDS_REQUIRED, TOO_MANY_IDS, or every id invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "None of the templates exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "TEMPLATE_IN_USE for every id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteTemplates"
      }
    },
    "/comm-api/api/templates/validate": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Validate a template without saving",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). validate checks the rules a template must meet to be saved and scheduled; lint (POST /templates/lint) additionally explains and fixes. Both read the same rulebook. Checks a template without saving it. Returns valid, errors[], warnings[], metrics and a preview rendered by the same renderer the sender uses (so {{name|there}} previews exactly as it will be sent). A warning with blocksScheduling: true means scheduling a campaign that uses this template will be refused: missing_unsubscribe_url (no {{unsubscribe_url}} in either body) and unknown_merge_variable (a tag outside the available set; the warning names it and lists the available variables). Other warnings: missing_text_fallback, unsubscribe_url_missing_in_body (the HTML or text version alone has no link), merge_variable_without_fallback (a hint: add {{name|there}}), missing_consent_url. Errors: missing_name, missing_subject, missing_type, invalid_type, invalid_field_type, name_too_long, subject_too_long, missing_body_html, missing_body_text, fallback_not_allowed, fallback_too_long, html_size_exceeded. Merge variables: name, first_name (derived from name; skips Mr, Mrs, Ms, Miss, Mx, Dr, Prof), email, identity_name, plus the system links unsubscribe_url and consent_url. A fallback is written {{name|there}} (at most 100 characters, not allowed on system links). Link findings: merge_variable_in_url (a merge variable inside a link or image address; blocksScheduling: true; url and variables name it) and non_web_link_scheme (sms:, whatsapp: and similar; not click-tracked; does not block). Only web links are click-tracked; mailto, tel, relative, anchor, unsubscribe and consent links are left as written. The text version: the template's own body_text is sent exactly as written; only a template with no body_text gets one generated from the HTML (paragraphs, bullets, every web link as text (url)).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "valid": true,
                    "warnings": [
                      {
                        "type": "merge_variable_without_fallback",
                        "variables": [],
                        "message": "Some contacts have no first_name; they would get an empty space. Add a fallback, for example {{first_name|there}}"
                      },
                      {
                        "type": "missing_consent_url",
                        "message": "Include {{consent_url}} so consent-request campaigns can render a confirmation link"
                      }
                    ],
                    "errors": [],
                    "metrics": {
                      "htmlSize": 86,
                      "textLength": 60,
                      "subjectLength": 20,
                      "nodeCount": 6,
                      "linkCount": 1,
                      "imageCount": 0,
                      "mergeVariables": [
                        "first_name",
                        "unsubscribe_url"
                      ]
                    },
                    "preview": {
                      "subject": "Your receipt",
                      "body_html": "<p>Example content</p>",
                      "body_text": "Example content"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsValidateTemplate"
      }
    },
    "/comm-api/api/templates/{id}": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get a template",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). One template with its bodies, updated_at, used_by (the most recent campaigns that use it: id, name, status, in_recycle_bin) and used_by_count (the total).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "name": "Example 39",
                    "subject": "Your receipt",
                    "type": "html",
                    "body_html": "<p>Example content</p>",
                    "body_text": "Example content",
                    "description": "Example content",
                    "kind": "test",
                    "derived_from": null,
                    "created_at": "2026-11-04T19:57:20.286Z",
                    "updated_at": "2026-11-23T14:24:00.882Z",
                    "description_check": {
                      "ok": true,
                      "warnings": []
                    },
                    "used_by": [
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "name": "Example 29",
                        "status": "draft",
                        "in_recycle_bin": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "name": "Example 32",
                        "status": "completed",
                        "in_recycle_bin": false
                      }
                    ],
                    "used_by_count": 2
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetTemplate"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update a template",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). The card (description, kind) is saved on its own: a card-only change never re-validates or touches the body, so an older template can still be described. Sending a body field validates the merged result as before. Updates a template. The merged result (your changes on top of the stored template) is validated as a whole, so a partial update cannot leave an invalid template (422 TEMPLATE_INVALID, with validation). type cannot be changed (400 TYPE_IMMUTABLE): create a new template instead. The response includes updated_at. A campaign that is already scheduled keeps the compiled copy it was scheduled with.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "TYPE_IMMUTABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "TEMPLATE_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpdateTemplate"
      },
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Delete a template",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Deletes a template that no campaign uses. A campaign keeps its template until the campaign is permanently deleted, so finished campaigns and campaigns in the recycle bin also block it: the answer is 409 TEMPLATE_IN_USE with used_by (id, name, status, in_recycle_bin) and used_by_count naming them. 404 when there is no such template in this workspace. Add ?dry_run=true to delete nothing and get { dry_run: true, would_delete, template, used_by_count, used_by }: what would be deleted and which campaigns use it.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Template not found in this workspace",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "TEMPLATE_IN_USE: used_by and used_by_count name the campaigns",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteTemplate"
      }
    },
    "/comm-api/api/templates/{id}/test-send": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Send a template as a test to the account owner only, without a campaign",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Sends one copy of the template, with sample merge values, to the account owner only, without needing a campaign: the recipient is always the owner's verified email and cannot be chosen (409 TEST_RECIPIENT_UNAVAILABLE when the owner has none, or is suspended). Body: { \"motor_block_id\": \"<a marketing Motor Block of this workspace>\" (required; it decides the From domain and DKIM), \"sample\": { \"name\": \"...\", \"identity_name\": \"...\" } (optional) }. The message is marked [TEST], links are placeholders pointing to https://motorical.com/ (links.note says so), and there is no tracking pixel and no List-Unsubscribe header. It writes no events. Limits are the same as a campaign test send (429 TEST_SEND_LIMIT). The response is { sent_to, from, subject, warnings[], links: { placeholder_url, note } }.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "TEMPLATE_NOT_FOUND or MOTOR_BLOCK_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "TEST_RECIPIENT_UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "TEST_SEND_LIMIT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsSendTemplateTest"
      }
    },
    "/comm-api/api/workspaces/current/motor-blocks": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List marketing Motor Blocks assigned to the workspace",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 45",
                      "type": "marketing",
                      "active": true,
                      "domain": {
                        "name": "Example 46",
                        "verified": true
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000002",
                      "name": "Example 17",
                      "type": "marketing",
                      "active": true,
                      "domain": {
                        "name": "Example 47",
                        "verified": true
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000003",
                      "name": "Example 12",
                      "type": "marketing",
                      "active": true,
                      "domain": {
                        "name": "Example 47",
                        "verified": true
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListMarketingBlocks"
      }
    },
    "/comm-api/api/campaigns": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List campaigns",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Lists the workspace campaigns. Each carries pacing {state, reason, resumes_at}: state is not_started, running, waiting_for_cap, done or stopped; while waiting_for_cap, reason names the sending limit reached and resumes_at says when it continues. compact=true omits compiled bodies. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 29",
                      "description": null,
                      "template_id": "00000000-0000-4000-8000-000000000002",
                      "motor_block_id": "00000000-0000-4000-8000-000000000003",
                      "status": "draft",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example2.com",
                      "from_name": null,
                      "reply_to": null,
                      "scheduled_at": null,
                      "created_at": "2026-11-21T14:24:12.333Z",
                      "chunk_size": 1,
                      "delay_seconds_between_chunks": 3600,
                      "pacing": {
                        "state": "not_started",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": null,
                      "latestSnapshot": null
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000004",
                      "name": "Example 30",
                      "description": "Example content",
                      "template_id": "00000000-0000-4000-8000-000000000005",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-11-04T21:03:00Z",
                      "created_at": "2026-11-04T20:26:45.218Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "campaign_id": "00000000-0000-4000-8000-000000000004",
                        "version": 5,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 2759,
                              "linkCount": 2,
                              "nodeCount": 33,
                              "imageCount": 0,
                              "textLength": 265
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-11-04T20:45:18.104Z"
                          },
                          "sanitized": {
                            "tags": 0,
                            "urls": 0,
                            "handlers": 0
                          },
                          "compiled_at": "2026-11-04T20:45:18.095Z",
                          "fingerprint": {
                            "list_ids": [
                              "00000000-0000-4000-8000-000000000008"
                            ],
                            "settings": {
                              "click_consent": true,
                              "open_tracking": false,
                              "unsubscribe_landing": null
                            },
                            "source_hash": "9da92e6e436f6d75f3a65c076aa506f869a2dbbad0b5b5bedbba056eec158bbb",
                            "exclude_list_ids": [],
                            "total_recipients": 5
                          }
                        },
                        "created_at": "2026-11-04T20:45:18.095Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "campaign_id": "00000000-0000-4000-8000-000000000004",
                        "version": 5,
                        "total_recipients": 5,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-11-04T20:45:18.095Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000010",
                      "name": "Example 32",
                      "description": "Example content",
                      "template_id": "00000000-0000-4000-8000-000000000002",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-11-04T20:18:00Z",
                      "created_at": "2026-11-04T19:57:32.076Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000011",
                        "campaign_id": "00000000-0000-4000-8000-000000000010",
                        "version": 5,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {
                                "utm_medium": "email",
                                "utm_source": "newsletter",
                                "utm_campaign": "complex-test"
                              },
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {
                                "utm_content": "block1"
                              },
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 2,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {
                                "utm_content": "block2"
                              },
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 3,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {
                                "utm_content": "block3"
                              },
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 4,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "mailto:recipient@example.com",
                              "processed": "mailto:recipient@example.com"
                            },
                            {
                              "text": "Example content",
                              "index": 5,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 6,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 4370,
                              "linkCount": 7,
                              "nodeCount": 76,
                              "imageCount": 0,
                              "textLength": 863
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 4,
                                "message": "Event handlers detected (will be removed) (4 instances)"
                              }
                            ],
                            "validatedAt": "2026-11-04T19:59:20.579Z"
                          },
                          "sanitized": {
                            "tags": 0,
                            "urls": 0,
                            "handlers": 0
                          },
                          "compiled_at": "2026-11-04T19:59:20.568Z",
                          "fingerprint": {
                            "list_ids": [
                              "00000000-0000-4000-8000-000000000008"
                            ],
                            "settings": {
                              "click_consent": true,
                              "open_tracking": false,
                              "unsubscribe_landing": null
                            },
                            "source_hash": "4dfa66c3afd9a8cd19b067909a37d13d1ce69e4f39b0fe1bc8eec12fb334e126",
                            "exclude_list_ids": [],
                            "total_recipients": 4
                          }
                        },
                        "created_at": "2026-11-04T19:59:20.568Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "campaign_id": "00000000-0000-4000-8000-000000000010",
                        "version": 5,
                        "total_recipients": 4,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-11-04T19:59:20.568Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000013",
                      "name": "Example 33",
                      "description": "Example content",
                      "template_id": "00000000-0000-4000-8000-000000000005",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-11-04T18:50:00Z",
                      "created_at": "2026-11-04T18:30:47.571Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000014",
                        "campaign_id": "00000000-0000-4000-8000-000000000013",
                        "version": 4,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 2759,
                              "linkCount": 2,
                              "nodeCount": 33,
                              "imageCount": 0,
                              "textLength": 265
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-11-04T18:32:45.837Z"
                          },
                          "sanitized": {
                            "tags": 0,
                            "urls": 0,
                            "handlers": 0
                          },
                          "compiled_at": "2026-11-04T18:32:45.827Z",
                          "fingerprint": {
                            "list_ids": [
                              "00000000-0000-4000-8000-000000000008"
                            ],
                            "source_hash": "9da92e6e436f6d75f3a65c076aa506f869a2dbbad0b5b5bedbba056eec158bbb",
                            "exclude_list_ids": [],
                            "total_recipients": 4
                          }
                        },
                        "created_at": "2026-11-04T18:32:45.827Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000015",
                        "campaign_id": "00000000-0000-4000-8000-000000000013",
                        "version": 4,
                        "total_recipients": 4,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-11-04T18:32:45.827Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000016",
                      "name": "Example 34",
                      "description": "Example content",
                      "template_id": "00000000-0000-4000-8000-000000000017",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-11-04T16:35:00Z",
                      "created_at": "2026-11-04T16:04:02.445Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000018",
                        "campaign_id": "00000000-0000-4000-8000-000000000016",
                        "version": 4,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 2765,
                              "linkCount": 2,
                              "nodeCount": 33,
                              "imageCount": 0,
                              "textLength": 283
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-11-04T16:15:12.186Z"
                          },
                          "sanitized": {
                            "tags": 0,
                            "urls": 0,
                            "handlers": 0
                          },
                          "compiled_at": "2026-11-04T16:15:12.182Z",
                          "fingerprint": {
                            "list_ids": [
                              "00000000-0000-4000-8000-000000000008"
                            ],
                            "source_hash": "fdac6f5902df8cebb7e34a84664ca1017cb372c74ccc79131b260862151983b7",
                            "exclude_list_ids": [],
                            "total_recipients": 4
                          }
                        },
                        "created_at": "2026-11-04T16:15:12.181Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000019",
                        "campaign_id": "00000000-0000-4000-8000-000000000016",
                        "version": 4,
                        "total_recipients": 4,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-11-04T16:15:12.181Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000020",
                      "name": "Example 35",
                      "description": null,
                      "template_id": "00000000-0000-4000-8000-000000000021",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-09-19T18:38:00Z",
                      "created_at": "2026-09-19T18:37:08.969Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000022",
                        "campaign_id": "00000000-0000-4000-8000-000000000020",
                        "version": 1,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{consent_url}}",
                              "processed": "{{consent_url}}"
                            },
                            {
                              "text": "Example content",
                              "index": 2,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 1638,
                              "linkCount": 3,
                              "nodeCount": 20,
                              "imageCount": 0,
                              "textLength": 649
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-09-19T18:37:13.631Z"
                          },
                          "compiled_at": "2026-09-19T18:37:13.585Z"
                        },
                        "created_at": "2026-09-19T18:37:13.585Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000023",
                        "campaign_id": "00000000-0000-4000-8000-000000000020",
                        "version": 1,
                        "total_recipients": 7,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-09-19T18:37:13.585Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000024",
                      "name": "Example 36",
                      "description": null,
                      "template_id": "00000000-0000-4000-8000-000000000021",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-09-14T18:07:00Z",
                      "created_at": "2026-09-14T18:05:40.920Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000025",
                        "campaign_id": "00000000-0000-4000-8000-000000000024",
                        "version": 1,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{consent_url}}",
                              "processed": "{{consent_url}}"
                            },
                            {
                              "text": "Example content",
                              "index": 2,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 1638,
                              "linkCount": 3,
                              "nodeCount": 20,
                              "imageCount": 0,
                              "textLength": 649
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-09-14T18:05:45.050Z"
                          },
                          "compiled_at": "2026-09-14T18:05:45.032Z"
                        },
                        "created_at": "2026-09-14T18:05:45.032Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000026",
                        "campaign_id": "00000000-0000-4000-8000-000000000024",
                        "version": 1,
                        "total_recipients": 7,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-09-14T18:05:45.032Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000027",
                      "name": "Example 37",
                      "description": null,
                      "template_id": "00000000-0000-4000-8000-000000000021",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-09-14T17:00:00Z",
                      "created_at": "2026-09-14T17:57:58.398Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000028",
                        "campaign_id": "00000000-0000-4000-8000-000000000027",
                        "version": 1,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{consent_url}}",
                              "processed": "{{consent_url}}"
                            },
                            {
                              "text": "Example content",
                              "index": 2,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 1638,
                              "linkCount": 3,
                              "nodeCount": 20,
                              "imageCount": 0,
                              "textLength": 649
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-09-14T17:58:10.239Z"
                          },
                          "compiled_at": "2026-09-14T17:58:10.206Z"
                        },
                        "created_at": "2026-09-14T17:58:10.206Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000029",
                        "campaign_id": "00000000-0000-4000-8000-000000000027",
                        "version": 1,
                        "total_recipients": 7,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-09-14T17:58:10.206Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000030",
                      "name": "Example 48",
                      "description": null,
                      "template_id": "00000000-0000-4000-8000-000000000021",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": false,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-09-13T12:05:00Z",
                      "created_at": "2026-09-13T12:01:59.459Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000031",
                        "campaign_id": "00000000-0000-4000-8000-000000000030",
                        "version": 1,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{consent_url}}",
                              "processed": "{{consent_url}}"
                            },
                            {
                              "text": "Example content",
                              "index": 2,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 1638,
                              "linkCount": 3,
                              "nodeCount": 20,
                              "imageCount": 0,
                              "textLength": 649
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-09-13T12:02:11.373Z"
                          },
                          "compiled_at": "2026-09-13T12:02:11.342Z"
                        },
                        "created_at": "2026-09-13T12:02:11.342Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000032",
                        "campaign_id": "00000000-0000-4000-8000-000000000030",
                        "version": 1,
                        "total_recipients": 8,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-09-13T12:02:11.342Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000033",
                      "name": "Example 49",
                      "description": null,
                      "template_id": "00000000-0000-4000-8000-000000000021",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": true,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-09-13T11:45:00Z",
                      "created_at": "2026-09-13T11:40:04.103Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000034",
                        "campaign_id": "00000000-0000-4000-8000-000000000033",
                        "version": 1,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{consent_url}}",
                              "processed": "{{consent_url}}"
                            },
                            {
                              "text": "Example content",
                              "index": 2,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 1638,
                              "linkCount": 3,
                              "nodeCount": 20,
                              "imageCount": 0,
                              "textLength": 649
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-09-13T11:40:27.170Z"
                          },
                          "compiled_at": "2026-09-13T11:40:27.125Z"
                        },
                        "created_at": "2026-09-13T11:40:27.124Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000035",
                        "campaign_id": "00000000-0000-4000-8000-000000000033",
                        "version": 1,
                        "total_recipients": 3,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-09-13T11:40:27.124Z"
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000036",
                      "name": "Example 50",
                      "description": null,
                      "template_id": "00000000-0000-4000-8000-000000000021",
                      "motor_block_id": "00000000-0000-4000-8000-000000000006",
                      "status": "completed",
                      "status_reason": null,
                      "consent_request": true,
                      "google_analytics": {
                        "enabled": false
                      },
                      "from_address": "recipient@example.com",
                      "from_name": "Ada",
                      "reply_to": null,
                      "scheduled_at": "2026-09-12T20:25:00Z",
                      "created_at": "2026-09-12T20:20:08.644Z",
                      "chunk_size": 100,
                      "delay_seconds_between_chunks": 30,
                      "pacing": {
                        "state": "done",
                        "reason": null,
                        "resumes_at": null
                      },
                      "latestArtifact": {
                        "id": "00000000-0000-4000-8000-000000000037",
                        "campaign_id": "00000000-0000-4000-8000-000000000036",
                        "version": 1,
                        "subject": "Your receipt",
                        "html_compiled": "<p>Example content</p>",
                        "text_compiled": "Example content",
                        "meta": {
                          "linkMap": [
                            {
                              "text": "Example content",
                              "index": 0,
                              "tracked": true,
                              "original": "https://example.com/",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "https://example.com/"
                            },
                            {
                              "text": "Example content",
                              "index": 1,
                              "tracked": true,
                              "original": "{{consent_url}}",
                              "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                              "utmPolicy": "preserve",
                              "utmsApplied": {},
                              "finalDestination": "{{consent_url}}"
                            },
                            {
                              "text": "Example content",
                              "index": 2,
                              "reason": "Example content",
                              "tracked": false,
                              "original": "{{unsubscribe_url}}",
                              "processed": "{{unsubscribe_url}}"
                            }
                          ],
                          "security": {
                            "metrics": {
                              "htmlSize": 1638,
                              "linkCount": 3,
                              "nodeCount": 20,
                              "imageCount": 0,
                              "textLength": 649
                            },
                            "warnings": [
                              {
                                "type": "event_handlers",
                                "count": 1,
                                "message": "Event handlers detected (will be removed) (1 instances)"
                              }
                            ],
                            "validatedAt": "2026-09-12T20:20:49.601Z"
                          },
                          "compiled_at": "2026-09-12T20:20:49.554Z"
                        },
                        "created_at": "2026-09-12T20:20:49.554Z"
                      },
                      "latestSnapshot": {
                        "id": "00000000-0000-4000-8000-000000000038",
                        "campaign_id": "00000000-0000-4000-8000-000000000036",
                        "version": 1,
                        "total_recipients": 1,
                        "included_lists": null,
                        "deduped_by": "email",
                        "filters": null,
                        "created_at": "2026-09-12T20:20:49.554Z"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListCampaigns"
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create a campaign",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Optional: description (max 1000; what this campaign is and why) and exclude_list_ids (up to 50 lists whose ACTIVE members are never sent to, even if they are on a list in list_ids). Exclusions are fixed at creation, must be lists of this workspace, cannot be built-in system views, and cannot also be in list_ids (400 EXCLUDE_OVERLAPS_LISTS). Other codes: TOO_MANY_EXCLUDE_LISTS, LIST_NOT_FOUND, SYSTEM_LIST_NOT_ALLOWED. An excluded list can never be deleted while a campaign excludes it. Creates a draft. Required: name (max 200 characters), template_id, list_ids (1 to 50), motor_block_id (a marketing Motor Block assigned to the workspace). Optional: from_address (must be an address at the Motor Block's own domain, default noreply@<domain>; otherwise 400 FROM_DOMAIN_MISMATCH), from_name (cleaned, not rejected: control characters, quotes, < > and @ are removed; at most 100 characters; when empty, recipients see the workspace name as the From name), reply_to (one email address on any domain, replies go there; 400 INVALID_REPLY_TO; without it replies go to the From address), google_analytics, consent_request. The template and every list must belong to this workspace (404 TEMPLATE_NOT_FOUND / LIST_NOT_FOUND). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,128}$"
            },
            "description": "Optional. Retrying with the same key and the same request replays the stored answer (response header Idempotent-Replay: true); the same key with a different request is 422 IDEMPOTENCY_KEY_REUSED; while the first request is still running it is 409 IDEMPOTENCY_IN_PROGRESS. Keys are per workspace and kept 24 hours."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "EXCLUDE_OVERLAPS_LISTS, TOO_MANY_EXCLUDE_LISTS, SYSTEM_LIST_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "MOTOR_BLOCK_FORBIDDEN: the Motor Block belongs to another account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "A request with this Idempotency-Key is still running (IDEMPOTENCY_IN_PROGRESS)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was already used with a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCreateCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get campaign details",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Also returns description, list_ids and exclude_list_ids. One campaign with its latest artifact and audience snapshot, and pacing {state, reason, resumes_at}: state is not_started, running, waiting_for_cap, done or stopped; a waiting_for_cap campaign continues by itself at resumes_at. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "name": "Example 30",
                    "description": "Example content",
                    "template_id": "00000000-0000-4000-8000-000000000002",
                    "motor_block_id": "00000000-0000-4000-8000-000000000003",
                    "status": "completed",
                    "status_reason": null,
                    "consent_request": false,
                    "google_analytics": {
                      "enabled": false
                    },
                    "timezone": "Europe/Riga",
                    "from_address": "recipient@example.com",
                    "from_name": "Ada",
                    "reply_to": null,
                    "scheduled_at": "2026-11-04T21:03:00Z",
                    "created_at": "2026-11-04T20:26:45.218Z",
                    "list_ids": [
                      "00000000-0000-4000-8000-000000000004"
                    ],
                    "exclude_list_ids": [],
                    "pacing": {
                      "state": "done",
                      "reason": null,
                      "resumes_at": null
                    },
                    "latestArtifact": {
                      "id": "00000000-0000-4000-8000-000000000005",
                      "campaign_id": "00000000-0000-4000-8000-000000000001",
                      "version": 5,
                      "subject": "Your receipt",
                      "html_compiled": "<p>Example content</p>",
                      "text_compiled": "Example content",
                      "meta": {
                        "linkMap": [
                          {
                            "text": "Example content",
                            "index": 0,
                            "tracked": true,
                            "original": "https://example.com/",
                            "processed": "https://track.motorical.com/c/TRACK_TOKEN?url=https%3A%2F%2Fexample.com%2F",
                            "utmPolicy": "preserve",
                            "utmsApplied": {},
                            "finalDestination": "https://example.com/"
                          },
                          {
                            "text": "Example content",
                            "index": 1,
                            "reason": "Example content",
                            "tracked": false,
                            "original": "{{unsubscribe_url}}",
                            "processed": "{{unsubscribe_url}}"
                          }
                        ],
                        "security": {
                          "metrics": {
                            "htmlSize": 2759,
                            "linkCount": 2,
                            "nodeCount": 33,
                            "imageCount": 0,
                            "textLength": 265
                          },
                          "warnings": [
                            {
                              "type": "event_handlers",
                              "count": 1,
                              "message": "Event handlers detected (will be removed) (1 instances)"
                            }
                          ],
                          "validatedAt": "2026-11-04T20:45:18.104Z"
                        },
                        "sanitized": {
                          "tags": 0,
                          "urls": 0,
                          "handlers": 0
                        },
                        "compiled_at": "2026-11-04T20:45:18.095Z",
                        "fingerprint": {
                          "list_ids": [
                            "00000000-0000-4000-8000-000000000004"
                          ],
                          "settings": {
                            "click_consent": true,
                            "open_tracking": false,
                            "unsubscribe_landing": null
                          },
                          "source_hash": "9da92e6e436f6d75f3a65c076aa506f869a2dbbad0b5b5bedbba056eec158bbb",
                          "exclude_list_ids": [],
                          "total_recipients": 5
                        }
                      },
                      "created_at": "2026-11-04T20:45:18.095Z"
                    },
                    "latestSnapshot": {
                      "id": "00000000-0000-4000-8000-000000000006",
                      "campaign_id": "00000000-0000-4000-8000-000000000001",
                      "version": 5,
                      "total_recipients": 5,
                      "included_lists": null,
                      "deduped_by": "email",
                      "filters": null,
                      "created_at": "2026-11-04T20:45:18.095Z"
                    },
                    "settings": {
                      "click_consent": {
                        "enabled": true,
                        "source": "workspace"
                      },
                      "open_tracking": {
                        "enabled": false,
                        "source": "workspace"
                      },
                      "unsubscribe_landing": {
                        "url": null,
                        "saved_url": null,
                        "source": "workspace"
                      },
                      "summary": "Click counts as consent: on. Open tracking: off. Unsubscribe: after unsubscribing people see the shared Motorical page.",
                      "warnings": [
                        {
                          "type": "click_consent_on",
                          "message": "Click counts as consent is ON: a click on any tracked link in this campaign can record that person as having consented. Scanner clicks are not filtered out."
                        },
                        {
                          "type": "open_tracking_off",
                          "message": "Open tracking is OFF: opens will not be measured, so the report will show them as unknown."
                        }
                      ],
                      "explained_by": "comms_get_workspace_settings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetCampaign"
      },
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Delete a campaign",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Moves the campaign to the recycle bin. A scheduled campaign is cancelled in the same step so it cannot send from the bin; a campaign that is sending cannot be deleted (409). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "The campaign is currently sending",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}/settings": {
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update campaign settings (what can change depends on the status)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). description (null clears it) can be changed in any status except completed and cancelled. Editable fields by status. draft: from_address, from_name, reply_to (null clears it), timezone, scheduled_at (null clears it), chunk_size (1-1000), delay_seconds_between_chunks (1-86400). scheduled: when it goes (scheduled_at, timezone) and the pacing. sending: pacing only. completed and cancelled: nothing (409 INVALID_STATE). scheduled_at must be in the future (400 SCHEDULED_AT_IN_PAST). reply_to and from_name can only change while the campaign is a draft (409 INVALID_STATE otherwise); an invalid reply_to is 400 INVALID_REPLY_TO. The template, lists and Motor Block of a campaign cannot be changed: duplicate it instead. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "INVALID_STATE: that change is not allowed in the campaign's current status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpdateCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}/schedule": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Schedule a draft campaign: compiles it, then sends now or at scheduled_at",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). The response carries the same audience breakdown. A campaign with nobody left to send to is refused with 400 EMPTY_AUDIENCE and the breakdown shows why. Only a draft (or an already scheduled campaign, to reschedule) can be scheduled. In one step it re-checks the Motor Block, template, lists and From address, compiles the campaign (sanitising the HTML and freezing the audience), and moves it to scheduled. With no scheduled_at it sends as soon as the sender picks it up (send_immediately: true). Refused with 400 EMPTY_AUDIENCE when no recipient is eligible, 400 MISSING_CONSENT_URL for a consent-request campaign whose template lacks {{consent_url}}, 400 UNSUBSCRIBE_LINK_MISSING when neither the template html nor its text contains {{unsubscribe_url}}, 400 UNKNOWN_MERGE_VARIABLE when the subject or a body uses a {{tag}} outside the available set (the response lists the offending tags in variables[]; validate the template first), 400 SCHEDULED_AT_IN_PAST, 409 INVALID_STATE for a sending, completed or cancelled campaign. The response carries total_recipients, artifact_version, from_address, forecast and warnings. forecast {estimated_completion_at, estimated_duration_seconds, limiting_cap, caps, assumes_no_other_traffic, enforced} says how long the campaign takes under the Motor Block and account sending limits (limiting_cap: chunk_pacing, burst, hourly, daily, acct_hourly or acct_daily); enforced false means the limits are not applied to campaigns yet. warnings[].type is will_take_hours or will_span_multiple_days (only when enforced). 400 CAMPAIGN_CANNOT_COMPLETE (reason too_long when it would take longer than 7 days, or cap_zero) when the limits are enforced and the campaign could never be sent; nothing is scheduled. forecast is null when it cannot be known; that never blocks scheduling. 400 MERGE_VARIABLE_IN_URL when a link or image address in the template contains a merge variable (it cannot be filled there; urls[] lists each link; only {{unsubscribe_url}} and {{consent_url}} as the whole address are allowed). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,128}$"
            },
            "description": "Optional. Retrying with the same key and the same request replays the stored answer (response header Idempotent-Replay: true); the same key with a different request is 422 IDEMPOTENCY_KEY_REUSED; while the first request is still running it is 409 IDEMPOTENCY_IN_PROGRESS. Keys are per workspace and kept 24 hours."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "EMPTY_AUDIENCE: nobody is left to send to (see audience)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "INVALID_STATE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was already used with a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsScheduleCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}/cancel": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Cancel a draft, scheduled or sending campaign (final)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Allowed for draft, scheduled and sending campaigns. Cancelled is final: a cancelled or completed campaign answers 409 INVALID_STATE. Duplicate a cancelled campaign to send it again. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "INVALID_STATE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCancelCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}/duplicate": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Duplicate a campaign into a new draft",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Works on a campaign in any status. Creates a new draft named \"<name> (copy)\" with the same template, lists, Motor Block, From address and name, Reply-To, consent flag, tracking settings, timezone and pacing. The schedule, compile and all results are not copied. The Motor Block, template and lists are re-checked; lists deleted since are dropped, and if none are left the answer is 409 SOURCE_LISTS_GONE. A From address on a domain the Motor Block no longer uses falls back to noreply@<block domain>. Returns the new campaign with list_ids and copied_from. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,128}$"
            },
            "description": "Optional. Retrying with the same key and the same request replays the stored answer (response header Idempotent-Replay: true); the same key with a different request is 422 IDEMPOTENCY_KEY_REUSED; while the first request is still running it is 409 IDEMPOTENCY_IN_PROGRESS. Keys are per workspace and kept 24 hours."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "SOURCE_LISTS_GONE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was already used with a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDuplicateCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}/test-send": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Send the campaign as a test to the account owner only",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Sends the campaign, as it would be sent, to the account owner only: the recipient is always the owner's verified email and cannot be chosen (409 TEST_RECIPIENT_UNAVAILABLE when the owner has none, or is suspended). It uses the current template (a template edited after scheduling is not what a scheduled campaign sends) and the real sending path, so the From domain, DKIM and gateway rules are the real ones. The message is marked [TEST], links are placeholders, and there is no tracking pixel and no List-Unsubscribe header. It writes no campaign events, statistics or webhooks. Works in any campaign status. Optional body: { \"sample\": { \"name\": \"...\", \"identity_name\": \"...\" } } supplies the merge values (defaults \"Test Recipient\" and \"Example Co\"). Limits: 5 per campaign per hour and 20 per account per day (429 TEST_SEND_LIMIT, with retryAfter in seconds). The response is { sent_to, subject, warnings[], links: { placeholder_url, note } }: links says that the links in the copy are placeholders pointing to https://motorical.com/ (expected, not a fault); unknown merge variables do not block a test, they are listed in warnings. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "CAMPAIGN_NOT_FOUND or TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "TEST_RECIPIENT_UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "TEST_SEND_LIMIT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsSendCampaignTest"
      }
    },
    "/comm-api/api/campaigns/deleted": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List deleted campaigns",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 28",
                      "template_id": "00000000-0000-4000-8000-000000000002",
                      "motor_block_id": "00000000-0000-4000-8000-000000000003",
                      "status": "draft",
                      "deleted_at": "2026-11-23T11:01:08.388Z",
                      "created_at": "2026-11-23T11:00:53.314Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000004",
                      "name": "Example 31",
                      "template_id": "00000000-0000-4000-8000-000000000005",
                      "motor_block_id": "00000000-0000-4000-8000-000000000003",
                      "status": "draft",
                      "deleted_at": "2026-11-04T20:26:51.716Z",
                      "created_at": "2026-11-04T20:20:49.515Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListDeletedCampaigns"
      }
    },
    "/comm-api/api/campaigns/{id}/restore": {
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Restore a campaign",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsRestoreCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}/permanent": {
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Permanently delete a campaign",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsPermanentlyDeleteCampaign"
      }
    },
    "/comm-api/api/campaigns/cleanup": {
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Cleanup deleted campaigns",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsPurgeDeletedCampaigns"
      }
    },
    "/comm-api/api/campaigns/{id}/compile": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Preview-compile a draft campaign (optional: scheduling compiles by itself)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). The response carries audience: why the audience is the size it is. lists[] (member_count, eligible_count each), list_members_total, unique_contacts, overlap_removed, included (= the recipient count), and excluded { unsubscribed, bounced, other_inactive, suppressed, excluded_by_list, consent_not_eligible }; adds_up is true when included plus excluded equals unique_contacts. A person excluded for several reasons counts once, under the first reason in that order. Optional preview of the compiled message (sanitised HTML, tracked links, audience snapshot) for a draft or scheduled campaign. Scheduling always compiles by itself, so this is never a required step. 400 SECURITY_VALIDATION_FAILED when the content fails the security check; a sending, completed or cancelled campaign answers 409 INVALID_STATE. Also returns totalRecipients and a forecast (same shape as in schedule: how long the campaign takes under the Motor Block and account sending limits, with enforced telling whether they apply to campaigns yet; null when it cannot be known) and warnings, so call it before schedule. It never refuses on the forecast. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "INVALID_STATE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCompileCampaign"
      }
    },
    "/comm-api/api/campaigns/{id}/events": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List campaign events",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Paged (page, pageSize up to 200). status filters by event type. redact=true removes the recipient IP address and user agent from each event. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "sending",
                "sent",
                "delivered",
                "bounced",
                "complained",
                "failed",
                "blocked",
                "opened",
                "clicked",
                "unsubscribed"
              ]
            }
          },
          {
            "name": "redact",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "items": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "type": "clicked",
                        "message_id": null,
                        "contact_id": "00000000-0000-4000-8000-000000000002",
                        "occurred_at": "2026-11-04T21:16:08.469Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T21:16:08.457Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "type": "clicked",
                        "message_id": null,
                        "contact_id": "00000000-0000-4000-8000-000000000004",
                        "occurred_at": "2026-11-04T21:15:45.307Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T21:15:45.295Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "type": "delivered",
                        "message_id": "00000000-0000-4000-8000-000000000006",
                        "contact_id": "00000000-0000-4000-8000-000000000007",
                        "occurred_at": "2026-11-04T21:03:53.670Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000006",
                          "queuedAt": "2026-11-04T21:03:04.753Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000008",
                          "currentOutcome": "delivered"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "type": "delivered",
                        "message_id": "00000000-0000-4000-8000-000000000010",
                        "contact_id": "00000000-0000-4000-8000-000000000011",
                        "occurred_at": "2026-11-04T21:03:53.666Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000010",
                          "queuedAt": "2026-11-04T21:03:04.769Z",
                          "smtpCode": "2.6.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000012",
                          "currentOutcome": "delivered"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000013",
                        "type": "delivered",
                        "message_id": "00000000-0000-4000-8000-000000000014",
                        "contact_id": "00000000-0000-4000-8000-000000000002",
                        "occurred_at": "2026-11-04T21:03:53.663Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000014",
                          "queuedAt": "2026-11-04T21:03:04.777Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000015",
                          "currentOutcome": "delivered"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000016",
                        "type": "delivered",
                        "message_id": "00000000-0000-4000-8000-000000000017",
                        "contact_id": "00000000-0000-4000-8000-000000000018",
                        "occurred_at": "2026-11-04T21:03:53.658Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000017",
                          "queuedAt": "2026-11-04T21:03:04.785Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000019",
                          "currentOutcome": "delivered"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000020",
                        "type": "sent",
                        "message_id": "00000000-0000-4000-8000-000000000021",
                        "contact_id": "00000000-0000-4000-8000-000000000004",
                        "occurred_at": "2026-11-04T21:03:53.654Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000021",
                          "queuedAt": "2026-11-04T21:03:04.794Z",
                          "smtpCode": "250",
                          "recipient": "re***@example3.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000022",
                          "currentOutcome": "processed"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000023",
                        "type": "queued",
                        "message_id": "00000000-0000-4000-8000-000000000021",
                        "contact_id": "00000000-0000-4000-8000-000000000004",
                        "occurred_at": "2026-11-04T21:03:04.801Z",
                        "payload": {
                          "data": {
                            "status": "queued",
                            "messageId": "00000000-0000-4000-8000-000000000021"
                          },
                          "success": true,
                          "idempotencyKey": "00000000-0000-4000-8000-000000000024:00000000-0000-4000-8000-000000000004"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000025",
                        "type": "queued",
                        "message_id": "00000000-0000-4000-8000-000000000017",
                        "contact_id": "00000000-0000-4000-8000-000000000018",
                        "occurred_at": "2026-11-04T21:03:04.792Z",
                        "payload": {
                          "data": {
                            "status": "queued",
                            "messageId": "00000000-0000-4000-8000-000000000017"
                          },
                          "success": true,
                          "idempotencyKey": "00000000-0000-4000-8000-000000000024:00000000-0000-4000-8000-000000000018"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000026",
                        "type": "queued",
                        "message_id": "00000000-0000-4000-8000-000000000014",
                        "contact_id": "00000000-0000-4000-8000-000000000002",
                        "occurred_at": "2026-11-04T21:03:04.782Z",
                        "payload": {
                          "data": {
                            "status": "queued",
                            "messageId": "00000000-0000-4000-8000-000000000014"
                          },
                          "success": true,
                          "idempotencyKey": "00000000-0000-4000-8000-000000000024:00000000-0000-4000-8000-000000000002"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000027",
                        "type": "queued",
                        "message_id": "00000000-0000-4000-8000-000000000010",
                        "contact_id": "00000000-0000-4000-8000-000000000011",
                        "occurred_at": "2026-11-04T21:03:04.774Z",
                        "payload": {
                          "data": {
                            "status": "queued",
                            "messageId": "00000000-0000-4000-8000-000000000010"
                          },
                          "success": true,
                          "idempotencyKey": "00000000-0000-4000-8000-000000000024:00000000-0000-4000-8000-000000000011"
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000028",
                        "type": "queued",
                        "message_id": "00000000-0000-4000-8000-000000000006",
                        "contact_id": "00000000-0000-4000-8000-000000000007",
                        "occurred_at": "2026-11-04T21:03:04.766Z",
                        "payload": {
                          "data": {
                            "status": "queued",
                            "messageId": "00000000-0000-4000-8000-000000000006"
                          },
                          "success": true,
                          "idempotencyKey": "00000000-0000-4000-8000-000000000024:00000000-0000-4000-8000-000000000007"
                        }
                      }
                    ],
                    "total": 12,
                    "page": 1,
                    "pageSize": 50
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListCampaignEvents"
      }
    },
    "/comm-api/api/campaigns/{id}/stats": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get campaign stats",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Counts come from the same per-recipient report as /report and /analytics: sent, delivered, bounced, opened, clicked, unique_opened (security scanners excluded), unique_clicked, the three rates, unsubscribed, and the full report. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "totals": {
                      "queued": 5,
                      "sending": 0,
                      "sent": 1,
                      "delivered": 4,
                      "bounced": 0,
                      "complained": 0,
                      "failed": 0,
                      "blocked": 0,
                      "opened": 0,
                      "clicked": 2
                    },
                    "sent": 5,
                    "total_sent": 5,
                    "delivered": 5,
                    "bounced": 0,
                    "opened": 0,
                    "clicked": 2,
                    "unique_opened": 0,
                    "unique_clicked": 2,
                    "delivery_rate": 100,
                    "open_rate": 0,
                    "click_rate": 40,
                    "unsubscribed": 0,
                    "report": {
                      "campaign_id": "00000000-0000-4000-8000-000000000001",
                      "basis": "One row per recipient, reduced to the furthest stage reached. \"handed_off\" = queued for delivery; \"accepted\" = accepted by the receiving mail server; \"delivered\" excludes bounced recipients; opened/clicked imply delivered. opens_unique_excluding_scanners drops only obvious security scanners and crawlers; Apple Mail Privacy Protection and Gmail image-proxy fetches look like real opens and are included.",
                      "audience": {
                        "snapshot_total": 5,
                        "snapshot_version": 5
                      },
                      "recipients": 5,
                      "funnel": {
                        "handed_off": 5,
                        "accepted": 5,
                        "delivered": 5,
                        "opened": 2,
                        "clicked": 2
                      },
                      "outcomes": {
                        "bounced": 0,
                        "failed": 0,
                        "complained": 0
                      },
                      "engagement": {
                        "opens_total": 0,
                        "opens_unique": 0,
                        "opens_unique_excluding_scanners": 0,
                        "clicks_total": 2,
                        "clicks_unique": 2
                      },
                      "rates": {
                        "delivery_rate": 100,
                        "bounce_rate": 0,
                        "open_rate": 0,
                        "click_rate": 40,
                        "denominators": {
                          "delivery_rate": "handed_off",
                          "bounce_rate": "handed_off",
                          "open_rate": "delivered",
                          "click_rate": "delivered"
                        }
                      },
                      "sync": {
                        "synced": true,
                        "outcomes_pending": 0,
                        "latest_handoff_at": "2026-11-04T21:03:04.801Z",
                        "lag_seconds": null,
                        "as_of": "2026-11-28T00:39:27.435Z"
                      },
                      "notes": [],
                      "open_tracking": {
                        "enabled": false,
                        "note": "Example content"
                      },
                      "consent": {
                        "click_consent_enabled_now": true,
                        "recorded_total": 1,
                        "by_source": {
                          "campaign_click": 1
                        },
                        "denominator": {
                          "delivered": 5
                        },
                        "note": "Example content"
                      },
                      "unsubscribes": {
                        "people": 0,
                        "of_delivered": 5,
                        "note": "Example content"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetCampaignStats"
      }
    },
    "/comm-api/api/campaigns/{id}/report": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get the per-recipient delivery report for a campaign",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Also carries sync { synced, ... }: delivery outcomes arrive from the mail servers with a delay, so a zero in accepted or delivered while synced is false means not known yet, not failed. The single source of campaign results: one row per recipient reduced to the furthest stage reached. Returns funnel (handed_off, accepted, delivered, opened, clicked), outcomes (bounced, failed, complained), engagement, rates, and a basis sentence that says how each number is counted. Apple Mail Privacy Protection and image-proxy opens cannot be told from real opens and are included. Also returns pacing {state, reason, resumes_at, sent, remaining}: state is not_started, running, waiting_for_cap, done or stopped; while waiting_for_cap, reason (burst, hourly, daily, acct_hourly or acct_daily) names the sending limit that was reached and resumes_at says when the campaign continues by itself. A waiting campaign is not stuck. Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "campaign_id": "00000000-0000-4000-8000-000000000001",
                    "basis": "One row per recipient, reduced to the furthest stage reached. \"handed_off\" = queued for delivery; \"accepted\" = accepted by the receiving mail server; \"delivered\" excludes bounced recipients; opened/clicked imply delivered. opens_unique_excluding_scanners drops only obvious security scanners and crawlers; Apple Mail Privacy Protection and Gmail image-proxy fetches look like real opens and are included.",
                    "audience": {
                      "snapshot_total": 5,
                      "snapshot_version": 5
                    },
                    "recipients": 5,
                    "funnel": {
                      "handed_off": 5,
                      "accepted": 5,
                      "delivered": 5,
                      "opened": 2,
                      "clicked": 2
                    },
                    "outcomes": {
                      "bounced": 0,
                      "failed": 0,
                      "complained": 0
                    },
                    "engagement": {
                      "opens_total": 0,
                      "opens_unique": 0,
                      "opens_unique_excluding_scanners": 0,
                      "clicks_total": 2,
                      "clicks_unique": 2
                    },
                    "rates": {
                      "delivery_rate": 100,
                      "bounce_rate": 0,
                      "open_rate": 0,
                      "click_rate": 40,
                      "denominators": {
                        "delivery_rate": "handed_off",
                        "bounce_rate": "handed_off",
                        "open_rate": "delivered",
                        "click_rate": "delivered"
                      }
                    },
                    "sync": {
                      "synced": true,
                      "outcomes_pending": 0,
                      "latest_handoff_at": "2026-11-04T21:03:04.801Z",
                      "lag_seconds": null,
                      "as_of": "2026-11-28T00:39:27.445Z"
                    },
                    "notes": [],
                    "open_tracking": {
                      "enabled": false,
                      "note": "Example content"
                    },
                    "consent": {
                      "click_consent_enabled_now": true,
                      "recorded_total": 1,
                      "by_source": {
                        "campaign_click": 1
                      },
                      "denominator": {
                        "delivered": 5
                      },
                      "note": "Example content"
                    },
                    "unsubscribes": {
                      "people": 0,
                      "of_delivered": 5,
                      "note": "Example content"
                    },
                    "status": "completed",
                    "pacing": {
                      "state": "done",
                      "reason": null,
                      "resumes_at": null,
                      "sent": 5,
                      "remaining": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetCampaignReport"
      }
    },
    "/comm-api/api/campaigns/{id}/analytics": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get campaign analytics",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "summary": {
                      "totalEmails": 0,
                      "deliveryRate": 0,
                      "acceptanceRate": 0,
                      "openRate": 0,
                      "clickRate": 0,
                      "totalClicks": 0,
                      "uniqueClickers": 0,
                      "period_days": 7,
                      "basis": "One row per recipient, reduced to the furthest stage reached. \"handed_off\" = queued for delivery; \"accepted\" = accepted by the receiving mail server; \"delivered\" excludes bounced recipients; opened/clicked imply delivered. opens_unique_excluding_scanners drops only obvious security scanners and crawlers; Apple Mail Privacy Protection and Gmail image-proxy fetches look like real opens and are included."
                    },
                    "dailyBreakdown": {},
                    "recentActivity": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetCampaignAnalytics"
      }
    },
    "/comm-api/api/campaigns/{id}/click-breakdown": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get click breakdown",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "url": "https://example.com/",
                      "total_clicks": 2,
                      "unique_clicks": 2
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetCampaignClickBreakdown"
      }
    },
    "/comm-api/api/campaigns/{id}/recipients": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List campaign recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total_potential": 5,
                    "remaining": 0,
                    "processed": 5,
                    "recipients": [
                      {
                        "contact_id": "00000000-0000-4000-8000-000000000001",
                        "email": "recipient@example.com",
                        "name": null,
                        "identity_name": null,
                        "contact_status": "active",
                        "consent_given_at": "2026-09-13T11:51:18.986Z",
                        "consent_requested_at": "2026-09-13T11:45:02.948Z",
                        "consent_source": "campaign_click",
                        "consent_kind": "inferred",
                        "is_processed": true
                      },
                      {
                        "contact_id": "00000000-0000-4000-8000-000000000002",
                        "email": "recipient@example.com",
                        "name": null,
                        "identity_name": null,
                        "contact_status": "active",
                        "consent_given_at": "2026-09-12T20:27:18.453Z",
                        "consent_requested_at": "2026-09-12T20:25:03.309Z",
                        "consent_source": "campaign_click",
                        "consent_kind": "inferred",
                        "is_processed": true
                      },
                      {
                        "contact_id": "00000000-0000-4000-8000-000000000003",
                        "email": "recipient@example.com",
                        "name": null,
                        "identity_name": null,
                        "contact_status": "active",
                        "consent_given_at": "2026-09-13T11:50:54.684Z",
                        "consent_requested_at": "2026-09-13T11:45:02.924Z",
                        "consent_source": "link_confirmation",
                        "consent_kind": "explicit",
                        "is_processed": true
                      },
                      {
                        "contact_id": "00000000-0000-4000-8000-000000000004",
                        "email": "recipient@example.com",
                        "name": null,
                        "identity_name": null,
                        "contact_status": "active",
                        "consent_given_at": "2026-09-12T20:27:54.649Z",
                        "consent_requested_at": "2026-09-12T20:25:03.327Z",
                        "consent_source": "campaign_click",
                        "consent_kind": "inferred",
                        "is_processed": true
                      },
                      {
                        "contact_id": "00000000-0000-4000-8000-000000000005",
                        "email": "recipient@example3.com",
                        "name": null,
                        "identity_name": null,
                        "contact_status": "active",
                        "consent_given_at": "2026-11-04T21:15:45.316Z",
                        "consent_requested_at": null,
                        "consent_source": "campaign_click",
                        "consent_kind": "inferred",
                        "is_processed": true
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListCampaignRecipients"
      }
    },
    "/comm-api/api/campaigns/{id}/recipient-consent": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get campaign recipient consent status",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "email": "recipient@example.com",
                      "consent_source": "campaign_click",
                      "consent_kind": "inferred"
                    },
                    {
                      "email": "recipient@example.com",
                      "consent_source": "campaign_click",
                      "consent_kind": "inferred"
                    },
                    {
                      "email": "recipient@example.com",
                      "consent_source": "link_confirmation",
                      "consent_kind": "explicit"
                    },
                    {
                      "email": "recipient@example.com",
                      "consent_source": "campaign_click",
                      "consent_kind": "inferred"
                    },
                    {
                      "email": "recipient@example.com",
                      "consent_source": null,
                      "consent_kind": null
                    },
                    {
                      "email": "recipient@example3.com",
                      "consent_source": "campaign_click",
                      "consent_kind": "inferred"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetCampaignRecipientConsent"
      }
    },
    "/comm-api/api/campaigns/{id}/clicks": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List campaign clicks",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Errors are `{ success:false, error, code }`; a malformed id in the path is `400 INVALID_ID`.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "clicks": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "occurred_at": "2026-11-04T21:16:08.469Z",
                        "link": {
                          "index": 0,
                          "url": "https://example.com/"
                        },
                        "recipient": {
                          "email": "recipient@example.com",
                          "name": null,
                          "status": "engaged"
                        },
                        "user_agent": "Mozilla/5.0 (example)",
                        "ip_address": "203.0.113.10"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "occurred_at": "2026-11-04T21:15:45.307Z",
                        "link": {
                          "index": 0,
                          "url": "https://example.com/"
                        },
                        "recipient": {
                          "email": "recipient@example3.com",
                          "name": null,
                          "status": "engaged"
                        },
                        "user_agent": "Mozilla/5.0 (example)",
                        "ip_address": "203.0.113.10"
                      }
                    ],
                    "pagination": {
                      "total": 2,
                      "limit": 50,
                      "offset": 0,
                      "has_more": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListCampaignClicks"
      }
    },
    "/comm-api/api/recipients": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Search recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "recipients": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "email": "recipient@example3.com",
                        "name": null,
                        "computed_status": "engaged",
                        "engagement_level": "medium",
                        "quality_index": 85,
                        "created_at": "2026-11-04T20:26:31.870Z",
                        "last_engagement_at": "2026-11-04T21:15:45.307Z",
                        "last_click_at": "2026-11-04T21:15:45.307Z",
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": "00000000-0000-4000-8000-000000000002",
                        "last_campaign_activity": "2026-11-04T21:15:45.307Z",
                        "consent_given_at": "2026-11-04T21:15:45.316Z",
                        "consent_source": "campaign_click",
                        "consent_kind": "inferred",
                        "consent_recorded_at": "2026-11-04T21:15:45.316Z",
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "email": "recipient@example4.com",
                        "name": "Example 51",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:50:21.359Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000004",
                        "email": "recipient@example5.com",
                        "name": "Example 52",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "email": "recipient@example6.com",
                        "name": "Example 53",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000006",
                        "email": "recipient@example7.com",
                        "name": "Example 54",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "email": "recipient@example8.com",
                        "name": "Example 55",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000008",
                        "email": "recipient@example9.com",
                        "name": "Example 56",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "email": "recipient@example.com",
                        "name": "Example 57",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000010",
                        "email": "recipient@example.com",
                        "name": "Example 58",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000011",
                        "email": "recipient@example10.com",
                        "name": "Example 59",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "email": "recipient@example11.com",
                        "name": "Example 60",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000013",
                        "email": "recipient@example12.com",
                        "name": "Example 61",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000014",
                        "email": "recipient@example.com",
                        "name": "Example 62",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000015",
                        "email": "recipient@example13.com",
                        "name": "Example 63",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000016",
                        "email": "recipient@example.com",
                        "name": "Example 64",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000017",
                        "email": "recipient@example14.com",
                        "name": "Example 65",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000018",
                        "email": "recipient@example15.com",
                        "name": "Example 66",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000019",
                        "email": "recipient@example.com",
                        "name": "Example 67",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000020",
                        "email": "recipient@example.com",
                        "name": "Example 68",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000021",
                        "email": "recipient@example16.com",
                        "name": "Example 69",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000022",
                        "email": "recipient@example17.com",
                        "name": "Example 70",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000023",
                        "email": "recipient@example.com",
                        "name": "Example 71",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000024",
                        "email": "recipient@example18.com",
                        "name": "Example 72",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000025",
                        "email": "recipient@example19.com",
                        "name": "Example 73",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000026",
                        "email": "recipient@example20.com",
                        "name": "Example 74",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000027",
                        "email": "recipient@example21.com",
                        "name": "Example 75",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000028",
                        "email": "recipient@example22.com",
                        "name": "Example 76",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000029",
                        "email": "recipient@example23.com",
                        "name": "Example 77",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000030",
                        "email": "recipient@example.com",
                        "name": "Example 78",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000031",
                        "email": "recipient@example.com",
                        "name": "Example 79",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000032",
                        "email": "recipient@example24.com",
                        "name": "Example 80",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000033",
                        "email": "recipient@example25.com",
                        "name": "Example 81",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000034",
                        "email": "recipient@example.com",
                        "name": "Example 82",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000035",
                        "email": "recipient@example.com",
                        "name": "Example 83",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000036",
                        "email": "recipient@example26.com",
                        "name": "Example 84",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000037",
                        "email": "recipient@example27.com",
                        "name": "Example 85",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000038",
                        "email": "recipient@example28.com",
                        "name": "Example 86",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000039",
                        "email": "recipient@example29.com",
                        "name": "Example 87",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000040",
                        "email": "recipient@example.com",
                        "name": "Example 88",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000041",
                        "email": "recipient@example.com",
                        "name": "Example 89",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000042",
                        "email": "recipient@example30.com",
                        "name": "Example 90",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000043",
                        "email": "recipient@example31.com",
                        "name": "Example 91",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000044",
                        "email": "recipient@example32.com",
                        "name": "Example 92",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000045",
                        "email": "recipient@example33.com",
                        "name": "Example 93",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000046",
                        "email": "recipient@example.com",
                        "name": "Example 94",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000047",
                        "email": "recipient@example34.com",
                        "name": "Example 95",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000048",
                        "email": "recipient@example.com",
                        "name": "Example 96",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000049",
                        "email": "recipient@example23.com",
                        "name": "Example 97",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000050",
                        "email": "recipient@example35.com",
                        "name": "Example 98",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000051",
                        "email": "recipient@example.com",
                        "name": "Example 99",
                        "computed_status": "new",
                        "engagement_level": "none",
                        "quality_index": 50,
                        "created_at": "2026-11-04T15:24:31.278Z",
                        "last_engagement_at": null,
                        "last_click_at": null,
                        "suppression_reason": null,
                        "suppressed_at": null,
                        "last_campaign_id": null,
                        "last_campaign_activity": null,
                        "consent_given_at": null,
                        "consent_source": null,
                        "consent_kind": null,
                        "consent_recorded_at": null,
                        "email_domain": "example.com",
                        "list_count": "1"
                      }
                    ],
                    "pagination": {
                      "total": 1161,
                      "limit": 50,
                      "offset": 0,
                      "has_more": true
                    },
                    "filters_applied": {},
                    "sorting": {
                      "sort_by": "created_at",
                      "sort_order": "desc",
                      "available_columns": [
                        "email",
                        "name",
                        "computed_status",
                        "engagement_level",
                        "quality_index",
                        "created_at",
                        "last_engagement_at",
                        "last_click_at",
                        "last_campaign_activity",
                        "email_domain",
                        "list_count"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListRecipients"
      }
    },
    "/comm-api/api/recipients/search": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Search the whole audience with a structured filter (domain, status, campaign, import batch, dates, on no list, not on these lists); returns each person with the lists they are on",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Searches EVERY contact in the workspace (the recycle bin is left out). Body: { filter?, limit? (1 to 100, default 25), offset?, sort? (recent, email, activity) }. Filter keys (all optional, combined with AND, unknown keys are refused with 400 UNKNOWN_FILTER_KEY): status[] (new, sent, delivered, engaged, bounced, unsubscribed, complained), engagement[] (none, low, medium, high), consent_kind (explicit, inferred, none), suppressed (boolean), list_id[], list_id_not[] (on none of these lists), no_list (boolean), campaign_id[], batch_id (an import batch), email_domain (exactly the part after the at sign, for example example.com), search, date_from, date_to (when the person was added), last_activity_from, last_activity_to, never_active (boolean). Returns { total, limit, offset, has_more, filter, rows[] } where each row has id, email, name, status, engagement, created_at, last_activity, suppression_reason, list_count and lists[] ({ id, name }, up to 5). Real addresses are returned to the caller; the MCP masks them. Read-only.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "UNKNOWN_FILTER_KEY, INVALID_FILTER, INVALID_SORT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsSearchAudience"
      }
    },
    "/comm-api/api/recipients/summary": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Counts for the whole audience or a filter: by status, consent, engagement, domain and list; no addresses",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Counts only, for the whole audience or a filter. Body: { filter?, top? (1 to 20, default 10) }. Filter keys (all optional, combined with AND, unknown keys are refused with 400 UNKNOWN_FILTER_KEY): status[] (new, sent, delivered, engaged, bounced, unsubscribed, complained), engagement[] (none, low, medium, high), consent_kind (explicit, inferred, none), suppressed (boolean), list_id[], list_id_not[] (on none of these lists), no_list (boolean), campaign_id[], batch_id (an import batch), email_domain (exactly the part after the at sign, for example example.com), search, date_from, date_to (when the person was added), last_activity_from, last_activity_to, never_active (boolean). Returns { total, filter, by_status, by_consent, by_engagement, top_domains[], top_lists[], on_no_list }. No addresses. Read-only.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "UNKNOWN_FILTER_KEY, INVALID_FILTER",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsAudienceSummary"
      }
    },
    "/comm-api/api/recipients/campaigns": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List recipient campaign groupings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 30",
                      "status": "completed",
                      "created_at": "2026-11-04T20:26:45.218Z",
                      "recipient_count": "5"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000002",
                      "name": "Example 32",
                      "status": "completed",
                      "created_at": "2026-11-04T19:57:32.076Z",
                      "recipient_count": "4"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000003",
                      "name": "Example 33",
                      "status": "completed",
                      "created_at": "2026-11-04T18:30:47.571Z",
                      "recipient_count": "4"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000004",
                      "name": "Example 34",
                      "status": "completed",
                      "created_at": "2026-11-04T16:04:02.445Z",
                      "recipient_count": "4"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000005",
                      "name": "Example 35",
                      "status": "completed",
                      "created_at": "2026-09-19T18:37:08.969Z",
                      "recipient_count": "4"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000006",
                      "name": "Example 36",
                      "status": "completed",
                      "created_at": "2026-09-14T18:05:40.920Z",
                      "recipient_count": "4"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000007",
                      "name": "Example 37",
                      "status": "completed",
                      "created_at": "2026-09-14T17:57:58.398Z",
                      "recipient_count": "4"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000008",
                      "name": "Example 48",
                      "status": "completed",
                      "created_at": "2026-09-13T12:01:59.459Z",
                      "recipient_count": "4"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000009",
                      "name": "Example 49",
                      "status": "completed",
                      "created_at": "2026-09-13T11:40:04.103Z",
                      "recipient_count": "2"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000010",
                      "name": "Example 50",
                      "status": "completed",
                      "created_at": "2026-09-12T20:20:08.644Z",
                      "recipient_count": "2"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListRecipientCampaigns"
      }
    },
    "/comm-api/api/recipients/facets": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List recipient filter facets",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total": 1161,
                    "status": [
                      {
                        "value": "new",
                        "count": 1146
                      },
                      {
                        "value": "unsubscribed",
                        "count": 8
                      },
                      {
                        "value": "engaged",
                        "count": 5
                      },
                      {
                        "value": "bounced",
                        "count": 2
                      }
                    ],
                    "engagement": [
                      {
                        "value": "none",
                        "count": 1156
                      },
                      {
                        "value": "medium",
                        "count": 3
                      },
                      {
                        "value": "high",
                        "count": 2
                      }
                    ],
                    "suppressed": {
                      "yes": 10,
                      "no": 1151
                    },
                    "consent_kind": {
                      "explicit": 2,
                      "inferred": 4,
                      "none": 1155
                    },
                    "campaigns": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "name": "Example 30",
                        "count": 5
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "name": "Example 34",
                        "count": 4
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "name": "Example 33",
                        "count": 4
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000004",
                        "name": "Example 36",
                        "count": 4
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "name": "Example 37",
                        "count": 4
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000006",
                        "name": "Example 32",
                        "count": 4
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "name": "Example 35",
                        "count": 4
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000008",
                        "name": "Example 48",
                        "count": 4
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "name": "Example 50",
                        "count": 2
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000010",
                        "name": "Example 49",
                        "count": 2
                      }
                    ],
                    "lists": [
                      {
                        "id": "00000000-0000-4000-8000-000000000011",
                        "name": "Example 24",
                        "count": 1123
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "name": "Example 23",
                        "count": 442
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000013",
                        "name": "Example 38",
                        "count": 14
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000014",
                        "name": "Example 27",
                        "count": 6
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000015",
                        "name": "Example 26",
                        "count": 5
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000016",
                        "name": "Example 25",
                        "count": 3
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetRecipientFacets"
      }
    },
    "/comm-api/api/recipients/filter": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Filter recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsFilterRecipients"
      }
    },
    "/comm-api/api/recipients/export": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Export recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsExportRecipients"
      }
    },
    "/comm-api/api/recipients/bulk-delete": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Bulk delete recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsBulkDeleteRecipients"
      }
    },
    "/comm-api/api/recipients/bulk-delete-by-filter": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Bulk delete recipients matching a filter",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsBulkDeleteRecipientsByFilter"
      }
    },
    "/comm-api/api/recipients/bulk-move": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Bulk move recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsBulkMoveRecipients"
      }
    },
    "/comm-api/api/recipients/restore": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Restore recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsRestoreRecipients"
      }
    },
    "/comm-api/api/recipients/deleted": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List deleted recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "items": [],
                    "total": 0,
                    "page": 1,
                    "page_size": 50,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListDeletedRecipients"
      }
    },
    "/comm-api/api/recipients/{id}/restore": {
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Restore a recipient",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsRestoreRecipient"
      }
    },
    "/comm-api/api/recipients/{id}/permanent": {
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Permanently delete a recipient",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsPermanentlyDeleteRecipient"
      }
    },
    "/comm-api/api/recipients/bulk-permanent-delete": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Permanently delete several deleted recipients at once",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Permanently deletes several contacts that are already in the recycle bin, in one request. Body: { \"recipient_ids\": [\"...\"] } (or \"ids\"). Only this workspace's deleted contacts are touched; anything else in the list is ignored. Irreversible: the contacts, their list memberships and their event history are removed. Returns { deleted_count }; 400 when the id list is missing or empty.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "recipient_ids missing or empty",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsBulkPermanentlyDeleteRecipients"
      }
    },
    "/comm-api/api/recipients/cleanup": {
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Cleanup deleted recipients",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsPurgeDeletedRecipients"
      }
    },
    "/comm-api/api/suppressions": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List suppressions",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "suppressions": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "email": "recipient@example.com",
                        "reason": "Example content",
                        "source": "manual",
                        "landing_variant": null,
                        "created_at": "2026-10-27T11:09:42.146Z",
                        "contact_id": "00000000-0000-4000-8000-000000000002",
                        "contact_status": "unsubscribed",
                        "contact_name": "Probe Aaa",
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "email": "recipient@example.com",
                        "reason": "Example content",
                        "source": "link",
                        "landing_variant": null,
                        "created_at": "2026-10-26T17:26:10.177Z",
                        "contact_id": "00000000-0000-4000-8000-000000000004",
                        "contact_status": "unsubscribed",
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "email": "recipient@example3.com",
                        "reason": "Example content",
                        "source": "link",
                        "landing_variant": null,
                        "created_at": "2026-10-26T17:25:29.051Z",
                        "contact_id": "00000000-0000-4000-8000-000000000006",
                        "contact_status": "unsubscribed",
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "email": "recipient@example36.com",
                        "reason": "Example content",
                        "source": "user_request",
                        "landing_variant": null,
                        "created_at": "2026-09-13T11:48:43.836Z",
                        "contact_id": null,
                        "contact_status": null,
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000008",
                        "email": "recipient@example.com",
                        "reason": "Example content",
                        "source": "import",
                        "landing_variant": "admin",
                        "created_at": "2026-07-22T13:02:20.297Z",
                        "contact_id": "00000000-0000-4000-8000-000000000009",
                        "contact_status": "bounced",
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000010",
                        "email": "recipient@example.com",
                        "reason": "Example content",
                        "source": "import",
                        "landing_variant": "admin",
                        "created_at": "2026-07-22T13:02:20.292Z",
                        "contact_id": "00000000-0000-4000-8000-000000000011",
                        "contact_status": "bounced",
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "email": "recipient@example37.com",
                        "reason": "Example content",
                        "source": "user_request",
                        "landing_variant": null,
                        "created_at": "2026-07-22T12:19:21.128Z",
                        "contact_id": "00000000-0000-4000-8000-000000000013",
                        "contact_status": "unsubscribed",
                        "contact_name": "mailtest-12",
                        "contact_type": "individual"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000014",
                        "email": "recipient@example37.com",
                        "reason": "Example content",
                        "source": "user_request",
                        "landing_variant": null,
                        "created_at": "2026-07-22T12:19:13.810Z",
                        "contact_id": "00000000-0000-4000-8000-000000000015",
                        "contact_status": "unsubscribed",
                        "contact_name": "mailtest-11",
                        "contact_type": "individual"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000016",
                        "email": "recipient@example36.com",
                        "reason": "Example content",
                        "source": "link",
                        "landing_variant": "motorical",
                        "created_at": "2025-11-28T13:48:29.109Z",
                        "contact_id": null,
                        "contact_status": null,
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000017",
                        "email": "recipient@example38.com",
                        "reason": "Example content",
                        "source": "link",
                        "landing_variant": "motorical",
                        "created_at": "2025-11-24T21:51:19.635Z",
                        "contact_id": "00000000-0000-4000-8000-000000000018",
                        "contact_status": "unsubscribed",
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000019",
                        "email": "recipient@example.com",
                        "reason": "Example content",
                        "source": "link",
                        "landing_variant": "motorical",
                        "created_at": "2025-11-24T21:12:51.466Z",
                        "contact_id": "00000000-0000-4000-8000-000000000020",
                        "contact_status": "unsubscribed",
                        "contact_name": null,
                        "contact_type": null
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000021",
                        "email": "owner@example.com",
                        "reason": "Example content",
                        "source": "link",
                        "landing_variant": "customer",
                        "created_at": "2025-11-14T13:45:23.573Z",
                        "contact_id": "00000000-0000-4000-8000-000000000022",
                        "contact_status": "unsubscribed",
                        "contact_name": "Ģirts",
                        "contact_type": null
                      }
                    ],
                    "pagination": {
                      "page": 1,
                      "limit": 50,
                      "total": 12,
                      "totalPages": 1,
                      "hasNext": false,
                      "hasPrev": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListSuppressions"
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Add a suppression",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Account-wide: the address is suppressed for every workspace of the account. reason defaults to manual; the recipient-initiated reason is unsubscribe (older records may read unsubscribed, which is treated the same).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsAddSuppression"
      }
    },
    "/comm-api/api/suppressions/{id}": {
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Remove a suppression (a spam-complaint one needs acknowledge_complaint=true)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Suppressions are account-wide, shared by every workspace of the account. A suppression whose reason is a spam complaint is removed only on purpose: without acknowledge_complaint=true the answer is 409 COMPLAINT_ACKNOWLEDGEMENT_REQUIRED.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "acknowledge_complaint",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Must be true to remove a spam-complaint suppression."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "COMPLAINT_ACKNOWLEDGEMENT_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteSuppression"
      }
    },
    "/comm-api/api/suppressions/bulk": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Bulk import suppressions",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsAddSuppressions"
      }
    },
    "/comm-api/api/suppressions/stats": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get suppression stats",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "suppressions": {
                      "total": 12,
                      "by_reason": {
                        "unsubscribe": 10,
                        "bounce": 2,
                        "complaint": 0,
                        "manual": 0
                      },
                      "by_source": {
                        "link": 6,
                        "admin": 0
                      },
                      "recent": {
                        "last_7_days": 0,
                        "last_30_days": 0
                      }
                    },
                    "contacts": {
                      "total": 1161,
                      "active": 1151,
                      "unsubscribed": 8
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetSuppressionStats"
      }
    },
    "/comm-api/api/suppressions/lookup": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Is one address suppressed: the reason, the source and since when (account-wide)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Query: email (the full address). Returns { suppressed: false } or { suppressed: true, reason, source, since }. Suppressions are account-wide. Read-only.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "INVALID_EMAIL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsSuppressionInfo"
      }
    },
    "/comm-api/api/suppressions/import-bounces": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Import bounces into suppressions",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsImportBounceSuppressions"
      }
    },
    "/comm-api/api/tracking/events": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Search tracking events",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Tracking events, summary counts, and CSV export share these filters and hide queued lifecycle rows superseded by a later outcome.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "event_type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated event types, such as opened,clicked."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated campaign UUIDs."
          },
          {
            "name": "contact_email",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "chronological",
                "recipient"
              ]
            },
            "description": "Defaults to chronological (the raw per-event timeline, unchanged). recipient collapses each campaign recipient to one row at their furthest send-funnel stage (queued, sent, delivered-or-bounced, opened, clicked). complained and unsubscribed are reported as independent flags rather than funnel stages, since a recipient can carry either at any stage -- they never compete with or hide the funnel stage they occurred at. In recipient view, event_type filters on the winning stage (or the flag) rather than on raw per-event rows."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "view": "chronological",
                    "events": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "type": "clicked",
                        "occurred_at": "2026-11-04T21:16:24.716Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T21:16:24.707Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 33",
                        "campaign_id": "00000000-0000-4000-8000-000000000002"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "type": "clicked",
                        "occurred_at": "2026-11-04T21:16:08.469Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T21:16:08.457Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 30",
                        "campaign_id": "00000000-0000-4000-8000-000000000004"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "type": "clicked",
                        "occurred_at": "2026-11-04T21:15:45.307Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T21:15:45.295Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        },
                        "contact_email": "recipient@example3.com",
                        "contact_name": null,
                        "campaign_name": "Example 30",
                        "campaign_id": "00000000-0000-4000-8000-000000000004"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000006",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T21:03:53.670Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000007",
                          "queuedAt": "2026-11-04T21:03:04.753Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000008",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 30",
                        "campaign_id": "00000000-0000-4000-8000-000000000004"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T21:03:53.666Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000010",
                          "queuedAt": "2026-11-04T21:03:04.769Z",
                          "smtpCode": "2.6.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000011",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 30",
                        "campaign_id": "00000000-0000-4000-8000-000000000004"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T21:03:53.663Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000013",
                          "queuedAt": "2026-11-04T21:03:04.777Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000014",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 30",
                        "campaign_id": "00000000-0000-4000-8000-000000000004"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000015",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T21:03:53.658Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000016",
                          "queuedAt": "2026-11-04T21:03:04.785Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000017",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 30",
                        "campaign_id": "00000000-0000-4000-8000-000000000004"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000018",
                        "type": "sent",
                        "occurred_at": "2026-11-04T21:03:53.654Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000019",
                          "queuedAt": "2026-11-04T21:03:04.794Z",
                          "smtpCode": "250",
                          "recipient": "re***@example3.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000020",
                          "currentOutcome": "processed"
                        },
                        "contact_email": "recipient@example3.com",
                        "contact_name": null,
                        "campaign_name": "Example 30",
                        "campaign_id": "00000000-0000-4000-8000-000000000004"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000021",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T20:18:53.517Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000022",
                          "queuedAt": "2026-11-04T20:18:03.170Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000023",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 32",
                        "campaign_id": "00000000-0000-4000-8000-000000000024"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000025",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T20:18:53.514Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000026",
                          "queuedAt": "2026-11-04T20:18:03.184Z",
                          "smtpCode": "2.6.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000027",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 32",
                        "campaign_id": "00000000-0000-4000-8000-000000000024"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000028",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T20:18:53.511Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000029",
                          "queuedAt": "2026-11-04T20:18:03.194Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000030",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 32",
                        "campaign_id": "00000000-0000-4000-8000-000000000024"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000031",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T20:18:53.504Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000032",
                          "queuedAt": "2026-11-04T20:18:03.205Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000033",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 32",
                        "campaign_id": "00000000-0000-4000-8000-000000000024"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000034",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T18:53:52.741Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000035",
                          "queuedAt": "2026-11-04T18:50:05.005Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000036",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 33",
                        "campaign_id": "00000000-0000-4000-8000-000000000002"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000037",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T18:53:52.739Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000038",
                          "queuedAt": "2026-11-04T18:50:05.019Z",
                          "smtpCode": "2.6.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000039",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 33",
                        "campaign_id": "00000000-0000-4000-8000-000000000002"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000040",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T18:53:52.735Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000041",
                          "queuedAt": "2026-11-04T18:50:05.027Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000042",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 33",
                        "campaign_id": "00000000-0000-4000-8000-000000000002"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000043",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T18:53:52.730Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000044",
                          "queuedAt": "2026-11-04T18:50:05.037Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000045",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 33",
                        "campaign_id": "00000000-0000-4000-8000-000000000002"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000046",
                        "type": "clicked",
                        "occurred_at": "2026-11-04T18:53:19.174Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T18:53:19.164Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 33",
                        "campaign_id": "00000000-0000-4000-8000-000000000002"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000047",
                        "type": "clicked",
                        "occurred_at": "2026-11-04T18:53:06.289Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T18:53:06.277Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 33",
                        "campaign_id": "00000000-0000-4000-8000-000000000002"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000048",
                        "type": "clicked",
                        "occurred_at": "2026-11-04T16:43:21.716Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-11-04T16:43:21.716Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 34",
                        "campaign_id": "00000000-0000-4000-8000-000000000049"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000050",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T16:37:52.613Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000051",
                          "queuedAt": "2026-11-04T16:35:00.655Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000052",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 34",
                        "campaign_id": "00000000-0000-4000-8000-000000000049"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000053",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T16:37:52.608Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000054",
                          "queuedAt": "2026-11-04T16:35:00.677Z",
                          "smtpCode": "2.6.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000055",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 34",
                        "campaign_id": "00000000-0000-4000-8000-000000000049"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000056",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T16:37:52.603Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000057",
                          "queuedAt": "2026-11-04T16:35:00.686Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000058",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 34",
                        "campaign_id": "00000000-0000-4000-8000-000000000049"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000059",
                        "type": "delivered",
                        "occurred_at": "2026-11-04T16:37:52.593Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000060",
                          "queuedAt": "2026-11-04T16:35:00.694Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000061",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 34",
                        "campaign_id": "00000000-0000-4000-8000-000000000049"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000062",
                        "type": "opened",
                        "occurred_at": "2026-10-12T10:57:26.836Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-10-12T10:57:26.827Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000064",
                        "type": "opened",
                        "occurred_at": "2026-10-12T10:57:26.836Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-10-12T10:57:26.825Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 50",
                        "campaign_id": "00000000-0000-4000-8000-000000000065"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000066",
                        "type": "opened",
                        "occurred_at": "2026-10-12T10:57:26.824Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-10-12T10:57:26.812Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000068",
                        "type": "opened",
                        "occurred_at": "2026-09-24T08:33:03.136Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-24T08:33:03.121Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000069",
                        "type": "opened",
                        "occurred_at": "2026-09-19T19:11:47.229Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-19T19:11:47.218Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000070",
                        "type": "delivered",
                        "occurred_at": "2026-09-19T18:40:02.269Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000071",
                          "queuedAt": "2026-09-19T18:38:01.299Z",
                          "smtpCode": "2.6.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000072",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000073",
                        "type": "delivered",
                        "occurred_at": "2026-09-19T18:40:02.267Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000074",
                          "queuedAt": "2026-09-19T18:38:01.334Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000075",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000076",
                        "type": "delivered",
                        "occurred_at": "2026-09-19T18:40:02.264Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000077",
                          "queuedAt": "2026-09-19T18:38:01.346Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000078",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000079",
                        "type": "delivered",
                        "occurred_at": "2026-09-19T18:40:02.262Z",
                        "payload": {
                          "id": "00000000-0000-4000-8000-000000000080",
                          "queuedAt": "2026-09-19T18:38:01.358Z",
                          "smtpCode": "2.0.0",
                          "recipient": "re***@example.com",
                          "smtpMessageId": "00000000-0000-4000-8000-000000000081",
                          "currentOutcome": "delivered"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000082",
                        "type": "opened",
                        "occurred_at": "2026-09-19T18:39:07.216Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-19T18:39:07.216Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000083",
                        "type": "clicked",
                        "occurred_at": "2026-09-19T18:39:02.707Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "url": "https://example.com/",
                          "clickedAt": "2026-09-19T18:39:02.707Z",
                          "linkIndex": 0,
                          "userAgent": "Mozilla/5.0 (example)",
                          "originalUrl": "https://example.com/"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000084",
                        "type": "opened",
                        "occurred_at": "2026-09-19T18:38:59.373Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-19T18:38:59.372Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000085",
                        "type": "opened",
                        "occurred_at": "2026-09-19T18:38:56.834Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-19T18:38:56.823Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 35",
                        "campaign_id": "00000000-0000-4000-8000-000000000063"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000086",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:43:56.018Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:43:56.017Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000087",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:43:55.632Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:43:55.632Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000088",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:43:53.925Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:43:53.925Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000089",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:43:53.812Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:43:53.802Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000090",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:17:39.613Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:17:39.602Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000091",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:16:38.722Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:16:38.712Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000092",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:15:37.638Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:15:37.626Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000093",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:14:36.658Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:14:36.641Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000094",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:13:35.800Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:13:35.789Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000095",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:12:34.689Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:12:34.675Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000096",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:11:33.696Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:11:33.685Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000097",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:10:32.546Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:10:32.535Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000098",
                        "type": "opened",
                        "occurred_at": "2026-09-15T19:09:31.997Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T19:09:31.983Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000099",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:29:35.842Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:29:35.830Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000100",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:29:06.875Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:29:06.864Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000101",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:17:38.670Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:17:38.658Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000102",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:16:37.616Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:16:37.606Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000103",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:15:36.636Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:15:36.625Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000104",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:14:35.675Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:14:35.664Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000105",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:13:34.666Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:13:34.654Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000106",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:12:33.863Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:12:33.852Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000107",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:11:32.709Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:11:32.697Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000108",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:10:31.573Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:10:31.563Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000109",
                        "type": "opened",
                        "occurred_at": "2026-09-15T18:09:30.856Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T18:09:30.841Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000110",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:17:37.633Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:17:37.621Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000111",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:16:36.744Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:16:36.729Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000112",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:15:35.714Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:15:35.703Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000113",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:14:34.529Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:14:34.516Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000114",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:13:33.777Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:13:33.761Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000115",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:12:32.764Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:12:32.754Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000116",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:11:31.674Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:11:31.664Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000117",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:10:30.656Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:10:30.643Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000118",
                        "type": "opened",
                        "occurred_at": "2026-09-15T17:09:29.760Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T17:09:29.741Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000119",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:16:35.741Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:16:35.719Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000120",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:15:34.696Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:15:34.686Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000121",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:14:33.687Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:14:33.671Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000122",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:13:32.755Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:13:32.743Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000123",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:12:31.679Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:12:31.669Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000124",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:11:30.776Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:11:30.766Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000125",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:10:29.793Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:10:29.783Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000126",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:09:28.496Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:09:28.485Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000127",
                        "type": "opened",
                        "occurred_at": "2026-09-15T16:08:27.772Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T16:08:27.758Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000128",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:22:40.782Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:22:40.772Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000129",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:21:39.566Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:21:39.556Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000130",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:20:38.672Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:20:38.658Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000131",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:19:38.029Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:19:38.018Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000132",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:18:37.013Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:18:37.002Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000133",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:17:36.340Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:17:36.330Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000134",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:16:34.728Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:16:34.607Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000135",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:15:33.603Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:15:33.589Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000136",
                        "type": "opened",
                        "occurred_at": "2026-09-15T15:14:32.894Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T15:14:32.882Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000137",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:19:36.676Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:19:36.666Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000138",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:18:35.617Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:18:35.607Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000139",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:17:34.725Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:17:34.715Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000140",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:16:33.729Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:16:33.718Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000141",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:15:32.627Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:15:32.617Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000142",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:14:31.689Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:14:31.678Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000143",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:13:30.653Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:13:30.642Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000144",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:12:29.727Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:12:29.718Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000145",
                        "type": "opened",
                        "occurred_at": "2026-09-15T14:11:28.647Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T14:11:28.637Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000146",
                        "type": "opened",
                        "occurred_at": "2026-09-15T13:19:35.664Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T13:19:35.653Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000147",
                        "type": "opened",
                        "occurred_at": "2026-09-15T13:18:34.698Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T13:18:34.687Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000148",
                        "type": "opened",
                        "occurred_at": "2026-09-15T13:17:33.701Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T13:17:33.687Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000149",
                        "type": "opened",
                        "occurred_at": "2026-09-15T13:16:32.648Z",
                        "payload": {
                          "ip": "203.0.113.10",
                          "openedAt": "2026-09-15T13:16:32.634Z",
                          "userAgent": "Mozilla/5.0 (example)"
                        },
                        "contact_email": "recipient@example.com",
                        "contact_name": null,
                        "campaign_name": "Example 36",
                        "campaign_id": "00000000-0000-4000-8000-000000000067"
                      }
                    ],
                    "pagination": {
                      "total": 276,
                      "limit": 100,
                      "offset": 0,
                      "pages": 3
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListTrackingEvents"
      }
    },
    "/comm-api/api/tracking/export": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Export tracking events",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Tracking events, summary counts, and CSV export share these filters and hide queued lifecycle rows superseded by a later outcome.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "event_type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated event types, such as opened,clicked."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated campaign UUIDs."
          },
          {
            "name": "contact_email",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "chronological",
                "recipient"
              ]
            },
            "description": "Defaults to chronological (the raw per-event timeline, unchanged). recipient collapses each campaign recipient to one row at their furthest send-funnel stage (queued, sent, delivered-or-bounced, opened, clicked). complained and unsubscribed are reported as independent flags rather than funnel stages, since a recipient can carry either at any stage -- they never compete with or hide the funnel stage they occurred at. In recipient view, event_type filters on the winning stage (or the flag) rather than on raw per-event rows."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsExportTrackingEvents"
      }
    },
    "/comm-api/api/tracking/stats": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get tracking stats",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Tracking events, summary counts, and CSV export share these filters and hide queued lifecycle rows superseded by a later outcome. The total and by_type values describe the same visible population returned by the tracking events endpoint. In recipient view, the response instead carries by_status (the non-overlapping funnel breakdown, one recipient per stage), plus separate complained and unsubscribed counts.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "event_type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated event types, such as opened,clicked."
          },
          {
            "name": "campaign_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated campaign UUIDs."
          },
          {
            "name": "contact_email",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date_from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "chronological",
                "recipient"
              ]
            },
            "description": "Defaults to chronological (the raw per-event timeline, unchanged). recipient collapses each campaign recipient to one row at their furthest send-funnel stage (queued, sent, delivered-or-bounced, opened, clicked). complained and unsubscribed are reported as independent flags rather than funnel stages, since a recipient can carry either at any stage -- they never compete with or hide the funnel stage they occurred at. In recipient view, event_type filters on the winning stage (or the flag) rather than on raw per-event rows."
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Optional rolling-day window. When omitted with no date_from, the summary covers all visible events."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "view": "chronological",
                    "total": 276,
                    "by_type": {
                      "opened": 228,
                      "delivered": 36,
                      "clicked": 11,
                      "sent": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetTrackingStats"
      }
    },
    "/comm-api/api/unsubscribe-events": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List unsubscribe events",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "events": [],
                    "pagination": {
                      "page": 1,
                      "limit": 50,
                      "total": 0,
                      "totalPages": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListUnsubscribeEvents"
      }
    },
    "/comm-api/api/unsubscribe-analytics": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get unsubscribe analytics",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total": 0,
                    "rate": 0,
                    "last_7_days": 0,
                    "by_source": {},
                    "period_days": 30,
                    "recent": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetUnsubscribeAnalytics"
      }
    },
    "/comm-api/api/unsubscribe-trends": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get unsubscribe trends",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "dates": [],
                    "counts": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetUnsubscribeTrends"
      }
    },
    "/comm-api/api/settings/consent": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get current workspace consent settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "click_consent_enabled": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetConsentSettings"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update current workspace consent settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpdateConsentSettings"
      }
    },
    "/comm-api/api/settings/open-tracking": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get current workspace open-tracking settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "open_tracking_enabled": false
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetOpenTrackingSettings"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update current workspace open-tracking settings",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpdateOpenTrackingSettings"
      }
    },
    "/comm-api/api/settings/unsubscribe": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get the current workspace unsubscribe landing page",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "unsubscribe_landing_url": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetUnsubscribeSettings"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Set or clear the current workspace unsubscribe landing page",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Sets or clears the page recipients are sent to after they confirm an unsubscribe. Body: { \"unsubscribe_landing_url\": \"https://...\" }, or null to use the default Motorical page. The URL must be https, at most 2048 characters, without credentials, on a domain verified in your account or a subdomain of one (400 LANDING_URL_INVALID, 400 LANDING_DOMAIN_NOT_VERIFIED). It is checked again each time a recipient is redirected; if it no longer qualifies, the default page is shown. Only the confirmation page redirects (303); the one-click unsubscribe from a mail client never does, and the List-Unsubscribe header always points at Motorical.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "LANDING_URL_INVALID or LANDING_DOMAIN_NOT_VERIFIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpdateUnsubscribeSettings"
      }
    },
    "/comm-api/api/workspaces/{id}/webhooks": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List the webhooks of a workspace",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Lists the workspace webhooks with url, events, enabled, failure_count (consecutive failed attempts) and last_delivery_status. The secret is never returned.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": []
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListWebhooks"
      },
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create a workspace webhook",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Creates a webhook for this workspace; X-Tenant-Id must equal the workspace id in the path (otherwise 404 WORKSPACE_NOT_FOUND). Body: url (https, a public address) and events (a non-empty list of campaign.completed, message.delivered, message.bounced, message.complained, contact.unsubscribed, contact.consent_given). The 201 response returns the signing secret once; it is never shown again. Each delivery is a POST of a JSON body signed with HMAC-SHA256 in X-Motorical-Signature, with the event name in X-Motorical-Event. 400 INVALID_EVENTS, 400 WEBHOOK_URL_UNSAFE, 409 WEBHOOK_LIMIT (10 webhooks per workspace).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Created; includes the secret, shown once"
          },
          "400": {
            "description": "INVALID_EVENTS or WEBHOOK_URL_UNSAFE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "WEBHOOK_LIMIT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCreateWebhook"
      }
    },
    "/comm-api/api/workspaces/{id}/webhooks/{webhookId}": {
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update a workspace webhook",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Changes url, events and/or enabled. Setting enabled to true resets the failure count; a webhook the system disabled after repeated failures stays off until you do this. A new url is checked like a new webhook (400 WEBHOOK_URL_UNSAFE). 404 WEBHOOK_NOT_FOUND.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUpdateWebhook"
      },
      "delete": {
        "tags": [
          "Communications"
        ],
        "summary": "Delete a workspace webhook",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Deletes the webhook together with its undelivered events. 404 WEBHOOK_NOT_FOUND.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeleteWebhook"
      }
    },
    "/comm-api/api/workspaces/{id}/webhooks/{webhookId}/test": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Queue a test event for a workspace webhook",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Queues one event named test for this webhook; it is sent like any other delivery. 202 when queued; 404 WEBHOOK_NOT_FOUND.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Queued"
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "WEBHOOK_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsTestWebhook"
      }
    },
    "/comm-api/api/lists/{id}/archive": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Archive a list (hidden from the default list view, refused by campaigns)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsArchiveList"
      }
    },
    "/comm-api/api/lists/{id}/unarchive": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Restore an archived list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUnarchiveList"
      }
    },
    "/comm-api/api/lists/{id}/imports": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "The import batches of a list",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "source_label": "Example content",
                      "created_at": "2026-11-04T15:29:06.592Z",
                      "undone_at": null,
                      "created": 0,
                      "added_existing": 443
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListImports"
      }
    },
    "/comm-api/api/lists/{id}/imports/{batchId}/undo": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Undo one import batch, with a dry run",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsUndoImport"
      }
    },
    "/comm-api/api/contacts/cleanup-orphans": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Delete contacts that are on no list, with a dry run",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCleanupOrphanContacts"
      }
    },
    "/comm-api/api/lists/{id}/contacts/bulk": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Add up to 1001 contacts as JSON, with a dry run and a result for every row",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Adds up to 1001 contacts as JSON: { contacts: [{ email, name?, identity_name?, phone? }], dry_run?, on_existing: keep (default) or update, source_label?, consent_given? }. Every row gets its own result and the summary adds up to the number received. Row outcomes: created, added_existing, already_in_list, invalid, duplicate_in_request, rejected_unsafe, skipped_unsubscribed, skipped_bounced, skipped_inactive, skipped_suppressed. People who unsubscribed, bounced or are suppressed are never re-added. With dry_run true nothing is written and the result shows what WOULD change (would_change). Use the CSV import for larger files. Import notes are added to the list card.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Motorical-Actor",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "dashboard",
                "api"
              ]
            },
            "description": "Optional. Who is acting; recorded on the list card (provenance.created_by). Informational: it never grants or limits anything. Defaults to api."
          }
        ],
        "responses": {
          "200": {
            "description": "A result for every row",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "dry_run": {
                          "type": "boolean"
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "row": {
                                "type": "integer"
                              },
                              "email": {
                                "type": "string",
                                "nullable": true,
                                "description": "Masked"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "outcome": {
                                "type": "string",
                                "enum": [
                                  "created",
                                  "added_existing",
                                  "already_in_list",
                                  "invalid",
                                  "duplicate_in_request",
                                  "rejected_unsafe",
                                  "skipped_unsubscribed",
                                  "skipped_bounced",
                                  "skipped_inactive",
                                  "skipped_suppressed"
                                ]
                              }
                            }
                          }
                        },
                        "summary": {
                          "type": "object",
                          "properties": {
                            "received": {
                              "type": "integer"
                            },
                            "would_change": {
                              "type": "integer"
                            },
                            "adds_up": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": {
                            "type": "integer"
                          }
                        },
                        "list": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "CONTACTS_REQUIRED, TOO_MANY_CONTACTS (more than 1001 rows: use the CSV import or the dashboard), INVALID_ON_EXISTING",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "List not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "contacts"
                ],
                "properties": {
                  "contacts": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1001,
                    "items": {
                      "type": "object",
                      "required": [
                        "email"
                      ],
                      "properties": {
                        "email": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "phone": {
                          "type": "string",
                          "maxLength": 50
                        },
                        "identity_type": {
                          "type": "string",
                          "maxLength": 20
                        },
                        "identity_name": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    }
                  },
                  "dry_run": {
                    "type": "boolean",
                    "description": "true: nothing is written; the answer shows what WOULD change."
                  },
                  "on_existing": {
                    "type": "string",
                    "enum": [
                      "keep",
                      "update"
                    ],
                    "default": "keep"
                  },
                  "source_label": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Where these contacts came from. Optional on this call."
                  },
                  "consent_given": {
                    "type": "boolean",
                    "description": "The list owner's own statement that these people agreed to receive marketing email. Never assumed."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsAddListContacts"
      }
    },
    "/comm-api/api/lists/derive": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Make a new list from other lists (union, intersection or difference) or from an audience filter (operation filter)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Makes a new list from other lists, or from an audience filter, and records how. Body: { name, operation: union | intersection | difference | filter, filter (only for operation filter, with at least one key; the same keys as POST /recipients/search; give no source or exclude lists then), source_list_ids (1 to 10; an intersection needs two), exclude_list_ids (only for a difference), description?, kind? (default derived), source_label?, dry_run? }. The result is a snapshot (members copied once, max 10000; later changes to the sources do not flow in). Members are active contacts; suppressed ones are copied but stay ineligible and are counted separately. The card records the sources and exclusions, and they are readable with GET /lists/{id}/relations. dry_run true returns the counts without creating anything.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "X-Motorical-Actor",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "dashboard",
                "api"
              ]
            },
            "description": "Optional. Who is acting; recorded on the list card (provenance.created_by). Informational: it never grants or limits anything. Defaults to api."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "NAME_REQUIRED, INVALID_OPERATION, SOURCES_REQUIRED, TOO_MANY_SOURCES, FILTER_REQUIRED, FILTER_AND_LISTS, UNKNOWN_FILTER_KEY, INVALID_FILTER, INTERSECTION_NEEDS_TWO, EXCLUDE_REQUIRED, EXCLUDE_NOT_ALLOWED, SOURCES_OVERLAP_EXCLUDES, INVALID_ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "LIST_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDeriveList"
      }
    },
    "/comm-api/api/lists/compare": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Compare two lists: who is only in one, who is in both",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Query: a and b (two different list ids). Returns only_a, only_b, both and union (people), and the same four counts for the ELIGIBLE people (eligible), so the overlap between two lists is a number instead of a guess.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "a",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "b",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "LISTS_REQUIRED, INVALID_ID or SAME_LIST",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "LIST_NOT_FOUND (missing[] names the ids)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCompareLists"
      }
    },
    "/comm-api/api/lists/{id}/relations": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Where a list came from and what was made from it",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Where a list came from and what depends on it: derived_from (its sources), excludes, children (lists made from it), excluded_by, and graph { nodes, edges } for the connected lists (up to 50). Use it before deleting or changing a list.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "list": {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 23",
                      "kind": "customers"
                    },
                    "derived_from": [],
                    "excludes": [],
                    "children": [],
                    "excluded_by": [],
                    "graph": {
                      "nodes": [
                        {
                          "id": "00000000-0000-4000-8000-000000000001",
                          "name": "Example 23",
                          "kind": "customers"
                        }
                      ],
                      "edges": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "List not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetListRelations"
      }
    },
    "/comm-api/api/map": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "The workspace at a glance: lists, campaigns, templates and how they connect",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). The workspace in one call: lists (as short cards), the 50 most recent campaigns (with list_ids, exclude_list_ids and pacing), templates (with used_by_count) and edges between them: sends_to, excludes and uses (campaign to list or template), derived_from and excludes (list to list). truncated tells whether lists or campaigns were cut off.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "workspace": {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 22",
                      "isDefault": true
                    },
                    "lists": [
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "name": "Example 23",
                        "kind": "customers",
                        "type": "user",
                        "member_count": 442,
                        "eligible_count": 442,
                        "snapshot": false,
                        "description_ok": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "name": "Example 24",
                        "kind": "customers",
                        "type": "user",
                        "member_count": 1123,
                        "eligible_count": 1123,
                        "snapshot": false,
                        "description_ok": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000004",
                        "name": "Example 100",
                        "kind": null,
                        "type": "user",
                        "member_count": 0,
                        "eligible_count": 0,
                        "snapshot": false,
                        "description_ok": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "name": "Example 25",
                        "kind": null,
                        "type": "user",
                        "member_count": 3,
                        "eligible_count": 2,
                        "snapshot": false,
                        "description_ok": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000006",
                        "name": "Example 26",
                        "kind": null,
                        "type": "user",
                        "member_count": 5,
                        "eligible_count": 4,
                        "snapshot": false,
                        "description_ok": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "name": "Example 27",
                        "kind": null,
                        "type": "user",
                        "member_count": 6,
                        "eligible_count": 5,
                        "snapshot": false,
                        "description_ok": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000008",
                        "name": "Example 38",
                        "kind": "derived",
                        "type": "smart",
                        "member_count": 14,
                        "eligible_count": 7,
                        "snapshot": true,
                        "description_ok": false
                      }
                    ],
                    "campaigns": [
                      {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "name": "Example 29",
                        "status": "draft",
                        "template_id": "00000000-0000-4000-8000-000000000010",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "not_started",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000011",
                        "name": "Example 30",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000012",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000013",
                        "name": "Example 32",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000010",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000014",
                        "name": "Example 33",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000012",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000015",
                        "name": "Example 34",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000016",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000017",
                        "name": "Example 35",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000018",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000019",
                        "name": "Example 36",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000018",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000020",
                        "name": "Example 37",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000018",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000021",
                        "name": "Example 48",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000018",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000022",
                        "name": "Example 49",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000018",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000023",
                        "name": "Example 50",
                        "status": "completed",
                        "template_id": "00000000-0000-4000-8000-000000000018",
                        "list_ids": [
                          "00000000-0000-4000-8000-000000000007"
                        ],
                        "exclude_list_ids": [],
                        "pacing": {
                          "state": "done",
                          "reason": null,
                          "resumes_at": null
                        }
                      }
                    ],
                    "templates": [
                      {
                        "id": "00000000-0000-4000-8000-000000000010",
                        "name": "Example 39",
                        "used_by_count": 2
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "name": "Example 40",
                        "used_by_count": 3
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000016",
                        "name": "Example 41",
                        "used_by_count": 1
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000018",
                        "name": "Example 42",
                        "used_by_count": 7
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000024",
                        "name": "Example 43",
                        "used_by_count": 0
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000025",
                        "name": "Example 44",
                        "used_by_count": 0
                      }
                    ],
                    "edges": [
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000009"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000009"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000010"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000011"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000011"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000012"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000013"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000013"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000010"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000014"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000014"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000012"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000015"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000015"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000016"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000017"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000017"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000018"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000019"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000019"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000018"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000020"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000020"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000018"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000021"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000021"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000018"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000022"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000022"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000018"
                        },
                        "relation": "uses"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000023"
                        },
                        "to": {
                          "type": "list",
                          "id": "00000000-0000-4000-8000-000000000007"
                        },
                        "relation": "sends_to"
                      },
                      {
                        "from": {
                          "type": "campaign",
                          "id": "00000000-0000-4000-8000-000000000023"
                        },
                        "to": {
                          "type": "template",
                          "id": "00000000-0000-4000-8000-000000000018"
                        },
                        "relation": "uses"
                      }
                    ],
                    "truncated": {
                      "lists": false,
                      "campaigns": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetMap"
      }
    },
    "/comm-api/api/readiness": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "What is still missing before a campaign can be sent",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). What stands between this workspace and a sent campaign, in a fixed order: plan, workspace, domain, marketing_block, list, template. Returns ready, next (the FIRST missing step with a message and a fix hint, or null), steps[] with ok and detail, and the sending limits (hourly, daily) of the workspace campaign Motor Blocks. Read-only. The plan step only says the account is admitted to this API; plans and prices are in the main API.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "ready": true,
                    "next": null,
                    "steps": [
                      {
                        "step": "plan",
                        "ok": true,
                        "detail": "This account can use the Comms API (check the main API for plan details)."
                      },
                      {
                        "step": "workspace",
                        "ok": true,
                        "detail": "First WS (active)"
                      },
                      {
                        "step": "domain",
                        "ok": true,
                        "detail": "8 verified sending domains"
                      },
                      {
                        "step": "marketing_block",
                        "ok": true,
                        "detail": "3 active campaign Motor Blocks"
                      },
                      {
                        "step": "list",
                        "ok": true,
                        "detail": "7 lists"
                      },
                      {
                        "step": "template",
                        "ok": true,
                        "detail": "6 templates"
                      }
                    ],
                    "workspace": {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 22",
                      "isDefault": true
                    },
                    "limits": [
                      {
                        "motor_block_id": "00000000-0000-4000-8000-000000000002",
                        "name": "Example 45",
                        "hourly": 5000,
                        "daily": 20000
                      },
                      {
                        "motor_block_id": "00000000-0000-4000-8000-000000000003",
                        "name": "Example 17",
                        "hourly": 5000,
                        "daily": 20000
                      },
                      {
                        "motor_block_id": "00000000-0000-4000-8000-000000000004",
                        "name": "Example 12",
                        "hourly": 300,
                        "daily": 3000
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetReadiness"
      }
    },
    "/comm-api/api/templates/preview": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Render a template for a contact or a sample",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). What a recipient will see, rendered by the same renderer the sender uses. Body: template_id OR an unsaved draft (subject with body_html and/or body_text), and optionally contact_id (a real contact of this workspace) or sample { name, email, identity_name }. Returns renders[]: with_name, and without_name when the template uses a name variable (so the fallback text is visible), each with subject, body_html and body_text; text_source (template when it has its own text, generated otherwise); a links table (tracked or not, and why); and notes. Unsubscribe and consent links are example addresses. Read-only; sends nothing.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "template_id": null,
                    "contact": {
                      "source": "sample",
                      "has_name": true,
                      "email": "recipient@example.com"
                    },
                    "text_source": "template",
                    "renders": [
                      {
                        "label": "Example 187",
                        "contact": {
                          "name": "Example 188",
                          "email": "recipient@example.com"
                        },
                        "subject": "Your receipt",
                        "body_html": "<p>Example content</p>",
                        "body_text": "Example content"
                      },
                      {
                        "label": "Example 189",
                        "contact": {
                          "name": null,
                          "email": "recipient@example.com"
                        },
                        "subject": "Your receipt",
                        "body_html": "<p>Example content</p>",
                        "body_text": "Example content"
                      }
                    ],
                    "links": [
                      {
                        "index": 0,
                        "url": "https://example.com/",
                        "text": "Example content",
                        "tracked": false,
                        "reason": "Example content"
                      }
                    ],
                    "notes": [
                      "Example content",
                      "Example content"
                    ],
                    "settings": {
                      "click_consent": {
                        "enabled": true,
                        "source": "workspace"
                      },
                      "open_tracking": {
                        "enabled": false,
                        "source": "workspace"
                      },
                      "unsubscribe_landing": {
                        "url": null,
                        "saved_url": null,
                        "source": "workspace"
                      },
                      "summary": "Click counts as consent: on. Open tracking: off. Unsubscribe: after unsubscribing people see the shared Motorical page.",
                      "warnings": [
                        {
                          "type": "click_consent_on",
                          "message": "Click counts as consent is ON: a click on any tracked link in this campaign can record that person as having consented. Scanner clicks are not filtered out."
                        },
                        {
                          "type": "open_tracking_off",
                          "message": "Open tracking is OFF: opens will not be measured, so the report will show them as unknown."
                        }
                      ],
                      "explained_by": "comms_get_workspace_settings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "MISSING_TEMPLATE or INVALID_ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "TEMPLATE_NOT_FOUND or CONTACT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsPreviewTemplate"
      }
    },
    "/comm-api/api/templates/rules": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "The template rulebook",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). The template rulebook, generated from the same constants the validator and the lint use: limits, merge variables (and the fallback syntax), what is removed at compile, what is kept but risky, which links are tracked, the text-version rule, and the closed list of finding types with their severity (blocks_scheduling, altered, risk, tip). Read it before drafting or repairing a template.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "limits": {
                      "html_bytes": 512000,
                      "dom_nodes": 2000,
                      "links": 100,
                      "images_advised": 50,
                      "text_chars_advised": 102400,
                      "subject_chars": 998,
                      "subject_advised_chars": 70,
                      "name_chars": 200,
                      "warning_at_fraction": 0.8
                    },
                    "merge_variables": {
                      "known": [
                        "name",
                        "first_name",
                        "email",
                        "identity_name"
                      ],
                      "system": [
                        "unsubscribe_url",
                        "consent_url"
                      ],
                      "fallback_syntax": "{{name|there}}",
                      "fallback_max_chars": 100,
                      "notes": [
                        "Example content",
                        "Example content",
                        "Example content",
                        "Example content",
                        "Example content",
                        "Example content"
                      ]
                    },
                    "removed_at_compile": {
                      "elements": [
                        "script",
                        "iframe",
                        "object",
                        "embed",
                        "applet",
                        "frame",
                        "frameset",
                        "base",
                        "meta http-equiv=refresh"
                      ],
                      "attributes": [],
                      "style_values": [
                        "expression(",
                        "javascript:",
                        "behavior:"
                      ]
                    },
                    "kept_but_risky": [
                      "<style> blocks",
                      "<form> and <input>",
                      "web fonts",
                      "external stylesheets"
                    ],
                    "links": {
                      "tracked": [
                        "<a href> with an http(s) address (rewritten to the tracking domain; UTM policy preserve)"
                      ],
                      "not_tracked": [
                        "mailto:",
                        "tel:",
                        "any address containing \"unsubscribe\" or \"opt-out\"",
                        "the consent link",
                        "relative paths",
                        "#anchors",
                        "non-web schemes (sms:, whatsapp:)"
                      ],
                      "never": [
                        "a merge tag inside an address (refused at schedule)"
                      ]
                    },
                    "text_version": {
                      "rule": "The template's own body_text is kept as written and never replaced; text is generated from the HTML only when the template has none.",
                      "should_contain": [
                        "the web address of every important link",
                        "{{unsubscribe_url}}"
                      ]
                    },
                    "images": {
                      "rule": "No image hosting: use absolute https URLs you host; always give alt text. The open-tracking pixel is added by the sender."
                    },
                    "subject": {
                      "rule": "One line; merge variables allowed (fallbacks single-lined); avoid all capitals; keep it under the advised length."
                    },
                    "severities": [
                      "blocks_scheduling",
                      "altered",
                      "risk",
                      "tip"
                    ],
                    "findings": [
                      {
                        "type": "missing_body",
                        "severity": "blocks_scheduling",
                        "summary": "The template has no body for its type (HTML templates need body_html, text templates need body_text)."
                      },
                      {
                        "type": "missing_unsubscribe_url",
                        "severity": "blocks_scheduling",
                        "summary": "Neither the HTML nor the text carries {{unsubscribe_url}}; a campaign cannot be scheduled without it."
                      },
                      {
                        "type": "unknown_merge_variable",
                        "severity": "blocks_scheduling",
                        "summary": "A merge tag outside the supported set would reach people as literal braces."
                      },
                      {
                        "type": "malformed_merge_tag",
                        "severity": "blocks_scheduling",
                        "summary": "A merge tag is not written correctly (use {{name}} or {{name|fallback}})."
                      },
                      {
                        "type": "fallback_not_allowed",
                        "severity": "blocks_scheduling",
                        "summary": "A fallback is not allowed on the system links {{unsubscribe_url}} and {{consent_url}}."
                      },
                      {
                        "type": "fallback_too_long",
                        "severity": "blocks_scheduling",
                        "summary": "A merge fallback may be at most 100 characters."
                      },
                      {
                        "type": "limit_exceeded",
                        "severity": "blocks_scheduling",
                        "summary": "The template is over a hard limit (size, elements, links or subject length)."
                      },
                      {
                        "type": "merge_variable_in_url",
                        "severity": "blocks_scheduling",
                        "summary": "A merge tag inside a link address is never filled (the tracked link would carry the raw tag) and would put personal data in a URL."
                      },
                      {
                        "type": "script_removed",
                        "severity": "altered",
                        "summary": "Scripts, frames, objects, embeds, applets and base tags are removed at compile; do not rely on them."
                      },
                      {
                        "type": "event_handler_removed",
                        "severity": "altered",
                        "summary": "on... attributes (onclick, onload, ...) are removed at compile."
                      },
                      {
                        "type": "dangerous_url_removed",
                        "severity": "altered",
                        "summary": "javascript:, vbscript: and data:text/html addresses are removed at compile."
                      },
                      {
                        "type": "non_web_link_scheme",
                        "severity": "altered",
                        "summary": "sms:, whatsapp: and other non-web links are not click-tracked and some mail apps will not open them."
                      },
                      {
                        "type": "relative_link",
                        "severity": "altered",
                        "summary": "A relative link (/page) has no meaning in an email and is not tracked; use the full https address."
                      },
                      {
                        "type": "form_in_email",
                        "severity": "altered",
                        "summary": "Forms and inputs are kept but most mail apps ignore or block them; link to a page instead."
                      },
                      {
                        "type": "external_stylesheet",
                        "severity": "altered",
                        "summary": "External stylesheets are kept untouched and are blocked by most mail apps; inline the CSS."
                      },
                      {
                        "type": "style_block_unreliable",
                        "severity": "altered",
                        "summary": "A <style> block is kept but many mail apps drop or rewrite it; inline the CSS for anything important."
                      },
                      {
                        "type": "link_text_domain_mismatch",
                        "severity": "risk",
                        "summary": "The visible link text shows one website but the link goes to another; mail providers treat this as phishing."
                      },
                      {
                        "type": "url_shortener",
                        "severity": "risk",
                        "summary": "Link shorteners are a common spam signal and hide the destination."
                      },
                      {
                        "type": "http_not_https",
                        "severity": "risk",
                        "summary": "A plain http:// link is flagged by some providers and warns the reader in browsers."
                      },
                      {
                        "type": "image_without_alt",
                        "severity": "risk",
                        "summary": "An image without alt text shows nothing when images are blocked and is skipped by screen readers."
                      },
                      {
                        "type": "image_not_https",
                        "severity": "risk",
                        "summary": "Images must be absolute https addresses; http and relative images are blocked or broken."
                      },
                      {
                        "type": "missing_text_version",
                        "severity": "risk",
                        "summary": "An HTML email without a plain-text version scores worse with spam filters and cannot be read by text-only clients."
                      },
                      {
                        "type": "text_without_links",
                        "severity": "risk",
                        "summary": "The text version has no web address although the HTML has links, so text readers cannot click through."
                      },
                      {
                        "type": "unsubscribe_missing_in_text",
                        "severity": "risk",
                        "summary": "The text version has no {{unsubscribe_url}}, so people reading it see no unsubscribe link."
                      },
                      {
                        "type": "all_caps_subject",
                        "severity": "risk",
                        "summary": "An all-capitals subject is a spam signal."
                      },
                      {
                        "type": "subject_too_long",
                        "severity": "risk",
                        "summary": "A subject over 70 characters is cut off in most inboxes."
                      },
                      {
                        "type": "empty_greeting_risk",
                        "severity": "risk",
                        "summary": "A name tag without a fallback prints nothing for contacts without that value (\"Hello ,\")."
                      },
                      {
                        "type": "identity_name_as_brand",
                        "severity": "risk",
                        "summary": "{{identity_name}} is the CONTACT's organisation (filled for about 2% of contacts), not your brand; do not use it as the sender's name."
                      },
                      {
                        "type": "consent_link_inert_outside_consent_request",
                        "severity": "altered",
                        "summary": "{{consent_url}} is a live confirmation link only in a campaign created as a consent request; in any other campaign it is turned into an empty \"#\" link (and removed from the text version)."
                      },
                      {
                        "type": "unsubscribe_link_points_to_landing_page",
                        "severity": "risk",
                        "summary": "A link goes straight to the workspace's unsubscribe landing page. That page only thanks people after they have unsubscribed; it unsubscribes no one. Use {{unsubscribe_url}}."
                      },
                      {
                        "type": "click_consent_without_links",
                        "severity": "tip",
                        "summary": "Click counts as consent is on, but this template has no tracked web link, so nothing in it can record a consent."
                      },
                      {
                        "type": "missing_sender_identity",
                        "severity": "tip",
                        "summary": "No sender name or postal address found in the footer; most jurisdictions expect one (guidance, not legal advice)."
                      },
                      {
                        "type": "no_preheader",
                        "severity": "tip",
                        "summary": "A short hidden preheader line improves the inbox preview."
                      },
                      {
                        "type": "many_links",
                        "severity": "tip",
                        "summary": "Many links in one email can look like spam and dilute the call to action."
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetTemplateRules"
      }
    },
    "/comm-api/api/templates/lint": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Check a template against the rulebook",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Checks a saved template (template_id) or a draft against the rulebook. Findings come from a closed vocabulary; each has id, type, severity, blocks_scheduling, location { field, line, selector, excerpt }, why, and where one exists fix { summary, before, after, auto_applicable }. Also returns summary counts, blocks_scheduling and fixable (the types fixTemplate can repair). Read-only.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "template_id": null,
                    "findings": [
                      {
                        "id": "empty_greeting_risk:subject:1:0",
                        "type": "empty_greeting_risk",
                        "severity": "risk",
                        "blocks_scheduling": false,
                        "location": {
                          "field": "subject",
                          "line": 1,
                          "selector": null,
                          "excerpt": "{{first_name}}"
                        },
                        "why": "Contacts without a first_name would see an empty space where {{first_name}} is.",
                        "fix": {
                          "summary": "Give {{first_name}} a fallback",
                          "before": "{{first_name}}",
                          "after": "{{first_name|there}}",
                          "auto_applicable": true,
                          "raw": "{{first_name}}"
                        },
                        "variable": "{{first_name}}"
                      },
                      {
                        "id": "empty_greeting_risk:body_html:1:1",
                        "type": "empty_greeting_risk",
                        "severity": "risk",
                        "blocks_scheduling": false,
                        "location": {
                          "field": "body_html",
                          "line": 1,
                          "selector": null,
                          "excerpt": "{{first_name}}"
                        },
                        "why": "Contacts without a first_name would see an empty space where {{first_name}} is.",
                        "fix": {
                          "summary": "Give {{first_name}} a fallback",
                          "before": "{{first_name}}",
                          "after": "{{first_name|there}}",
                          "auto_applicable": true,
                          "raw": "{{first_name}}"
                        },
                        "variable": "{{first_name}}"
                      },
                      {
                        "id": "empty_greeting_risk:body_text:1:2",
                        "type": "empty_greeting_risk",
                        "severity": "risk",
                        "blocks_scheduling": false,
                        "location": {
                          "field": "body_text",
                          "line": 1,
                          "selector": null,
                          "excerpt": "{{first_name}}"
                        },
                        "why": "Contacts without a first_name would see an empty space where {{first_name}} is.",
                        "fix": {
                          "summary": "Give {{first_name}} a fallback",
                          "before": "{{first_name}}",
                          "after": "{{first_name|there}}",
                          "auto_applicable": true,
                          "raw": "{{first_name}}"
                        },
                        "variable": "{{first_name}}"
                      },
                      {
                        "id": "missing_sender_identity:body_html:3:3",
                        "type": "missing_sender_identity",
                        "severity": "tip",
                        "blocks_scheduling": false,
                        "location": {
                          "field": "body_html",
                          "line": null,
                          "selector": null,
                          "excerpt": null
                        },
                        "why": "The footer shows no postal address or sender details. Many jurisdictions expect them (guidance, not legal advice).",
                        "fix": null
                      },
                      {
                        "id": "no_preheader:body_html:4:4",
                        "type": "no_preheader",
                        "severity": "tip",
                        "blocks_scheduling": false,
                        "location": {
                          "field": "body_html",
                          "line": null,
                          "selector": null,
                          "excerpt": null
                        },
                        "why": "A hidden first line of 40 to 90 characters becomes the inbox preview text.",
                        "fix": null
                      },
                      {
                        "id": "click_consent_without_links:body_html:5:5",
                        "type": "click_consent_without_links",
                        "severity": "tip",
                        "blocks_scheduling": false,
                        "location": {
                          "field": "body_html",
                          "line": null,
                          "selector": null,
                          "excerpt": null
                        },
                        "why": "Click counts as consent is on for this workspace, but this email has no link whose click is tracked, so it can record no consent.",
                        "fix": null
                      }
                    ],
                    "summary": {
                      "total": 6,
                      "blocks_scheduling": 0,
                      "altered": 0,
                      "risk": 3,
                      "tip": 3
                    },
                    "blocks_scheduling": false,
                    "fixable": [
                      "empty_greeting_risk"
                    ],
                    "settings": {
                      "click_consent": {
                        "enabled": true,
                        "source": "workspace"
                      },
                      "open_tracking": {
                        "enabled": false,
                        "source": "workspace"
                      },
                      "unsubscribe_landing": {
                        "url": null,
                        "saved_url": null,
                        "source": "workspace"
                      },
                      "summary": "Click counts as consent: on. Open tracking: off. Unsubscribe: after unsubscribing people see the shared Motorical page.",
                      "warnings": [
                        {
                          "type": "click_consent_on",
                          "message": "Click counts as consent is ON: a click on any tracked link in this campaign can record that person as having consented. Scanner clicks are not filtered out."
                        },
                        {
                          "type": "open_tracking_off",
                          "message": "Open tracking is OFF: opens will not be measured, so the report will show them as unknown."
                        }
                      ],
                      "explained_by": "comms_get_workspace_settings"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "MISSING_TEMPLATE or INVALID_ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "TEMPLATE_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsLintTemplate"
      }
    },
    "/comm-api/api/templates/fix": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Apply the safe fixes to a template in memory",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Applies only the safe, deterministic fixes (an unsubscribe link, a generated text version, a fallback on a bare name tag, removal of scripts, event handlers and javascript: addresses) IN MEMORY and returns result { subject, body_html, body_text }, changes[] and the re-lint (lint_after). Pass types[] to apply only some. It never saves anything (applied is false): to keep the result, PATCH the template with result. Anything that needs a human (alt text, link destinations, wording, http links) stays a suggestion.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsApplyTemplateFixes"
      }
    },
    "/comm-api/api/templates/check-links": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Check every link of a template",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Every link in the HTML with its kind (link, mailto, tel, unsubscribe, consent), tracked (and the reason when not), and problems[] from: merge_variable_in_url, relative_link, non_web_link_scheme, http_not_https, url_shortener, link_text_domain_mismatch. Returns totals (total, tracked, with_problems). Read-only.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCheckLinks"
      }
    },
    "/comm-api/api/templates/{id}/duplicate": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Duplicate a template",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Copies the template (bodies, kind, description) into a new one named \"<name> (copy)\" with derived_from set to the original. The original is never touched.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,128}$"
            },
            "description": "Optional. Retrying with the same key and the same request replays the stored answer (response header Idempotent-Replay: true); the same key with a different request is 422 IDEMPOTENCY_KEY_REUSED; while the first request is still running it is 409 IDEMPOTENCY_IN_PROGRESS. Keys are per workspace and kept 24 hours."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Template not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "A request with this Idempotency-Key is still running (IDEMPOTENCY_IN_PROGRESS)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was already used with a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsDuplicateTemplate"
      }
    },
    "/comm-api/api/templates/starters": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List the template starters",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). The seven starter skeletons: newsletter, promotion, announcement, welcome, reengagement, event, notice. Each lists its slots (key, type text, paragraph or url, required, max length). Starters produce table-based, inline-CSS email with a hidden preheader, a greeting with a fallback, a footer with the sender and postal address and an unsubscribe link, and a plain-text twin.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "key": "newsletter",
                      "label": "Example 101",
                      "kind": "newsletter",
                      "description": "Example content",
                      "subject_hint": "This month at {your brand}",
                      "slots": [
                        {
                          "key": "headline",
                          "type": "text",
                          "required": true,
                          "label": "Example 102",
                          "max": 200
                        },
                        {
                          "key": "intro",
                          "type": "paragraph",
                          "required": true,
                          "label": "Example 103",
                          "max": 2000
                        },
                        {
                          "key": "item1_title",
                          "type": "text",
                          "required": true,
                          "label": "Example 104",
                          "max": 200
                        },
                        {
                          "key": "item1_text",
                          "type": "paragraph",
                          "required": false,
                          "label": "Example 105",
                          "max": 2000
                        },
                        {
                          "key": "item1_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 106",
                          "max": 500
                        },
                        {
                          "key": "item2_title",
                          "type": "text",
                          "required": false,
                          "label": "Example 107",
                          "max": 200
                        },
                        {
                          "key": "item2_text",
                          "type": "paragraph",
                          "required": false,
                          "label": "Example 108",
                          "max": 2000
                        },
                        {
                          "key": "item2_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 109",
                          "max": 500
                        },
                        {
                          "key": "item3_title",
                          "type": "text",
                          "required": false,
                          "label": "Example 110",
                          "max": 200
                        },
                        {
                          "key": "item3_text",
                          "type": "paragraph",
                          "required": false,
                          "label": "Example 111",
                          "max": 2000
                        },
                        {
                          "key": "item3_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 112",
                          "max": 500
                        },
                        {
                          "key": "cta_label",
                          "type": "text",
                          "required": false,
                          "label": "Example 113",
                          "max": 200
                        },
                        {
                          "key": "cta_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 114",
                          "max": 500
                        },
                        {
                          "key": "preheader",
                          "type": "text",
                          "required": false,
                          "label": "Example 115",
                          "max": 200
                        },
                        {
                          "key": "reason",
                          "type": "text",
                          "required": false,
                          "label": "Example 116",
                          "max": 200
                        }
                      ],
                      "blocks": [
                        "greeting",
                        "heading",
                        "paragraph",
                        "item",
                        "item",
                        "item",
                        "button"
                      ]
                    },
                    {
                      "key": "promotion",
                      "label": "Example 117",
                      "kind": "promotion",
                      "description": "Example content",
                      "subject_hint": "An offer for you",
                      "slots": [
                        {
                          "key": "headline",
                          "type": "text",
                          "required": true,
                          "label": "Example 102",
                          "max": 200
                        },
                        {
                          "key": "deal",
                          "type": "text",
                          "required": false,
                          "label": "Example 118",
                          "max": 200
                        },
                        {
                          "key": "body",
                          "type": "paragraph",
                          "required": true,
                          "label": "Example 119",
                          "max": 2000
                        },
                        {
                          "key": "cta_label",
                          "type": "text",
                          "required": true,
                          "label": "Example 113",
                          "max": 200
                        },
                        {
                          "key": "cta_url",
                          "type": "url",
                          "required": true,
                          "label": "Example 114",
                          "max": 500
                        },
                        {
                          "key": "fine_print",
                          "type": "paragraph",
                          "required": false,
                          "label": "Example 120",
                          "max": 2000
                        },
                        {
                          "key": "preheader",
                          "type": "text",
                          "required": false,
                          "label": "Example 115",
                          "max": 200
                        },
                        {
                          "key": "reason",
                          "type": "text",
                          "required": false,
                          "label": "Example 116",
                          "max": 200
                        }
                      ],
                      "blocks": [
                        "greeting",
                        "heading",
                        "highlight",
                        "paragraph",
                        "button",
                        "small"
                      ]
                    },
                    {
                      "key": "announcement",
                      "label": "Example 121",
                      "kind": "announcement",
                      "description": "Example content",
                      "subject_hint": "News from {your brand}",
                      "slots": [
                        {
                          "key": "headline",
                          "type": "text",
                          "required": true,
                          "label": "Example 102",
                          "max": 200
                        },
                        {
                          "key": "body",
                          "type": "paragraph",
                          "required": true,
                          "label": "Example 119",
                          "max": 2000
                        },
                        {
                          "key": "cta_label",
                          "type": "text",
                          "required": false,
                          "label": "Example 113",
                          "max": 200
                        },
                        {
                          "key": "cta_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 114",
                          "max": 500
                        },
                        {
                          "key": "preheader",
                          "type": "text",
                          "required": false,
                          "label": "Example 115",
                          "max": 200
                        },
                        {
                          "key": "reason",
                          "type": "text",
                          "required": false,
                          "label": "Example 116",
                          "max": 200
                        }
                      ],
                      "blocks": [
                        "greeting",
                        "heading",
                        "paragraph",
                        "button"
                      ]
                    },
                    {
                      "key": "welcome",
                      "label": "Example 122",
                      "kind": "welcome",
                      "description": "Example content",
                      "subject_hint": "Welcome to {your brand}",
                      "slots": [
                        {
                          "key": "headline",
                          "type": "text",
                          "required": true,
                          "label": "Example 102",
                          "max": 200
                        },
                        {
                          "key": "intro",
                          "type": "paragraph",
                          "required": true,
                          "label": "Example 103",
                          "max": 2000
                        },
                        {
                          "key": "step1_title",
                          "type": "text",
                          "required": true,
                          "label": "Example 123",
                          "max": 200
                        },
                        {
                          "key": "step1_text",
                          "type": "paragraph",
                          "required": false,
                          "label": "Example 124",
                          "max": 2000
                        },
                        {
                          "key": "step1_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 125",
                          "max": 500
                        },
                        {
                          "key": "step2_title",
                          "type": "text",
                          "required": false,
                          "label": "Example 126",
                          "max": 200
                        },
                        {
                          "key": "step2_text",
                          "type": "paragraph",
                          "required": false,
                          "label": "Example 127",
                          "max": 2000
                        },
                        {
                          "key": "step2_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 128",
                          "max": 500
                        },
                        {
                          "key": "step3_title",
                          "type": "text",
                          "required": false,
                          "label": "Example 129",
                          "max": 200
                        },
                        {
                          "key": "step3_text",
                          "type": "paragraph",
                          "required": false,
                          "label": "Example 130",
                          "max": 2000
                        },
                        {
                          "key": "step3_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 131",
                          "max": 500
                        },
                        {
                          "key": "cta_label",
                          "type": "text",
                          "required": false,
                          "label": "Example 113",
                          "max": 200
                        },
                        {
                          "key": "cta_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 114",
                          "max": 500
                        },
                        {
                          "key": "preheader",
                          "type": "text",
                          "required": false,
                          "label": "Example 115",
                          "max": 200
                        },
                        {
                          "key": "reason",
                          "type": "text",
                          "required": false,
                          "label": "Example 116",
                          "max": 200
                        }
                      ],
                      "blocks": [
                        "greeting",
                        "heading",
                        "paragraph",
                        "item",
                        "item",
                        "item",
                        "button"
                      ]
                    },
                    {
                      "key": "reengagement",
                      "label": "Example 132",
                      "kind": "reengagement",
                      "description": "Example content",
                      "subject_hint": "Still interested?",
                      "slots": [
                        {
                          "key": "headline",
                          "type": "text",
                          "required": true,
                          "label": "Example 102",
                          "max": 200
                        },
                        {
                          "key": "body",
                          "type": "paragraph",
                          "required": true,
                          "label": "Example 119",
                          "max": 2000
                        },
                        {
                          "key": "cta_label",
                          "type": "text",
                          "required": true,
                          "label": "Example 113",
                          "max": 200
                        },
                        {
                          "key": "cta_url",
                          "type": "url",
                          "required": true,
                          "label": "Example 114",
                          "max": 500
                        },
                        {
                          "key": "preheader",
                          "type": "text",
                          "required": false,
                          "label": "Example 115",
                          "max": 200
                        },
                        {
                          "key": "reason",
                          "type": "text",
                          "required": false,
                          "label": "Example 116",
                          "max": 200
                        }
                      ],
                      "blocks": [
                        "greeting",
                        "heading",
                        "paragraph",
                        "button"
                      ]
                    },
                    {
                      "key": "event",
                      "label": "Example 133",
                      "kind": "event",
                      "description": "Example content",
                      "subject_hint": "You are invited",
                      "slots": [
                        {
                          "key": "headline",
                          "type": "text",
                          "required": true,
                          "label": "Example 102",
                          "max": 200
                        },
                        {
                          "key": "when",
                          "type": "text",
                          "required": true,
                          "label": "Example 134",
                          "max": 200
                        },
                        {
                          "key": "where",
                          "type": "text",
                          "required": true,
                          "label": "Example 135",
                          "max": 200
                        },
                        {
                          "key": "body",
                          "type": "paragraph",
                          "required": true,
                          "label": "Example 119",
                          "max": 2000
                        },
                        {
                          "key": "cta_label",
                          "type": "text",
                          "required": true,
                          "label": "Example 113",
                          "max": 200
                        },
                        {
                          "key": "cta_url",
                          "type": "url",
                          "required": true,
                          "label": "Example 114",
                          "max": 500
                        },
                        {
                          "key": "preheader",
                          "type": "text",
                          "required": false,
                          "label": "Example 115",
                          "max": 200
                        },
                        {
                          "key": "reason",
                          "type": "text",
                          "required": false,
                          "label": "Example 116",
                          "max": 200
                        }
                      ],
                      "blocks": [
                        "greeting",
                        "heading",
                        "line",
                        "line",
                        "paragraph",
                        "button"
                      ]
                    },
                    {
                      "key": "notice",
                      "label": "Example 136",
                      "kind": "notice",
                      "description": "Example content",
                      "subject_hint": "An important update",
                      "slots": [
                        {
                          "key": "headline",
                          "type": "text",
                          "required": true,
                          "label": "Example 102",
                          "max": 200
                        },
                        {
                          "key": "body",
                          "type": "paragraph",
                          "required": true,
                          "label": "Example 119",
                          "max": 2000
                        },
                        {
                          "key": "cta_label",
                          "type": "text",
                          "required": false,
                          "label": "Example 113",
                          "max": 200
                        },
                        {
                          "key": "cta_url",
                          "type": "url",
                          "required": false,
                          "label": "Example 114",
                          "max": 500
                        },
                        {
                          "key": "preheader",
                          "type": "text",
                          "required": false,
                          "label": "Example 115",
                          "max": 200
                        },
                        {
                          "key": "reason",
                          "type": "text",
                          "required": false,
                          "label": "Example 116",
                          "max": 200
                        }
                      ],
                      "blocks": [
                        "greeting",
                        "heading",
                        "paragraph",
                        "button"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListStarters"
      }
    },
    "/comm-api/api/templates/starters/{key}": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get one template starter",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). One starter with its slots and the order of its blocks.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "key": "newsletter",
                    "label": "Example 101",
                    "kind": "newsletter",
                    "description": "Example content",
                    "subject_hint": "This month at {your brand}",
                    "slots": [
                      {
                        "key": "headline",
                        "type": "text",
                        "required": true,
                        "label": "Example 102",
                        "max": 200
                      },
                      {
                        "key": "intro",
                        "type": "paragraph",
                        "required": true,
                        "label": "Example 103",
                        "max": 2000
                      },
                      {
                        "key": "item1_title",
                        "type": "text",
                        "required": true,
                        "label": "Example 104",
                        "max": 200
                      },
                      {
                        "key": "item1_text",
                        "type": "paragraph",
                        "required": false,
                        "label": "Example 105",
                        "max": 2000
                      },
                      {
                        "key": "item1_url",
                        "type": "url",
                        "required": false,
                        "label": "Example 106",
                        "max": 500
                      },
                      {
                        "key": "item2_title",
                        "type": "text",
                        "required": false,
                        "label": "Example 107",
                        "max": 200
                      },
                      {
                        "key": "item2_text",
                        "type": "paragraph",
                        "required": false,
                        "label": "Example 108",
                        "max": 2000
                      },
                      {
                        "key": "item2_url",
                        "type": "url",
                        "required": false,
                        "label": "Example 109",
                        "max": 500
                      },
                      {
                        "key": "item3_title",
                        "type": "text",
                        "required": false,
                        "label": "Example 110",
                        "max": 200
                      },
                      {
                        "key": "item3_text",
                        "type": "paragraph",
                        "required": false,
                        "label": "Example 111",
                        "max": 2000
                      },
                      {
                        "key": "item3_url",
                        "type": "url",
                        "required": false,
                        "label": "Example 112",
                        "max": 500
                      },
                      {
                        "key": "cta_label",
                        "type": "text",
                        "required": false,
                        "label": "Example 113",
                        "max": 200
                      },
                      {
                        "key": "cta_url",
                        "type": "url",
                        "required": false,
                        "label": "Example 114",
                        "max": 500
                      },
                      {
                        "key": "preheader",
                        "type": "text",
                        "required": false,
                        "label": "Example 115",
                        "max": 200
                      },
                      {
                        "key": "reason",
                        "type": "text",
                        "required": false,
                        "label": "Example 116",
                        "max": 200
                      }
                    ],
                    "blocks": [
                      "greeting",
                      "heading",
                      "paragraph",
                      "item",
                      "item",
                      "item",
                      "button"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "STARTER_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetStarter"
      }
    },
    "/comm-api/api/templates/starters/{key}/render": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Render a starter with a brand kit, without saving",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Dry run: the finished email for the stored brand kit (a brand object in the body overrides it field by field) and slots, plus its lint. Nothing is saved. Refusals are named: BRAND_KIT_INCOMPLETE (missing[] lists sender_name and/or postal_address: ask the person, never invent them), MISSING_SLOT and UNKNOWN_SLOT (slots[]), SLOT_TOO_LONG, INVALID_SLOT_URL (links must be full https addresses without merge tags), STARTER_NOT_FOUND.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "STARTER_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "BRAND_KIT_INCOMPLETE, MISSING_SLOT, UNKNOWN_SLOT, SLOT_TOO_LONG, INVALID_SLOT_URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsRenderStarter"
      }
    },
    "/comm-api/api/templates/from-starter": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Create a template from a starter and the brand kit",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Builds the email from a starter, slots and the workspace brand kit (an inline brand overrides it field by field) and SAVES it as a normal html template. Body: starter, name (required), slots, subject? (defaults to the headline), description?, kind? (defaults to the starter kind), brand?. Returns template, lint, kit_source (stored, inline or stored+inline) and starter. Later edits are normal edits; nothing stays linked to the starter. Same named refusals as the render (BRAND_KIT_INCOMPLETE and the slot codes), plus MISSING_NAME and INVALID_KIND; nothing is written when it refuses.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._:-]{8,128}$"
            },
            "description": "Optional. Retrying with the same key and the same request replays the stored answer (response header Idempotent-Replay: true); the same key with a different request is 422 IDEMPOTENCY_KEY_REUSED; while the first request is still running it is 409 IDEMPOTENCY_IN_PROGRESS. Keys are per workspace and kept 24 hours."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "STARTER_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "A request with this Idempotency-Key is still running (IDEMPOTENCY_IN_PROGRESS)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "The Idempotency-Key was already used with a different request (IDEMPOTENCY_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCreateTemplateFromStarter"
      }
    },
    "/comm-api/api/settings/brand-kit": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get the workspace brand kit",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). The workspace brand kit: brand_kit as stored, missing (what a starter still needs: sender_name, postal_address), ready_for_starters and effective (the kit with the design defaults a starter would use). Fields: sender_name, postal_address, logo_url (https), colors { text, background, card, primary } as #rrggbb, font (system_sans, arial_sans, verdana_sans, trebuchet_sans, georgia_serif, courier_mono), button_radius (0 to 24), footer_text, reply_to, tone_notes, language, description.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "brand_kit": {
                      "font": "system_sans",
                      "language": "lv",
                      "sender_name": "busomat",
                      "button_radius": 6,
                      "postal_address": "Brīvības iela 311, LV-1001, Latvia"
                    },
                    "missing": [],
                    "ready_for_starters": true,
                    "effective": {
                      "font": "system_sans",
                      "language": "lv",
                      "sender_name": "busomat",
                      "button_radius": 6,
                      "postal_address": "Brīvības iela 311, LV-1001, Latvia",
                      "colors": {
                        "text": "Example content",
                        "background": "#f4f4f4",
                        "card": "#ffffff",
                        "primary": "#1a5fb4"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetBrandKit"
      },
      "patch": {
        "tags": [
          "Communications"
        ],
        "summary": "Update the workspace brand kit",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Partial: only the fields you send change; null clears a field (null clears a colour back to its default); colours merge one by one. An invalid value is 400 INVALID_BRAND_KIT with the field named. Legal identity (sender_name, postal_address) is never filled in on the person's behalf.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "INVALID_BRAND_KIT (field names the offender) or NO_FIELDS",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsSetBrandKit"
      }
    },
    "/comm-api/api/consent-events": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "List consent events",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "events": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "contact_id": "00000000-0000-4000-8000-000000000002",
                        "contact_email": "recipient@example3.com",
                        "campaign_id": "00000000-0000-4000-8000-000000000003",
                        "campaign_name": "Example 30",
                        "source": "campaign_click",
                        "occurred_at": "2026-11-04T21:15:45.316Z",
                        "metadata": {},
                        "consent_kind": "inferred"
                      }
                    ],
                    "pagination": {
                      "page": 1,
                      "limit": 50,
                      "total": 1,
                      "totalPages": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsListConsentEvents"
      }
    },
    "/comm-api/api/consent-events/analytics": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get consent-event analytics",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`).",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "total": 1,
                    "explicit_total": 0,
                    "inferred_total": 1,
                    "by_source": {
                      "campaign_click": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetConsentAnalytics"
      }
    },
    "/comm-api/api/analytics/overview": {
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Get Communications analytics overview",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Ranks every campaign active in the window and reads the same per-recipient report as the campaign endpoints, so the numbers agree.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "overview": {
                      "clicked": {
                        "total_events": 6,
                        "campaigns": 3,
                        "unique_recipients": 5
                      },
                      "delivered": {
                        "total_events": 16,
                        "campaigns": 4,
                        "unique_recipients": 4
                      },
                      "queued": {
                        "total_events": 17,
                        "campaigns": 4,
                        "unique_recipients": 5
                      },
                      "sent": {
                        "total_events": 1,
                        "campaigns": 1,
                        "unique_recipients": 1
                      }
                    },
                    "top_campaigns": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "name": "Example 33",
                        "sent": 4,
                        "delivered": 4,
                        "clicked": 3,
                        "unique_clickers": 3,
                        "click_rate": 75
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "name": "Example 30",
                        "sent": 5,
                        "delivered": 5,
                        "clicked": 2,
                        "unique_clickers": 2,
                        "click_rate": 40
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "name": "Example 34",
                        "sent": 4,
                        "delivered": 4,
                        "clicked": 1,
                        "unique_clickers": 1,
                        "click_rate": 25
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000004",
                        "name": "Example 32",
                        "sent": 4,
                        "delivered": 4,
                        "clicked": 0,
                        "unique_clickers": 0,
                        "click_rate": 0
                      }
                    ],
                    "period_days": 30
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetAnalyticsOverview"
      }
    },
    "/comm-api/api/gdpr/export": {
      "post": {
        "tags": [
          "Communications"
        ],
        "summary": "Email a contact their GDPR data export",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "Communications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Sends the export for the address in the body (email, format json or csv) to that address. This sends mail, which is why POST is the supported method. 400 INVALID_EMAIL / INVALID_FORMAT, 404 when the contact does not exist in this workspace.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsCreateGdprExport"
      },
      "get": {
        "tags": [
          "Communications"
        ],
        "summary": "Email a contact their GDPR data export (deprecated: use POST)",
        "servers": [
          {
            "url": "https://motorical.com",
            "description": "Communications API gateway"
          }
        ],
        "description": "**Deprecated since 2026-10-25.** No removal date is set yet; one will be announced at least 90 days ahead. Use POST /comm-api/api/gdpr/export (the call emails the export, so POST is the supported method) instead. Policy: https://docs.motorical.com/api-reference/versioning\n\nCommunications Block endpoint. Requires `X-Tenant-Id` (workspace id) plus caller auth: `Authorization: Bearer <dashboard JWT>` or `Authorization: ApiKey ak_live_...` (must own the workspace). Discover default workspace via `GET /api/comm/tenant` (returns `tenantId` + `workspaces[]`). Deprecated: it sends mail, so a prefetch or a stray link can trigger it. Use POST.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <dashboard JWT> or ApiKey ak_live_..."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {},
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Tenant entitlement required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "security": [
          {
            "tenantHeaderAuth": []
          }
        ],
        "operationId": "commsGetGdprExport",
        "deprecated": true,
        "x-deprecated-at": "2026-10-25",
        "x-sunset": null
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Short-lived Public Analytics API token used for /api/public/v1 endpoints."
      },
      "dashboardBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Dashboard session JWT used only to mint Public Analytics API tokens."
      },
      "accountApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Account API key for token minting. Format: ApiKey ak_live_..."
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Motor Block API key. Format: ApiKey mk_live_..."
      },
      "xApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Alternative API key header. Use ak_live_... for token minting or mk_live_... for /v1/send."
      },
      "tenantHeaderAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tenant-Id",
        "description": "Communications Block tenant identifier used to scope lists, templates, campaigns, suppressions, and analytics."
      }
    },
    "schemas": {
      "MotorBlocksListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RateLimitsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "burst": {
                "$ref": "#/components/schemas/LimitBucket"
              },
              "hourly": {
                "$ref": "#/components/schemas/LimitBucket"
              },
              "daily": {
                "$ref": "#/components/schemas/LimitBucket"
              },
              "limits": {
                "type": "object",
                "description": "Raw customer-configured limits (unaffected by throttling)"
              },
              "throttled": {
                "type": "boolean",
                "description": "Whether a system-imposed throttle is currently lowering the effective ceiling below the configured limits"
              },
              "throttleReason": {
                "type": "string",
                "nullable": true,
                "description": "Reason for the active throttle, if any"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "warning": {
            "type": "string",
            "description": "Present only when counter data was temporarily unavailable; the bucket values are then ceiling-only estimates, not live counts. Note this sits at the response root here, while AccountRateLimitsResponse carries it inside data."
          }
        }
      },
      "AccountRateLimitsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "hourly": {
                "$ref": "#/components/schemas/AccountLimitBucket"
              },
              "daily": {
                "$ref": "#/components/schemas/AccountLimitBucket"
              },
              "source": {
                "type": "string",
                "description": "Where the account ceiling came from -- \"plan\" or \"fallback\""
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              },
              "warning": {
                "type": "string",
                "description": "Present only when account usage data was temporarily unavailable (e.g. a Redis outage); the bucket values above are then fallback estimates, not live counts"
              }
            }
          }
        }
      },
      "AccountLimitBucket": {
        "type": "object",
        "properties": {
          "used": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "resetIn": {
            "type": "integer"
          }
        }
      },
      "LimitBucket": {
        "type": "object",
        "properties": {
          "used": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "percentage": {
            "type": "integer"
          },
          "resetIn": {
            "type": "integer"
          }
        }
      },
      "LogsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LogItem"
                }
              },
              "nextCursor": {
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      },
      "MessageSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "smtpMessageId": {
            "type": "string",
            "nullable": true
          },
          "recipient": {
            "type": "string"
          },
          "currentOutcome": {
            "type": "string",
            "enum": [
              "queued",
              "processed",
              "deferred",
              "delivered",
              "bounced",
              "failed",
              "complained"
            ]
          },
          "smtpCode": {
            "type": "string",
            "nullable": true
          },
          "queuedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MessageResource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "smtpMessageId": {
            "type": "string",
            "nullable": true
          },
          "currentOutcome": {
            "type": "string"
          },
          "isTerminal": {
            "type": "boolean"
          },
          "from": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "queuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "processedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deliveredAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "bouncedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "smtpCode": {
            "type": "string",
            "nullable": true
          },
          "smtpResponse": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "smtpMessageId": {
            "type": "string",
            "nullable": true
          },
          "motorBlockId": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subject": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "currentOutcome": {
            "type": "string"
          },
          "isTerminal": {
            "type": "boolean"
          },
          "smtpCode": {
            "type": "string",
            "nullable": true
          },
          "smtpResponse": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "LogItem": {
        "$ref": "#/components/schemas/MessageSummary"
      },
      "MetricsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "series": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MetricsPoint"
                }
              },
              "totals": {
                "$ref": "#/components/schemas/MetricsTotals"
              }
            }
          }
        }
      },
      "MetricsPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time"
          },
          "total": {
            "type": "integer"
          },
          "processed": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "deferred": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "complained": {
            "type": "integer"
          }
        }
      },
      "MetricsTotals": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "processed": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "deferred": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "complained": {
            "type": "integer"
          }
        }
      },
      "OverviewResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "timeWindow": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "to": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "totals": {
                "type": "object",
                "properties": {
                  "sent": {
                    "type": "integer"
                  },
                  "delivered": {
                    "type": "integer"
                  },
                  "bounced": {
                    "type": "integer"
                  },
                  "complained": {
                    "type": "integer"
                  }
                }
              },
              "rates": {
                "type": "object",
                "properties": {
                  "deliveryRate": {
                    "type": "number"
                  },
                  "bounceRate": {
                    "type": "number"
                  },
                  "complaintRate": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/MessageResource"
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Every error body on this API. Branch on `code` (case-sensitive, never changes once published); never on `error` or `message` text. Every code: https://docs.motorical.com/api-reference/errors",
        "required": [
          "success",
          "error",
          "code"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "code": {
            "type": "string",
            "description": "Stable machine code. New codes are lower snake_case; some older codes are upper case and stay that way. Catalogue: https://docs.motorical.com/api-reference/errors",
            "examples": [
              "api_key_required",
              "VALIDATION_ERROR",
              "rate_limited_block"
            ]
          },
          "error": {
            "type": "string",
            "description": "Short description, or the code itself on some routes. For display, not for branching."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation. Can change."
          },
          "requestId": {
            "type": "string",
            "description": "Same value as the X-Request-Id response header."
          },
          "details": {
            "description": "Per-field problems on validation errors, or extra context."
          },
          "nextAction": {
            "type": "object",
            "description": "When present: what to do next, and whether a person must do it (humanRequired).",
            "additionalProperties": true
          },
          "retryAfterSeconds": {
            "type": "integer",
            "description": "On some 429 and 503 answers: seconds to wait. The Retry-After header carries the same value where set."
          }
        },
        "additionalProperties": true,
        "example": {
          "success": false,
          "code": "api_key_required",
          "error": "API key required for /v1/send",
          "message": "API key required for /v1/send: send Authorization: ApiKey mk_live_<prefix>_<secret> (or X-Api-Key), or an OAuth token with send:transactional",
          "requestId": "req_5f0c2a9d4b7e41c3a8e2f6b1"
        }
      }
    },
    "headers": {
      "RequestId": {
        "description": "Unique id of this request, on every response. Quote it to support. A safe caller-supplied X-Request-Id is echoed back.",
        "schema": {
          "type": "string"
        }
      }
    }
  },
  "x-motorical-error-codes": [
    "api_key_required",
    "invalid_api_key",
    "access_token_required",
    "invalid_access_token",
    "invalid_token_type",
    "authorization_revoked",
    "INVALID_TOKEN",
    "TOKEN_EXPIRED",
    "unauthorized",
    "missing_scope",
    "grant_mismatch",
    "delegation_grant_mismatch",
    "motor_block_not_authorized",
    "motor_block_not_owned",
    "motor_block_not_found",
    "motor_block_id_required",
    "motor_block_id_conflict",
    "no_motor_block_covered",
    "oauth_grant_inactive",
    "subscription_required",
    "account_suspended",
    "ACCOUNT_NOT_VERIFIED",
    "use_comms_api",
    "feature_not_enabled",
    "forbidden",
    "MISSING_TOKEN",
    "AUTH_ERROR",
    "MISSING_REFRESH_TOKEN",
    "INVALID_REFRESH_TOKEN",
    "PASSWORD_NOT_SET",
    "PASSWORD_SETUP_NOT_REQUIRED",
    "ACCOUNT_SUSPENDED",
    "SIGNS_IN_ELSEWHERE",
    "VERIFIED_NO_PASSWORD",
    "UNVERIFIED_TOKEN_REFRESHED",
    "UNVERIFIED_EXPIRING_SOON",
    "EMAIL_CODE_REQUIRED",
    "EMAIL_CODE_NOT_APPLICABLE",
    "EMAIL_CODE_RATE_LIMITED",
    "NO_MFA_FACTOR",
    "TOTP_ALREADY_ENABLED",
    "AUTH_RATE_LIMIT",
    "signup_handoff_rate_limit",
    "signup_handoff_status_rate_limit",
    "ACCESS_DENIED",
    "DNS_TOKEN_MISMATCH",
    "DNS_RECORD_NOT_FOUND",
    "DNS_VERIFICATION_FAILED",
    "EMAIL_REQUIRED",
    "INVALID_EMAIL",
    "DOMAIN_HAS_MOTOR_BLOCKS",
    "VALIDATION_ERROR",
    "MISSING_REQUIRED_FIELD",
    "DISALLOWED_HEADERS",
    "ILLEGAL_HEADER_CHARS",
    "conflicting_fields",
    "invalid_attachment",
    "invalid_email",
    "invalid_id",
    "invalid_smtp_code",
    "IDEMPOTENCY_KEY_REQUIRED",
    "IDEMPOTENCY_KEY_INVALID",
    "idempotency_key_conflict",
    "webhook_url_blocked",
    "bad_request",
    "unprocessable",
    "DOMAIN_DNS_INCOMPLETE",
    "recipient_suppressed",
    "content_policy_rejected",
    "attachment_too_large",
    "attachments_total_too_large",
    "too_many_attachments",
    "attachment_type_not_allowed",
    "attachments_not_allowed",
    "payload_too_large",
    "message_too_large",
    "gateway_reply_unreadable",
    "delivery_status_unknown",
    "temporarily_unavailable",
    "sandbox_outbound_locked",
    "sandbox_recipient_denied",
    "allowlist_full",
    "sandbox_monthly_limit",
    "sandbox_dns_unavailable",
    "domain_has_motor_block",
    "free_recipient_not_confirmed",
    "free_policy_unavailable",
    "own_address",
    "recipient_limit",
    "invalid_code",
    "expired",
    "email_send_failed",
    "rate_limited_block",
    "rate_limited_account",
    "rate_limited_warmup",
    "rate_limit_exceeded",
    "RATE_LIMIT_EXCEEDED",
    "RATE_LIMIT_ANONYMOUS",
    "rate_limited",
    "dryrun_rate_limited",
    "too_many_large_requests",
    "allowlist_request_rate_limit",
    "free_recipient_request_rate_limit",
    "NOT_FOUND",
    "not_found",
    "domain_not_found",
    "account_not_found",
    "user_not_found",
    "grant_not_found",
    "not_an_oauth_grant",
    "DUPLICATE_RESOURCE",
    "FOREIGN_KEY_ERROR",
    "conflict",
    "method_not_allowed",
    "INTERNAL_ERROR",
    "APPLICATION_ERROR",
    "SERVICE_UNAVAILABLE",
    "FILE_TOO_LARGE",
    "TOO_MANY_FILES",
    "internal_error",
    "bad_gateway",
    "service_unavailable",
    "gateway_timeout"
  ]
}
