{"openapi":"3.0.1","info":{"title":"Message Rules API","description":"Provides methods for creating, retrieving, updating, and deleting inbound\nmessage rule configurations. Rules define how inbound messages are routed or\nprocessed automatically, supporting both bulk retrieval of all configured\nrules and individual rule management.","version":"1.0.1"},"servers":[{"url":"https://{region}-api.dotdigital.com","variables":{"region":{"description":"The Dotdigital region id your account belongs to","enum":["r1","r2","r3"],"default":"r1"}}}],"security":[{"basicAuth":[]}],"paths":{"/cpaas/automation/inboundrules":{"get":{"summary":"Retrieves a message rules configuration list","responses":{"200":{"description":"The requested message rules  configuration list","headers":{"ETag":{"description":"A unique value representing the version of the inbound rules configuration, optionally used for optimistic concurrency control on PUT and DELETE","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InboundRuleConfiguration"}}}}},"404":{"description":"The  was not found","content":{}}}},"post":{"summary":"Create a message rule configuration","parameters":[{"name":"if-match","in":"header","description":"An optional ETag for optimistic concurrency control","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Detail of the message rule configuration to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundRuleConfiguration"}}},"required":true},"responses":{"200":{"description":"The created inbound rules  configuration","headers":{"ETag":{"description":"A unique value representing the version of the inbound rules configuration, optionally used for optimistic concurrency control on PUT and DELETE","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundRuleConfiguration"}}}},"404":{"description":"The inbound rules configuration was not found","content":{}}},"x-codegen-request-body-name":"messageRulesData"}},"/cpaas/automation/inboundrules/{messageRulesId}":{"get":{"summary":"Retrieves single message rule configuration","parameters":[{"name":"messageRulesId","in":"path","description":"The message rule id","required":true,"schema":{"pattern":"^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})|[a-f0-9]{32}$","type":"string"}}],"responses":{"200":{"description":"The requested message rule configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundRuleConfiguration"}}}},"404":{"description":"The message rule configuration was not found","content":{}}}},"put":{"summary":"Update single message rule configuration","parameters":[{"name":"messageRulesId","in":"path","description":"The message rule id","required":true,"schema":{"pattern":"^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})|[a-f0-9]{32}$","type":"string"}},{"name":"if-match","in":"header","description":"An optional ETag for optimistic concurrency control","required":false,"schema":{"type":"string"}}],"requestBody":{"description":"Detail of the message rule configuration to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundRuleConfiguration"}}},"required":true},"responses":{"200":{"description":"The message rule configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundRuleConfiguration"}}}},"404":{"description":"The message rule configuration was not found","content":{}}},"x-codegen-request-body-name":"messageRulesData"},"delete":{"summary":"Delete single message rule configuration","parameters":[{"name":"messageRulesId","in":"path","description":"The message rule id","required":true,"schema":{"pattern":"^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})|[a-f0-9]{32}$","type":"string"}}],"responses":{"204":{"description":"Indicates successful deletion of an message rule configuration","content":{}},"404":{"description":"The message rule configuration was not found","content":{}}}}}},"components":{"schemas":{"InboundRuleConfiguration":{"type":"object","properties":{"id":{"pattern":"^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})|[a-f0-9]{32}$","type":"string","description":"The id (GUID) of message rule configuration"},"channel":{"type":"string","description":"Type of channel","enum":["sms","fbMessenger","appMessaging","email","whatsApp","rcs"]},"inbound":{"type":"string","description":"Inbound message identifier - number, profile id, fb page name. Use a value of '*' for matching any"},"keyword":{"type":"string","description":"Comma delimited keyword(s) that we are going to search for in the message"},"action":{"type":"string","description":"Type of action to take after successful match","enum":["startChat","replyMessage","profileUpdate"]},"actionData":{"$ref":"#/components/schemas/InboundRuleConfiguration_actionData"}}},"ProfileChange":{"type":"object","properties":{"propertyName":{"type":"string","description":"A name of the property"},"propertyValue":{"type":"string","description":"A value of the property after change"}},"description":"Single profile change"},"MessagePart":{"required":["type"],"type":"object","properties":{"name":{"type":"string","description":"A name for the part"},"type":{"type":"string","description":"The mime type (if applicable) sof the part"},"url":{"type":"string","description":"A url associated with the message part"},"data":{"type":"string","description":"String representation (e.g. base64) of the message part"},"size":{"type":"integer","description":"Size of the message part in bytes"}},"description":"Details of a single part that makes up a message"},"InboundRuleConfiguration_actionData":{"type":"object","properties":{"chatTeamId":{"type":"string","description":"If action is startChat specify team id which should have this chat assigned"},"messageParts":{"type":"array","description":"Additional message parts / attachments. If action is set to replayMessage","items":{"$ref":"#/components/schemas/MessagePart"}},"profileUpdate":{"type":"array","description":"If action is set to profileUpdate gives list of profile changes.","items":{"$ref":"#/components/schemas/ProfileChange"}}},"description":"Defines options for picked action "}},"parameters":{"messageRuleParameter":{"name":"messageRulesId","in":"path","description":"The message rule id","required":true,"schema":{"pattern":"^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})|[a-f0-9]{32}$","type":"string"}}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}}},"x-readme":{"samples-languages":["curl","csharp","java","node","php","python","ruby"],"explorer-enabled":true,"proxy-enabled":true,"samples-enabled":true}}