{"__v":0,"_id":"591a8c67b560ce1b00071dd7","category":{"project":"56008ba98c0c9d0d00dcaeb0","version":"5719767ec863120e0012a042","_id":"591e4c277f22100f00031521","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-05-19T01:36:39.888Z","from_sync":false,"order":4,"slug":"rules","title":"Rules"},"parentDoc":null,"project":"56008ba98c0c9d0d00dcaeb0","user":"564a46904fa1460d00780c0d","version":{"__v":7,"_id":"5719767ec863120e0012a042","hasDoc":true,"hasReference":true,"project":"56008ba98c0c9d0d00dcaeb0","createdAt":"2016-04-22T00:55:26.295Z","releaseDate":"2016-04-22T00:55:26.295Z","categories":["5719767ec863120e0012a043","5719767ec863120e0012a044","5719767ec863120e0012a045","5719767ec863120e0012a046","5719767ec863120e0012a047","5719767ec863120e0012a048","5719767ec863120e0012a049","57f45a18da14e71700d12e4a","582b71b15403840f008c0410","58c060cf3eee111b00a8b210","591e4c277f22100f00031521","591e4c3d094c5b0f006769fe","591e4c461e0dc20f0047b58b"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-05-16T05:21:43.268Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -XPOST 'https://api.thisdata.com/v1/rules/816677874491720987?api_key=API_KEY' -d'\n{\n  \"filters\": [\"123.123.123.123\",\"1.1.1.1\"]\n}'\n","language":"text","name":"curl"}]},"method":"post","results":{"codes":[{"name":"","code":"{\n  \"id\": \"816677874491720987\",\n  \"name\": \"IP Blacklist for Guests\",\n  \"description\": \"Blacklist for guest account users\",\n  \"type\": \"blacklist\",\n  \"target\": \"location.ip\",\n  \"source\": \"guest-123\",\n  \"filters\": [\"123.123.123.123\",\"1.1.1.1\"]\n}\n","language":"json","status":200},{"name":"","code":"","language":"json","status":400},{"status":401,"language":"text","code":""}]},"settings":"","auth":"required","params":[{"_id":"591a7fc4064b8319004caae9","ref":"","in":"query","required":false,"desc":"Your ThisData API key","default":"","type":"string","name":"api_key"},{"_id":"591a8a17b560ce1b00071db4","ref":"","in":"body","required":false,"desc":"The name of this rule","default":"","type":"string","name":"name"},{"_id":"591a8a17b560ce1b00071db3","ref":"","in":"body","required":false,"desc":"Optional description of why this rule exists","default":"","type":"string","name":"description"},{"_id":"591a8a17b560ce1b00071db2","ref":"","in":"body","required":false,"desc":"The type of rule from the list below","default":"","type":"string","name":"type"},{"_id":"591a8a17b560ce1b00071db1","ref":"","in":"body","required":false,"desc":"The event attribute to apply the rule against","default":"","type":"string","name":"target"},{"_id":"591a8a17b560ce1b00071db0","ref":"","in":"body","required":false,"desc":"Optional source to filter rules by team or customer","default":"","type":"string","name":"source"},{"_id":"591a8a17b560ce1b00071daf","ref":"","in":"body","required":false,"desc":"Array of values relevant to the given rule type. See below for rule types.","default":"","type":"array_string","name":"filters"},{"_id":"591a8c67b560ce1b00071dd9","ref":"","in":"path","required":true,"desc":"The ID of the rule to update","default":"","type":"string","name":"id"}],"url":"/v1/rules"},"isReference":true,"order":3,"body":"### Body \nOnly the attributes that are supplied in the body will be updated. \n\n### Authentication\n\nYour API Key must be provided in the URL's query string. [Learn more about Authentication & your API Key](doc:authentication-api-key).\n\n### Response Messages\n\n* 200 - Success, the Rule was updated. \n* 400 - Invalid rule attribute. Validation errors are returned in the response body. \n* 401 - Invalid API Key\n\n### Time to update\n\nUpdates can take up to 10 minutes to take effect.","excerpt":"Update an existing rule","slug":"v1rulesid-1","type":"endpoint","title":"Update a rule"}

postUpdate a rule

Update an existing rule

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
The ID of the rule to update

Query Params

api_key:
string
Your ThisData API key

Body Params

name:
string
The name of this rule
description:
string
Optional description of why this rule exists
type:
string
The type of rule from the list below
target:
string
The event attribute to apply the rule against
source:
string
Optional source to filter rules by team or customer
filters:
array of strings
Array of values relevant to the given rule type. See below for rule types.

Examples


Result Format


Documentation

### Body Only the attributes that are supplied in the body will be updated. ### Authentication Your API Key must be provided in the URL's query string. [Learn more about Authentication & your API Key](doc:authentication-api-key). ### Response Messages * 200 - Success, the Rule was updated. * 400 - Invalid rule attribute. Validation errors are returned in the response body. * 401 - Invalid API Key ### Time to update Updates can take up to 10 minutes to take effect.