Update a saved search
const url = 'http://api.disclosebot.localdev:3000/v1/saved_searches/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":{"type":"saved_search","attributes":{"name":"example","query":{"q":{"additionalProperty":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"]},"results":{"additionalProperty":{"additionalProperty":"example"}}}}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url http://api.disclosebot.localdev:3000/v1/saved_searches/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "data": { "type": "saved_search", "attributes": { "name": "example", "query": { "q": { "additionalProperty": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }, "results": { "additionalProperty": { "additionalProperty": "example" } } } } } }'Renames the search, replaces its query, or both. Channels that copied the query keep their copy.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body required
Section titled “Request Body required ”object
object
object
A report query in two parts. q: ransack predicates over title_or_description, title, description (cont, not_cont, eq, not_eq), submitted_through_id (the brief, an array of brief ids; in, not_in), created_at (gteq, lteq), encrypted (eq). results: result key (severity, validity, scope, duplicate, summary, or any key an integration wrote) to predicate (eq, not_eq, cont, not_cont, gteq, lteq) to value. A channel keeps results conditions but ignores them at evaluation, and applies a brief condition to its briefs instead of storing it. A flat object of ransack predicates is accepted and stored as q.
object
object
object
object
Responses
Section titled “ Responses ”Query replaced; the channels referencing the search read the new query
object
object
object
A report query in two parts. q: ransack predicates over title_or_description, title, description (cont, not_cont, eq, not_eq), submitted_through_id (the brief, an array of brief ids; in, not_in), created_at (gteq, lteq), encrypted (eq). results: result key (severity, validity, scope, duplicate, summary, or any key an integration wrote) to predicate (eq, not_eq, cont, not_cont, gteq, lteq) to value. A channel keeps results conditions but ignores them at evaluation, and applies a brief condition to its briefs instead of storing it. A flat object of ransack predicates is accepted and stored as q.
object
object
object
object
The query as conditions: part (q or results), attribute, label, predicate, predicate_label, value, value_label
object
The value as shown: brief names for a brief condition
The user who saved it from the app; null when created over the API
object
object
The channels whose pre-filter references this search
object
Example
{ "data": { "type": "saved_search", "attributes": { "conditions": [ { "part": "q" } ] } }}Unauthorized
Another organisation
Invalid