Spam Detection

Classify short-form text as spam or legitimate (ham). Ideal for messages, comments, emails, and form submissions.

POST /spam/detect

Authentication

Bearer token in the Authorization header.

Request

Content-Type: application/json
FieldTypeRequiredDescription
textstringRequiredThe message or text to classify. Long text is automatically chunked.

Response

FieldTypeDescription
scorenumberProbability the text is spam (0.0 – 1.0).
is_spambooleanWhether the text is classified as spam.
verdictstringHuman-readable verdict: "ham", "likely_ham", "suspicious", "likely_spam", or "spam".

Example

Request

curl -X POST https://api.cacuda.com/spam/detect \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Congratulations! You have won a free iPhone!"}'

Response 200 OK

{
  "score": 0.97,
  "is_spam": true,
  "verdict": "spam"
}

Error Codes

CodeDescription
400Missing or empty text field.
401Missing or invalid API key.
402Insufficient credits.
503Detection service unavailable.

Notes

Text longer than ~450 tokens is automatically split into chunks. Each chunk consumes one credit.

Try it in the scanner

Test this endpoint interactively with real data. No code required.

Open Scanner