// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.mjs` to generate the docs examples

[source, js]
----
const response = await client.queryRules.putRule({
  ruleset_id: "my-ruleset",
  rule_id: "my-rule1",
  type: "pinned",
  criteria: [
    {
      type: "contains",
      metadata: "user_query",
      values: ["pugs", "puggles"],
    },
    {
      type: "exact",
      metadata: "user_country",
      values: ["us"],
    },
  ],
  actions: {
    ids: ["id1", "id2"],
  },
});
console.log(response);
----
