Creates a new watch, or updates an existing one
Path parameters
-
Watch ID
Query parameters
-
active boolean
Specify whether the watch is in/active by default
-
if_primary_term number
only update the watch if the last operation that has changed the watch has the specified primary term
-
if_seq_no number
only update the watch if the last operation that has changed the watch has the specified sequence number
-
version number
Explicit version number for concurrency control
POST /_watcher/watch/{id}
curl \
-X POST http://api.example.com/_watcher/watch/{id} \
-H "Content-Type: application/json" \
-d '{"actions":{"additionalProperty1":{"action_type":"email","condition":{"always":{},"array_compare":{"additionalProperty1":{"path":"string"},"additionalProperty2":{"path":"string"}},"compare":{"additionalProperty1":{},"additionalProperty2":{}},"never":{},"script":{"lang":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"source":"string","id":"string"}},"foreach":"string","max_iterations":42.0,"name":"string","throttle_period":"string","":{"auth":{"basic":{"password":"string","username":"string"}},"body":"string","connection_timeout":"string","headers":{"additionalProperty1":"string","additionalProperty2":"string"},"host":"string","method":"head","params":{"additionalProperty1":"string","additionalProperty2":"string"},"path":"string","port":42.0,"proxy":{"host":"string","port":42.0},"read_timeout":"string","scheme":"http","url":"string"},"transform":{"chain":[{}],"script":{"lang":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"source":"string","id":"string"},"search":{"request":{"body":{"query":{}},"indices":["string"],"indices_options":{"allow_no_indices":true,"expand_wildcards":"string","ignore_unavailable":true,"ignore_throttled":true},"search_type":"query_then_fetch","template":{"explain":true,"id":"string","params":{},"profile":true,"source":"string"},"rest_total_hits_as_int":true},"timeout":"string"}},"index":{"index":"string","doc_id":"string","refresh":"true","op_type":"index","timeout":"string","execution_time_field":"string"},"logging":{"level":"string","text":"string","category":"string"},"slack":{"account":"string","message":{"attachments":[{"author_icon":"string","author_link":"string","author_name":"string","color":"string","fallback":"string","fields":[{}],"footer":"string","footer_icon":"string","image_url":"string","pretext":"string","text":"string","thumb_url":"string","title":"string","title_link":"string"}],"dynamic_attachments":{"attachment_template":{"author_icon":"string","author_link":"string","author_name":"string","color":"string","fallback":"string","fields":[{}],"footer":"string","footer_icon":"string","image_url":"string","pretext":"string","text":"string","thumb_url":"string","title":"string","title_link":"string"},"list_path":"string"},"from":"string","icon":"string","text":"string","to":["string"]}}},"additionalProperty2":{"action_type":"email","condition":{"always":{},"array_compare":{"additionalProperty1":{"path":"string"},"additionalProperty2":{"path":"string"}},"compare":{"additionalProperty1":{},"additionalProperty2":{}},"never":{},"script":{"lang":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"source":"string","id":"string"}},"foreach":"string","max_iterations":42.0,"name":"string","throttle_period":"string","":{"auth":{"basic":{"password":"string","username":"string"}},"body":"string","connection_timeout":"string","headers":{"additionalProperty1":"string","additionalProperty2":"string"},"host":"string","method":"head","params":{"additionalProperty1":"string","additionalProperty2":"string"},"path":"string","port":42.0,"proxy":{"host":"string","port":42.0},"read_timeout":"string","scheme":"http","url":"string"},"transform":{"chain":[{}],"script":{"lang":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"source":"string","id":"string"},"search":{"request":{"body":{"query":{}},"indices":["string"],"indices_options":{"allow_no_indices":true,"expand_wildcards":"string","ignore_unavailable":true,"ignore_throttled":true},"search_type":"query_then_fetch","template":{"explain":true,"id":"string","params":{},"profile":true,"source":"string"},"rest_total_hits_as_int":true},"timeout":"string"}},"index":{"index":"string","doc_id":"string","refresh":"true","op_type":"index","timeout":"string","execution_time_field":"string"},"logging":{"level":"string","text":"string","category":"string"},"slack":{"account":"string","message":{"attachments":[{"author_icon":"string","author_link":"string","author_name":"string","color":"string","fallback":"string","fields":[{}],"footer":"string","footer_icon":"string","image_url":"string","pretext":"string","text":"string","thumb_url":"string","title":"string","title_link":"string"}],"dynamic_attachments":{"attachment_template":{"author_icon":"string","author_link":"string","author_name":"string","color":"string","fallback":"string","fields":[{}],"footer":"string","footer_icon":"string","image_url":"string","pretext":"string","text":"string","thumb_url":"string","title":"string","title_link":"string"},"list_path":"string"},"from":"string","icon":"string","text":"string","to":["string"]}}}},"condition":{"always":{},"array_compare":{"additionalProperty1":{"path":"string"},"additionalProperty2":{"path":"string"}},"compare":{"additionalProperty1":{},"additionalProperty2":{}},"never":{},"script":{"lang":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"source":"string","id":"string"}},"input":{"chain":{"inputs":[{"*":{}}]},"http":{"extract":["string"],"request":{"auth":{"basic":{"password":"string","username":"string"}},"body":"string","connection_timeout":"string","headers":{"additionalProperty1":"string","additionalProperty2":"string"},"host":"string","method":"head","params":{"additionalProperty1":"string","additionalProperty2":"string"},"path":"string","port":42.0,"proxy":{"host":"string","port":42.0},"read_timeout":"string","scheme":"http","url":"string"},"response_content_type":"json"},"search":{"extract":["string"],"request":{"body":{"query":{}},"indices":["string"],"indices_options":{"allow_no_indices":true,"expand_wildcards":"string","ignore_unavailable":true,"ignore_throttled":true},"search_type":"query_then_fetch","template":{"explain":true,"id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"profile":true,"source":"string"},"rest_total_hits_as_int":true},"timeout":"string"},"simple":{"additionalProperty1":{},"additionalProperty2":{}}},"metadata":{"additionalProperty1":{},"additionalProperty2":{}},"throttle_period":"string","transform":{"chain":[{}],"script":{"lang":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"source":"string","id":"string"},"search":{"request":{"body":{"query":{}},"indices":["string"],"indices_options":{"allow_no_indices":true,"expand_wildcards":"string","ignore_unavailable":true,"ignore_throttled":true},"search_type":"query_then_fetch","template":{"explain":true,"id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"profile":true,"source":"string"},"rest_total_hits_as_int":true},"timeout":"string"}},"trigger":{"schedule":{"cron":"string","daily":{"at":["string"]},"hourly":{"minute":[42.0]},"interval":"string","monthly":{"at":["string"],"on":[42.0]},"weekly":{"at":["string"],"on":["sunday"]},"yearly":{"at":["string"],"int":["january"],"on":[42.0]}}}}'
Request examples
{
"actions": {
"additionalProperty1": {
"action_type": "email",
"condition": {
"always": {},
"array_compare": {
"additionalProperty1": {
"path": "string"
},
"additionalProperty2": {
"path": "string"
}
},
"compare": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"never": {},
"script": {
"lang": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"source": "string",
"id": "string"
}
},
"foreach": "string",
"max_iterations": 42.0,
"name": "string",
"throttle_period": "string",
"": {
"auth": {
"basic": {
"password": "string",
"username": "string"
}
},
"body": "string",
"connection_timeout": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"host": "string",
"method": "head",
"params": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"path": "string",
"port": 42.0,
"proxy": {
"host": "string",
"port": 42.0
},
"read_timeout": "string",
"scheme": "http",
"url": "string"
},
"transform": {
"chain": [
{}
],
"script": {
"lang": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"source": "string",
"id": "string"
},
"search": {
"request": {
"body": {
"query": {}
},
"indices": [
"string"
],
"indices_options": {
"allow_no_indices": true,
"expand_wildcards": "string",
"ignore_unavailable": true,
"ignore_throttled": true
},
"search_type": "query_then_fetch",
"template": {
"explain": true,
"id": "string",
"params": {},
"profile": true,
"source": "string"
},
"rest_total_hits_as_int": true
},
"timeout": "string"
}
},
"index": {
"index": "string",
"doc_id": "string",
"refresh": "true",
"op_type": "index",
"timeout": "string",
"execution_time_field": "string"
},
"logging": {
"level": "string",
"text": "string",
"category": "string"
},
"slack": {
"account": "string",
"message": {
"attachments": [
{
"author_icon": "string",
"author_link": "string",
"author_name": "string",
"color": "string",
"fallback": "string",
"fields": [
{}
],
"footer": "string",
"footer_icon": "string",
"image_url": "string",
"pretext": "string",
"text": "string",
"thumb_url": "string",
"title": "string",
"title_link": "string"
}
],
"dynamic_attachments": {
"attachment_template": {
"author_icon": "string",
"author_link": "string",
"author_name": "string",
"color": "string",
"fallback": "string",
"fields": [
{}
],
"footer": "string",
"footer_icon": "string",
"image_url": "string",
"pretext": "string",
"text": "string",
"thumb_url": "string",
"title": "string",
"title_link": "string"
},
"list_path": "string"
},
"from": "string",
"icon": "string",
"text": "string",
"to": [
"string"
]
}
}
},
"additionalProperty2": {
"action_type": "email",
"condition": {
"always": {},
"array_compare": {
"additionalProperty1": {
"path": "string"
},
"additionalProperty2": {
"path": "string"
}
},
"compare": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"never": {},
"script": {
"lang": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"source": "string",
"id": "string"
}
},
"foreach": "string",
"max_iterations": 42.0,
"name": "string",
"throttle_period": "string",
"": {
"auth": {
"basic": {
"password": "string",
"username": "string"
}
},
"body": "string",
"connection_timeout": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"host": "string",
"method": "head",
"params": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"path": "string",
"port": 42.0,
"proxy": {
"host": "string",
"port": 42.0
},
"read_timeout": "string",
"scheme": "http",
"url": "string"
},
"transform": {
"chain": [
{}
],
"script": {
"lang": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"source": "string",
"id": "string"
},
"search": {
"request": {
"body": {
"query": {}
},
"indices": [
"string"
],
"indices_options": {
"allow_no_indices": true,
"expand_wildcards": "string",
"ignore_unavailable": true,
"ignore_throttled": true
},
"search_type": "query_then_fetch",
"template": {
"explain": true,
"id": "string",
"params": {},
"profile": true,
"source": "string"
},
"rest_total_hits_as_int": true
},
"timeout": "string"
}
},
"index": {
"index": "string",
"doc_id": "string",
"refresh": "true",
"op_type": "index",
"timeout": "string",
"execution_time_field": "string"
},
"logging": {
"level": "string",
"text": "string",
"category": "string"
},
"slack": {
"account": "string",
"message": {
"attachments": [
{
"author_icon": "string",
"author_link": "string",
"author_name": "string",
"color": "string",
"fallback": "string",
"fields": [
{}
],
"footer": "string",
"footer_icon": "string",
"image_url": "string",
"pretext": "string",
"text": "string",
"thumb_url": "string",
"title": "string",
"title_link": "string"
}
],
"dynamic_attachments": {
"attachment_template": {
"author_icon": "string",
"author_link": "string",
"author_name": "string",
"color": "string",
"fallback": "string",
"fields": [
{}
],
"footer": "string",
"footer_icon": "string",
"image_url": "string",
"pretext": "string",
"text": "string",
"thumb_url": "string",
"title": "string",
"title_link": "string"
},
"list_path": "string"
},
"from": "string",
"icon": "string",
"text": "string",
"to": [
"string"
]
}
}
}
},
"condition": {
"always": {},
"array_compare": {
"additionalProperty1": {
"path": "string"
},
"additionalProperty2": {
"path": "string"
}
},
"compare": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"never": {},
"script": {
"lang": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"source": "string",
"id": "string"
}
},
"input": {
"chain": {
"inputs": [
{
"*": {}
}
]
},
"http": {
"extract": [
"string"
],
"request": {
"auth": {
"basic": {
"password": "string",
"username": "string"
}
},
"body": "string",
"connection_timeout": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"host": "string",
"method": "head",
"params": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"path": "string",
"port": 42.0,
"proxy": {
"host": "string",
"port": 42.0
},
"read_timeout": "string",
"scheme": "http",
"url": "string"
},
"response_content_type": "json"
},
"search": {
"extract": [
"string"
],
"request": {
"body": {
"query": {}
},
"indices": [
"string"
],
"indices_options": {
"allow_no_indices": true,
"expand_wildcards": "string",
"ignore_unavailable": true,
"ignore_throttled": true
},
"search_type": "query_then_fetch",
"template": {
"explain": true,
"id": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"profile": true,
"source": "string"
},
"rest_total_hits_as_int": true
},
"timeout": "string"
},
"simple": {
"additionalProperty1": {},
"additionalProperty2": {}
}
},
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"throttle_period": "string",
"transform": {
"chain": [
{}
],
"script": {
"lang": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"source": "string",
"id": "string"
},
"search": {
"request": {
"body": {
"query": {}
},
"indices": [
"string"
],
"indices_options": {
"allow_no_indices": true,
"expand_wildcards": "string",
"ignore_unavailable": true,
"ignore_throttled": true
},
"search_type": "query_then_fetch",
"template": {
"explain": true,
"id": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"profile": true,
"source": "string"
},
"rest_total_hits_as_int": true
},
"timeout": "string"
}
},
"trigger": {
"schedule": {
"cron": "string",
"daily": {
"at": [
"string"
]
},
"hourly": {
"minute": [
42.0
]
},
"interval": "string",
"monthly": {
"at": [
"string"
],
"on": [
42.0
]
},
"weekly": {
"at": [
"string"
],
"on": [
"sunday"
]
},
"yearly": {
"at": [
"string"
],
"int": [
"january"
],
"on": [
42.0
]
}
}
}
}
Response examples (200)
{
"created": true,
"_id": "string",
"_primary_term": 42.0,
"_seq_no": 42.0,
"_version": 42.0
}