Add a block entry

Blocks an email address or domain from inbound receiving and returns the created block entry. Responds with 201.

POST
/v1/email/blocks

Blocks an email address or domain from inbound receiving and returns the created block entry. Responds with 201.

Authorization

apiKey
headerx-api-key<token>

Request Body

application/json
  1. body
blockType*string
Value in"email""domain"
blockValue*string
reason*string
notes?string|null
expiresAt?string|null

Response Body

Success

application/json
  1. response
id*BlockedEmailId
Match^blk_[0-9a-hjkmnp-tv-z]{16,24}$
blockType*string
Value in"email""domain"
blockValue*string
reason*string
notes*string|null
isActive*boolean
expiresAt*string|null
createdAt*string
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.email.addBlock({  "blockType": "email",  "blockValue": "example",  "reason": "example"});
Example Response
{  "id": "string",  "blockType": "email",  "blockValue": "string",  "reason": "string",  "notes": "string",  "isActive": true,  "expiresAt": "string",  "createdAt": "string"}

Related documentation