> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailchannels.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Suppression Entries

> Creates suppression entries for the specified account.
Parent accounts can create suppression entries for all associated sub-accounts.
If suppression_type is not provided, it defaults to 'non-transactional'.
The operation is atomic, meaning all entries are successfully added or none are added if an error occurs.




## OpenAPI

````yaml /email-api/api-reference/openapi.yaml post /suppression-list
openapi: 3.0.0
info:
  contact:
    email: support@mailchannels.com
    name: MailChannels Corporation
  description: >
    This is the API reference for Email API. Here, you'll find more detailed
    information on every endpoint, including parameters, response formats, and
    error codes.
  title: Email API
  version: 1.4.0
servers:
  - url: https://api.mailchannels.net/tx/v1
security: []
tags:
  - name: Send
  - name: DKIM
  - name: Metrics
  - name: Sub-accounts
  - name: Suppression
  - name: Webhooks
  - name: Usage
  - name: Custom Tracking
paths:
  /suppression-list:
    post:
      tags:
        - Suppression
      summary: Create Suppression Entries
      description: >
        Creates suppression entries for the specified account.

        Parent accounts can create suppression entries for all associated
        sub-accounts.

        If suppression_type is not provided, it defaults to 'non-transactional'.

        The operation is atomic, meaning all entries are successfully added or
        none are added if an error occurs.
      parameters:
        - in: header
          name: X-Api-Key
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuppressionListInput'
        description: The details of the suppression entries to create.
        required: true
      responses:
        '201':
          description: All suppression entries were successfully created.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request. The request body is invalid.
        '409':
          description: |
            Conflicts.
            One or more suppression entries in the request already exist and
            cannot be created again.
        '413':
          description: >
            Payload too large.

            The request exceeds the maximum allowed total of 1000 suppression
            entries

            for the parent account and/or its sub-accounts.
        '500':
          description: An unexpected internal error occurred.
        '503':
          description: Temporarily unavailable for maintenance.
      x-codeSamples:
        - label: Node.js
          lang: javascript
          source: >-
            import { MailChannels } from "mailchannels-sdk";


            const { MAILCHANNELS_API_KEY, RECIPIENT } = process.env;

            if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY
            before running");

            if (!RECIPIENT) throw new Error("Set RECIPIENT to the email address
            to suppress");


            const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);


            const { success, error } = await mailchannels.suppressions.create({
              entries: [{ recipient: RECIPIENT }],
            });


            if (!success) {
              console.error("Create suppression failed:", error);
              process.exit(1);
            }

            console.log("Suppression created");
        - label: Python
          lang: python
          source: >-
            import os

            import sys


            import mailchannels


            if not os.environ.get("MAILCHANNELS_API_KEY"):
                sys.exit("Set MAILCHANNELS_API_KEY (parent or sub-account) before running")

            recipient = os.environ.get("RECIPIENT")

            if not recipient:
                sys.exit("Set RECIPIENT to the email address to suppress")

            response = mailchannels.Suppressions.create([{"recipient":
            recipient}])


            print(response)
        - label: PHP
          lang: php
          source: >-
            <?php


            require_once __DIR__ . '/vendor/autoload.php';


            use MailChannels\Client;


            $api_key   = getenv('MAILCHANNELS_API_KEY') or exit("Error:
            MAILCHANNELS_API_KEY is not set\n");

            $recipient = getenv('RECIPIENT') or exit("Error: RECIPIENT is not
            set\n");


            $client = new Client(apiKey: $api_key);


            $response = $client->suppressions->create([['recipient' =>
            $recipient]]);


            print_r($response->toArray());
components:
  schemas:
    SuppressionListInput:
      properties:
        add_to_sub_accounts:
          default: false
          description: >
            If true, the parent account creates suppression entries for all
            associated sub-accounts.

            This field is only applicable to parent accounts.

            Sub-accounts cannot create entries for other sub-accounts.
          type: boolean
        suppression_entries:
          description: >-
            The total number of suppression entries to create, for the parent
            and/or its sub-accounts, must not exceed 1000.
          items:
            $ref: '#/components/schemas/SuppressionEntry'
          type: array
      required:
        - suppression_entries
      type: object
    ErrorResponse:
      properties:
        errors:
          description: >
            This is an array error objects that provide machine and human
            readable descriptions of the errors.
          items:
            type: string
          type: array
      type: object
    SuppressionEntry:
      properties:
        notes:
          maxLength: 1024
          nullable: true
          type: string
        recipient:
          maxLength: 255
          type: string
        suppression_types:
          items:
            enum:
              - transactional
              - non-transactional
            type: string
          type: array
      required:
        - recipient
      type: object

````