POST /mail/{id}/rules

The deny rules allow you to setup assorted types of rules which will automatically deny the email from being sent through our system when the citeria match.

Adds a new email deny rule into the system to block new emails that match the given criteria

Path parameters

  • id integer Required

    Mail ID number

Body Required

These are the fields needed to create a new email deny rule.

  • user string

    Mail account username that will be tied to this rule. If not specified the first active mail order will be used.

  • type string Required

    The type of deny rule.

    Values are domain, email, startswith, or destination.

  • data string Required

    The content of the rule. If a domain type rule then an example would be google.com. For a begins with type an example would be msgid-. For the email typer an example would be user@server.com.

Body Required

These are the fields needed to create a new email deny rule.

  • user string

    Mail account username that will be tied to this rule. If not specified the first active mail order will be used.

  • type string Required

    The type of deny rule.

    Values are domain, email, startswith, or destination.

  • data string Required

    The content of the rule. If a domain type rule then an example would be google.com. For a begins with type an example would be msgid-. For the email typer an example would be user@server.com.

Responses

  • 200 application/json

    search results matching criteria

    Hide response attributes Show response attributes object
    • status string Required
    • text string Required
  • 400 application/json

    The specified resource was not found

    Hide response attributes Show response attributes object
    • code string Required
    • message string Required
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • code string Required
    • message string Required
  • 404 application/json

    The specified resource was not found

    Hide response attributes Show response attributes object
    • code string Required
    • message string Required
POST /mail/{id}/rules
curl \
 --request POST 'https://my.interserver.net/apiv2/mail/{id}/rules' \
 --header "X-API-KEY: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"data":"domeinwo@server.guesshost.net","type":"email","user":"mb20682"}'
curl \
 --request POST 'https://my.interserver.net/apiv2/mail/{id}/rules' \
 --header "X-API-KEY: $API_KEY" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'data=domeinwo%40server.guesshost.net&type=email&user=mb20682'
Request example
{
  "data": "domeinwo@server.guesshost.net",
  "type": "email",
  "user": "mb20682"
}
Request example
{"data" => "domeinwo@server.guesshost.net", "type" => "email", "user" => "mb20682"}
Response examples (200)
{
  "text": "The command completed successfully.",
  "status": "ok"
}
Response examples (400)
{
  "code": "string",
  "message": "string"
}
Response examples (401)
{
  "code": "string",
  "message": "string"
}
Response examples (404)
{
  "code": "string",
  "message": "string"
}