Create a forwarding rule
Creates an inbound email forwarding rule and returns it.
POST
Creates an inbound email forwarding rule and returns it. Responds with 201. Priority is a non-negative integer, default 0; higher priority rules are tried first, and at equal priority an exact address outranks a wildcard pattern. An organization holds at most 100 forwarding rules.
apiKeyheader
x-api-key<token>application/json- body
name*stringdescription?string|nulldomainId?|nullsourcePattern?string|nullforwardTo*array<string>preserveHeaders?boolean|nullappendNote?string|nullconditions?|nullpriority?|nullisActive?boolean|nullmetadata?|null|nullSuccess
application/json- response
id*EmailForwardingRuleIdMatch
^fwd_[0-9a-hjkmnp-tv-z]{16,24}$name*stringforwardTo*array<string>priority*integerRange
0 <= value <= 2147483647isActive*booleancreatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.email.createForwardingRule({
"name": "example",
"forwardTo": [
"example"
]
});Example Response
{
"id": "string",
"name": "string",
"forwardTo": [
"string"
],
"priority": 0,
"isActive": true,
"createdAt": "string"
}