Skip to content
POST
/api/v1/rules
curl --request POST \
--url https://deck.example.com/api/v1/rules \
--header 'Content-Type: application/json' \
--cookie qd_auth=<qd_auth> \
--data '{ "action_template": { "target": null, "types": [ "archive" ] }, "created_from_card_id": null, "criteria": { "account": null, "from_address": null, "from_domain": null, "list_id": null, "subject_contains": null }, "instruction": null, "known_sender_domains": [], "mode": "fuzzy", "project": null, "session_ref": null, "topic": null }'

A grant as the person writes it on the Rules screen or from a card (“Auto-approve matches in future”).

Media typeapplication/json

A grant as the person writes it on the Rules screen or from a card (“Auto-approve matches in future”).

object
action_template
required

What a rule allows: action types, and for forwards, resumes and new sessions, the target.

object
target
Any of:

A session by its tab, on a node. session_id pins one conversation when the tab has been reused.

object
node
required
string
>= 1 characters <= 100 characters
session_id
string | null
tab
required
string
>= 1 characters <= 200 characters
types
required
Array
>= 1 items <= 13 items
created_from_card_id
integer | null format: int64
criteria
object
account
string | null
from_address
string | null
from_domain
string | null
list_id
string | null
subject_contains
string | null
instruction
string | null
known_sender_domains
Array<string>
default: <= 50 items
mode
required
One of:

The agent judges matches from the instruction; the deck checks the grant, the sender’s domain, the template and the policy.

string
Allowed value: fuzzy
project

The project whose policy governs every action. Without one, each action’s project is found from its target session’s directory or its account.

string | null
session_ref

The session the grant is tied to: when it closes, the grant is archived. Defaults to the template’s target.

Any of:

A session by its tab, on a node. session_id pins one conversation when the tab has been reused.

object
node
required
string
>= 1 characters <= 100 characters
session_id
string | null
tab
required
string
>= 1 characters <= 200 characters
topic
string | null

A grant.

Media typeapplication/json

A grant.

object
action_template
required

What a rule allows: action types, and for forwards, resumes and new sessions, the target.

object
target
Any of:

A session by its tab, on a node. session_id pins one conversation when the tab has been reused.

object
node
required
string
>= 1 characters <= 100 characters
session_id
string | null
tab
required
string
>= 1 characters <= 200 characters
types
required
Array
>= 1 items <= 13 items
archived_reason
string | null
builtin
required

Shipped with the deck (the sent-mail grant). The person can turn it off but not delete it.

boolean
created_from_card_id
integer | null format: int64
criteria
required

A strict rule’s criteria. A sender criterion needs the card to report DMARC or DKIM passing.

object
account
string | null
from_address
string | null
from_domain
string | null
list_id
string | null
subject_contains
string | null
id
required
integer format: int64
instruction
string | null
known_sender_domains
required

A fuzzy match from any other domain is refused.

Array<string>
last_matched_at
string | null
match_count
required
integer format: int64
mode
required
One of:

The agent judges matches from the instruction; the deck checks the grant, the sender’s domain, the template and the policy.

string
Allowed value: fuzzy
project
string | null
session_ref
Any of:

A session by its tab, on a node. session_id pins one conversation when the tab has been reused.

object
node
required
string
>= 1 characters <= 100 characters
session_id
string | null
tab
required
string
>= 1 characters <= 200 characters
status
required
One of:
string
Allowed values: active disabled
topic
string | null

Example

{
"action_template": {
"target": null,
"types": [
"archive"
]
},
"criteria": {
"account": null,
"from_address": null,
"from_domain": null,
"list_id": null,
"subject_contains": null
},
"mode": "fuzzy",
"status": "active"
}

An error, with its message.

Media typeapplication/json

Every error the REST API returns, with an HTTP status.

object
error
required
string

Example generated

{
"error": "example"
}