Mailrith Email Marketing
Qué hace este MCP
Manages email marketing subscribers, templates, broadcasts, automations, scheduling, testing, and campaign analytics.
Herramientas
Esquema de entrada
{'type': 'object', '$defs': {'AnalyticsReportCreateRequest': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': 'string', 'format': 'date'}, 'from': {'type': 'string', 'format': 'date'}, 'group_by': {'type': 'array', 'items': {'enum': ['source_type', 'source', 'message', 'provider', 'day'], 'type': 'string'}, 'maxItems': 2}, 'source_ids': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}, 'source_types': {'type': 'array', 'items': {'enum': ['broadcast', 'sequence', 'automation'], 'type': 'string'}, 'maxItems': 3}, 'compare_previous': {'type': 'boolean', 'default': True}}, 'additionalProperties': False}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/AnalyticsReportCreateRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'AnalyticsReport': {'type': 'object', 'required': ['self'], 'properties': {'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}}, 'description': 'A 24-hour cached report with at most 100 aggregate rows, explicit definitions, freshness, attribution, and optional previous-period comparison.', 'additionalProperties': True}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'anyOf': [{'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/AnalyticsReport'}}}, {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/AnalyticsReport'}}}]}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'createAnalyticsReport', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['report_id'], 'properties': {'limit': {'type': 'integer', 'maximum': 50, 'minimum': 1, 'description': 'Maximum aggregate row count, from 1 to 50.'}, 'report_id': {'type': 'string', 'description': 'Stable analytics report identifier.'}, 'starting_after': {'type': 'string', 'description': 'Opaque next_cursor returned by the previous report page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'AnalyticsReport': {'type': 'object', 'required': ['self'], 'properties': {'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}}, 'description': 'A 24-hour cached report with at most 100 aggregate rows, explicit definitions, freshness, attribution, and optional previous-period comparison.', 'additionalProperties': True}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/AnalyticsReport'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getAnalyticsReport', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'AutomationPath': {'type': 'object', 'required': ['id', 'label'], 'properties': {'id': {'type': 'string'}, 'label': {'type': 'string'}, 'weight': {'type': ['number', 'null']}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStep': {'type': 'object', 'required': ['id', 'kind', 'type'], 'properties': {'id': {'type': 'string'}, 'kind': {'enum': ['event', 'action', 'condition'], 'type': 'string'}, 'note': {'type': ['string', 'null']}, 'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'sequence_completed', 'add_tag', 'remove_tag', 'add_to_sequence', 'remove_from_sequence', 'change_subscriber_status', 'wait', 'update_custom_field', 'send_email', 'send_internal_notification', 'start_automation', 'remove_from_automation', 'webhook', 'end_automation', 'has_tag', 'custom_field_match', 'sequence_membership', 'subscriber_status', 'email_opened', 'email_clicked'], 'type': 'string'}, 'paths': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationPath'}}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'config': {'$ref': '#/$defs/AutomationStepConfig'}, 'branches': {'type': 'object', 'additionalProperties': {'type': ['string', 'null']}}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationTrigger': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'subscriber_status'], 'type': 'string'}, 'tagId': {'type': ['string', 'null']}, 'tagIds': {'type': 'array', 'items': {'type': 'string'}}, 'operator': {'enum': ['is', 'is_not'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}}, 'magicLinkId': {'type': ['string', 'null']}, 'magicLinkIds': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AutomationDefinition': {'type': 'object', 'example': {'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}, 'examples': [{'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}], 'required': ['steps'], 'properties': {'steps': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationStep'}, 'maxItems': 256}, 'trigger': {'anyOf': [{'$ref': '#/$defs/AutomationTrigger'}, {'type': 'null'}]}, 'version': {'enum': [2], 'type': 'integer'}, 'triggers': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationTrigger'}}, 'entryPoints': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationEntryPoint'}}}, 'additionalProperties': False}, 'AutomationEntryPoint': {'type': 'object', 'required': ['id', 'trigger'], 'properties': {'id': {'type': 'string'}, 'name': {'type': ['string', 'null']}, 'trigger': {'$ref': '#/$defs/AutomationTrigger'}, 'description': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStepConfig': {'type': 'object', 'properties': {'url': {'type': 'string', 'format': 'uri'}, 'date': {'type': 'string', 'format': 'date'}, 'mode': {'enum': ['duration', 'until_custom_date', 'until_custom_field_date'], 'type': 'string'}, 'tagId': {'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'method': {'enum': ['POST', 'PUT', 'PATCH'], 'type': 'string'}, 'status': {'type': 'string'}, 'emailId': {'type': 'string'}, 'headers': {'type': 'array', 'items': {'type': 'object', 'required': ['key'], 'properties': {'key': {'type': 'string'}, 'value': {'type': 'string', 'writeOnly': True, 'description': 'A secret header value accepted on writes and never returned.'}, 'configured': {'type': 'boolean', 'description': 'True when Mailrith has a saved value for this header. Send this unchanged during an update to preserve the saved value.'}}, 'additionalProperties': False}}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utmTerm': {'type': 'string'}, 'authType': {'enum': ['none', 'bearer'], 'type': 'string'}, 'operator': {'enum': ['equals', 'not_equals', 'contains', 'not_contains', 'starts_with', 'ends_with', 'exists', 'missing', 'greater_than', 'greater_than_or_equal', 'less_than', 'less_than_or_equal', 'on', 'not_on', 'before', 'on_or_before', 'after', 'on_or_after', 'contains_any', 'contains_all', 'does_not_contain_any', 'is_checked', 'is_not_checked'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'type': 'string'}}, 'waitMode': {'enum': ['duration', 'custom_date'], 'type': 'string'}, 'operation': {'enum': ['set', 'clear', 'increment', 'decrement', 'set_today', 'add_choices', 'remove_choices', 'set_true', 'set_false', 'toggle'], 'type': 'string'}, 'timeOfDay': {'type': 'string', 'pattern': '^([01]\\d|2[0-3]):[0-5]\\d$'}, 'utmMedium': {'type': 'string'}, 'utmSource': {'type': 'string'}, 'dateSource': {'enum': ['custom_field', 'fixed_date'], 'type': 'string'}, 'sequenceId': {'type': 'string'}, 'trackOpens': {'type': 'boolean'}, 'utmContent': {'type': 'string'}, 'bearerToken': {'type': 'string', 'writeOnly': True}, 'includeTags': {'type': 'boolean'}, 'magicLinkId': {'type': 'string'}, 'previewText': {'type': 'string'}, 'trackClicks': {'type': 'boolean'}, 'utmCampaign': {'type': 'string'}, 'automationId': {'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'durationUnit': {'enum': ['minute', 'hour', 'day', 'week'], 'type': 'string'}, 'lookbackDays': {'type': 'integer', 'minimum': 1}, 'replyToEmail': {'type': 'string'}, 'customFieldId': {'type': 'string'}, 'durationValue': {'type': 'number', 'minimum': 0}, 'exitNextStepId': {'type': ['string', 'null']}, 'recipientEmail': {'type': 'string', 'format': 'email'}, 'includeSubscriber': {'type': 'boolean'}, 'waitForCompletion': {'type': 'boolean'}, 'waitUntilComplete': {'type': 'boolean'}, 'includeCustomFields': {'type': 'boolean'}, 'bearerTokenConfigured': {'type': 'boolean', 'description': 'True when Mailrith has a saved webhook bearer token. Send this unchanged during an update to preserve the saved value. The token value is never returned.'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'AutomationUpsertRequest': {'type': 'object', 'required': ['name', 'definition'], 'properties': {'name': {'type': 'string'}, 'definition': {'$ref': '#/$defs/AutomationDefinition'}}, 'additionalProperties': False}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/AutomationUpsertRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Automation': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'definition', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'running', 'paused'], 'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/AutomationDefinition'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Automation change.'}, 'subscriber_count': {'type': 'integer'}}}, 'AutomationPath': {'type': 'object', 'required': ['id', 'label'], 'properties': {'id': {'type': 'string'}, 'label': {'type': 'string'}, 'weight': {'type': ['number', 'null']}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStep': {'type': 'object', 'required': ['id', 'kind', 'type'], 'properties': {'id': {'type': 'string'}, 'kind': {'enum': ['event', 'action', 'condition'], 'type': 'string'}, 'note': {'type': ['string', 'null']}, 'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'sequence_completed', 'add_tag', 'remove_tag', 'add_to_sequence', 'remove_from_sequence', 'change_subscriber_status', 'wait', 'update_custom_field', 'send_email', 'send_internal_notification', 'start_automation', 'remove_from_automation', 'webhook', 'end_automation', 'has_tag', 'custom_field_match', 'sequence_membership', 'subscriber_status', 'email_opened', 'email_clicked'], 'type': 'string'}, 'paths': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationPath'}}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'config': {'$ref': '#/$defs/AutomationStepConfig'}, 'branches': {'type': 'object', 'additionalProperties': {'type': ['string', 'null']}}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationTrigger': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'subscriber_status'], 'type': 'string'}, 'tagId': {'type': ['string', 'null']}, 'tagIds': {'type': 'array', 'items': {'type': 'string'}}, 'operator': {'enum': ['is', 'is_not'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}}, 'magicLinkId': {'type': ['string', 'null']}, 'magicLinkIds': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AutomationDefinition': {'type': 'object', 'example': {'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}, 'examples': [{'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}], 'required': ['steps'], 'properties': {'steps': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationStep'}, 'maxItems': 256}, 'trigger': {'anyOf': [{'$ref': '#/$defs/AutomationTrigger'}, {'type': 'null'}]}, 'version': {'enum': [2], 'type': 'integer'}, 'triggers': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationTrigger'}}, 'entryPoints': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationEntryPoint'}}}, 'additionalProperties': False}, 'AutomationEntryPoint': {'type': 'object', 'required': ['id', 'trigger'], 'properties': {'id': {'type': 'string'}, 'name': {'type': ['string', 'null']}, 'trigger': {'$ref': '#/$defs/AutomationTrigger'}, 'description': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStepConfig': {'type': 'object', 'properties': {'url': {'type': 'string', 'format': 'uri'}, 'date': {'type': 'string', 'format': 'date'}, 'mode': {'enum': ['duration', 'until_custom_date', 'until_custom_field_date'], 'type': 'string'}, 'tagId': {'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'method': {'enum': ['POST', 'PUT', 'PATCH'], 'type': 'string'}, 'status': {'type': 'string'}, 'emailId': {'type': 'string'}, 'headers': {'type': 'array', 'items': {'type': 'object', 'required': ['key'], 'properties': {'key': {'type': 'string'}, 'configured': {'type': 'boolean', 'description': 'True when Mailrith has a saved value for this header. Send this unchanged during an update to preserve the saved value.'}}, 'additionalProperties': False}}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utmTerm': {'type': 'string'}, 'authType': {'enum': ['none', 'bearer'], 'type': 'string'}, 'operator': {'enum': ['equals', 'not_equals', 'contains', 'not_contains', 'starts_with', 'ends_with', 'exists', 'missing', 'greater_than', 'greater_than_or_equal', 'less_than', 'less_than_or_equal', 'on', 'not_on', 'before', 'on_or_before', 'after', 'on_or_after', 'contains_any', 'contains_all', 'does_not_contain_any', 'is_checked', 'is_not_checked'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'type': 'string'}}, 'waitMode': {'enum': ['duration', 'custom_date'], 'type': 'string'}, 'operation': {'enum': ['set', 'clear', 'increment', 'decrement', 'set_today', 'add_choices', 'remove_choices', 'set_true', 'set_false', 'toggle'], 'type': 'string'}, 'timeOfDay': {'type': 'string', 'pattern': '^([01]\\d|2[0-3]):[0-5]\\d$'}, 'utmMedium': {'type': 'string'}, 'utmSource': {'type': 'string'}, 'dateSource': {'enum': ['custom_field', 'fixed_date'], 'type': 'string'}, 'sequenceId': {'type': 'string'}, 'trackOpens': {'type': 'boolean'}, 'utmContent': {'type': 'string'}, 'includeTags': {'type': 'boolean'}, 'magicLinkId': {'type': 'string'}, 'previewText': {'type': 'string'}, 'trackClicks': {'type': 'boolean'}, 'utmCampaign': {'type': 'string'}, 'automationId': {'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'durationUnit': {'enum': ['minute', 'hour', 'day', 'week'], 'type': 'string'}, 'lookbackDays': {'type': 'integer', 'minimum': 1}, 'replyToEmail': {'type': 'string'}, 'customFieldId': {'type': 'string'}, 'durationValue': {'type': 'number', 'minimum': 0}, 'exitNextStepId': {'type': ['string', 'null']}, 'recipientEmail': {'type': 'string', 'format': 'email'}, 'includeSubscriber': {'type': 'boolean'}, 'waitForCompletion': {'type': 'boolean'}, 'waitUntilComplete': {'type': 'boolean'}, 'includeCustomFields': {'type': 'boolean'}, 'bearerTokenConfigured': {'type': 'boolean', 'description': 'True when Mailrith has a saved webhook bearer token. Send this unchanged during an update to preserve the saved value. The token value is never returned.'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Automation'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'createAutomation', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['automation_id'], 'properties': {'automation_id': {'type': 'string', 'description': 'The automation identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Automation': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'definition', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'running', 'paused'], 'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/AutomationDefinition'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Automation change.'}, 'subscriber_count': {'type': 'integer'}}}, 'AutomationPath': {'type': 'object', 'required': ['id', 'label'], 'properties': {'id': {'type': 'string'}, 'label': {'type': 'string'}, 'weight': {'type': ['number', 'null']}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStep': {'type': 'object', 'required': ['id', 'kind', 'type'], 'properties': {'id': {'type': 'string'}, 'kind': {'enum': ['event', 'action', 'condition'], 'type': 'string'}, 'note': {'type': ['string', 'null']}, 'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'sequence_completed', 'add_tag', 'remove_tag', 'add_to_sequence', 'remove_from_sequence', 'change_subscriber_status', 'wait', 'update_custom_field', 'send_email', 'send_internal_notification', 'start_automation', 'remove_from_automation', 'webhook', 'end_automation', 'has_tag', 'custom_field_match', 'sequence_membership', 'subscriber_status', 'email_opened', 'email_clicked'], 'type': 'string'}, 'paths': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationPath'}}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'config': {'$ref': '#/$defs/AutomationStepConfig'}, 'branches': {'type': 'object', 'additionalProperties': {'type': ['string', 'null']}}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationTrigger': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'subscriber_status'], 'type': 'string'}, 'tagId': {'type': ['string', 'null']}, 'tagIds': {'type': 'array', 'items': {'type': 'string'}}, 'operator': {'enum': ['is', 'is_not'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}}, 'magicLinkId': {'type': ['string', 'null']}, 'magicLinkIds': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AutomationDefinition': {'type': 'object', 'example': {'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}, 'examples': [{'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}], 'required': ['steps'], 'properties': {'steps': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationStep'}, 'maxItems': 256}, 'trigger': {'anyOf': [{'$ref': '#/$defs/AutomationTrigger'}, {'type': 'null'}]}, 'version': {'enum': [2], 'type': 'integer'}, 'triggers': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationTrigger'}}, 'entryPoints': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationEntryPoint'}}}, 'additionalProperties': False}, 'AutomationEntryPoint': {'type': 'object', 'required': ['id', 'trigger'], 'properties': {'id': {'type': 'string'}, 'name': {'type': ['string', 'null']}, 'trigger': {'$ref': '#/$defs/AutomationTrigger'}, 'description': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStepConfig': {'type': 'object', 'properties': {'url': {'type': 'string', 'format': 'uri'}, 'date': {'type': 'string', 'format': 'date'}, 'mode': {'enum': ['duration', 'until_custom_date', 'until_custom_field_date'], 'type': 'string'}, 'tagId': {'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'method': {'enum': ['POST', 'PUT', 'PATCH'], 'type': 'string'}, 'status': {'type': 'string'}, 'emailId': {'type': 'string'}, 'headers': {'type': 'array', 'items': {'type': 'object', 'required': ['key'], 'properties': {'key': {'type': 'string'}, 'configured': {'type': 'boolean', 'description': 'True when Mailrith has a saved value for this header. Send this unchanged during an update to preserve the saved value.'}}, 'additionalProperties': False}}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utmTerm': {'type': 'string'}, 'authType': {'enum': ['none', 'bearer'], 'type': 'string'}, 'operator': {'enum': ['equals', 'not_equals', 'contains', 'not_contains', 'starts_with', 'ends_with', 'exists', 'missing', 'greater_than', 'greater_than_or_equal', 'less_than', 'less_than_or_equal', 'on', 'not_on', 'before', 'on_or_before', 'after', 'on_or_after', 'contains_any', 'contains_all', 'does_not_contain_any', 'is_checked', 'is_not_checked'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'type': 'string'}}, 'waitMode': {'enum': ['duration', 'custom_date'], 'type': 'string'}, 'operation': {'enum': ['set', 'clear', 'increment', 'decrement', 'set_today', 'add_choices', 'remove_choices', 'set_true', 'set_false', 'toggle'], 'type': 'string'}, 'timeOfDay': {'type': 'string', 'pattern': '^([01]\\d|2[0-3]):[0-5]\\d$'}, 'utmMedium': {'type': 'string'}, 'utmSource': {'type': 'string'}, 'dateSource': {'enum': ['custom_field', 'fixed_date'], 'type': 'string'}, 'sequenceId': {'type': 'string'}, 'trackOpens': {'type': 'boolean'}, 'utmContent': {'type': 'string'}, 'includeTags': {'type': 'boolean'}, 'magicLinkId': {'type': 'string'}, 'previewText': {'type': 'string'}, 'trackClicks': {'type': 'boolean'}, 'utmCampaign': {'type': 'string'}, 'automationId': {'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'durationUnit': {'enum': ['minute', 'hour', 'day', 'week'], 'type': 'string'}, 'lookbackDays': {'type': 'integer', 'minimum': 1}, 'replyToEmail': {'type': 'string'}, 'customFieldId': {'type': 'string'}, 'durationValue': {'type': 'number', 'minimum': 0}, 'exitNextStepId': {'type': ['string', 'null']}, 'recipientEmail': {'type': 'string', 'format': 'email'}, 'includeSubscriber': {'type': 'boolean'}, 'waitForCompletion': {'type': 'boolean'}, 'waitUntilComplete': {'type': 'boolean'}, 'includeCustomFields': {'type': 'boolean'}, 'bearerTokenConfigured': {'type': 'boolean', 'description': 'True when Mailrith has a saved webhook bearer token. Send this unchanged during an update to preserve the saved value. The token value is never returned.'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Automation'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getAutomation', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of automations to return.'}, 'search': {'type': 'string', 'maxLength': 200, 'description': 'Filter Automations by name or status.'}, 'starting_after': {'type': 'string', 'description': 'Use the opaque cursor from the previous page to request the next page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'AutomationSummary': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'running', 'paused'], 'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'is_updating': {'type': 'boolean'}, 'subscriber_count': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationSummary'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listAutomations', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['automation_id'], 'properties': {'automation_id': {'type': 'string', 'description': 'The Automation identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'AutomationPreflight': {'type': 'object', 'required': ['automation_id', 'ready', 'step_count', 'email_step_count', 'checks', 'checked_at'], 'properties': {'ready': {'type': 'boolean'}, 'checks': {'type': 'array', 'items': {'$ref': '#/$defs/WorkflowReadinessCheck'}}, 'checked_at': {'type': 'string', 'format': 'date-time'}, 'step_count': {'type': 'integer', 'minimum': 0}, 'automation_id': {'type': 'string'}, 'email_step_count': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'WorkflowReadinessCheck': {'type': 'object', 'required': ['key', 'status', 'message'], 'properties': {'key': {'type': 'string'}, 'status': {'enum': ['passed', 'blocking'], 'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/AutomationPreflight'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'preflightAutomation', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['automation_id', 'subscriber_id'], 'properties': {'automation_id': {'type': 'string', 'description': 'The Automation identifier.'}, 'subscriber_id': {'type': 'string', 'description': 'The saved Subscriber whose current state should be evaluated.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'AutomationJourneyPreview': {'type': 'object', 'required': ['automation_id', 'subscriber_id', 'side_effect_free', 'evaluation_basis', 'triggers', 'ended', 'cycle_detected', 'steps'], 'properties': {'ended': {'type': 'boolean'}, 'steps': {'type': 'array', 'items': {'type': 'object', 'required': ['position', 'step_id', 'kind', 'type', 'condition_matched', 'selected_branch', 'next_step_id'], 'properties': {'kind': {'enum': ['event', 'action', 'condition'], 'type': 'string'}, 'type': {'type': 'string'}, 'step_id': {'type': 'string'}, 'position': {'type': 'integer', 'minimum': 1}, 'next_step_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'selected_branch': {'anyOf': [{'enum': ['yes', 'no'], 'type': 'string'}, {'type': 'null'}]}, 'condition_matched': {'anyOf': [{'type': 'boolean'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'maxItems': 256}, 'triggers': {'type': 'array', 'items': {'type': 'object', 'required': ['type'], 'properties': {'type': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 50}, 'automation_id': {'type': 'string'}, 'subscriber_id': {'type': 'string'}, 'cycle_detected': {'type': 'boolean'}, 'evaluation_basis': {'enum': ['current_saved_subscriber_state'], 'type': 'string'}, 'side_effect_free': {'enum': [True], 'type': 'boolean'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/AutomationJourneyPreview'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'previewAutomationJourney', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'WorkflowTestRequest': {'type': 'object', 'required': ['recipient', 'subscriber_id'], 'properties': {'recipient': {'type': 'string', 'format': 'email'}, 'message_ids': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 5, 'description': 'Optional Sequence email IDs or Automation step IDs. Omit to test the first five available messages.', 'uniqueItems': True}, 'subscriber_id': {'type': 'string', 'description': 'The saved Subscriber whose personalization should be rendered in every test message.'}}, 'additionalProperties': False}}, 'required': ['automation_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/WorkflowTestRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'automation_id': {'type': 'string', 'description': 'The Automation identifier.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'WorkflowTestResult': {'type': 'object', 'required': ['status', 'sent_count', 'message_ids', 'subscriber_id'], 'properties': {'status': {'enum': ['completed'], 'type': 'string'}, 'sent_count': {'type': 'integer', 'maximum': 5, 'minimum': 1}, 'message_ids': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 5}, 'subscriber_id': {'type': 'string'}, 'provider_message_ids': {'type': 'array', 'items': {'anyOf': [{'type': 'string', 'maxLength': 200}, {'type': 'null'}]}, 'maxItems': 5, 'minItems': 1, 'description': 'Provider acceptance IDs in sent-message order; null when unavailable. These are not delivery or inbox receipts.'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/WorkflowTestResult'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'testAutomation', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'AutomationPath': {'type': 'object', 'required': ['id', 'label'], 'properties': {'id': {'type': 'string'}, 'label': {'type': 'string'}, 'weight': {'type': ['number', 'null']}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStep': {'type': 'object', 'required': ['id', 'kind', 'type'], 'properties': {'id': {'type': 'string'}, 'kind': {'enum': ['event', 'action', 'condition'], 'type': 'string'}, 'note': {'type': ['string', 'null']}, 'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'sequence_completed', 'add_tag', 'remove_tag', 'add_to_sequence', 'remove_from_sequence', 'change_subscriber_status', 'wait', 'update_custom_field', 'send_email', 'send_internal_notification', 'start_automation', 'remove_from_automation', 'webhook', 'end_automation', 'has_tag', 'custom_field_match', 'sequence_membership', 'subscriber_status', 'email_opened', 'email_clicked'], 'type': 'string'}, 'paths': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationPath'}}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'config': {'$ref': '#/$defs/AutomationStepConfig'}, 'branches': {'type': 'object', 'additionalProperties': {'type': ['string', 'null']}}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationTrigger': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'subscriber_status'], 'type': 'string'}, 'tagId': {'type': ['string', 'null']}, 'tagIds': {'type': 'array', 'items': {'type': 'string'}}, 'operator': {'enum': ['is', 'is_not'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}}, 'magicLinkId': {'type': ['string', 'null']}, 'magicLinkIds': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AutomationDefinition': {'type': 'object', 'example': {'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}, 'examples': [{'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}], 'required': ['steps'], 'properties': {'steps': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationStep'}, 'maxItems': 256}, 'trigger': {'anyOf': [{'$ref': '#/$defs/AutomationTrigger'}, {'type': 'null'}]}, 'version': {'enum': [2], 'type': 'integer'}, 'triggers': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationTrigger'}}, 'entryPoints': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationEntryPoint'}}}, 'additionalProperties': False}, 'AutomationEntryPoint': {'type': 'object', 'required': ['id', 'trigger'], 'properties': {'id': {'type': 'string'}, 'name': {'type': ['string', 'null']}, 'trigger': {'$ref': '#/$defs/AutomationTrigger'}, 'description': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStepConfig': {'type': 'object', 'properties': {'url': {'type': 'string', 'format': 'uri'}, 'date': {'type': 'string', 'format': 'date'}, 'mode': {'enum': ['duration', 'until_custom_date', 'until_custom_field_date'], 'type': 'string'}, 'tagId': {'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'method': {'enum': ['POST', 'PUT', 'PATCH'], 'type': 'string'}, 'status': {'type': 'string'}, 'emailId': {'type': 'string'}, 'headers': {'type': 'array', 'items': {'type': 'object', 'required': ['key'], 'properties': {'key': {'type': 'string'}, 'value': {'type': 'string', 'writeOnly': True, 'description': 'A secret header value accepted on writes and never returned.'}, 'configured': {'type': 'boolean', 'description': 'True when Mailrith has a saved value for this header. Send this unchanged during an update to preserve the saved value.'}}, 'additionalProperties': False}}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utmTerm': {'type': 'string'}, 'authType': {'enum': ['none', 'bearer'], 'type': 'string'}, 'operator': {'enum': ['equals', 'not_equals', 'contains', 'not_contains', 'starts_with', 'ends_with', 'exists', 'missing', 'greater_than', 'greater_than_or_equal', 'less_than', 'less_than_or_equal', 'on', 'not_on', 'before', 'on_or_before', 'after', 'on_or_after', 'contains_any', 'contains_all', 'does_not_contain_any', 'is_checked', 'is_not_checked'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'type': 'string'}}, 'waitMode': {'enum': ['duration', 'custom_date'], 'type': 'string'}, 'operation': {'enum': ['set', 'clear', 'increment', 'decrement', 'set_today', 'add_choices', 'remove_choices', 'set_true', 'set_false', 'toggle'], 'type': 'string'}, 'timeOfDay': {'type': 'string', 'pattern': '^([01]\\d|2[0-3]):[0-5]\\d$'}, 'utmMedium': {'type': 'string'}, 'utmSource': {'type': 'string'}, 'dateSource': {'enum': ['custom_field', 'fixed_date'], 'type': 'string'}, 'sequenceId': {'type': 'string'}, 'trackOpens': {'type': 'boolean'}, 'utmContent': {'type': 'string'}, 'bearerToken': {'type': 'string', 'writeOnly': True}, 'includeTags': {'type': 'boolean'}, 'magicLinkId': {'type': 'string'}, 'previewText': {'type': 'string'}, 'trackClicks': {'type': 'boolean'}, 'utmCampaign': {'type': 'string'}, 'automationId': {'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'durationUnit': {'enum': ['minute', 'hour', 'day', 'week'], 'type': 'string'}, 'lookbackDays': {'type': 'integer', 'minimum': 1}, 'replyToEmail': {'type': 'string'}, 'customFieldId': {'type': 'string'}, 'durationValue': {'type': 'number', 'minimum': 0}, 'exitNextStepId': {'type': ['string', 'null']}, 'recipientEmail': {'type': 'string', 'format': 'email'}, 'includeSubscriber': {'type': 'boolean'}, 'waitForCompletion': {'type': 'boolean'}, 'waitUntilComplete': {'type': 'boolean'}, 'includeCustomFields': {'type': 'boolean'}, 'bearerTokenConfigured': {'type': 'boolean', 'description': 'True when Mailrith has a saved webhook bearer token. Send this unchanged during an update to preserve the saved value. The token value is never returned.'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'AutomationUpdateRequest': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'definition': {'$ref': '#/$defs/AutomationDefinition'}}, 'minProperties': 1, 'additionalProperties': False}}, 'required': ['automation_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/AutomationUpdateRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'automation_id': {'type': 'string', 'description': 'The automation identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Automation': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'definition', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'running', 'paused'], 'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/AutomationDefinition'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Automation change.'}, 'subscriber_count': {'type': 'integer'}}}, 'AutomationPath': {'type': 'object', 'required': ['id', 'label'], 'properties': {'id': {'type': 'string'}, 'label': {'type': 'string'}, 'weight': {'type': ['number', 'null']}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStep': {'type': 'object', 'required': ['id', 'kind', 'type'], 'properties': {'id': {'type': 'string'}, 'kind': {'enum': ['event', 'action', 'condition'], 'type': 'string'}, 'note': {'type': ['string', 'null']}, 'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'sequence_completed', 'add_tag', 'remove_tag', 'add_to_sequence', 'remove_from_sequence', 'change_subscriber_status', 'wait', 'update_custom_field', 'send_email', 'send_internal_notification', 'start_automation', 'remove_from_automation', 'webhook', 'end_automation', 'has_tag', 'custom_field_match', 'sequence_membership', 'subscriber_status', 'email_opened', 'email_clicked'], 'type': 'string'}, 'paths': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationPath'}}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'config': {'$ref': '#/$defs/AutomationStepConfig'}, 'branches': {'type': 'object', 'additionalProperties': {'type': ['string', 'null']}}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationTrigger': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'subscriber_status'], 'type': 'string'}, 'tagId': {'type': ['string', 'null']}, 'tagIds': {'type': 'array', 'items': {'type': 'string'}}, 'operator': {'enum': ['is', 'is_not'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}}, 'magicLinkId': {'type': ['string', 'null']}, 'magicLinkIds': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AutomationDefinition': {'type': 'object', 'example': {'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}, 'examples': [{'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}], 'required': ['steps'], 'properties': {'steps': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationStep'}, 'maxItems': 256}, 'trigger': {'anyOf': [{'$ref': '#/$defs/AutomationTrigger'}, {'type': 'null'}]}, 'version': {'enum': [2], 'type': 'integer'}, 'triggers': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationTrigger'}}, 'entryPoints': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationEntryPoint'}}}, 'additionalProperties': False}, 'AutomationEntryPoint': {'type': 'object', 'required': ['id', 'trigger'], 'properties': {'id': {'type': 'string'}, 'name': {'type': ['string', 'null']}, 'trigger': {'$ref': '#/$defs/AutomationTrigger'}, 'description': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStepConfig': {'type': 'object', 'properties': {'url': {'type': 'string', 'format': 'uri'}, 'date': {'type': 'string', 'format': 'date'}, 'mode': {'enum': ['duration', 'until_custom_date', 'until_custom_field_date'], 'type': 'string'}, 'tagId': {'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'method': {'enum': ['POST', 'PUT', 'PATCH'], 'type': 'string'}, 'status': {'type': 'string'}, 'emailId': {'type': 'string'}, 'headers': {'type': 'array', 'items': {'type': 'object', 'required': ['key'], 'properties': {'key': {'type': 'string'}, 'configured': {'type': 'boolean', 'description': 'True when Mailrith has a saved value for this header. Send this unchanged during an update to preserve the saved value.'}}, 'additionalProperties': False}}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utmTerm': {'type': 'string'}, 'authType': {'enum': ['none', 'bearer'], 'type': 'string'}, 'operator': {'enum': ['equals', 'not_equals', 'contains', 'not_contains', 'starts_with', 'ends_with', 'exists', 'missing', 'greater_than', 'greater_than_or_equal', 'less_than', 'less_than_or_equal', 'on', 'not_on', 'before', 'on_or_before', 'after', 'on_or_after', 'contains_any', 'contains_all', 'does_not_contain_any', 'is_checked', 'is_not_checked'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'type': 'string'}}, 'waitMode': {'enum': ['duration', 'custom_date'], 'type': 'string'}, 'operation': {'enum': ['set', 'clear', 'increment', 'decrement', 'set_today', 'add_choices', 'remove_choices', 'set_true', 'set_false', 'toggle'], 'type': 'string'}, 'timeOfDay': {'type': 'string', 'pattern': '^([01]\\d|2[0-3]):[0-5]\\d$'}, 'utmMedium': {'type': 'string'}, 'utmSource': {'type': 'string'}, 'dateSource': {'enum': ['custom_field', 'fixed_date'], 'type': 'string'}, 'sequenceId': {'type': 'string'}, 'trackOpens': {'type': 'boolean'}, 'utmContent': {'type': 'string'}, 'includeTags': {'type': 'boolean'}, 'magicLinkId': {'type': 'string'}, 'previewText': {'type': 'string'}, 'trackClicks': {'type': 'boolean'}, 'utmCampaign': {'type': 'string'}, 'automationId': {'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'durationUnit': {'enum': ['minute', 'hour', 'day', 'week'], 'type': 'string'}, 'lookbackDays': {'type': 'integer', 'minimum': 1}, 'replyToEmail': {'type': 'string'}, 'customFieldId': {'type': 'string'}, 'durationValue': {'type': 'number', 'minimum': 0}, 'exitNextStepId': {'type': ['string', 'null']}, 'recipientEmail': {'type': 'string', 'format': 'email'}, 'includeSubscriber': {'type': 'boolean'}, 'waitForCompletion': {'type': 'boolean'}, 'waitUntilComplete': {'type': 'boolean'}, 'includeCustomFields': {'type': 'boolean'}, 'bearerTokenConfigured': {'type': 'boolean', 'description': 'True when Mailrith has a saved webhook bearer token. Send this unchanged during an update to preserve the saved value. The token value is never returned.'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Automation'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateAutomation', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'AutomationStatusRequest': {'type': 'object', 'required': ['status'], 'properties': {'status': {'enum': ['draft', 'running', 'paused'], 'type': 'string'}}}}, 'required': ['automation_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/AutomationStatusRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'automation_id': {'type': 'string', 'description': 'The Automation identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Automation': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'definition', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'running', 'paused'], 'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/AutomationDefinition'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Automation change.'}, 'subscriber_count': {'type': 'integer'}}}, 'AutomationPath': {'type': 'object', 'required': ['id', 'label'], 'properties': {'id': {'type': 'string'}, 'label': {'type': 'string'}, 'weight': {'type': ['number', 'null']}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStep': {'type': 'object', 'required': ['id', 'kind', 'type'], 'properties': {'id': {'type': 'string'}, 'kind': {'enum': ['event', 'action', 'condition'], 'type': 'string'}, 'note': {'type': ['string', 'null']}, 'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'sequence_completed', 'add_tag', 'remove_tag', 'add_to_sequence', 'remove_from_sequence', 'change_subscriber_status', 'wait', 'update_custom_field', 'send_email', 'send_internal_notification', 'start_automation', 'remove_from_automation', 'webhook', 'end_automation', 'has_tag', 'custom_field_match', 'sequence_membership', 'subscriber_status', 'email_opened', 'email_clicked'], 'type': 'string'}, 'paths': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationPath'}}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'config': {'$ref': '#/$defs/AutomationStepConfig'}, 'branches': {'type': 'object', 'additionalProperties': {'type': ['string', 'null']}}, 'nextStepId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationTrigger': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['tag_added', 'tag_removed', 'magic_link_clicked', 'subscriber_status'], 'type': 'string'}, 'tagId': {'type': ['string', 'null']}, 'tagIds': {'type': 'array', 'items': {'type': 'string'}}, 'operator': {'enum': ['is', 'is_not'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}}, 'magicLinkId': {'type': ['string', 'null']}, 'magicLinkIds': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AutomationDefinition': {'type': 'object', 'example': {'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}, 'examples': [{'steps': [{'id': 'send-welcome-email', 'kind': 'action', 'type': 'send_email', 'config': {'subject': 'Welcome', 'utmTerm': '', 'utmMedium': '', 'utmSource': '', 'trackOpens': True, 'utmContent': '', 'previewText': 'Thanks for joining', 'trackClicks': True, 'utmCampaign': '', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to Mailrith.', 'type': 'text'}]}]}, 'replyToEmail': ''}}], 'trigger': {'type': 'tag_added', 'tagIds': ['tag_welcome']}, 'version': 2}], 'required': ['steps'], 'properties': {'steps': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationStep'}, 'maxItems': 256}, 'trigger': {'anyOf': [{'$ref': '#/$defs/AutomationTrigger'}, {'type': 'null'}]}, 'version': {'enum': [2], 'type': 'integer'}, 'triggers': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationTrigger'}}, 'entryPoints': {'type': 'array', 'items': {'$ref': '#/$defs/AutomationEntryPoint'}}}, 'additionalProperties': False}, 'AutomationEntryPoint': {'type': 'object', 'required': ['id', 'trigger'], 'properties': {'id': {'type': 'string'}, 'name': {'type': ['string', 'null']}, 'trigger': {'$ref': '#/$defs/AutomationTrigger'}, 'description': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AutomationStepConfig': {'type': 'object', 'properties': {'url': {'type': 'string', 'format': 'uri'}, 'date': {'type': 'string', 'format': 'date'}, 'mode': {'enum': ['duration', 'until_custom_date', 'until_custom_field_date'], 'type': 'string'}, 'tagId': {'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'method': {'enum': ['POST', 'PUT', 'PATCH'], 'type': 'string'}, 'status': {'type': 'string'}, 'emailId': {'type': 'string'}, 'headers': {'type': 'array', 'items': {'type': 'object', 'required': ['key'], 'properties': {'key': {'type': 'string'}, 'configured': {'type': 'boolean', 'description': 'True when Mailrith has a saved value for this header. Send this unchanged during an update to preserve the saved value.'}}, 'additionalProperties': False}}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utmTerm': {'type': 'string'}, 'authType': {'enum': ['none', 'bearer'], 'type': 'string'}, 'operator': {'enum': ['equals', 'not_equals', 'contains', 'not_contains', 'starts_with', 'ends_with', 'exists', 'missing', 'greater_than', 'greater_than_or_equal', 'less_than', 'less_than_or_equal', 'on', 'not_on', 'before', 'on_or_before', 'after', 'on_or_after', 'contains_any', 'contains_all', 'does_not_contain_any', 'is_checked', 'is_not_checked'], 'type': 'string'}, 'statuses': {'type': 'array', 'items': {'type': 'string'}}, 'waitMode': {'enum': ['duration', 'custom_date'], 'type': 'string'}, 'operation': {'enum': ['set', 'clear', 'increment', 'decrement', 'set_today', 'add_choices', 'remove_choices', 'set_true', 'set_false', 'toggle'], 'type': 'string'}, 'timeOfDay': {'type': 'string', 'pattern': '^([01]\\d|2[0-3]):[0-5]\\d$'}, 'utmMedium': {'type': 'string'}, 'utmSource': {'type': 'string'}, 'dateSource': {'enum': ['custom_field', 'fixed_date'], 'type': 'string'}, 'sequenceId': {'type': 'string'}, 'trackOpens': {'type': 'boolean'}, 'utmContent': {'type': 'string'}, 'includeTags': {'type': 'boolean'}, 'magicLinkId': {'type': 'string'}, 'previewText': {'type': 'string'}, 'trackClicks': {'type': 'boolean'}, 'utmCampaign': {'type': 'string'}, 'automationId': {'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'durationUnit': {'enum': ['minute', 'hour', 'day', 'week'], 'type': 'string'}, 'lookbackDays': {'type': 'integer', 'minimum': 1}, 'replyToEmail': {'type': 'string'}, 'customFieldId': {'type': 'string'}, 'durationValue': {'type': 'number', 'minimum': 0}, 'exitNextStepId': {'type': ['string', 'null']}, 'recipientEmail': {'type': 'string', 'format': 'email'}, 'includeSubscriber': {'type': 'boolean'}, 'waitForCompletion': {'type': 'boolean'}, 'waitUntilComplete': {'type': 'boolean'}, 'includeCustomFields': {'type': 'boolean'}, 'bearerTokenConfigured': {'type': 'boolean', 'description': 'True when Mailrith has a saved webhook bearer token. Send this unchanged during an update to preserve the saved value. The token value is never returned.'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Automation'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateAutomationStatus', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['broadcast_id'], 'properties': {'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'type': 'object', 'required': ['status', 'run_id', 'changed', 'recovery_pending', 'message'], 'properties': {'run_id': {'type': 'string'}, 'status': {'enum': ['canceling', 'canceled'], 'type': 'string', 'description': 'canceling while remaining work is stopping, or canceled when cancellation already finished.'}, 'changed': {'type': 'boolean'}, 'message': {'type': 'string'}, 'recovery_pending': {'type': 'boolean'}}}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'cancelBroadcastSend', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'BroadcastUpsertRequest': {'type': 'object', 'required': ['subject', 'body_document'], 'properties': {'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'allOf': [{'$ref': '#/$defs/BroadcastEmailDocument'}], 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/BroadcastUpsertRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Broadcast': {'type': 'object', 'required': ['id', 'subject', 'preview_text', 'body', 'body_document', 'status', 'scheduled_at', 'completed_at', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'audience_definition', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'recipient_count', 'opened_count', 'clicked_count', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'scheduled', 'running', 'completed', 'failed'], 'type': 'string'}, 'subject': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'completed_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'opened_count': {'type': 'integer'}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'scheduled_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'bounced_count': {'type': 'integer'}, 'clicked_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'recipient_count': {'type': 'integer'}, 'complained_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Broadcast'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'createBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['broadcast_id'], 'properties': {'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Broadcast': {'type': 'object', 'required': ['id', 'subject', 'preview_text', 'body', 'body_document', 'status', 'scheduled_at', 'completed_at', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'audience_definition', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'recipient_count', 'opened_count', 'clicked_count', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'scheduled', 'running', 'completed', 'failed'], 'type': 'string'}, 'subject': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'completed_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'opened_count': {'type': 'integer'}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'scheduled_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'bounced_count': {'type': 'integer'}, 'clicked_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'recipient_count': {'type': 'integer'}, 'complained_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Broadcast'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['broadcast_id'], 'properties': {'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'BroadcastSendProgress': {'type': 'object', 'required': ['run_id', 'phase', 'selected', 'materialized', 'sent', 'accepted', 'skipped', 'retrying', 'permanent_failed', 'unknown', 'canceled', 'percent_complete', 'effective_rate', 'provider_limited_rate', 'provider', 'estimated_completion', 'estimated_completion_basis', 'last_progress_at', 'pause_reason', 'next_retry_at', 'next_retry_action', 'pause_message', 'terminal'], 'properties': {'sent': {'type': 'integer'}, 'phase': {'enum': ['preparing', 'sending', 'paused', 'canceling', 'sent', 'sent_with_errors', 'canceled', 'failed'], 'type': 'string'}, 'run_id': {'type': 'string'}, 'skipped': {'type': 'integer'}, 'unknown': {'type': 'integer'}, 'accepted': {'type': 'integer'}, 'canceled': {'type': 'integer'}, 'provider': {'anyOf': [{'type': 'string', 'description': 'The email delivery provider used by this send.'}, {'type': 'null'}]}, 'retrying': {'type': 'integer'}, 'selected': {'type': 'integer'}, 'terminal': {'type': 'boolean'}, 'materialized': {'type': 'integer'}, 'pause_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'next_retry_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'pause_message': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'effective_rate': {'type': 'number'}, 'last_progress_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'percent_complete': {'type': 'number'}, 'permanent_failed': {'type': 'integer'}, 'next_retry_action': {'anyOf': [{'enum': ['resume', 'recheck'], 'type': 'string', 'description': 'Whether the next time is a known quota reset or another connection check.'}, {'type': 'null'}]}, 'estimated_completion': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'provider_limited_rate': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'estimated_completion_basis': {'anyOf': [{'enum': ['current-rate', 'provider-quota'], 'type': 'string', 'description': 'Whether the estimate uses only the current rate or also includes known provider quota windows.'}, {'type': 'null'}]}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/BroadcastSendProgress'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getBroadcastSendProgress', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of items to return.'}, 'search': {'type': 'string', 'maxLength': 200, 'description': 'Filter Broadcasts by subject, preview text, status, or sender.'}, 'starting_after': {'type': 'string', 'description': 'Opaque cursor returned by the previous page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'BroadcastSummary': {'type': 'object', 'required': ['id', 'subject', 'preview_text', 'status', 'scheduled_at', 'completed_at', 'recipient_count', 'opened_count', 'clicked_count', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'scheduled', 'running', 'completed', 'failed'], 'type': 'string'}, 'subject': {'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'completed_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'opened_count': {'type': 'integer', 'minimum': 0}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'scheduled_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'bounced_count': {'type': 'integer', 'minimum': 0}, 'clicked_count': {'type': 'integer', 'minimum': 0}, 'recipient_count': {'type': 'integer', 'minimum': 0}, 'complained_count': {'type': 'integer', 'minimum': 0}, 'unsubscribed_count': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastSummary'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listBroadcasts', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['broadcast_id'], 'properties': {'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'BroadcastSendPreflight': {'type': 'object', 'required': ['workspace_id', 'broadcast_id', 'subject', 'recipient_estimate', 'connection', 'provider_production_status', 'remaining_daily_quota', 'sending_quota', 'safe_send_rate', 'estimated_duration_seconds', 'sender_authentication_status', 'event_webhook_health', 'blocking_issues', 'checked_at', 'send_proof', 'send_proof_expires_at'], 'properties': {'subject': {'type': 'string'}, 'checked_at': {'type': 'string', 'format': 'date-time'}, 'connection': {'type': 'object', 'required': ['id', 'name', 'provider'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'provider': {'type': 'string'}}}, 'send_proof': {'anyOf': [{'type': 'string', 'description': 'Short-lived proof returned when preflight passes. Submit it unchanged to Send so Mailrith can accept the durable run without repeating the expensive Subscriber count and provider checks.'}, {'type': 'null'}]}, 'broadcast_id': {'type': 'string'}, 'workspace_id': {'type': 'string'}, 'sending_quota': {'anyOf': [{'type': 'object', 'required': ['remaining', 'limit', 'period'], 'properties': {'limit': {'type': 'integer', 'minimum': 1}, 'period': {'enum': ['rolling-24-hours', 'day', 'month'], 'type': 'string'}, 'remaining': {'type': 'integer', 'minimum': 0}}}, {'type': 'null'}]}, 'safe_send_rate': {'anyOf': [{'type': 'number', 'exclusiveMinimum': 0}, {'type': 'null'}]}, 'blocking_issues': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'message', 'resolution'], 'properties': {'code': {'type': 'string'}, 'message': {'type': 'string'}, 'resolution': {'type': 'string'}}}}, 'recipient_estimate': {'type': 'integer', 'minimum': 0}, 'event_webhook_health': {'enum': ['healthy', 'unknown'], 'type': 'string'}, 'remaining_daily_quota': {'anyOf': [{'type': 'integer', 'minimum': 0}, {'type': 'null'}]}, 'send_proof_expires_at': {'anyOf': [{'type': 'string', 'format': 'date-time', 'description': 'When the short-lived Send proof expires. Run preflight again after this time.'}, {'type': 'null'}]}, 'estimated_duration_seconds': {'anyOf': [{'type': 'integer', 'minimum': 0}, {'type': 'null'}]}, 'provider_production_status': {'enum': ['production', 'restricted', 'unknown'], 'type': 'string'}, 'sender_authentication_status': {'enum': ['verified', 'unverified', 'unknown'], 'type': 'string'}}, 'description': 'Current Subscriber estimate, provider capacity, sender and event setup health, duration estimate, and blocking issues.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/BroadcastSendPreflight'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'preflightBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'BroadcastScheduleRequest': {'type': 'object', 'example': {'scheduled_at': '2026-08-01T09:30:00.000Z'}, 'examples': [{'scheduled_at': '2026-08-01T09:30:00.000Z'}], 'required': ['scheduled_at'], 'properties': {'scheduled_at': {'type': 'string', 'pattern': '^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$', 'description': 'A future date and time. Include an explicit UTC offset or Z suffix.'}}, 'additionalProperties': False}}, 'required': ['broadcast_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/BroadcastScheduleRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Broadcast': {'type': 'object', 'required': ['id', 'subject', 'preview_text', 'body', 'body_document', 'status', 'scheduled_at', 'completed_at', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'audience_definition', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'recipient_count', 'opened_count', 'clicked_count', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'scheduled', 'running', 'completed', 'failed'], 'type': 'string'}, 'subject': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'completed_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'opened_count': {'type': 'integer'}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'scheduled_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'bounced_count': {'type': 'integer'}, 'clicked_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'recipient_count': {'type': 'integer'}, 'complained_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Broadcast'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'scheduleBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['broadcast_id'], 'properties': {'body': {'type': 'object', 'properties': {'preflight_proof': {'type': 'string', 'description': 'Optional unchanged short-lived send_proof returned by a recent diagnostic preflight. A valid proof can seed its checked estimate. If it is omitted, expired, or no longer matches, Mailrith still creates the run immediately and calculates the exact total during durable preparation.'}}, 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Broadcast': {'type': 'object', 'required': ['id', 'subject', 'preview_text', 'body', 'body_document', 'status', 'scheduled_at', 'completed_at', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'audience_definition', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'recipient_count', 'opened_count', 'clicked_count', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'scheduled', 'running', 'completed', 'failed'], 'type': 'string'}, 'subject': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'completed_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'opened_count': {'type': 'integer'}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'scheduled_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'bounced_count': {'type': 'integer'}, 'clicked_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'recipient_count': {'type': 'integer'}, 'complained_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'type': 'object', 'required': ['status', 'run_id', 'resource'], 'properties': {'run_id': {'type': 'string'}, 'status': {'enum': ['running', 'queued'], 'type': 'string', 'description': 'Queued means Mailrith accepted the send and will start it automatically when a sending slot is available.'}, 'resource': {'$ref': '#/$defs/Broadcast'}}}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'sendBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'BroadcastTestRequest': {'type': 'object', 'required': ['recipient', 'subscriber_id'], 'properties': {'recipient': {'type': 'string', 'format': 'email', 'description': 'The inbox that receives the test message. It may differ from the saved Subscriber used for personalization.'}, 'subscriber_id': {'type': 'string', 'description': 'Required saved Subscriber ID whose profile supplies personalization. Use subscribers_list to find one before sending the test when needed.'}}, 'additionalProperties': False}}, 'required': ['broadcast_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/BroadcastTestRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'BroadcastTestResult': {'type': 'object', 'required': ['status', 'subscriber_id'], 'properties': {'status': {'enum': ['completed'], 'type': 'string'}, 'subscriber_id': {'type': 'string'}, 'provider_message_ids': {'type': 'array', 'items': {'anyOf': [{'type': 'string', 'maxLength': 200}, {'type': 'null'}]}, 'maxItems': 5, 'minItems': 1, 'description': 'Provider acceptance IDs in sent-message order; null when unavailable. These are not delivery or inbox receipts.'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/BroadcastTestResult'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'testBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['broadcast_id'], 'properties': {'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Broadcast': {'type': 'object', 'required': ['id', 'subject', 'preview_text', 'body', 'body_document', 'status', 'scheduled_at', 'completed_at', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'audience_definition', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'recipient_count', 'opened_count', 'clicked_count', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'scheduled', 'running', 'completed', 'failed'], 'type': 'string'}, 'subject': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'completed_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'opened_count': {'type': 'integer'}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'scheduled_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'bounced_count': {'type': 'integer'}, 'clicked_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'recipient_count': {'type': 'integer'}, 'complained_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Broadcast'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'unscheduleBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'BroadcastUpdateRequest': {'type': 'object', 'properties': {'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'allOf': [{'$ref': '#/$defs/BroadcastEmailDocument'}], 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'minProperties': 1, 'additionalProperties': False}}, 'required': ['broadcast_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/BroadcastUpdateRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'broadcast_id': {'type': 'string', 'description': 'The broadcast identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Broadcast': {'type': 'object', 'required': ['id', 'subject', 'preview_text', 'body', 'body_document', 'status', 'scheduled_at', 'completed_at', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'audience_definition', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'recipient_count', 'opened_count', 'clicked_count', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['draft', 'scheduled', 'running', 'completed', 'failed'], 'type': 'string'}, 'subject': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'completed_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'opened_count': {'type': 'integer'}, 'preview_text': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'scheduled_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'body_document': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'bounced_count': {'type': 'integer'}, 'clicked_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'recipient_count': {'type': 'integer'}, 'complained_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}, 'audience_definition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Broadcast'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateBroadcast', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['custom_field_id'], 'properties': {'custom_field_id': {'type': 'string', 'description': 'The custom field identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'CustomField': {'type': 'object', 'required': ['id', 'label', 'type', 'settings', 'personalization_token', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'type': {'type': 'string'}, 'label': {'type': 'string'}, 'settings': {'type': 'object', 'required': ['options'], 'properties': {'options': {'type': 'array', 'items': {'type': 'string'}}}}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'personalization_token': {'type': 'string', 'description': 'The exact ready-to-use token for this custom field. Copy it into an email subject or body text node and replace only the fallback text when needed. This value is computed from the current field label and is not stored separately.'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/CustomField'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getCustomField', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of custom fields to return.'}, 'search': {'type': 'string', 'maxLength': 200, 'description': 'Filter custom fields by label or type.'}, 'starting_after': {'type': 'string', 'description': 'Use the opaque cursor from the previous page to request the next page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'CustomField': {'type': 'object', 'required': ['id', 'label', 'type', 'settings', 'personalization_token', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'type': {'type': 'string'}, 'label': {'type': 'string'}, 'settings': {'type': 'object', 'required': ['options'], 'properties': {'options': {'type': 'array', 'items': {'type': 'string'}}}}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'personalization_token': {'type': 'string', 'description': 'The exact ready-to-use token for this custom field. Copy it into an email subject or body text node and replace only the fallback text when needed. This value is computed from the current field label and is not stored separately.'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/CustomField'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listCustomFields', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Capabilities': {'type': 'object', 'required': ['version', 'workspace', 'authentication', 'credential', 'discovery', 'sdks', 'mcp', 'conventions', 'capability_mode', 'limitations', 'events', 'resources'], 'properties': {'mcp': {'$ref': '#/$defs/PublicApiMcp'}, 'sdks': {'$ref': '#/$defs/PublicApiSdks'}, 'events': {'$ref': '#/$defs/WebhookEventSupport'}, 'version': {'type': 'string'}, 'discovery': {'type': 'object', 'required': ['documentation_url', 'reference_url', 'agents_url', 'sdk_docs_url', 'typescript_sdk_url', 'python_sdk_url', 'mcp_docs_url', 'mcp_url', 'llms_url', 'llms_full_url', 'openapi_url', 'webhook_subscriptions_url', 'oauth_authorization_server_url'], 'properties': {'mcp_url': {'type': 'string'}, 'llms_url': {'type': 'string'}, 'agents_url': {'type': 'string'}, 'openapi_url': {'type': 'string'}, 'mcp_docs_url': {'type': 'string'}, 'sdk_docs_url': {'type': 'string'}, 'llms_full_url': {'type': 'string'}, 'reference_url': {'type': 'string'}, 'python_sdk_url': {'type': 'string'}, 'documentation_url': {'type': 'string'}, 'typescript_sdk_url': {'type': 'string'}, 'webhook_subscriptions_url': {'type': 'string'}, 'oauth_authorization_server_url': {'type': 'string'}}}, 'resources': {'type': 'array', 'items': {'$ref': '#/$defs/CapabilityResource'}}, 'workspace': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}, 'credential': {'oneOf': [{'type': 'object', 'required': ['type', 'id', 'name', 'status', 'scopes', 'key_preview', 'created_at', 'updated_at'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'type': {'enum': ['workspace_api_key'], 'type': 'string'}, 'scopes': {'type': 'array', 'items': {'type': 'string'}}, 'status': {'enum': ['active', 'expired', 'revoked', 'rotated'], 'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'expires_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'revoked_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'key_preview': {'type': 'string'}, 'last_used_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, {'type': 'object', 'required': ['type', 'id', 'status', 'scopes', 'token_preview', 'client', 'created_by_user_id', 'last_authorized_by_user_id', 'expires_at', 'created_at', 'updated_at'], 'properties': {'id': {'type': 'string'}, 'type': {'enum': ['oauth_access_token'], 'type': 'string'}, 'client': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}, 'scopes': {'type': 'array', 'items': {'type': 'string'}}, 'status': {'enum': ['active'], 'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'expires_at': {'type': 'string', 'format': 'date-time'}, 'revoked_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'last_used_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'token_preview': {'type': 'string'}, 'created_by_user_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'last_authorized_by_user_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}]}, 'conventions': {'type': 'object', 'required': ['pagination_type', 'pagination_limit_param', 'pagination_cursor_param', 'idempotency_header'], 'properties': {'pagination_type': {'enum': ['cursor'], 'type': 'string'}, 'idempotency_header': {'type': 'string'}, 'pagination_limit_param': {'type': 'string'}, 'pagination_cursor_param': {'type': 'string'}}}, 'limitations': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'message', 'affected_operation_ids'], 'properties': {'code': {'type': 'string'}, 'message': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'affected_operation_ids': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Exact operation IDs omitted because of this limitation.'}}}, 'description': 'Current plan or workspace prerequisites that caused otherwise supported operations to be omitted.'}, 'authentication': {'type': 'object', 'required': ['type', 'header_name', 'header_value_prefix', 'workspace_scoped', 'scopes_supported', 'supported_credential_types'], 'properties': {'type': {'enum': ['bearer'], 'type': 'string'}, 'header_name': {'type': 'string'}, 'scopes_supported': {'type': 'array', 'items': {'type': 'string'}}, 'workspace_scoped': {'type': 'boolean'}, 'header_value_prefix': {'type': 'string'}, 'supported_credential_types': {'type': 'array', 'items': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}}}}, 'capability_mode': {'enum': ['effective'], 'type': 'string', 'description': 'Resources contain only operations currently available to this credential, plan, workspace state, rollout state, and active MCP client catalog when called through MCP.'}}}, 'PublicApiMcp': {'type': 'object', 'required': ['package_name', 'docs_url', 'server_url', 'recommended_transport', 'supported_transports'], 'properties': {'docs_url': {'type': 'string'}, 'read_only': {'type': 'boolean', 'description': 'True when this MCP request is restricted to read-only operations.'}, 'server_url': {'type': 'string'}, 'package_name': {'type': 'string'}, 'active_toolsets': {'anyOf': [{'type': 'array', 'items': {'type': 'string'}, 'description': 'Toolsets selected for this MCP request. Omitted for direct REST requests.'}, {'type': 'null'}]}, 'active_operation_ids': {'anyOf': [{'type': 'array', 'items': {'type': 'string'}, 'description': "Exact operation IDs exposed by this MCP client's active tool catalog. Omitted for direct REST requests and unrestricted MCP clients."}, {'type': 'null'}]}, 'supported_transports': {'type': 'array', 'items': {'enum': ['streamable_http', 'stdio'], 'type': 'string'}}, 'recommended_transport': {'enum': ['streamable_http'], 'type': 'string'}}}, 'PublicApiSdks': {'type': 'object', 'required': ['typescript', 'python'], 'properties': {'python': {'type': 'object', 'required': ['package_name', 'docs_url', 'language'], 'properties': {'docs_url': {'type': 'string'}, 'language': {'enum': ['python'], 'type': 'string'}, 'package_name': {'type': 'string'}}}, 'typescript': {'type': 'object', 'required': ['package_name', 'docs_url', 'language'], 'properties': {'docs_url': {'type': 'string'}, 'language': {'enum': ['typescript'], 'type': 'string'}, 'package_name': {'type': 'string'}}}}}, 'WebhookSigning': {'type': 'object', 'required': ['algorithm', 'id_header', 'timestamp_header', 'signature_header', 'signature_prefix'], 'properties': {'algorithm': {'enum': ['hmac-sha256'], 'type': 'string'}, 'id_header': {'type': 'string'}, 'signature_header': {'type': 'string'}, 'signature_prefix': {'type': 'string'}, 'timestamp_header': {'type': 'string'}}}, 'CapabilityResource': {'type': 'object', 'required': ['key', 'name', 'description', 'operations'], 'properties': {'key': {'type': 'string'}, 'name': {'type': 'string'}, 'operations': {'type': 'array', 'items': {'$ref': '#/$defs/CapabilityOperation'}}, 'description': {'type': 'string'}}}, 'CapabilityOperation': {'type': 'object', 'required': ['method', 'path', 'operation_id', 'summary', 'required_scopes'], 'properties': {'path': {'type': 'string'}, 'method': {'type': 'string'}, 'summary': {'type': 'string'}, 'operation_id': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}}}}, 'WebhookEventSupport': {'type': 'object', 'required': ['subscriptions_url', 'supported_events', 'supported_event_patterns', 'signing'], 'properties': {'signing': {'$ref': '#/$defs/WebhookSigning'}, 'supported_events': {'type': 'array', 'items': {'type': 'string'}}, 'subscriptions_url': {'type': 'string'}, 'supported_event_patterns': {'type': 'array', 'items': {'type': 'string'}}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Capabilities'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getPublicApiCapabilities', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'EmailTemplateUpsertRequest': {'type': 'object', 'anyOf': [{'required': ['body_document']}, {'required': ['starting_point_id']}], 'required': ['name'], 'properties': {'name': {'type': 'string', 'maxLength': 160}, 'enabled': {'type': 'boolean'}, 'body_document': {'allOf': [{'$ref': '#/$defs/BroadcastEmailDocument'}], 'description': 'Structured email editor content. The serialized document must be 512000 bytes or less. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'starting_point_id': {'type': 'string', 'description': 'Creates the email template from this canonical starting point. Do not also provide body_document.'}}, 'additionalProperties': False}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/EmailTemplateUpsertRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'EmailTemplate': {'type': 'object', 'required': ['id', 'name', 'body', 'body_document', 'enabled', 'workspaces', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'name': {'type': 'string', 'maxLength': 160}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'enabled': {'type': 'boolean'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'workspaces': {'type': 'array', 'items': {'$ref': '#/$defs/WorkspaceReference'}}, 'body_document': {'allOf': [{'$ref': '#/$defs/BroadcastEmailDocument'}], 'description': 'Structured email editor content. The serialized document must be 512000 bytes or less. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'WorkspaceReference': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/EmailTemplate'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'createEmailTemplate', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['template_id'], 'properties': {'template_id': {'type': 'string', 'description': 'The email template identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'EmailTemplate': {'type': 'object', 'required': ['id', 'name', 'body', 'body_document', 'enabled', 'workspaces', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'name': {'type': 'string', 'maxLength': 160}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'enabled': {'type': 'boolean'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'workspaces': {'type': 'array', 'items': {'$ref': '#/$defs/WorkspaceReference'}}, 'body_document': {'allOf': [{'$ref': '#/$defs/BroadcastEmailDocument'}], 'description': 'Structured email editor content. The serialized document must be 512000 bytes or less. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'WorkspaceReference': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/EmailTemplate'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getEmailTemplate', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of items to return.'}, 'search': {'type': 'string', 'maxLength': 200, 'description': 'Filter email templates by name.'}, 'starting_after': {'type': 'string', 'description': 'Opaque cursor returned by the previous page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'WorkspaceReference': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}, 'EmailTemplateSummary': {'type': 'object', 'required': ['id', 'name', 'enabled', 'workspaces', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string', 'maxLength': 160}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'enabled': {'type': 'boolean'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'workspaces': {'type': 'array', 'items': {'$ref': '#/$defs/WorkspaceReference'}}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/EmailTemplateSummary'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listEmailTemplates', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'SubscriberPreviewRequest': {'type': 'object', 'required': ['subscriber_id'], 'properties': {'subscriber_id': {'type': 'string', 'description': 'The saved Subscriber whose name, email, and custom fields should be used for personalization.'}}, 'additionalProperties': False}}, 'required': ['template_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/SubscriberPreviewRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'template_id': {'type': 'string', 'description': 'The email template identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'EmailTemplatePreview': {'type': 'object', 'required': ['template_id', 'subscriber_id', 'html', 'text'], 'properties': {'html': {'type': 'string'}, 'text': {'type': 'string'}, 'template_id': {'type': 'string'}, 'subscriber_id': {'type': 'string'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/EmailTemplatePreview'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'previewEmailTemplate', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'EmailTemplateUpdateRequest': {'type': 'object', 'properties': {'name': {'type': 'string', 'maxLength': 160}, 'enabled': {'type': 'boolean'}, 'body_document': {'allOf': [{'$ref': '#/$defs/BroadcastEmailDocument'}], 'description': 'Structured email editor content. The serialized document must be 512000 bytes or less. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'minProperties': 1, 'additionalProperties': False}}, 'required': ['template_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/EmailTemplateUpdateRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'template_id': {'type': 'string', 'description': 'The email template identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'EmailTemplate': {'type': 'object', 'required': ['id', 'name', 'body', 'body_document', 'enabled', 'workspaces', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string'}, 'name': {'type': 'string', 'maxLength': 160}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'enabled': {'type': 'boolean'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'workspaces': {'type': 'array', 'items': {'$ref': '#/$defs/WorkspaceReference'}}, 'body_document': {'allOf': [{'$ref': '#/$defs/BroadcastEmailDocument'}], 'description': 'Structured email editor content. The serialized document must be 512000 bytes or less. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'WorkspaceReference': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/EmailTemplate'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateEmailTemplate', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['segment_id'], 'properties': {'segment_id': {'type': 'string', 'description': 'The identifier of the segment to return.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Segment': {'type': 'object', 'required': ['id', 'name', 'description', 'definition', 'confirmed_subscriber_count', 'total_subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/AudienceDefinition'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'total_subscriber_count': {'type': 'integer'}, 'confirmed_subscriber_count': {'type': 'integer'}}}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Segment'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getSegment', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'The maximum number of segments to return.'}, 'search': {'type': 'string', 'maxLength': 200, 'description': 'Filter Segments by name or description.'}, 'starting_after': {'type': 'string', 'description': 'The opaque cursor from the previous page of saved segments.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'SegmentSummary': {'type': 'object', 'required': ['id', 'name', 'description', 'confirmed_subscriber_count', 'total_subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'total_subscriber_count': {'type': 'integer', 'minimum': 0}, 'confirmed_subscriber_count': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/SegmentSummary'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listSegments', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'SegmentPreviewRequest': {'type': 'object', 'required': ['definition'], 'properties': {'definition': {'allOf': [{'$ref': '#/$defs/AudienceDefinition'}], 'description': 'The segment filters to preview. Include at least one filter group.'}, 'current_segment_id': {'anyOf': [{'type': 'string', 'description': 'When previewing an edit to an existing segment, include that segment id so Mailrith can catch circular segment references before saving.'}, {'type': 'null'}]}}}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/SegmentPreviewRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'SegmentPreview': {'type': 'object', 'required': ['confirmed_subscriber_count', 'total_subscriber_count'], 'properties': {'total_subscriber_count': {'type': 'integer'}, 'confirmed_subscriber_count': {'type': 'integer'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/SegmentPreview'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'previewSegment', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['sender_identity_id'], 'properties': {'sender_identity_id': {'type': 'string', 'description': 'The sender identity identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'SenderIdentity': {'type': 'object', 'required': ['id', 'name', 'provider', 'from_name', 'from_email', 'ready_for_selection', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'provider': {'type': 'string', 'description': 'The configured email delivery provider. No provider credentials or configuration are returned.'}, 'from_name': {'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'type': 'string', 'format': 'email'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'ready_for_selection': {'enum': [True], 'type': 'boolean', 'description': 'True because this read returns only enabled sender identities linked to the current workspace.'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/SenderIdentity'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getSenderIdentity', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of sender identities to return.'}, 'starting_after': {'type': 'string', 'description': 'Opaque next_cursor returned by the previous sender identity page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'SenderIdentity': {'type': 'object', 'required': ['id', 'name', 'provider', 'from_name', 'from_email', 'ready_for_selection', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'provider': {'type': 'string', 'description': 'The configured email delivery provider. No provider credentials or configuration are returned.'}, 'from_name': {'type': 'string'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'from_email': {'type': 'string', 'format': 'email'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'ready_for_selection': {'enum': [True], 'type': 'boolean', 'description': 'True because this read returns only enabled sender identities linked to the current workspace.'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/SenderIdentity'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listSenderIdentities', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'SequenceEmail': {'type': 'object', 'required': ['id', 'subject', 'previewText', 'bodyDocument', 'status', 'delayValue', 'delayUnit', 'sendOnWeekdays'], 'properties': {'id': {'type': 'string'}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'status': {'enum': ['Draft', 'Published'], 'type': 'string'}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'delayUnit': {'enum': ['minute', 'hour', 'day'], 'type': 'string'}, 'delayValue': {'type': 'number', 'minimum': 0}, 'previewText': {'type': ['string', 'null']}, 'audienceMode': {'enum': ['all', 'include', 'exclude'], 'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'audienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'SequenceDefinition': {'type': 'object', 'example': {'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}, 'examples': [{'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}], 'required': ['emails'], 'properties': {'emails': {'type': 'array', 'items': {'$ref': '#/$defs/SequenceEmail'}}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'defaultTemplateId': {'type': ['string', 'null']}, 'excludeAudienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}, 'sendNewEmailsToCompletedSubscribers': {'type': 'boolean'}, 'restartSequenceForCompletedSubscribers': {'type': 'boolean'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'SequenceUpsertRequest': {'type': 'object', 'required': ['name', 'definition'], 'properties': {'name': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'definition': {'$ref': '#/$defs/SequenceDefinition'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/SequenceUpsertRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Sequence': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'definition', 'subscriber_count', 'open_rate', 'click_rate', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['running', 'paused'], 'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'open_rate': {'type': 'integer'}, 'click_rate': {'type': 'integer'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/SequenceDefinition'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Sequence change.'}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'bounced_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'send_progress': {'anyOf': [{'allOf': [{'$ref': '#/$defs/BroadcastSendProgress'}]}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'complained_count': {'type': 'integer'}, 'subscriber_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}}}, 'SequenceEmail': {'type': 'object', 'required': ['id', 'subject', 'previewText', 'bodyDocument', 'status', 'delayValue', 'delayUnit', 'sendOnWeekdays'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string', 'readOnly': True, 'description': 'Rendered HTML returned by Mailrith. Agents should send bodyDocument when creating or updating a Sequence.'}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'status': {'enum': ['Draft', 'Published'], 'type': 'string'}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'delayUnit': {'enum': ['minute', 'hour', 'day'], 'type': 'string'}, 'delayValue': {'type': 'number', 'minimum': 0}, 'previewText': {'type': ['string', 'null']}, 'audienceMode': {'enum': ['all', 'include', 'exclude'], 'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'audienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'SequenceDefinition': {'type': 'object', 'example': {'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}, 'examples': [{'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}], 'required': ['emails'], 'properties': {'emails': {'type': 'array', 'items': {'$ref': '#/$defs/SequenceEmail'}}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'defaultTemplateId': {'type': ['string', 'null']}, 'excludeAudienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}, 'sendNewEmailsToCompletedSubscribers': {'type': 'boolean'}, 'restartSequenceForCompletedSubscribers': {'type': 'boolean'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastSendProgress': {'type': 'object', 'required': ['run_id', 'phase', 'selected', 'materialized', 'sent', 'accepted', 'skipped', 'retrying', 'permanent_failed', 'unknown', 'canceled', 'percent_complete', 'effective_rate', 'provider_limited_rate', 'provider', 'estimated_completion', 'estimated_completion_basis', 'last_progress_at', 'pause_reason', 'next_retry_at', 'next_retry_action', 'pause_message', 'terminal'], 'properties': {'sent': {'type': 'integer'}, 'phase': {'enum': ['preparing', 'sending', 'paused', 'canceling', 'sent', 'sent_with_errors', 'canceled', 'failed'], 'type': 'string'}, 'run_id': {'type': 'string'}, 'skipped': {'type': 'integer'}, 'unknown': {'type': 'integer'}, 'accepted': {'type': 'integer'}, 'canceled': {'type': 'integer'}, 'provider': {'anyOf': [{'type': 'string', 'description': 'The email delivery provider used by this send.'}, {'type': 'null'}]}, 'retrying': {'type': 'integer'}, 'selected': {'type': 'integer'}, 'terminal': {'type': 'boolean'}, 'materialized': {'type': 'integer'}, 'pause_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'next_retry_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'pause_message': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'effective_rate': {'type': 'number'}, 'last_progress_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'percent_complete': {'type': 'number'}, 'permanent_failed': {'type': 'integer'}, 'next_retry_action': {'anyOf': [{'enum': ['resume', 'recheck'], 'type': 'string', 'description': 'Whether the next time is a known quota reset or another connection check.'}, {'type': 'null'}]}, 'estimated_completion': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'provider_limited_rate': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'estimated_completion_basis': {'anyOf': [{'enum': ['current-rate', 'provider-quota'], 'type': 'string', 'description': 'Whether the estimate uses only the current rate or also includes known provider quota windows.'}, {'type': 'null'}]}}}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Sequence'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'createSequence', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['sequence_id'], 'properties': {'sequence_id': {'type': 'string', 'description': 'The sequence identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Sequence': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'definition', 'subscriber_count', 'open_rate', 'click_rate', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['running', 'paused'], 'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'open_rate': {'type': 'integer'}, 'click_rate': {'type': 'integer'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/SequenceDefinition'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Sequence change.'}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'bounced_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'send_progress': {'anyOf': [{'allOf': [{'$ref': '#/$defs/BroadcastSendProgress'}]}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'complained_count': {'type': 'integer'}, 'subscriber_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}}}, 'SequenceEmail': {'type': 'object', 'required': ['id', 'subject', 'previewText', 'bodyDocument', 'status', 'delayValue', 'delayUnit', 'sendOnWeekdays'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string', 'readOnly': True, 'description': 'Rendered HTML returned by Mailrith. Agents should send bodyDocument when creating or updating a Sequence.'}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'status': {'enum': ['Draft', 'Published'], 'type': 'string'}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'delayUnit': {'enum': ['minute', 'hour', 'day'], 'type': 'string'}, 'delayValue': {'type': 'number', 'minimum': 0}, 'previewText': {'type': ['string', 'null']}, 'audienceMode': {'enum': ['all', 'include', 'exclude'], 'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'audienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'SequenceDefinition': {'type': 'object', 'example': {'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}, 'examples': [{'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}], 'required': ['emails'], 'properties': {'emails': {'type': 'array', 'items': {'$ref': '#/$defs/SequenceEmail'}}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'defaultTemplateId': {'type': ['string', 'null']}, 'excludeAudienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}, 'sendNewEmailsToCompletedSubscribers': {'type': 'boolean'}, 'restartSequenceForCompletedSubscribers': {'type': 'boolean'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastSendProgress': {'type': 'object', 'required': ['run_id', 'phase', 'selected', 'materialized', 'sent', 'accepted', 'skipped', 'retrying', 'permanent_failed', 'unknown', 'canceled', 'percent_complete', 'effective_rate', 'provider_limited_rate', 'provider', 'estimated_completion', 'estimated_completion_basis', 'last_progress_at', 'pause_reason', 'next_retry_at', 'next_retry_action', 'pause_message', 'terminal'], 'properties': {'sent': {'type': 'integer'}, 'phase': {'enum': ['preparing', 'sending', 'paused', 'canceling', 'sent', 'sent_with_errors', 'canceled', 'failed'], 'type': 'string'}, 'run_id': {'type': 'string'}, 'skipped': {'type': 'integer'}, 'unknown': {'type': 'integer'}, 'accepted': {'type': 'integer'}, 'canceled': {'type': 'integer'}, 'provider': {'anyOf': [{'type': 'string', 'description': 'The email delivery provider used by this send.'}, {'type': 'null'}]}, 'retrying': {'type': 'integer'}, 'selected': {'type': 'integer'}, 'terminal': {'type': 'boolean'}, 'materialized': {'type': 'integer'}, 'pause_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'next_retry_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'pause_message': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'effective_rate': {'type': 'number'}, 'last_progress_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'percent_complete': {'type': 'number'}, 'permanent_failed': {'type': 'integer'}, 'next_retry_action': {'anyOf': [{'enum': ['resume', 'recheck'], 'type': 'string', 'description': 'Whether the next time is a known quota reset or another connection check.'}, {'type': 'null'}]}, 'estimated_completion': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'provider_limited_rate': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'estimated_completion_basis': {'anyOf': [{'enum': ['current-rate', 'provider-quota'], 'type': 'string', 'description': 'Whether the estimate uses only the current rate or also includes known provider quota windows.'}, {'type': 'null'}]}}}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Sequence'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getSequence', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of sequences to return.'}, 'search': {'type': 'string', 'description': 'Filter sequences by name, status, or sender details. Retrieve a known Sequence ID through the item endpoint.'}, 'starting_after': {'type': 'string', 'description': 'Use the opaque cursor from the previous page to request the next page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'SequenceSummary': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'email_count', 'subscriber_count', 'open_rate', 'click_rate', 'unsubscribed_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['running', 'paused'], 'type': 'string'}, 'open_rate': {'type': 'integer', 'minimum': 0}, 'click_rate': {'type': 'integer', 'minimum': 0}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'email_count': {'type': 'integer', 'minimum': 0}, 'is_updating': {'type': 'boolean'}, 'subscriber_count': {'type': 'integer', 'minimum': 0}, 'unsubscribed_count': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/SequenceSummary'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listSequences', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['sequence_id'], 'properties': {'sequence_id': {'type': 'string', 'description': 'The Sequence identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'SequencePreflight': {'type': 'object', 'required': ['sequence_id', 'ready', 'email_count', 'published_email_count', 'checks', 'checked_at'], 'properties': {'ready': {'type': 'boolean'}, 'checks': {'type': 'array', 'items': {'$ref': '#/$defs/WorkflowReadinessCheck'}}, 'checked_at': {'type': 'string', 'format': 'date-time'}, 'email_count': {'type': 'integer', 'minimum': 0}, 'sequence_id': {'type': 'string'}, 'published_email_count': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'WorkflowReadinessCheck': {'type': 'object', 'required': ['key', 'status', 'message'], 'properties': {'key': {'type': 'string'}, 'status': {'enum': ['passed', 'blocking'], 'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/SequencePreflight'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'preflightSequence', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['sequence_id', 'subscriber_id'], 'properties': {'sequence_id': {'type': 'string', 'description': 'The Sequence identifier.'}, 'subscriber_id': {'type': 'string', 'description': 'The saved Subscriber whose personalization and targeting should be previewed.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'SequenceJourneyPreview': {'type': 'object', 'required': ['sequence_id', 'subscriber_id', 'subscriber_eligible', 'side_effect_free', 'emails'], 'properties': {'emails': {'type': 'array', 'items': {'type': 'object', 'required': ['position', 'email_id', 'subject', 'status', 'eligible', 'delay_value', 'delay_unit', 'send_on_weekdays', 'audience_mode'], 'properties': {'status': {'enum': ['Draft', 'Published'], 'type': 'string'}, 'subject': {'type': 'string'}, 'eligible': {'type': 'boolean'}, 'email_id': {'type': 'string'}, 'position': {'type': 'integer', 'minimum': 1}, 'delay_unit': {'enum': ['minute', 'hour', 'day'], 'type': 'string'}, 'delay_value': {'type': 'integer', 'minimum': 0}, 'audience_mode': {'enum': ['all', 'include', 'exclude'], 'type': 'string'}, 'send_on_weekdays': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'maxItems': 100}, 'sequence_id': {'type': 'string'}, 'subscriber_id': {'type': 'string'}, 'side_effect_free': {'enum': [True], 'type': 'boolean'}, 'subscriber_eligible': {'type': 'boolean'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/SequenceJourneyPreview'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'previewSequenceJourney', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'WorkflowTestRequest': {'type': 'object', 'required': ['recipient', 'subscriber_id'], 'properties': {'recipient': {'type': 'string', 'format': 'email'}, 'message_ids': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 5, 'description': 'Optional Sequence email IDs or Automation step IDs. Omit to test the first five available messages.', 'uniqueItems': True}, 'subscriber_id': {'type': 'string', 'description': 'The saved Subscriber whose personalization should be rendered in every test message.'}}, 'additionalProperties': False}}, 'required': ['sequence_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/WorkflowTestRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'sequence_id': {'type': 'string', 'description': 'The Sequence identifier.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'WorkflowTestResult': {'type': 'object', 'required': ['status', 'sent_count', 'message_ids', 'subscriber_id'], 'properties': {'status': {'enum': ['completed'], 'type': 'string'}, 'sent_count': {'type': 'integer', 'maximum': 5, 'minimum': 1}, 'message_ids': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 5}, 'subscriber_id': {'type': 'string'}, 'provider_message_ids': {'type': 'array', 'items': {'anyOf': [{'type': 'string', 'maxLength': 200}, {'type': 'null'}]}, 'maxItems': 5, 'minItems': 1, 'description': 'Provider acceptance IDs in sent-message order; null when unavailable. These are not delivery or inbox receipts.'}}, 'additionalProperties': False}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/WorkflowTestResult'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'testSequence', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'SequenceEmail': {'type': 'object', 'required': ['id', 'subject', 'previewText', 'bodyDocument', 'status', 'delayValue', 'delayUnit', 'sendOnWeekdays'], 'properties': {'id': {'type': 'string'}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'status': {'enum': ['Draft', 'Published'], 'type': 'string'}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'delayUnit': {'enum': ['minute', 'hour', 'day'], 'type': 'string'}, 'delayValue': {'type': 'number', 'minimum': 0}, 'previewText': {'type': ['string', 'null']}, 'audienceMode': {'enum': ['all', 'include', 'exclude'], 'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'audienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'SequenceDefinition': {'type': 'object', 'example': {'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}, 'examples': [{'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}], 'required': ['emails'], 'properties': {'emails': {'type': 'array', 'items': {'$ref': '#/$defs/SequenceEmail'}}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'defaultTemplateId': {'type': ['string', 'null']}, 'excludeAudienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}, 'sendNewEmailsToCompletedSubscribers': {'type': 'boolean'}, 'restartSequenceForCompletedSubscribers': {'type': 'boolean'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'SequenceUpdateRequest': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'definition': {'$ref': '#/$defs/SequenceDefinition'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'minProperties': 1, 'additionalProperties': False}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'required': ['sequence_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/SequenceUpdateRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'sequence_id': {'type': 'string', 'description': 'The sequence identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Sequence': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'definition', 'subscriber_count', 'open_rate', 'click_rate', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['running', 'paused'], 'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'open_rate': {'type': 'integer'}, 'click_rate': {'type': 'integer'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/SequenceDefinition'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Sequence change.'}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'bounced_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'send_progress': {'anyOf': [{'allOf': [{'$ref': '#/$defs/BroadcastSendProgress'}]}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'complained_count': {'type': 'integer'}, 'subscriber_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}}}, 'SequenceEmail': {'type': 'object', 'required': ['id', 'subject', 'previewText', 'bodyDocument', 'status', 'delayValue', 'delayUnit', 'sendOnWeekdays'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string', 'readOnly': True, 'description': 'Rendered HTML returned by Mailrith. Agents should send bodyDocument when creating or updating a Sequence.'}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'status': {'enum': ['Draft', 'Published'], 'type': 'string'}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'delayUnit': {'enum': ['minute', 'hour', 'day'], 'type': 'string'}, 'delayValue': {'type': 'number', 'minimum': 0}, 'previewText': {'type': ['string', 'null']}, 'audienceMode': {'enum': ['all', 'include', 'exclude'], 'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'audienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'SequenceDefinition': {'type': 'object', 'example': {'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}, 'examples': [{'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}], 'required': ['emails'], 'properties': {'emails': {'type': 'array', 'items': {'$ref': '#/$defs/SequenceEmail'}}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'defaultTemplateId': {'type': ['string', 'null']}, 'excludeAudienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}, 'sendNewEmailsToCompletedSubscribers': {'type': 'boolean'}, 'restartSequenceForCompletedSubscribers': {'type': 'boolean'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastSendProgress': {'type': 'object', 'required': ['run_id', 'phase', 'selected', 'materialized', 'sent', 'accepted', 'skipped', 'retrying', 'permanent_failed', 'unknown', 'canceled', 'percent_complete', 'effective_rate', 'provider_limited_rate', 'provider', 'estimated_completion', 'estimated_completion_basis', 'last_progress_at', 'pause_reason', 'next_retry_at', 'next_retry_action', 'pause_message', 'terminal'], 'properties': {'sent': {'type': 'integer'}, 'phase': {'enum': ['preparing', 'sending', 'paused', 'canceling', 'sent', 'sent_with_errors', 'canceled', 'failed'], 'type': 'string'}, 'run_id': {'type': 'string'}, 'skipped': {'type': 'integer'}, 'unknown': {'type': 'integer'}, 'accepted': {'type': 'integer'}, 'canceled': {'type': 'integer'}, 'provider': {'anyOf': [{'type': 'string', 'description': 'The email delivery provider used by this send.'}, {'type': 'null'}]}, 'retrying': {'type': 'integer'}, 'selected': {'type': 'integer'}, 'terminal': {'type': 'boolean'}, 'materialized': {'type': 'integer'}, 'pause_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'next_retry_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'pause_message': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'effective_rate': {'type': 'number'}, 'last_progress_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'percent_complete': {'type': 'number'}, 'permanent_failed': {'type': 'integer'}, 'next_retry_action': {'anyOf': [{'enum': ['resume', 'recheck'], 'type': 'string', 'description': 'Whether the next time is a known quota reset or another connection check.'}, {'type': 'null'}]}, 'estimated_completion': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'provider_limited_rate': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'estimated_completion_basis': {'anyOf': [{'enum': ['current-rate', 'provider-quota'], 'type': 'string', 'description': 'Whether the estimate uses only the current rate or also includes known provider quota windows.'}, {'type': 'null'}]}}}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Sequence'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateSequence', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'SequenceStatusRequest': {'type': 'object', 'required': ['status'], 'properties': {'status': {'enum': ['running', 'paused'], 'type': 'string'}}}}, 'required': ['sequence_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/SequenceStatusRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'sequence_id': {'type': 'string', 'description': 'The Sequence identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Sequence': {'type': 'object', 'required': ['id', 'name', 'status', 'is_updating', 'connection_id', 'from_name', 'from_email', 'reply_to_email', 'track_opens', 'track_clicks', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'definition', 'subscriber_count', 'open_rate', 'click_rate', 'unsubscribed_count', 'bounced_count', 'complained_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'status': {'enum': ['running', 'paused'], 'type': 'string'}, 'utm_term': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'from_name': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'open_rate': {'type': 'integer'}, 'click_rate': {'type': 'integer'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'definition': {'$ref': '#/$defs/SequenceDefinition'}, 'from_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'utm_medium': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'utm_source': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'is_updating': {'type': 'boolean', 'description': 'True while Mailrith updates existing Subscriber progress after a structural Sequence change.'}, 'track_opens': {'type': 'boolean'}, 'utm_content': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'track_clicks': {'type': 'boolean'}, 'utm_campaign': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'bounced_count': {'type': 'integer'}, 'connection_id': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'send_progress': {'anyOf': [{'allOf': [{'$ref': '#/$defs/BroadcastSendProgress'}]}, {'type': 'null'}]}, 'reply_to_email': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'complained_count': {'type': 'integer'}, 'subscriber_count': {'type': 'integer'}, 'unsubscribed_count': {'type': 'integer'}}}, 'SequenceEmail': {'type': 'object', 'required': ['id', 'subject', 'previewText', 'bodyDocument', 'status', 'delayValue', 'delayUnit', 'sendOnWeekdays'], 'properties': {'id': {'type': 'string'}, 'body': {'type': 'string', 'readOnly': True, 'description': 'Rendered HTML returned by Mailrith. Agents should send bodyDocument when creating or updating a Sequence.'}, 'stats': {'$ref': '#/$defs/EmailEngagementStats'}, 'status': {'enum': ['Draft', 'Published'], 'type': 'string'}, 'subject': {'type': 'string', 'description': 'For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}, 'delayUnit': {'enum': ['minute', 'hour', 'day'], 'type': 'string'}, 'delayValue': {'type': 'number', 'minimum': 0}, 'previewText': {'type': ['string', 'null']}, 'audienceMode': {'enum': ['all', 'include', 'exclude'], 'type': 'string'}, 'bodyDocument': {'$ref': '#/$defs/BroadcastEmailDocument'}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'audienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}}, 'additionalProperties': False}, 'AudienceCondition': {'type': 'object', 'required': ['id', 'field', 'operator'], 'properties': {'id': {'type': 'string'}, 'field': {'enum': ['subscriber_status', 'country', 'segment', 'tag', 'sequence', 'form', 'custom_field', 'email_opened', 'email_unsubscribed', 'magic_link_clicked'], 'type': 'string'}, 'value': {'oneOf': [{'type': 'string'}, {'type': 'number'}, {'type': 'boolean'}, {'type': 'array', 'items': {'type': 'string'}}, {'type': 'null'}]}, 'operator': {'enum': ['is', 'is_not', 'has_any_of', 'has_none_of', 'is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of', 'contains', 'does_not_contain', 'is_empty', 'is_not_empty', 'before', 'after', 'on', 'in_last_days', 'greater_than', 'less_than', 'in_region', 'not_in_region'], 'type': 'string'}, 'customFieldId': {'type': ['string', 'null']}}, 'additionalProperties': False}, 'AudienceDefinition': {'type': 'object', 'example': {'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}, 'examples': [{'match': 'all', 'groups': [{'id': 'active-subscribers', 'match': 'all', 'conditions': [{'id': 'active-status', 'field': 'subscriber_status', 'value': ['Active'], 'operator': 'is'}]}]}], 'required': ['match', 'groups'], 'properties': {'match': {'enum': ['all', 'any'], 'type': 'string'}, 'groups': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceConditionGroup'}}}, 'additionalProperties': False}, 'BroadcastEmailMark': {'type': 'object', 'required': ['type'], 'properties': {'type': {'enum': ['bold', 'italic', 'strike', 'underline', 'link', 'textStyle', 'highlight'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'href': {'type': 'string'}, 'color': {'type': 'string'}, 'fontSize': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'BroadcastEmailNode': {'type': 'object', 'required': ['type'], 'properties': {'text': {'type': 'string'}, 'type': {'enum': ['doc', 'paragraph', 'heading', 'text', 'hardBreak', 'bulletList', 'orderedList', 'listItem', 'blockquote', 'emailSection', 'emailSectionColumn', 'emailButton', 'image', 'horizontalRule'], 'type': 'string'}, 'attrs': {'type': 'object', 'properties': {'id': {'type': 'string'}, 'alt': {'type': 'string'}, 'src': {'type': 'string'}, 'crop': {'enum': ['none', 'square', 'circle'], 'type': 'string'}, 'href': {'type': 'string'}, 'size': {'enum': ['small', 'medium', 'large'], 'type': 'string'}, 'align': {'enum': ['left', 'center', 'right'], 'type': 'string'}, 'label': {'type': 'string'}, 'level': {'enum': [1, 2, 3], 'type': 'integer'}, 'title': {'type': 'string'}, 'width': {'enum': ['default', 'large', 'full', 'fit'], 'type': 'string'}, 'margin': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'source': {'enum': ['unsplash'], 'type': 'string'}, 'caption': {'type': 'string'}, 'columns': {'enum': [1, 2, 3], 'type': 'integer'}, 'padding': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'unsplash': {'type': 'object', 'required': ['photographerName'], 'properties': {'photoId': {'type': 'string'}, 'unsplashUrl': {'type': 'string'}, 'photographerUrl': {'type': 'string'}, 'photographerName': {'type': 'string'}, 'photographerUsername': {'type': 'string'}}, 'additionalProperties': False}, 'linkColor': {'type': 'string'}, 'textAlign': {'enum': ['left', 'center', 'right', 'justify'], 'type': 'string'}, 'textColor': {'type': 'string'}, 'fillColumn': {'type': 'boolean'}, 'borderColor': {'type': 'string'}, 'borderWidth': {'enum': ['none', 'normal', 'large'], 'type': 'string'}, 'borderRadius': {'enum': ['none', 'normal', 'small', 'large', 'full'], 'type': 'string'}, 'widthPercent': {'type': 'number', 'maximum': 100, 'minimum': 1}, 'verticalAlign': {'enum': ['top', 'middle', 'bottom'], 'type': 'string'}, 'backgroundColor': {'type': 'string'}, 'layoutAlignment': {'enum': ['left', 'center'], 'type': 'string'}, 'backgroundImageUrl': {'type': 'string'}, 'blockquoteBorderColor': {'type': 'string'}}, 'additionalProperties': False}, 'marks': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailMark'}}, 'content': {'type': 'array', 'items': {'$ref': '#/$defs/BroadcastEmailNode'}}}, 'additionalProperties': False}, 'SequenceDefinition': {'type': 'object', 'example': {'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}, 'examples': [{'emails': [{'id': 'welcome', 'status': 'Published', 'subject': 'Welcome', 'delayUnit': 'day', 'delayValue': 0, 'previewText': 'Thanks for joining', 'audienceMode': 'all', 'bodyDocument': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Welcome to the newsletter.', 'type': 'text'}]}]}, 'sendOnWeekdays': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], 'audienceDefinition': None}]}], 'required': ['emails'], 'properties': {'emails': {'type': 'array', 'items': {'$ref': '#/$defs/SequenceEmail'}}, 'sendOnWeekdays': {'type': 'array', 'items': {'enum': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], 'type': 'string'}, 'uniqueItems': True}, 'defaultTemplateId': {'type': ['string', 'null']}, 'excludeAudienceDefinition': {'anyOf': [{'$ref': '#/$defs/AudienceDefinition'}, {'type': 'null'}]}, 'sendNewEmailsToCompletedSubscribers': {'type': 'boolean'}, 'restartSequenceForCompletedSubscribers': {'type': 'boolean'}}, 'additionalProperties': False}, 'EmailEngagementStats': {'type': 'object', 'required': ['recipientCount', 'openedCount', 'clickedCount', 'unsubscribedCount'], 'properties': {'openedCount': {'type': 'integer', 'minimum': 0}, 'bouncedCount': {'type': 'integer', 'minimum': 0}, 'clickedCount': {'type': 'integer', 'minimum': 0}, 'engagedCount': {'type': 'integer', 'minimum': 0}, 'recipientCount': {'type': 'integer', 'minimum': 0}, 'complainedCount': {'type': 'integer', 'minimum': 0}, 'sentCountsByDay': {'type': 'object', 'additionalProperties': {'type': 'integer', 'minimum': 0}}, 'unsubscribedCount': {'type': 'integer', 'minimum': 0}, 'clickedSubscriberCount': {'type': 'integer', 'minimum': 0}}, 'additionalProperties': False}, 'BroadcastSendProgress': {'type': 'object', 'required': ['run_id', 'phase', 'selected', 'materialized', 'sent', 'accepted', 'skipped', 'retrying', 'permanent_failed', 'unknown', 'canceled', 'percent_complete', 'effective_rate', 'provider_limited_rate', 'provider', 'estimated_completion', 'estimated_completion_basis', 'last_progress_at', 'pause_reason', 'next_retry_at', 'next_retry_action', 'pause_message', 'terminal'], 'properties': {'sent': {'type': 'integer'}, 'phase': {'enum': ['preparing', 'sending', 'paused', 'canceling', 'sent', 'sent_with_errors', 'canceled', 'failed'], 'type': 'string'}, 'run_id': {'type': 'string'}, 'skipped': {'type': 'integer'}, 'unknown': {'type': 'integer'}, 'accepted': {'type': 'integer'}, 'canceled': {'type': 'integer'}, 'provider': {'anyOf': [{'type': 'string', 'description': 'The email delivery provider used by this send.'}, {'type': 'null'}]}, 'retrying': {'type': 'integer'}, 'selected': {'type': 'integer'}, 'terminal': {'type': 'boolean'}, 'materialized': {'type': 'integer'}, 'pause_reason': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'next_retry_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'pause_message': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'effective_rate': {'type': 'number'}, 'last_progress_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'percent_complete': {'type': 'number'}, 'permanent_failed': {'type': 'integer'}, 'next_retry_action': {'anyOf': [{'enum': ['resume', 'recheck'], 'type': 'string', 'description': 'Whether the next time is a known quota reset or another connection check.'}, {'type': 'null'}]}, 'estimated_completion': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}, 'provider_limited_rate': {'anyOf': [{'type': 'number'}, {'type': 'null'}]}, 'estimated_completion_basis': {'anyOf': [{'enum': ['current-rate', 'provider-quota'], 'type': 'string', 'description': 'Whether the estimate uses only the current rate or also includes known provider quota windows.'}, {'type': 'null'}]}}}, 'AudienceConditionGroup': {'type': 'object', 'required': ['id', 'match', 'conditions'], 'properties': {'id': {'type': 'string'}, 'match': {'enum': ['all', 'any'], 'type': 'string'}, 'conditions': {'type': 'array', 'items': {'$ref': '#/$defs/AudienceCondition'}, 'minItems': 1}}, 'additionalProperties': False}, 'BroadcastEmailDocument': {'allOf': [{'$ref': '#/$defs/BroadcastEmailNode'}], 'example': {'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}, 'examples': [{'type': 'doc', 'content': [{'type': 'paragraph', 'content': [{'text': 'Hello [Subscriber_Name, fallback="friend"].', 'type': 'text'}]}]}], 'description': 'A structured email document. The root node must use type `doc` and contain supported block nodes. For Subscriber personalization in email subjects and body text nodes, use Mailrith bracket tokens such as [Subscriber_Name, fallback="friend"] or [Subscriber_Email, fallback=""]. Before using a custom field, call custom_fields_list or custom_fields_get and copy its personalization_token exactly. Do not use Handlebars-style variables such as {{ subscriber.name }}; Mailrith sends them as literal text.'}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Sequence'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateSequenceStatus', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['subscriber_id', 'tag_id'], 'properties': {'tag_id': {'type': 'string', 'description': 'The Tag identifier.'}, 'subscriber_id': {'type': 'string', 'description': 'The Subscriber identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'addSubscriberTag', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['subscriber_id', 'sequence_id'], 'properties': {'sequence_id': {'type': 'string', 'description': 'The sequence identifier.'}, 'subscriber_id': {'type': 'string', 'description': 'The subscriber identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'addSubscriberSequence', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['subscriber_id'], 'properties': {'subscriber_id': {'type': 'string', 'description': 'The Subscriber identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getSubscriber', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'email': {'type': 'string', 'format': 'email', 'description': 'Filter subscribers by an exact subscriber email address.'}, 'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of subscribers to return. Defaults to 25 and is capped at 100.'}, 'search': {'type': 'string', 'description': 'Filter subscribers by name, email, or status.'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string', 'description': 'Filter subscribers by subscriber status.'}, 'tag_id': {'type': 'string', 'description': 'Return subscribers that currently have this tag ID. Repeat `tag_id` or use `tag_ids` to match any of several tags.'}, 'tag_ids': {'type': 'string', 'description': 'Comma-separated tag IDs. By default, the API returns subscribers who have any listed tag.'}, 'cold_only': {'type': 'boolean', 'description': 'When `true`, return only cold subscribers.'}, 'sequence_id': {'type': 'string', 'description': 'Return subscribers that match this sequence ID. Repeat `sequence_id` or use `sequence_ids` to match any of several sequences.'}, 'sequence_ids': {'type': 'string', 'description': 'Comma-separated sequence IDs. By default, the API returns only subscribers who are active in any listed sequence.'}, 'tag_operator': {'enum': ['has_any_of', 'has_none_of'], 'type': 'string', 'default': 'has_any_of', 'description': 'Controls how tag filters are applied. Defaults to `has_any_of`.'}, 'starting_after': {'type': 'string', 'description': 'Use the opaque cursor from the previous page to request the next page.'}, 'sequence_operator': {'enum': ['is_active_in_any_of', 'is_not_active_in_any_of', 'has_completed_any_of', 'has_not_completed_any_of', 'has_ever_been_in_any_of', 'has_never_been_in_any_of'], 'type': 'string', 'default': 'is_active_in_any_of', 'description': 'Controls how sequence filters are applied. Defaults to `is_active_in_any_of`.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}, 'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/Subscriber'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listSubscribers', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['subscriber_id', 'sequence_id'], 'properties': {'sequence_id': {'type': 'string', 'description': 'The sequence identifier.'}, 'subscriber_id': {'type': 'string', 'description': 'The subscriber identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'removeSubscriberSequence', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['subscriber_id', 'tag_id'], 'properties': {'tag_id': {'type': 'string', 'description': 'The tag identifier.'}, 'subscriber_id': {'type': 'string', 'description': 'The subscriber identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'removeSubscriberTag', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'SubscriberUpdateRequest': {'type': 'object', 'example': {'name': 'Ada Lovelace', 'country': 'DE', 'custom_fields': {'cf_company': 'Analytical Engines'}}, 'examples': [{'name': 'Ada Lovelace', 'country': 'DE', 'custom_fields': {'cf_company': 'Analytical Engines'}}], 'properties': {'name': {'type': 'string'}, 'email': {'type': 'string', 'format': 'email'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'custom_fields': {'type': 'object', 'description': 'Custom field values keyed by custom field ID. For Multi Select fields, send an array of option names or a comma-separated string. Blank optional values leave saved values unchanged, and filled-in invalid values are rejected.', 'additionalProperties': True}, 'subscribed_on': {'type': 'string', 'example': '2026-04-11', 'examples': ['2026-04-11'], 'description': 'Subscriber-local subscription date in YYYY-MM-DD format.'}}}}, 'required': ['subscriber_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/SubscriberUpdateRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'subscriber_id': {'type': 'string', 'description': 'The subscriber identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateSubscriber', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'ConsentEvidence': {'type': 'object', 'required': ['lawful_basis', 'collected_at', 'evidence_reference'], 'properties': {'source_url': {'anyOf': [{'type': 'string', 'format': 'uri', 'maxLength': 2048}, {'type': 'null'}]}, 'collected_at': {'type': 'string', 'pattern': '^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$', 'description': "When the consent evidence was collected, as ISO 8601 with an explicit UTC offset. This must not be later than Mailrith's server time. Do not treat a workspace-local clock as UTC; use the evidence record's confirmed timestamp."}, 'lawful_basis': {'type': 'string', 'maxLength': 64}, 'evidence_reference': {'type': 'string', 'maxLength': 512}, 'consent_text_version': {'anyOf': [{'type': 'string', 'maxLength': 128}, {'type': 'null'}]}, 'technical_evidence_hash': {'anyOf': [{'type': 'string', 'pattern': '^[a-f0-9]{64}$'}, {'type': 'null'}]}}, 'description': 'Compact evidence required when the public API makes a Subscriber Active. Keep raw consent text, IP addresses, and user-agent data in your evidence system; Mailrith stores only this version, reference, URL, and optional SHA-256 digest.', 'additionalProperties': False}, 'SubscriberStatusRequest': {'type': 'object', 'required': ['status'], 'properties': {'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'consent_evidence': {'$ref': '#/$defs/ConsentEvidence'}}}}, 'required': ['subscriber_id', 'body'], 'properties': {'body': {'$ref': '#/$defs/SubscriberStatusRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'subscriber_id': {'type': 'string', 'description': 'The Subscriber identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'updateSubscriberStatus', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'ConsentEvidence': {'type': 'object', 'required': ['lawful_basis', 'collected_at', 'evidence_reference'], 'properties': {'source_url': {'anyOf': [{'type': 'string', 'format': 'uri', 'maxLength': 2048}, {'type': 'null'}]}, 'collected_at': {'type': 'string', 'pattern': '^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$', 'description': "When the consent evidence was collected, as ISO 8601 with an explicit UTC offset. This must not be later than Mailrith's server time. Do not treat a workspace-local clock as UTC; use the evidence record's confirmed timestamp."}, 'lawful_basis': {'type': 'string', 'maxLength': 64}, 'evidence_reference': {'type': 'string', 'maxLength': 512}, 'consent_text_version': {'anyOf': [{'type': 'string', 'maxLength': 128}, {'type': 'null'}]}, 'technical_evidence_hash': {'anyOf': [{'type': 'string', 'pattern': '^[a-f0-9]{64}$'}, {'type': 'null'}]}}, 'description': 'Compact evidence required when the public API makes a Subscriber Active. Keep raw consent text, IP addresses, and user-agent data in your evidence system; Mailrith stores only this version, reference, URL, and optional SHA-256 digest.', 'additionalProperties': False}, 'SubscriberUpsertRequest': {'type': 'object', 'example': {'name': 'Ada Lovelace', 'email': 'ada@example.com', 'status': 'Unconfirmed', 'country': 'DE', 'custom_fields': {'cf_company': 'Analytical Engines'}}, 'examples': [{'name': 'Ada Lovelace', 'email': 'ada@example.com', 'status': 'Unconfirmed', 'country': 'DE', 'custom_fields': {'cf_company': 'Analytical Engines'}}], 'required': ['email'], 'properties': {'name': {'type': 'string'}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'create_only': {'type': 'boolean', 'description': 'When true, Mailrith returns a 409 conflict instead of updating an existing subscriber with the same email.'}, 'custom_fields': {'type': 'object', 'description': 'Custom field values keyed by custom field ID. For Multi Select fields, send an array of option names or a comma-separated string. Blank optional values leave saved values unchanged when updating an existing subscriber, and filled-in invalid values are rejected.', 'additionalProperties': True}, 'subscribed_on': {'type': 'string', 'example': '2026-04-11', 'examples': ['2026-04-11'], 'description': 'Subscriber-local subscription date in YYYY-MM-DD format.'}, 'consent_evidence': {'$ref': '#/$defs/ConsentEvidence'}}}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/SubscriberUpsertRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Subscriber': {'type': 'object', 'required': ['id', 'email', 'name', 'status', 'country', 'subscribed_at', 'tags', 'sequence_ids', 'custom_fields', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'tags': {'type': 'array', 'items': {'$ref': '#/$defs/TagSummary'}}, 'email': {'type': 'string', 'format': 'email'}, 'status': {'enum': ['Active', 'Unconfirmed', 'Unsubscribed', 'Complained', 'Bounced', 'Blocked'], 'type': 'string'}, 'country': {'anyOf': [{'type': 'string', 'description': 'Two-letter country code or country name. Mailrith stores Subscriber country as a two-letter country code.'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'sequence_ids': {'type': 'array', 'items': {'type': 'string'}}, 'custom_fields': {'type': 'object', 'additionalProperties': True}, 'subscribed_at': {'type': 'string', 'format': 'date-time'}, 'last_opened_at': {'anyOf': [{'type': 'string', 'format': 'date-time'}, {'type': 'null'}]}}}, 'TagSummary': {'type': 'object', 'required': ['id', 'name'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'anyOf': [{'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}, {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Subscriber'}}}]}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'upsertSubscriber', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', '$defs': {'TagCreateRequest': {'type': 'object', 'required': ['name'], 'properties': {'name': {'type': 'string', 'description': 'Tag name to create. You can also create the GDPR consent tag names when you need to apply consent collected outside Mailrith.'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}, 'additionalProperties': False}}, 'required': ['body'], 'properties': {'body': {'$ref': '#/$defs/TagCreateRequest', 'type': 'object', 'description': 'The exact JSON request body defined by the Mailrith public API contract.'}, 'idempotency_key': {'type': 'string', 'maxLength': 256, 'description': 'Optional idempotency key to retry the request safely. It must not exceed 256 UTF-8 bytes.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Tag': {'type': 'object', 'required': ['id', 'name', 'description', 'gdpr_consent_purpose', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'subscriber_count': {'type': 'integer'}, 'gdpr_consent_purpose': {'anyOf': [{'enum': ['email_marketing', 'ads_personalization'], 'type': 'string', 'description': 'Read-only GDPR consent purpose for Mailrith consent tags. Null for ordinary tags.'}, {'type': 'null'}]}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Tag'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'createTag', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'required': ['tag_id'], 'properties': {'tag_id': {'type': 'string', 'description': 'The Tag identifier.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Tag': {'type': 'object', 'required': ['id', 'name', 'description', 'gdpr_consent_purpose', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'subscriber_count': {'type': 'integer'}, 'gdpr_consent_purpose': {'anyOf': [{'enum': ['email_marketing', 'ads_personalization'], 'type': 'string', 'description': 'Read-only GDPR consent purpose for Mailrith consent tags. Null for ordinary tags.'}, {'type': 'null'}]}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Tag'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getTag', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {'limit': {'type': 'integer', 'maximum': 100, 'minimum': 1, 'description': 'Maximum number of tags to return.'}, 'search': {'type': 'string', 'description': 'Filter Tags by name or description. Retrieve a known Tag ID through the item endpoint.'}, 'starting_after': {'type': 'string', 'description': 'Use the opaque cursor from the previous page to request the next page.'}}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Tag': {'type': 'object', 'required': ['id', 'name', 'description', 'gdpr_consent_purpose', 'subscriber_count', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'description': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'subscriber_count': {'type': 'integer'}, 'gdpr_consent_purpose': {'anyOf': [{'enum': ['email_marketing', 'ads_personalization'], 'type': 'string', 'description': 'Read-only GDPR consent purpose for Mailrith consent tags. Null for ordinary tags.'}, {'type': 'null'}]}}}, 'Pagination': {'type': 'object', 'required': ['has_more', 'next_cursor'], 'properties': {'has_more': {'type': 'boolean'}, 'next_cursor': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data', 'pagination'], 'properties': {'data': {'type': 'array', 'items': {'$ref': '#/$defs/Tag'}}, 'pagination': {'$ref': '#/$defs/Pagination'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'listTags', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Esquema de entrada
{'type': 'object', 'properties': {}, 'additionalProperties': False}
Esquema de salida
{'type': 'object', '$defs': {'Workspace': {'type': 'object', 'required': ['id', 'name', 'logo', 'address', 'city', 'state', 'postal_code', 'country', 'time_zone', 'created_at', 'updated_at', 'self'], 'properties': {'id': {'type': 'string'}, 'city': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'logo': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'name': {'type': 'string'}, 'self': {'type': 'string', 'description': 'Stable relative Public API path for retrieving this resource.'}, 'state': {'anyOf': [{'type': 'string', 'description': 'State, province, or region for the workspace address.'}, {'type': 'null'}]}, 'address': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'country': {'anyOf': [{'type': 'string', 'description': 'Country for the workspace address.'}, {'type': 'null'}]}, 'time_zone': {'anyOf': [{'type': 'string'}, {'type': 'null'}]}, 'created_at': {'type': 'string', 'format': 'date-time'}, 'updated_at': {'type': 'string', 'format': 'date-time'}, 'postal_code': {'anyOf': [{'type': 'string', 'description': 'Postal or ZIP code for the workspace address.'}, {'type': 'null'}]}}}}, 'anyOf': [{'required': ['response']}, {'required': ['error']}], 'required': ['operation_id', 'request_id'], 'properties': {'error': {'type': 'object', 'required': ['category', 'status', 'code', 'message', 'retryable'], 'properties': {'code': {'type': 'string'}, 'retry': {'type': 'object', 'required': ['safe', 'guidance'], 'properties': {'safe': {'type': 'boolean'}, 'guidance': {'type': 'string'}}, 'additionalProperties': False}, 'issues': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'code', 'message'], 'properties': {'code': {'type': 'string'}, 'path': {'type': 'string'}, 'message': {'type': 'string'}}, 'additionalProperties': False}, 'maxItems': 20}, 'status': {'anyOf': [{'type': 'integer'}, {'type': 'null'}]}, 'details': {'type': 'object', 'properties': {'field': {'type': 'string'}, 'reason': {'type': 'string'}, 'resource': {'type': 'object', 'required': ['type', 'id'], 'properties': {'id': {'type': 'string'}, 'type': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}, 'message': {'type': 'string'}, 'category': {'enum': ['validation', 'authentication', 'permission', 'conflict', 'rate_limit', 'transient', 'unknown'], 'type': 'string'}, 'recovery': {'type': 'object', 'required': ['action', 'message'], 'properties': {'action': {'enum': ['replace_api_key', 'reconnect_oauth'], 'type': 'string'}, 'message': {'type': 'string'}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}, 'retryable': {'type': 'boolean'}, 'prerequisite': {'type': 'object', 'required': ['resource', 'state'], 'properties': {'state': {'enum': ['missing', 'disabled'], 'type': 'string'}, 'resource': {'type': 'string'}, 'setup_url': {'type': 'string', 'format': 'uri'}, 'work_profile': {'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}}, 'additionalProperties': False}, 'missing_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'credential_type': {'enum': ['workspace_api_key', 'oauth_access_token'], 'type': 'string'}, 'required_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'access_update_url': {'type': 'string', 'format': 'uri'}, 'reconnect_required': {'type': 'boolean'}, 'replacement_scopes': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 50}, 'permissions_help_url': {'type': 'string', 'format': 'uri'}, 'recommended_work_profiles': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 20}}, 'additionalProperties': False}, 'response': {'type': 'object', 'required': ['data'], 'properties': {'data': {'$ref': '#/$defs/Workspace'}}}, 'request_id': {'type': 'string', 'pattern': '^mcp_[0-9a-f-]{36}$', 'description': 'The stable correlation ID for this MCP tool invocation.'}, 'operation_id': {'type': 'string', 'const': 'getWorkspace', 'description': 'The stable Mailrith public API operation ID.'}}, 'additionalProperties': False}
Cambios recientes en herramientas
Servidores MCP similares
neuron
Operates AI chatbots and messaging workflows across WhatsApp and social channels, including contacts, campaigns, conversations, p…
commsharbor
Manages permission-based email audiences, contacts, campaigns, transactional sends, billing, consent, and tenant audit trails.
Emailchaser
Manages cold-email campaigns, leads, sender mailboxes, sequences, outreach automation, deliverability, prospect sourcing, webhook…
send16-mcp
Provides email marketing and transactional messaging tools for contacts, audiences, campaigns, templates, automations, analytics,…
mcp
Sends email, reads threaded replies, and runs campaigns with per-key limits.
MisarMail MCP Server
Supports transactional and campaign email, contacts, templates, automations, landing pages, deliverability checks, inbox manageme…
Sendgrid
Accesses SendGrid email delivery data, including sending statistics, bounces, and blocked recipients.
postari
Manages email campaigns, transactional messages, contacts, forms, landing pages, automations, launches, and delivery metrics.