---
title: "Check if json is spam"
method: POST
path: "/spam/check"
tags: ["Spam Check"]
---

# Check if json is spam

`POST /spam/check`

## Request

- Base URL: `https://api.spamcheck.ai/api/v1`
- URL: `https://api.spamcheck.ai/api/v1/spam/check`
- Auth: API key in header `Api-Key`

## Request body

- SpamCheck
  - `ip` string: IP address of the sender (must be a valid IPv4 or IPv6 address string)
  - `email` string: Email address to validate (must be a string)
  - `email_validation_method` 'mx' | 'smtp': The method to use for email validation. Defaults to 'mx'.
  - `body` object, required: The content to be checked for spam. Can contain any JSON object with form fields or message content.
  - `context` string: Business context for lead scoring. When provided along with score_threshold, enables lead scoring functionality.
  - `score_threshold` integer: Minimum score threshold for lead scoring (0-100). When provided along with context, enables lead scoring functionality.

## Response `200`

The SpamCheckAI response is broken into the sections IP, email, and content. A spam score greater than 0.5 indicates spam.
A true result for IP, email, risky_urls, or content spam should be considered spam.

- SpamCheckResponse
  - `id` integer, required: The unique identifier of the spam check response
  - `ip` IPBlock, required
    - `blocked` BlockedData
      - `result` boolean
  - `email` EmailBlock, required
    - `blocked` BlockedData
      - `result` boolean
    - `mx_valid` MXValidData
      - `result` boolean: Validity of the MX record
    - `regex_valid` RegexValidData
      - `result` boolean: Validity according to regex pattern
    - `smtp_valid` SmtpValidData
      - `result` boolean: Validity according to SMTP validation
  - `content` ContentBlock, required
    - `spam` SpamData
      - `result` boolean
      - `data` object
        - `score` number
    - `risky_urls` RiskyUrlsData
      - `result` boolean
      - `data` object[]
        - `message` string
        - `url` string
        - `keyword_counts` object
    - `short_urls` ShortUrlsData
      - `result` boolean
    - `redirect_urls` RedirectUrlsData
      - `result` boolean
    - `profanity` ProfanityData
      - `result` boolean
      - `data` object
    - `language` LanguageData
      - `data` array[]
        - union[]
          - union
            - string
            - number
  - `lead_score` LeadScoreBlock: Lead scoring results. Only present when both context and score_threshold parameters are provided.
    - `above_threshold` object
      - `result` boolean: True if the lead score is equal to or above the threshold (indicating quality lead), false if below threshold or on error
    - `data` object
      - `score` integer: Lead score from 0-100, with higher scores indicating better quality leads
      - `reasoning` string: AI-generated reasoning explaining the lead score
  - `mark_as_incorrect` string, uri, required: URL to mark the log as incorrect

## Other responses

- `400`: Bad Request - Invalid parameters provided
- `401`: Unauthorized - Invalid or missing API key
- `429`: Too Many Requests - Rate limit exceeded

---

[API](https://skmtc.dev/spamcheck/apis/spamcheckai-spam-filter-api.md) · [All operations](https://skmtc.dev/spamcheck/apis/spamcheckai-spam-filter-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spamcheck/apis/spamcheckai-spam-filter-api/revisions/89a5041be448?raw)
