Mail API reference

Mail API · Inbound-Routes

post/v1/workspaces/{workspace_id}/inbound-routes/{id}/testAuth

Test 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 · uuid

Id of the workspace.

id*string · uuid

Route id.

Request body

from*string · email

The sender to test with.

Example: "alice@example.com"

subjectstring

The subject to test with.

Example: "Invoice 42"

spamboolean

Test as spam.

toarray

To and Cc addresses to test with (default: the route address).

has_attachmentsboolean

Test as a message with attachments.

Response · 200

matched*boolean

True when a rule of this route matched.

matched_rule_ids*array

The rules that matched, in order.

drop*boolean

True when the message would be dropped.

keep*boolean

False when a `store` action with `keep: false` would delete it after the other actions.

actions*array

The 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"
    }
  ]
}