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

# Spam Listing

> This API adds users to a spam list, blocking selected communication channels and allowing external systems to manage user blocking more efficiently.<br><br>Request Body params:<br> 
•	Identifiers (required): A valid phone number (including country code) or an email address.<br>
•	Channel IDs (optional): A comma-separated list of channel IDs to block.<br> 
•	Module ID (optional): The communication module to block.<br>   Available modules: Email [6], WhatsApp [13], SMS [14], FB messenger [38]<br><br>Note:<br>
• If the user does not exist in the system, a new user profile will be created and added to the spam list.<br>
• You can block all communication channels by providing only the Identifiers parameter. <br>
•  To limit blocking to specific channels or modules, include the relevant Channel IDs or Module ID. <br>
• Blocking a module will apply to all channels within that module.<br> 
• Blocking a user from a specific sub-channel is not supported.

## OpenAPI

````json POST /users/block
{
  "openapi": "3.0.3",
  "info": {
    "title": "CommBox API",
    "x-logo": {
      "url": "https://www.commbox.io/logo/commbox_logo_large.png"
    },
    "version": "2.07",
    "termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
    "contact": {
      "name": "commbox",
      "url": "https://www.commbox.io",
      "email": "contactus@commbox.io"
    }
  },
  "servers": [
    {
      "url": "https://api.commbox.io/",
      "description": "Production server"
    }
  ],
  "paths": {
    "/users/block": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Spam Listing",
        "description": "This API adds users to a spam list, blocking selected communication channels and allowing external systems to manage user blocking more efficiently.<br><br>Request Body params:<br> \n•\tIdentifiers (required): A valid phone number (including country code) or an email address.<br>\n•\tChannel IDs (optional): A comma-separated list of channel IDs to block.<br> \n•\tModule ID (optional): The communication module to block.<br>   Available modules: Email [6], WhatsApp [13], SMS [14], FB messenger [38]<br><br>Note:<br>\n• If the user does not exist in the system, a new user profile will be created and added to the spam list.<br>\n• You can block all communication channels by providing only the Identifiers parameter. <br>\n•  To limit blocking to specific channels or modules, include the relevant Channel IDs or Module ID. <br>\n• Blocking a module will apply to all channels within that module.<br> \n• Blocking a user from a specific sub-channel is not supported.",
        "operationId": "add_spam_user",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identifiers": {
                    "required": true,
                    "description": "A valid identifier of user: A phone number or an email address",
                    "type": "string",
                    "example": "[john.doe1010@gmail.com]"
                  },
                  "channelIds": {
                    "description": "(optional) Channel IDs can be separated by commas",
                    "type": "string",
                    "example": "[1514,312]"
                  },
                  "moduleIds": {
                    "description": "(optional) Type of communication (see Enums)  ",
                    "type": "string",
                    "example": "[6]"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": 200
                    },
                    "description": {
                      "type": "string",
                      "example": "Operation successful"
                    },
                    "response_time": {
                      "type": "string",
                      "example": "2025-08-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request could not be understood by the server. Incoming parameters might not be valid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 400
                    },
                    "description": {
                      "type": "string",
                      "example": "Bad Request"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - The supplied credentials, if any, are not sufficient to access the resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401
                    },
                    "description": {
                      "type": "string",
                      "example": "Unauthorized access"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The requested resource is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404
                    },
                    "description": {
                      "type": "string",
                      "example": "Not found"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 429
                    },
                    "description": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - The server could not return the representation due to an internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500
                    },
                    "description": {
                      "type": "string",
                      "example": "Operation failed"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "status": 500,
                  "description": "Operation failed",
                  "response_time": "2025-04-15T07:24:52.956691Z"
                }
              }
            }
          },
          "501": {
            "description": "Not Implemented - The requested operation is not supported"
          }
        }
      }
    }
  }
}
````

