/v1/workspaces/{workspace_id}/inbound-routes/{id}/testAuthTest an inbound route
A dry run: which rules would match a message with this sender, subject and spam flag, and what they would do (forward destinations with whether each is confirmed). Sends and stores nothing.
Path parameters
workspace_id*string · uuidId of the workspace.
id*string · uuidRoute id.
Request body
from*string · emailThe sender to test with.
Example: "alice@example.com"
subjectstringThe subject to test with.
Example: "Invoice 42"
spambooleanTest as spam.
toarrayTo and Cc addresses to test with (default: the route address).
has_attachmentsbooleanTest as a message with attachments.
Response · 200
matched*booleanTrue when a rule of this route matched.
matched_rule_ids*arrayThe rules that matched, in order.
drop*booleanTrue when the message would be dropped.
keep*booleanFalse when a `store` action with `keep: false` would delete it after the other actions.
actions*arrayThe forward and webhook actions that would run.
Example
Request
POST https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/inbound-routes/{id}/test
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"from": "alice@example.com",
"subject": "Invoice 42",
"spam": false,
"to": [
"string"
],
"has_attachments": false
}Response
{
"matched": false,
"matched_rule_ids": [
"string"
],
"drop": false,
"keep": false,
"actions": [
{
"rule_id": "00000000-0000-0000-0000-000000000000",
"action_index": 0,
"type": {},
"outcome": {},
"destinations": [
{
"id": "00000000-0000-0000-0000-000000000000",
"address": "string",
"outcome": {}
}
],
"endpoint_id": "00000000-0000-0000-0000-000000000000"
}
]
}