---
updatedAt: 2026-04-20T19:43:50.000Z
agentTools:
  projectIndex: https://developers.gorgias.com/llms.txt
---

# Update rules' priorities

# OpenAPI definition

```json
{
  "security": [
    {
      "basicAuth": []
    }
  ],
  "info": {
    "description": "The Gorgias REST API. Please go to https://developers.gorgias.com for more details.",
    "title": "Gorgias REST API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://{domain}.gorgias.com",
      "variables": {
        "domain": {
          "default": "your-domain"
        }
      }
    }
  ],
  "x-readme": {
    "proxy-enabled": false
  },
  "paths": {
    "/api/rules/priorities": {
      "post": {
        "summary": "Update rules' priorities",
        "operationId": "update-rules-priorities",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "priorities": {
                    "description": "A list of rule IDs with their new priorities.",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "ID of the rule.",
                          "example": 1234
                        },
                        "priority": {
                          "type": "integer",
                          "description": "Order of execution of the rule. Rules with higher priorities are executed first.",
                          "example": "100"
                        }
                      },
                      "required": [
                        "id",
                        "priority"
                      ]
                    }
                  }
                },
                "required": [
                  "priorities"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "A list of rules.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Rule"
                  }
                },
                "examples": {
                  "responses": {
                    "value": [
                      {
                        "id": 1234,
                        "code": "\nif (eq(ticket.from_agent, false) && eq(ticket.status, 'open')) {\n    if (containsAny(message.intents.name, ['other/no_reply']) || containsAny(ticket.customer.email, [\n            'noreply@',\n            '@noreply'\n        ])) {\n        Action('addTags', { tags: 'auto-close' });\n        Action('setStatus', { status: 'closed' })\n    }\n}\n",
                        "code_ast": {
                          "loc": {
                            "start": {
                              "line": 2,
                              "column": 0
                            },
                            "end": {
                              "line": 10,
                              "column": 1
                            }
                          },
                          "type": "Program",
                          "body": [
                            {
                              "loc": {
                                "start": {
                                  "line": 2,
                                  "column": 0
                                },
                                "end": {
                                  "line": 10,
                                  "column": 1
                                }
                              },
                              "type": "IfStatement",
                              "test": {
                                "loc": {
                                  "start": {
                                    "line": 2,
                                    "column": 4
                                  },
                                  "end": {
                                    "line": 2,
                                    "column": 61
                                  }
                                },
                                "type": "LogicalExpression",
                                "operator": "&&",
                                "left": {
                                  "loc": {
                                    "start": {
                                      "line": 2,
                                      "column": 4
                                    },
                                    "end": {
                                      "line": 2,
                                      "column": 32
                                    }
                                  },
                                  "type": "CallExpression",
                                  "callee": {
                                    "loc": {
                                      "start": {
                                        "line": 2,
                                        "column": 4
                                      },
                                      "end": {
                                        "line": 2,
                                        "column": 6
                                      }
                                    },
                                    "type": "Identifier",
                                    "name": "eq"
                                  },
                                  "arguments": [
                                    {
                                      "loc": {
                                        "start": {
                                          "line": 2,
                                          "column": 7
                                        },
                                        "end": {
                                          "line": 2,
                                          "column": 24
                                        }
                                      },
                                      "type": "MemberExpression",
                                      "computed": false,
                                      "object": {
                                        "loc": {
                                          "start": {
                                            "line": 2,
                                            "column": 7
                                          },
                                          "end": {
                                            "line": 2,
                                            "column": 13
                                          }
                                        },
                                        "type": "Identifier",
                                        "name": "ticket"
                                      },
                                      "property": {
                                        "loc": {
                                          "start": {
                                            "line": 2,
                                            "column": 14
                                          },
                                          "end": {
                                            "line": 2,
                                            "column": 24
                                          }
                                        },
                                        "type": "Identifier",
                                        "name": "from_agent"
                                      }
                                    },
                                    {
                                      "loc": {
                                        "start": {
                                          "line": 2,
                                          "column": 26
                                        },
                                        "end": {
                                          "line": 2,
                                          "column": 31
                                        }
                                      },
                                      "type": "Literal",
                                      "value": false,
                                      "raw": "false"
                                    }
                                  ]
                                },
                                "right": {
                                  "loc": {
                                    "start": {
                                      "line": 2,
                                      "column": 36
                                    },
                                    "end": {
                                      "line": 2,
                                      "column": 61
                                    }
                                  },
                                  "type": "CallExpression",
                                  "callee": {
                                    "loc": {
                                      "start": {
                                        "line": 2,
                                        "column": 36
                                      },
                                      "end": {
                                        "line": 2,
                                        "column": 38
                                      }
                                    },
                                    "type": "Identifier",
                                    "name": "eq"
                                  },
                                  "arguments": [
                                    {
                                      "loc": {
                                        "start": {
                                          "line": 2,
                                          "column": 39
                                        },
                                        "end": {
                                          "line": 2,
                                          "column": 52
                                        }
                                      },
                                      "type": "MemberExpression",
                                      "computed": false,
                                      "object": {
                                        "loc": {
                                          "start": {
                                            "line": 2,
                                            "column": 39
                                          },
                                          "end": {
                                            "line": 2,
                                            "column": 45
                                          }
                                        },
                                        "type": "Identifier",
                                        "name": "ticket"
                                      },
                                      "property": {
                                        "loc": {
                                          "start": {
                                            "line": 2,
                                            "column": 46
                                          },
                                          "end": {
                                            "line": 2,
                                            "column": 52
                                          }
                                        },
                                        "type": "Identifier",
                                        "name": "status"
                                      }
                                    },
                                    {
                                      "loc": {
                                        "start": {
                                          "line": 2,
                                          "column": 54
                                        },
                                        "end": {
                                          "line": 2,
                                          "column": 60
                                        }
                                      },
                                      "type": "Literal",
                                      "value": "open",
                                      "raw": "'open'"
                                    }
                                  ]
                                }
                              },
                              "consequent": {
                                "loc": {
                                  "start": {
                                    "line": 2,
                                    "column": 63
                                  },
                                  "end": {
                                    "line": 10,
                                    "column": 1
                                  }
                                },
                                "type": "BlockStatement",
                                "body": [
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 3,
                                        "column": 4
                                      },
                                      "end": {
                                        "line": 9,
                                        "column": 5
                                      }
                                    },
                                    "type": "IfStatement",
                                    "test": {
                                      "loc": {
                                        "start": {
                                          "line": 3,
                                          "column": 8
                                        },
                                        "end": {
                                          "line": 6,
                                          "column": 10
                                        }
                                      },
                                      "type": "LogicalExpression",
                                      "operator": "||",
                                      "left": {
                                        "loc": {
                                          "start": {
                                            "line": 3,
                                            "column": 8
                                          },
                                          "end": {
                                            "line": 3,
                                            "column": 61
                                          }
                                        },
                                        "type": "CallExpression",
                                        "callee": {
                                          "loc": {
                                            "start": {
                                              "line": 3,
                                              "column": 8
                                            },
                                            "end": {
                                              "line": 3,
                                              "column": 19
                                            }
                                          },
                                          "type": "Identifier",
                                          "name": "containsAny"
                                        },
                                        "arguments": [
                                          {
                                            "loc": {
                                              "start": {
                                                "line": 3,
                                                "column": 20
                                              },
                                              "end": {
                                                "line": 3,
                                                "column": 40
                                              }
                                            },
                                            "type": "MemberExpression",
                                            "computed": false,
                                            "object": {
                                              "loc": {
                                                "start": {
                                                  "line": 3,
                                                  "column": 20
                                                },
                                                "end": {
                                                  "line": 3,
                                                  "column": 35
                                                }
                                              },
                                              "type": "MemberExpression",
                                              "computed": false,
                                              "object": {
                                                "loc": {
                                                  "start": {
                                                    "line": 3,
                                                    "column": 20
                                                  },
                                                  "end": {
                                                    "line": 3,
                                                    "column": 27
                                                  }
                                                },
                                                "type": "Identifier",
                                                "name": "message"
                                              },
                                              "property": {
                                                "loc": {
                                                  "start": {
                                                    "line": 3,
                                                    "column": 28
                                                  },
                                                  "end": {
                                                    "line": 3,
                                                    "column": 35
                                                  }
                                                },
                                                "type": "Identifier",
                                                "name": "intents"
                                              }
                                            },
                                            "property": {
                                              "loc": {
                                                "start": {
                                                  "line": 3,
                                                  "column": 36
                                                },
                                                "end": {
                                                  "line": 3,
                                                  "column": 40
                                                }
                                              },
                                              "type": "Identifier",
                                              "name": "name"
                                            }
                                          },
                                          {
                                            "loc": {
                                              "start": {
                                                "line": 3,
                                                "column": 42
                                              },
                                              "end": {
                                                "line": 3,
                                                "column": 60
                                              }
                                            },
                                            "type": "ArrayExpression",
                                            "elements": [
                                              {
                                                "loc": {
                                                  "start": {
                                                    "line": 3,
                                                    "column": 43
                                                  },
                                                  "end": {
                                                    "line": 3,
                                                    "column": 59
                                                  }
                                                },
                                                "type": "Literal",
                                                "value": "other/no_reply",
                                                "raw": "'other/no_reply'"
                                              }
                                            ]
                                          }
                                        ]
                                      },
                                      "right": {
                                        "loc": {
                                          "start": {
                                            "line": 3,
                                            "column": 65
                                          },
                                          "end": {
                                            "line": 6,
                                            "column": 10
                                          }
                                        },
                                        "type": "CallExpression",
                                        "callee": {
                                          "loc": {
                                            "start": {
                                              "line": 3,
                                              "column": 65
                                            },
                                            "end": {
                                              "line": 3,
                                              "column": 76
                                            }
                                          },
                                          "type": "Identifier",
                                          "name": "containsAny"
                                        },
                                        "arguments": [
                                          {
                                            "loc": {
                                              "start": {
                                                "line": 3,
                                                "column": 77
                                              },
                                              "end": {
                                                "line": 3,
                                                "column": 98
                                              }
                                            },
                                            "type": "MemberExpression",
                                            "computed": false,
                                            "object": {
                                              "loc": {
                                                "start": {
                                                  "line": 3,
                                                  "column": 77
                                                },
                                                "end": {
                                                  "line": 3,
                                                  "column": 92
                                                }
                                              },
                                              "type": "MemberExpression",
                                              "computed": false,
                                              "object": {
                                                "loc": {
                                                  "start": {
                                                    "line": 3,
                                                    "column": 77
                                                  },
                                                  "end": {
                                                    "line": 3,
                                                    "column": 83
                                                  }
                                                },
                                                "type": "Identifier",
                                                "name": "ticket"
                                              },
                                              "property": {
                                                "loc": {
                                                  "start": {
                                                    "line": 3,
                                                    "column": 84
                                                  },
                                                  "end": {
                                                    "line": 3,
                                                    "column": 92
                                                  }
                                                },
                                                "type": "Identifier",
                                                "name": "customer"
                                              }
                                            },
                                            "property": {
                                              "loc": {
                                                "start": {
                                                  "line": 3,
                                                  "column": 93
                                                },
                                                "end": {
                                                  "line": 3,
                                                  "column": 98
                                                }
                                              },
                                              "type": "Identifier",
                                              "name": "email"
                                            }
                                          },
                                          {
                                            "loc": {
                                              "start": {
                                                "line": 3,
                                                "column": 100
                                              },
                                              "end": {
                                                "line": 6,
                                                "column": 9
                                              }
                                            },
                                            "type": "ArrayExpression",
                                            "elements": [
                                              {
                                                "loc": {
                                                  "start": {
                                                    "line": 4,
                                                    "column": 12
                                                  },
                                                  "end": {
                                                    "line": 4,
                                                    "column": 22
                                                  }
                                                },
                                                "type": "Literal",
                                                "value": "noreply@",
                                                "raw": "'noreply@'"
                                              },
                                              {
                                                "loc": {
                                                  "start": {
                                                    "line": 5,
                                                    "column": 12
                                                  },
                                                  "end": {
                                                    "line": 5,
                                                    "column": 22
                                                  }
                                                },
                                                "type": "Literal",
                                                "value": "@noreply",
                                                "raw": "'@noreply'"
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    },
                                    "consequent": {
                                      "loc": {
                                        "start": {
                                          "line": 6,
                                          "column": 12
                                        },
                                        "end": {
                                          "line": 9,
                                          "column": 5
                                        }
                                      },
                                      "type": "BlockStatement",
                                      "body": [
                                        {
                                          "loc": {
                                            "start": {
                                              "line": 7,
                                              "column": 8
                                            },
                                            "end": {
                                              "line": 7,
                                              "column": 50
                                            }
                                          },
                                          "type": "ExpressionStatement",
                                          "expression": {
                                            "loc": {
                                              "start": {
                                                "line": 7,
                                                "column": 8
                                              },
                                              "end": {
                                                "line": 7,
                                                "column": 49
                                              }
                                            },
                                            "type": "CallExpression",
                                            "callee": {
                                              "loc": {
                                                "start": {
                                                  "line": 7,
                                                  "column": 8
                                                },
                                                "end": {
                                                  "line": 7,
                                                  "column": 14
                                                }
                                              },
                                              "type": "Identifier",
                                              "name": "Action"
                                            },
                                            "arguments": [
                                              {
                                                "loc": {
                                                  "start": {
                                                    "line": 7,
                                                    "column": 15
                                                  },
                                                  "end": {
                                                    "line": 7,
                                                    "column": 24
                                                  }
                                                },
                                                "type": "Literal",
                                                "value": "addTags",
                                                "raw": "'addTags'"
                                              },
                                              {
                                                "loc": {
                                                  "start": {
                                                    "line": 7,
                                                    "column": 26
                                                  },
                                                  "end": {
                                                    "line": 7,
                                                    "column": 48
                                                  }
                                                },
                                                "type": "ObjectExpression",
                                                "properties": [
                                                  {
                                                    "loc": {
                                                      "start": {
                                                        "line": 7,
                                                        "column": 28
                                                      },
                                                      "end": {
                                                        "line": 7,
                                                        "column": 46
                                                      }
                                                    },
                                                    "type": "Property",
                                                    "key": {
                                                      "loc": {
                                                        "start": {
                                                          "line": 7,
                                                          "column": 28
                                                        },
                                                        "end": {
                                                          "line": 7,
                                                          "column": 32
                                                        }
                                                      },
                                                      "type": "Identifier",
                                                      "name": "tags"
                                                    },
                                                    "computed": false,
                                                    "value": {
                                                      "loc": {
                                                        "start": {
                                                          "line": 7,
                                                          "column": 34
                                                        },
                                                        "end": {
                                                          "line": 7,
                                                          "column": 46
                                                        }
                                                      },
                                                      "type": "Literal",
                                                      "value": "auto-close",
                                                      "raw": "'auto-close'"
                                                    },
                                                    "kind": "init",
                                                    "method": false,
                                                    "shorthand": false
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        },
                                        {
                                          "loc": {
                                            "start": {
                                              "line": 8,
                                              "column": 8
                                            },
                                            "end": {
                                              "line": 8,
                                              "column": 49
                                            }
                                          },
                                          "type": "ExpressionStatement",
                                          "expression": {
                                            "loc": {
                                              "start": {
                                                "line": 8,
                                                "column": 8
                                              },
                                              "end": {
                                                "line": 8,
                                                "column": 49
                                              }
                                            },
                                            "type": "CallExpression",
                                            "callee": {
                                              "loc": {
                                                "start": {
                                                  "line": 8,
                                                  "column": 8
                                                },
                                                "end": {
                                                  "line": 8,
                                                  "column": 14
                                                }
                                              },
                                              "type": "Identifier",
                                              "name": "Action"
                                            },
                                            "arguments": [
                                              {
                                                "loc": {
                                                  "start": {
                                                    "line": 8,
                                                    "column": 15
                                                  },
                                                  "end": {
                                                    "line": 8,
                                                    "column": 26
                                                  }
                                                },
                                                "type": "Literal",
                                                "value": "setStatus",
                                                "raw": "'setStatus'"
                                              },
                                              {
                                                "loc": {
                                                  "start": {
                                                    "line": 8,
                                                    "column": 28
                                                  },
                                                  "end": {
                                                    "line": 8,
                                                    "column": 48
                                                  }
                                                },
                                                "type": "ObjectExpression",
                                                "properties": [
                                                  {
                                                    "loc": {
                                                      "start": {
                                                        "line": 8,
                                                        "column": 30
                                                      },
                                                      "end": {
                                                        "line": 8,
                                                        "column": 46
                                                      }
                                                    },
                                                    "type": "Property",
                                                    "key": {
                                                      "loc": {
                                                        "start": {
                                                          "line": 8,
                                                          "column": 30
                                                        },
                                                        "end": {
                                                          "line": 8,
                                                          "column": 36
                                                        }
                                                      },
                                                      "type": "Identifier",
                                                      "name": "status"
                                                    },
                                                    "computed": false,
                                                    "value": {
                                                      "loc": {
                                                        "start": {
                                                          "line": 8,
                                                          "column": 38
                                                        },
                                                        "end": {
                                                          "line": 8,
                                                          "column": 46
                                                        }
                                                      },
                                                      "type": "Literal",
                                                      "value": "closed",
                                                      "raw": "'closed'"
                                                    },
                                                    "kind": "init",
                                                    "method": false,
                                                    "shorthand": false
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        }
                                      ]
                                    },
                                    "alternate": null
                                  }
                                ]
                              },
                              "alternate": null
                            }
                          ],
                          "sourceType": "script"
                        },
                        "created_datetime": "2019-11-16T15:59:41.966927",
                        "deactivated_datetime": "2019-11-28T15:59:41.966927",
                        "description": "Automatically close all tickets from Amazon because there is nothing to do for them. We still want to keep them to be able to search.",
                        "event_types": "ticket-created,ticket-updated",
                        "name": "Auto-close all tickets from Amazon",
                        "priority": "100",
                        "updated_datetime": "2019-11-25T15:59:41.966927",
                        "uri": "/api/rules/1234/"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Rules"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "Rules"
    }
  ],
  "openapi": "3.1.0",
  "components": {
    "schemas": {
      "Rule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the rule.",
            "example": 1234
          },
          "code": {
            "type": "string",
            "description": "The logic of the rule (as JavaScript code).",
            "example": "\nif (eq(ticket.from_agent, false) && eq(ticket.status, 'open')) {\n    if (containsAny(message.intents.name, ['other/no_reply']) || containsAny(ticket.customer.email, [\n            'noreply@',\n            '@noreply'\n        ])) {\n        Action('addTags', { tags: 'auto-close' });\n        Action('setStatus', { status: 'closed' })\n    }\n}\n"
          },
          "code_ast": {
            "type": "object",
            "description": "The logic of the rule (as an ESTree [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) representation). Generated from the code if not specified.",
            "example": {
              "loc": {
                "start": {
                  "line": 2,
                  "column": 0
                },
                "end": {
                  "line": 10,
                  "column": 1
                }
              },
              "type": "Program",
              "body": [
                {
                  "loc": {
                    "start": {
                      "line": 2,
                      "column": 0
                    },
                    "end": {
                      "line": 10,
                      "column": 1
                    }
                  },
                  "type": "IfStatement",
                  "test": {
                    "loc": {
                      "start": {
                        "line": 2,
                        "column": 4
                      },
                      "end": {
                        "line": 2,
                        "column": 61
                      }
                    },
                    "type": "LogicalExpression",
                    "operator": "&&",
                    "left": {
                      "loc": {
                        "start": {
                          "line": 2,
                          "column": 4
                        },
                        "end": {
                          "line": 2,
                          "column": 32
                        }
                      },
                      "type": "CallExpression",
                      "callee": {
                        "loc": {
                          "start": {
                            "line": 2,
                            "column": 4
                          },
                          "end": {
                            "line": 2,
                            "column": 6
                          }
                        },
                        "type": "Identifier",
                        "name": "eq"
                      },
                      "arguments": [
                        {
                          "loc": {
                            "start": {
                              "line": 2,
                              "column": 7
                            },
                            "end": {
                              "line": 2,
                              "column": 24
                            }
                          },
                          "type": "MemberExpression",
                          "computed": false,
                          "object": {
                            "loc": {
                              "start": {
                                "line": 2,
                                "column": 7
                              },
                              "end": {
                                "line": 2,
                                "column": 13
                              }
                            },
                            "type": "Identifier",
                            "name": "ticket"
                          },
                          "property": {
                            "loc": {
                              "start": {
                                "line": 2,
                                "column": 14
                              },
                              "end": {
                                "line": 2,
                                "column": 24
                              }
                            },
                            "type": "Identifier",
                            "name": "from_agent"
                          }
                        },
                        {
                          "loc": {
                            "start": {
                              "line": 2,
                              "column": 26
                            },
                            "end": {
                              "line": 2,
                              "column": 31
                            }
                          },
                          "type": "Literal",
                          "value": false,
                          "raw": "false"
                        }
                      ]
                    },
                    "right": {
                      "loc": {
                        "start": {
                          "line": 2,
                          "column": 36
                        },
                        "end": {
                          "line": 2,
                          "column": 61
                        }
                      },
                      "type": "CallExpression",
                      "callee": {
                        "loc": {
                          "start": {
                            "line": 2,
                            "column": 36
                          },
                          "end": {
                            "line": 2,
                            "column": 38
                          }
                        },
                        "type": "Identifier",
                        "name": "eq"
                      },
                      "arguments": [
                        {
                          "loc": {
                            "start": {
                              "line": 2,
                              "column": 39
                            },
                            "end": {
                              "line": 2,
                              "column": 52
                            }
                          },
                          "type": "MemberExpression",
                          "computed": false,
                          "object": {
                            "loc": {
                              "start": {
                                "line": 2,
                                "column": 39
                              },
                              "end": {
                                "line": 2,
                                "column": 45
                              }
                            },
                            "type": "Identifier",
                            "name": "ticket"
                          },
                          "property": {
                            "loc": {
                              "start": {
                                "line": 2,
                                "column": 46
                              },
                              "end": {
                                "line": 2,
                                "column": 52
                              }
                            },
                            "type": "Identifier",
                            "name": "status"
                          }
                        },
                        {
                          "loc": {
                            "start": {
                              "line": 2,
                              "column": 54
                            },
                            "end": {
                              "line": 2,
                              "column": 60
                            }
                          },
                          "type": "Literal",
                          "value": "open",
                          "raw": "'open'"
                        }
                      ]
                    }
                  },
                  "consequent": {
                    "loc": {
                      "start": {
                        "line": 2,
                        "column": 63
                      },
                      "end": {
                        "line": 10,
                        "column": 1
                      }
                    },
                    "type": "BlockStatement",
                    "body": [
                      {
                        "loc": {
                          "start": {
                            "line": 3,
                            "column": 4
                          },
                          "end": {
                            "line": 9,
                            "column": 5
                          }
                        },
                        "type": "IfStatement",
                        "test": {
                          "loc": {
                            "start": {
                              "line": 3,
                              "column": 8
                            },
                            "end": {
                              "line": 6,
                              "column": 10
                            }
                          },
                          "type": "LogicalExpression",
                          "operator": "||",
                          "left": {
                            "loc": {
                              "start": {
                                "line": 3,
                                "column": 8
                              },
                              "end": {
                                "line": 3,
                                "column": 61
                              }
                            },
                            "type": "CallExpression",
                            "callee": {
                              "loc": {
                                "start": {
                                  "line": 3,
                                  "column": 8
                                },
                                "end": {
                                  "line": 3,
                                  "column": 19
                                }
                              },
                              "type": "Identifier",
                              "name": "containsAny"
                            },
                            "arguments": [
                              {
                                "loc": {
                                  "start": {
                                    "line": 3,
                                    "column": 20
                                  },
                                  "end": {
                                    "line": 3,
                                    "column": 40
                                  }
                                },
                                "type": "MemberExpression",
                                "computed": false,
                                "object": {
                                  "loc": {
                                    "start": {
                                      "line": 3,
                                      "column": 20
                                    },
                                    "end": {
                                      "line": 3,
                                      "column": 35
                                    }
                                  },
                                  "type": "MemberExpression",
                                  "computed": false,
                                  "object": {
                                    "loc": {
                                      "start": {
                                        "line": 3,
                                        "column": 20
                                      },
                                      "end": {
                                        "line": 3,
                                        "column": 27
                                      }
                                    },
                                    "type": "Identifier",
                                    "name": "message"
                                  },
                                  "property": {
                                    "loc": {
                                      "start": {
                                        "line": 3,
                                        "column": 28
                                      },
                                      "end": {
                                        "line": 3,
                                        "column": 35
                                      }
                                    },
                                    "type": "Identifier",
                                    "name": "intents"
                                  }
                                },
                                "property": {
                                  "loc": {
                                    "start": {
                                      "line": 3,
                                      "column": 36
                                    },
                                    "end": {
                                      "line": 3,
                                      "column": 40
                                    }
                                  },
                                  "type": "Identifier",
                                  "name": "name"
                                }
                              },
                              {
                                "loc": {
                                  "start": {
                                    "line": 3,
                                    "column": 42
                                  },
                                  "end": {
                                    "line": 3,
                                    "column": 60
                                  }
                                },
                                "type": "ArrayExpression",
                                "elements": [
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 3,
                                        "column": 43
                                      },
                                      "end": {
                                        "line": 3,
                                        "column": 59
                                      }
                                    },
                                    "type": "Literal",
                                    "value": "other/no_reply",
                                    "raw": "'other/no_reply'"
                                  }
                                ]
                              }
                            ]
                          },
                          "right": {
                            "loc": {
                              "start": {
                                "line": 3,
                                "column": 65
                              },
                              "end": {
                                "line": 6,
                                "column": 10
                              }
                            },
                            "type": "CallExpression",
                            "callee": {
                              "loc": {
                                "start": {
                                  "line": 3,
                                  "column": 65
                                },
                                "end": {
                                  "line": 3,
                                  "column": 76
                                }
                              },
                              "type": "Identifier",
                              "name": "containsAny"
                            },
                            "arguments": [
                              {
                                "loc": {
                                  "start": {
                                    "line": 3,
                                    "column": 77
                                  },
                                  "end": {
                                    "line": 3,
                                    "column": 98
                                  }
                                },
                                "type": "MemberExpression",
                                "computed": false,
                                "object": {
                                  "loc": {
                                    "start": {
                                      "line": 3,
                                      "column": 77
                                    },
                                    "end": {
                                      "line": 3,
                                      "column": 92
                                    }
                                  },
                                  "type": "MemberExpression",
                                  "computed": false,
                                  "object": {
                                    "loc": {
                                      "start": {
                                        "line": 3,
                                        "column": 77
                                      },
                                      "end": {
                                        "line": 3,
                                        "column": 83
                                      }
                                    },
                                    "type": "Identifier",
                                    "name": "ticket"
                                  },
                                  "property": {
                                    "loc": {
                                      "start": {
                                        "line": 3,
                                        "column": 84
                                      },
                                      "end": {
                                        "line": 3,
                                        "column": 92
                                      }
                                    },
                                    "type": "Identifier",
                                    "name": "customer"
                                  }
                                },
                                "property": {
                                  "loc": {
                                    "start": {
                                      "line": 3,
                                      "column": 93
                                    },
                                    "end": {
                                      "line": 3,
                                      "column": 98
                                    }
                                  },
                                  "type": "Identifier",
                                  "name": "email"
                                }
                              },
                              {
                                "loc": {
                                  "start": {
                                    "line": 3,
                                    "column": 100
                                  },
                                  "end": {
                                    "line": 6,
                                    "column": 9
                                  }
                                },
                                "type": "ArrayExpression",
                                "elements": [
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 4,
                                        "column": 12
                                      },
                                      "end": {
                                        "line": 4,
                                        "column": 22
                                      }
                                    },
                                    "type": "Literal",
                                    "value": "noreply@",
                                    "raw": "'noreply@'"
                                  },
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 5,
                                        "column": 12
                                      },
                                      "end": {
                                        "line": 5,
                                        "column": 22
                                      }
                                    },
                                    "type": "Literal",
                                    "value": "@noreply",
                                    "raw": "'@noreply'"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "consequent": {
                          "loc": {
                            "start": {
                              "line": 6,
                              "column": 12
                            },
                            "end": {
                              "line": 9,
                              "column": 5
                            }
                          },
                          "type": "BlockStatement",
                          "body": [
                            {
                              "loc": {
                                "start": {
                                  "line": 7,
                                  "column": 8
                                },
                                "end": {
                                  "line": 7,
                                  "column": 50
                                }
                              },
                              "type": "ExpressionStatement",
                              "expression": {
                                "loc": {
                                  "start": {
                                    "line": 7,
                                    "column": 8
                                  },
                                  "end": {
                                    "line": 7,
                                    "column": 49
                                  }
                                },
                                "type": "CallExpression",
                                "callee": {
                                  "loc": {
                                    "start": {
                                      "line": 7,
                                      "column": 8
                                    },
                                    "end": {
                                      "line": 7,
                                      "column": 14
                                    }
                                  },
                                  "type": "Identifier",
                                  "name": "Action"
                                },
                                "arguments": [
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 7,
                                        "column": 15
                                      },
                                      "end": {
                                        "line": 7,
                                        "column": 24
                                      }
                                    },
                                    "type": "Literal",
                                    "value": "addTags",
                                    "raw": "'addTags'"
                                  },
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 7,
                                        "column": 26
                                      },
                                      "end": {
                                        "line": 7,
                                        "column": 48
                                      }
                                    },
                                    "type": "ObjectExpression",
                                    "properties": [
                                      {
                                        "loc": {
                                          "start": {
                                            "line": 7,
                                            "column": 28
                                          },
                                          "end": {
                                            "line": 7,
                                            "column": 46
                                          }
                                        },
                                        "type": "Property",
                                        "key": {
                                          "loc": {
                                            "start": {
                                              "line": 7,
                                              "column": 28
                                            },
                                            "end": {
                                              "line": 7,
                                              "column": 32
                                            }
                                          },
                                          "type": "Identifier",
                                          "name": "tags"
                                        },
                                        "computed": false,
                                        "value": {
                                          "loc": {
                                            "start": {
                                              "line": 7,
                                              "column": 34
                                            },
                                            "end": {
                                              "line": 7,
                                              "column": 46
                                            }
                                          },
                                          "type": "Literal",
                                          "value": "auto-close",
                                          "raw": "'auto-close'"
                                        },
                                        "kind": "init",
                                        "method": false,
                                        "shorthand": false
                                      }
                                    ]
                                  }
                                ]
                              }
                            },
                            {
                              "loc": {
                                "start": {
                                  "line": 8,
                                  "column": 8
                                },
                                "end": {
                                  "line": 8,
                                  "column": 49
                                }
                              },
                              "type": "ExpressionStatement",
                              "expression": {
                                "loc": {
                                  "start": {
                                    "line": 8,
                                    "column": 8
                                  },
                                  "end": {
                                    "line": 8,
                                    "column": 49
                                  }
                                },
                                "type": "CallExpression",
                                "callee": {
                                  "loc": {
                                    "start": {
                                      "line": 8,
                                      "column": 8
                                    },
                                    "end": {
                                      "line": 8,
                                      "column": 14
                                    }
                                  },
                                  "type": "Identifier",
                                  "name": "Action"
                                },
                                "arguments": [
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 8,
                                        "column": 15
                                      },
                                      "end": {
                                        "line": 8,
                                        "column": 26
                                      }
                                    },
                                    "type": "Literal",
                                    "value": "setStatus",
                                    "raw": "'setStatus'"
                                  },
                                  {
                                    "loc": {
                                      "start": {
                                        "line": 8,
                                        "column": 28
                                      },
                                      "end": {
                                        "line": 8,
                                        "column": 48
                                      }
                                    },
                                    "type": "ObjectExpression",
                                    "properties": [
                                      {
                                        "loc": {
                                          "start": {
                                            "line": 8,
                                            "column": 30
                                          },
                                          "end": {
                                            "line": 8,
                                            "column": 46
                                          }
                                        },
                                        "type": "Property",
                                        "key": {
                                          "loc": {
                                            "start": {
                                              "line": 8,
                                              "column": 30
                                            },
                                            "end": {
                                              "line": 8,
                                              "column": 36
                                            }
                                          },
                                          "type": "Identifier",
                                          "name": "status"
                                        },
                                        "computed": false,
                                        "value": {
                                          "loc": {
                                            "start": {
                                              "line": 8,
                                              "column": 38
                                            },
                                            "end": {
                                              "line": 8,
                                              "column": 46
                                            }
                                          },
                                          "type": "Literal",
                                          "value": "closed",
                                          "raw": "'closed'"
                                        },
                                        "kind": "init",
                                        "method": false,
                                        "shorthand": false
                                      }
                                    ]
                                  }
                                ]
                              }
                            }
                          ]
                        },
                        "alternate": null
                      }
                    ]
                  },
                  "alternate": null
                }
              ],
              "sourceType": "script"
            }
          },
          "created_datetime": {
            "type": "string",
            "format": "date-time",
            "description": "When the rule was created.",
            "example": "2019-11-16T15:59:41.966927"
          },
          "deactivated_datetime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the rule was deactivated.",
            "example": "2019-11-28T15:59:41.966927"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "The description of the rule.",
            "example": "Automatically close all tickets from Amazon because there is nothing to do for them. We still want to keep them to be able to search."
          },
          "event_types": {
            "type": "string",
            "description": "A list of comma separated events that this rule will be executed on.",
            "example": "ticket-created,ticket-updated",
            "enum": [
              "ticket-created",
              "ticket-updated",
              "ticket-message-created",
              "ticket-assigned",
              "ticket-self-unsnoozed",
              "satisfaction-survey-responded"
            ]
          },
          "name": {
            "type": "string",
            "description": "The name of the rule.",
            "example": "Auto-close all tickets from Amazon"
          },
          "priority": {
            "type": "integer",
            "description": "Order of execution of the rule. Rules with higher priorities are executed first.",
            "example": "100"
          },
          "updated_datetime": {
            "type": "string",
            "format": "date-time",
            "description": "When the rule was last updated.",
            "example": "2019-11-25T15:59:41.966927"
          },
          "uri": {
            "type": "string",
            "readOnly": true,
            "description": "URI of the rule"
          }
        },
        "description": "Rules allow you to automatically perform actions on tickets when specific events occur. Rules are executed in the order of their `priority` field, with the rules having the higher priority being executed first.\n\nFor example, you can use rules to automatically tag your tickets, assign agents, apply macros, send messages and more."
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "The username will be the email address of your Gorgias account and the password will be your API key."
      }
    }
  }
}
```