Create a forwarding rule

Creates an inbound email forwarding rule and returns it.

POST
/v1/email/forwarding

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.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
name*string
description?string|null
domainId?|null
sourcePattern?string|null
forwardTo*array<string>
preserveHeaders?boolean|null
appendNote?string|null
conditions?|null
priority?|null
isActive?boolean|null
metadata?|null|null

Response Body

Success

application/json
  1. response
id*EmailForwardingRuleId
Match^fwd_[0-9a-hjkmnp-tv-z]{16,24}$
name*string
forwardTo*array<string>
priority*integer
Range0 <= value <= 2147483647
isActive*boolean
createdAt*string
Example Request
import { 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"}

Related documentation