apyhub
ARTIFICIAL INTELLIGENCE · DATA VALIDATION

Detect Spam API

What it does

Spam Detection lets you submit text content and check whether it is likely to be spam. Send a content string in the job request, then use the returned job_id and status_url to track processing asynchronously.

The submission response gives you a job_id and a status_url for polling. When the job completes, the status endpoint returns a data object with attributes.status and, when available, a result object containing pass, score, and reason.

Use Spam Detection when you need to screen user-generated text before publishing or routing it into a workflow. Typical cases include contact-form submissions, comments, sign-up messages, and other free-text inputs where you want an automated spam check without blocking the main request path.

Because the API is asynchronous, it fits batch processing and background moderation flows. You send the text once, then read the job status until the result is ready.

▣ ENDPOINT 01 / 02
POST
Submit Detect Spam job
http://localhost:8080/sharpapi/detect-spam
QUICKSTARTGUIDE

Quickstart

Submit text to the spam detector for asynchronous analysis.

curl -X POST "http://localhost:8080/sharpapi/detect-spam" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"This is a limited-time offer. Click here to claim your prize!"}'

What you'll get back

Returns a JSON object with job_id and status_url fields. job_id is a UUID identifying the asynchronous job, and status_url is the URI you can use to check its status.

{
  "status_url": "https://apyhub.com/services/provider/sharpapi/api/v1/content/detect_spam/job/status/c5c42851-027b-485a-80b1-3ffd8cde04b7",
  "job_id": "c5c42851-027b-485a-80b1-3ffd8cde04b7"
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Provide the content to check whether it is spam.

About this endpoint

What it does

Submits content for asynchronous spam detection and returns identifiers for checking the job later. The request sends the content to analyze, and the response returns a job ID plus a status URL.

Request Body

ParameterTypeMandatoryDescription
contentStringYesProvide the content to check whether it is spam.

Response

Returns a JSON object with required job_id and status_url string fields. job_id is a UUID identifying the submitted asynchronous job, and status_url is the URI used to check the job status.

ParameterTypeMandatoryDescription
job_idStringYesIdentifier of the submitted asynchronous job. Format: UUID.
status_urlStringYesURL used to check the submitted job status. Format: URI.

Notes

This endpoint kicks off an async job and returns immediately with a job identifier; the actual work runs in the background. Pair this call with the corresponding job_check endpoint — poll that until the status reaches a terminal state to retrieve the result. Use the returned job_id to track the job, and follow status_url to check its progress.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
GET
Get Detect Spam job status
http://localhost:8080/sharpapi/detect-spam/job/status/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of an existing spam-detection job by its job ID.

curl -X GET "http://localhost:8080/sharpapi/detect-spam/job/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a data object containing id, type, and attributes. Inside attributes, you’ll get type, status, and a result object with pass, score, and reason.

{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "job",
    "attributes": {
      "type": "spam-detection",
      "status": "completed",
      "result": {
        "pass": true,
        "score": 98,
        "reason": "Message appears to be legitimate."
      }
    }
  }
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves the current status of a Detect Spam job by its job_id. The response returns a JSON object containing a data object with the job identifier, type, and status information, plus the spam-check result fields when they are available.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesThe job identifier in UUID format.

Response

Returns a JSON object with a data object field. Inside data, the response includes id and type string fields, and an attributes object with type (string), status (string), and result (object) fields. The result object contains pass (boolean), score (integer), and reason (string) fields.

AttributeTypeMandatoryDescription
dataObjectNoWrapper object containing the job data.
data.idStringNoThe job identifier.
data.typeStringNoThe top-level resource type.
data.attributesObjectNoWrapper object containing status and result details.
data.attributes.typeStringNoThe attribute-level type value.
data.attributes.statusStringNoThe current job status.
data.attributes.resultObjectNoThe spam detection result object.
data.attributes.result.passBooleanNoWhether the spam check passed.
data.attributes.result.scoreIntegerNoThe spam score.
data.attributes.result.reasonStringNoThe reason associated with the result.

Notes

This endpoint is part of an async job flow. Poll this job_check endpoint with the job_id returned by the submit call, and read data.attributes.status for the current state. The data.attributes.result object is only populated once the job reaches a terminal success state; treat it as absent or unavailable before then.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.