Skip to main content

Perspective Compatibility Analyse

Accept a Google Perspective-style analyse request and return a Google-style response, while translating onto Respectify's scoring pipeline.

This endpoint is intended for easier migration from raw Perspective HTTP integrations. It preserves Google's wire shape as closely as currently supported, but it is not a claim of full behavioural parity.

Supported today: canonical Perspective attributes, preserved alias names, scoreThreshold, spanAnnotations, HTML text entries, and explicit languages when supplied.

Current limitations: only PROBABILITY score types are supported. In practice, that means 0 to 1 scores where higher values mean more of the requested attribute. Other score types are rejected. Respectify does not claim language detection when languages is omitted; compatibility responses fall back to the default English-oriented moderation context instead. doNotStore is accepted; in practice, analyse traffic is currently treated as though doNotStore were always true, because it is not retained for training. sessionId and communityId are accepted as request metadata for traceability, but they do not change scoring behaviour. dropUnsupportedAttributes is accepted, and current compat handling is already permissive in common flows.

Header Parameters
X-User-Email email REQUIRED

Account email address, for authentication

X-API-Key string REQUIRED

API key owned by the user (email), for authentication

Request Body REQUIRED
comment REQUIRED

Perspective-style comment input. String entries and {text, type} objects are accepted. HTML entries are normalised to text.

requestedAttributes object

Google-style requested attribute map, for example { "TOXICITY": {}, "INSULT": {} }.

context object
entries undefined[]
articleAndParentComment object
article
parentComment
spanAnnotations boolean

When true, include Google-style spanScores in the response.

languages string[]

Optional list of requested languages. Preserved in the response when supplied.

clientToken string

Opaque caller token echoed back in the response.

doNotStore boolean

Accepted for compatibility. Respectify does not currently use analyse traffic for training, so this flag does not change today's scoring path.

sessionId string

Accepted for compatibility as request metadata for traceability. Does not affect scoring behaviour.

communityId string

Accepted for compatibility as request metadata for traceability. Does not affect scoring behaviour.

dropUnsupportedAttributes boolean

Accepted for compatibility. Current compat handling is already permissive and ignores unsupported attributes in common flows.

Responses
200

Google-style compatibility response

Schema OPTIONAL
attributeScores object OPTIONAL
languages string[] OPTIONAL
detectedLanguages string[] OPTIONAL

Present only if Respectify actually detected a language. Omitted when no detection was performed.

clientToken string OPTIONAL
400

Google-style compatibility error, including unsupported non-PROBABILITY score types.