POST
/
v1
/
validate
/
spam_check
import { JigsawStack } from "jigsawstack";

const jigsaw = JigsawStack({ apiKey: "your-api-key" });

const response = await jigsaw.validate.spam_check({
  "text": "Congratulations! You've won a free iPhone! Click here to claim now!"
})
{
  "success": true,
  "check": {
        "score": 0.95,
        "is_spam": true
  },
  "_usage": {
        "input_tokens": 20,
        "output_tokens": 14,
        "inference_time_tokens": 490,
        "total_tokens": 524
  }
}

Body

text
string
required

The text to check for spam.

The text parameter supports two types:

  • string - {"text":"Your text here"}
  • Array<string> - {"text":["Text 1", "Text 2"]}
x-api-key
string
required

Your JigsawStack API key

Response

success
boolean

Indicates whether the call was successful.

check
object