Change a reading rule
const url = 'https://deck.example.com/api/v1/reading-rules/1';const options = { method: 'PUT', headers: {cookie: 'qd_auth=<qd_auth>', 'Content-Type': 'application/json'}, body: '{"account":null,"from":null,"label":null,"name":"example","source":null,"text_regex":null}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://deck.example.com/api/v1/reading-rules/1 \ --header 'Content-Type: application/json' \ --cookie qd_auth=<qd_auth> \ --data '{ "account": null, "from": null, "label": null, "name": "example", "source": null, "text_regex": null }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”A “while I’m reading” rule: an item that matches every condition it sets gets through while the person reads. Conditions left out match anything; a rule must set at least one.
A “while I’m reading” rule: an item that matches every condition it sets gets through while the person reads. Conditions left out match anything; a rule must set at least one.
object
The mail account, or the Matrix room’s name.
The sender contains this (case doesn’t matter): @alertmanager:, no-reply@accounts.google.com.
The item carries this Gmail label.
What it’s for, as the Rules screen shows it (“Critical alerts”).
gmail or matrix.
An RE2 regular expression the subject and text are matched against: (?i)\(critical\).
Responses
Section titled “Responses”A “while I’m reading” rule: an item that matches every condition it sets gets through while the person reads. Conditions left out match anything; a rule must set at least one.
A “while I’m reading” rule: an item that matches every condition it sets gets through while the person reads. Conditions left out match anything; a rule must set at least one.
object
The mail account, or the Matrix room’s name.
The sender contains this (case doesn’t matter): @alertmanager:, no-reply@accounts.google.com.
The item carries this Gmail label.
What it’s for, as the Rules screen shows it (“Critical alerts”).
gmail or matrix.
An RE2 regular expression the subject and text are matched against: (?i)\(critical\).
Example
{ "account": null, "from": null, "label": null, "source": null, "text_regex": null}default
Section titled “default”An error, with its message.
Every error the REST API returns, with an HTTP status.
object
Example generated
{ "error": "example"}