Update an automation rule
const url = 'https://open-api.replyco.com/openapi/messagerule/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, body: '{ "ruleName": "Auto-mark read: Amazon support reports", "priority": 1, "inActive": true, "condition": { "tableName": "Thread", "fieldName": "Subject", "operator": "0 - Contain", "value1": "Amazon product support report available", "value2": "example", "relations": "example" }, "action": { "tableName": "Message", "fieldName": "Unread", "value": "false", "actionType": "0 - UpdateField", "relations": "example" } }'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://open-api.replyco.com/openapi/messagerule/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json-patch+json' \ --data '{ "ruleName": "Auto-mark read: Amazon support reports", "priority": 1, "inActive": true, "condition": { "tableName": "Thread", "fieldName": "Subject", "operator": "0 - Contain", "value1": "Amazon product support report available", "value2": "example", "relations": "example" }, "action": { "tableName": "Message", "fieldName": "Unread", "value": "false", "actionType": "0 - UpdateField", "relations": "example" } }'Replaces the rule identified by id with the condition and action you send, so submit the complete rule
(fetch it with GET /openApi/messageRule/{id}, change what you need, and PUT it back).
The request body is identical to Create an automation rule (POST /openApi/messageRule); see that endpoint
for the full list of tables, columns, operators, actions and worked examples.
Recap
condition:tableName+fieldName+operator+value1(+value2forBetween);relationsoptional.action:tableName+value+actionType(UpdateFieldorInsertRelation),fieldNameforUpdateField;relationsoptional.priority0keeps the rule after all existing rules.
Rules managed through the Open API have a single condition and action. Updating a rule that was created in the app with several conditions or actions replaces all of them with the single pair you send.
Errors
400with{ "error": "…" }— same validation as create.404— no rule withidexists.
The update is recorded in the automation change log.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the rule to update.
Request Body
Section titled “Request Body”The complete rule definition.
Create or replace an automation rule. The same shape is used for create and update.
This is a simplified rule: exactly one condition and one action. Every incoming
message is checked against the condition and, when it matches, the action is applied to that message’s thread.
(The in-app rules engine supports multi-condition expressions; the Open API intentionally keeps a single
condition/action for simplicity.)
object
Human-readable rule name, shown in the app and in the thread change log. Required.
Example
Auto-mark read: Amazon support reportsExecution order; lower numbers run first. Leave 0 to place the rule after all existing rules.
Set true to create/keep the rule disabled. Defaults to enabled.
The condition that must match for a rule to fire. It reads one field of one table, reached from the incoming
message, and compares it with value1 (and value2 for Between).
object
The table to read: Message, Thread, Customer, Order, Task or
Product (case-sensitive). Required.
Example
ThreadThe column of tableName to compare (case-sensitive), e.g. Subject on Thread,
Text on Message, Email on Customer. See the endpoint description for the
catalog per table. Required.
Example
SubjectThe value to compare with, always sent as a string. Text: the fragment or exact value. Numbers: "100".
Booleans: "true"/"false". Enums (thread status, marketplace): the numeric value, e.g. "3".
Dates: a number of days ago ("7" = 7 days ago, must be 0 or greater) or an ISO date such as
"2026-01-31". Required.
Example
Amazon product support report availableThe upper bound for Between. Required for numeric ranges; for dates it is the “newer” bound and
may be omitted to mean “up to now”.
Navigation path from Message to tableName, segments joined with &.
Optional: it is filled in automatically for the documented tables (Thread → "Thread",
Customer → "Thread&Customer", Order → "Thread&Order",
Task → "Thread&Tasks"); Message and Product need none.
A single action applied to the matching message’s thread when the rule’s condition matches.
object
The table to change: Thread, Message or Task for UpdateField;
FolderThreads for InsertRelation (case-sensitive). Required.
Example
MessageThe column to set (case-sensitive), e.g. Status, InActive, PriorityId on Thread;
Unread on Message; UserId on Task. Required when actionType is
UpdateField; ignored for InsertRelation.
Example
UnreadFor UpdateField: the new value as a string — "3", "true", a GUID.
For InsertRelation: a JSON object with the columns of the row to insert, e.g.
{"FolderId":"4f6d…"} for FolderThreads. Required.
Example
falseNavigation path from Message to tableName, segments joined with &.
Optional: filled in automatically for the documented tables (Thread → "Thread",
Task → "Thread&Tasks", FolderThreads → "Thread&FolderThreads");
Message needs none.
Create or replace an automation rule. The same shape is used for create and update.
This is a simplified rule: exactly one condition and one action. Every incoming
message is checked against the condition and, when it matches, the action is applied to that message’s thread.
(The in-app rules engine supports multi-condition expressions; the Open API intentionally keeps a single
condition/action for simplicity.)
object
Human-readable rule name, shown in the app and in the thread change log. Required.
Example
Auto-mark read: Amazon support reportsExecution order; lower numbers run first. Leave 0 to place the rule after all existing rules.
Set true to create/keep the rule disabled. Defaults to enabled.
The condition that must match for a rule to fire. It reads one field of one table, reached from the incoming
message, and compares it with value1 (and value2 for Between).
object
The table to read: Message, Thread, Customer, Order, Task or
Product (case-sensitive). Required.
Example
ThreadThe column of tableName to compare (case-sensitive), e.g. Subject on Thread,
Text on Message, Email on Customer. See the endpoint description for the
catalog per table. Required.
Example
SubjectThe value to compare with, always sent as a string. Text: the fragment or exact value. Numbers: "100".
Booleans: "true"/"false". Enums (thread status, marketplace): the numeric value, e.g. "3".
Dates: a number of days ago ("7" = 7 days ago, must be 0 or greater) or an ISO date such as
"2026-01-31". Required.
Example
Amazon product support report availableThe upper bound for Between. Required for numeric ranges; for dates it is the “newer” bound and
may be omitted to mean “up to now”.
Navigation path from Message to tableName, segments joined with &.
Optional: it is filled in automatically for the documented tables (Thread → "Thread",
Customer → "Thread&Customer", Order → "Thread&Order",
Task → "Thread&Tasks"); Message and Product need none.
A single action applied to the matching message’s thread when the rule’s condition matches.
object
The table to change: Thread, Message or Task for UpdateField;
FolderThreads for InsertRelation (case-sensitive). Required.
Example
MessageThe column to set (case-sensitive), e.g. Status, InActive, PriorityId on Thread;
Unread on Message; UserId on Task. Required when actionType is
UpdateField; ignored for InsertRelation.
Example
UnreadFor UpdateField: the new value as a string — "3", "true", a GUID.
For InsertRelation: a JSON object with the columns of the row to insert, e.g.
{"FolderId":"4f6d…"} for FolderThreads. Required.
Example
falseNavigation path from Message to tableName, segments joined with &.
Optional: filled in automatically for the documented tables (Thread → "Thread",
Task → "Thread&Tasks", FolderThreads → "Thread&FolderThreads");
Message needs none.
Create or replace an automation rule. The same shape is used for create and update.
This is a simplified rule: exactly one condition and one action. Every incoming
message is checked against the condition and, when it matches, the action is applied to that message’s thread.
(The in-app rules engine supports multi-condition expressions; the Open API intentionally keeps a single
condition/action for simplicity.)
object
Human-readable rule name, shown in the app and in the thread change log. Required.
Example
Auto-mark read: Amazon support reportsExecution order; lower numbers run first. Leave 0 to place the rule after all existing rules.
Set true to create/keep the rule disabled. Defaults to enabled.
The condition that must match for a rule to fire. It reads one field of one table, reached from the incoming
message, and compares it with value1 (and value2 for Between).
object
The table to read: Message, Thread, Customer, Order, Task or
Product (case-sensitive). Required.
Example
ThreadThe column of tableName to compare (case-sensitive), e.g. Subject on Thread,
Text on Message, Email on Customer. See the endpoint description for the
catalog per table. Required.
Example
SubjectThe value to compare with, always sent as a string. Text: the fragment or exact value. Numbers: "100".
Booleans: "true"/"false". Enums (thread status, marketplace): the numeric value, e.g. "3".
Dates: a number of days ago ("7" = 7 days ago, must be 0 or greater) or an ISO date such as
"2026-01-31". Required.
Example
Amazon product support report availableThe upper bound for Between. Required for numeric ranges; for dates it is the “newer” bound and
may be omitted to mean “up to now”.
Navigation path from Message to tableName, segments joined with &.
Optional: it is filled in automatically for the documented tables (Thread → "Thread",
Customer → "Thread&Customer", Order → "Thread&Order",
Task → "Thread&Tasks"); Message and Product need none.
A single action applied to the matching message’s thread when the rule’s condition matches.
object
The table to change: Thread, Message or Task for UpdateField;
FolderThreads for InsertRelation (case-sensitive). Required.
Example
MessageThe column to set (case-sensitive), e.g. Status, InActive, PriorityId on Thread;
Unread on Message; UserId on Task. Required when actionType is
UpdateField; ignored for InsertRelation.
Example
UnreadFor UpdateField: the new value as a string — "3", "true", a GUID.
For InsertRelation: a JSON object with the columns of the row to insert, e.g.
{"FolderId":"4f6d…"} for FolderThreads. Required.
Example
falseNavigation path from Message to tableName, segments joined with &.
Optional: filled in automatically for the documented tables (Thread → "Thread",
Task → "Thread&Tasks", FolderThreads → "Thread&FolderThreads");
Message needs none.
Create or replace an automation rule. The same shape is used for create and update.
This is a simplified rule: exactly one condition and one action. Every incoming
message is checked against the condition and, when it matches, the action is applied to that message’s thread.
(The in-app rules engine supports multi-condition expressions; the Open API intentionally keeps a single
condition/action for simplicity.)
object
Human-readable rule name, shown in the app and in the thread change log. Required.
Example
Auto-mark read: Amazon support reportsExecution order; lower numbers run first. Leave 0 to place the rule after all existing rules.
Set true to create/keep the rule disabled. Defaults to enabled.
The condition that must match for a rule to fire. It reads one field of one table, reached from the incoming
message, and compares it with value1 (and value2 for Between).
object
The table to read: Message, Thread, Customer, Order, Task or
Product (case-sensitive). Required.
Example
ThreadThe column of tableName to compare (case-sensitive), e.g. Subject on Thread,
Text on Message, Email on Customer. See the endpoint description for the
catalog per table. Required.
Example
SubjectThe value to compare with, always sent as a string. Text: the fragment or exact value. Numbers: "100".
Booleans: "true"/"false". Enums (thread status, marketplace): the numeric value, e.g. "3".
Dates: a number of days ago ("7" = 7 days ago, must be 0 or greater) or an ISO date such as
"2026-01-31". Required.
Example
Amazon product support report availableThe upper bound for Between. Required for numeric ranges; for dates it is the “newer” bound and
may be omitted to mean “up to now”.
Navigation path from Message to tableName, segments joined with &.
Optional: it is filled in automatically for the documented tables (Thread → "Thread",
Customer → "Thread&Customer", Order → "Thread&Order",
Task → "Thread&Tasks"); Message and Product need none.
A single action applied to the matching message’s thread when the rule’s condition matches.
object
The table to change: Thread, Message or Task for UpdateField;
FolderThreads for InsertRelation (case-sensitive). Required.
Example
MessageThe column to set (case-sensitive), e.g. Status, InActive, PriorityId on Thread;
Unread on Message; UserId on Task. Required when actionType is
UpdateField; ignored for InsertRelation.
Example
UnreadFor UpdateField: the new value as a string — "3", "true", a GUID.
For InsertRelation: a JSON object with the columns of the row to insert, e.g.
{"FolderId":"4f6d…"} for FolderThreads. Required.
Example
falseNavigation path from Message to tableName, segments joined with &.
Optional: filled in automatically for the documented tables (Thread → "Thread",
Task → "Thread&Tasks", FolderThreads → "Thread&FolderThreads");
Message needs none.
Responses
Section titled “Responses”The rule was updated and is returned.
An automation rule. When an incoming message matches the condition, the action
is applied automatically.
The Open API represents a rule as a single condition and a single action. A rule created elsewhere with multiple conditions/actions is shown here by its first condition and first action.
object
Unique identifier of the rule.
Human-readable rule name.
Execution priority; lower numbers run first.
When true the rule is disabled.
The condition that must match for an automation rule to fire.
object
Unique identifier of the condition.
The entity the condition reads, e.g. Message, Thread, Customer, Order, Product.
The field on tableName to compare, e.g. Text, Status, Marketplace.
Primary comparison value.
Secondary value, used only with the Between operator.
Navigation path from Message to the target table when the field is not directly on Message, e.g. "Thread".
A single action applied when an automation rule matches.
object
Unique identifier of the action.
The entity the action modifies, e.g. Thread, Task, Message, FolderThreads.
The field to set (for UpdateField).
For UpdateField: the scalar value to set. For InsertRelation: a JSON object describing the record to insert.
Navigation path when the action targets a table related to the thread/message.
Example
{ "condition": { "operator": "0 - Contain" }, "action": { "actionType": "0 - UpdateField" }}The request is invalid; the body’s error says why.
User is not authenticated or authorized.
No rule with the given id exists.