Skip to main content

Perspective Compatibility Suggestscore

Accept a Google Perspective-style suggestscore request and translate it into Respectify's feedback pipeline.

This endpoint is intended for easier migration from raw Perspective score-correction integrations. summaryScore.value is supported. Google-style spanScores are accepted and validated for compatibility, but Respectify currently stores summary-score feedback rather than span-level corrections.

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. The feedback you submit here is retained intentionally. That is the point of this endpoint: if you call it, Respectify retains the feedback you send. sessionId and communityId are accepted as request metadata for traceability, but they do not change scoring behaviour.

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
attributeScores object — REQUIRED
context object
entries undefined[]
articleAndParentComment object
article
parentComment
languages string[]
clientToken string
doNotStore boolean

Accepted for compatibility. Respectify does not currently use analyse traffic for training, but this endpoint intentionally stores the feedback you submit.

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.

Responses
200

Google-style suggestscore compatibility response

Schema — OPTIONAL
requestedLanguages string[] — OPTIONAL

Present only when the caller explicitly supplied languages.

detectedLanguages string[] — OPTIONAL

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

clientToken string — OPTIONAL
400

Invalid request, including unsupported non-PROBABILITY score types. The request must change before it is retried.

Schema — OPTIONAL
error object
code integer

HTTP status code (same as the HTTP response status)

message string

Human-readable explanation of the error

status string

Possible values: [INVALID_ARGUMENT, UNAUTHENTICATED, FAILED_PRECONDITION, PERMISSION_DENIED, NOT_FOUND, UNIMPLEMENTED, RESOURCE_EXHAUSTED, INTERNAL, UNAVAILABLE]

google.rpc.Code name for the error

401

Missing or invalid credentials (the X-User-Email and X-API-Key headers).

Schema — OPTIONAL
error object
code integer

HTTP status code (same as the HTTP response status)

message string

Human-readable explanation of the error

status string

Possible values: [INVALID_ARGUMENT, UNAUTHENTICATED, FAILED_PRECONDITION, PERMISSION_DENIED, NOT_FOUND, UNIMPLEMENTED, RESOURCE_EXHAUSTED, INTERNAL, UNAVAILABLE]

google.rpc.Code name for the error

402

The account's credit balance does not cover this call. Do not retry until funds have been added.

Schema — OPTIONAL
error object
code integer

HTTP status code (same as the HTTP response status)

message string

Human-readable explanation of the error

status string

Possible values: [INVALID_ARGUMENT, UNAUTHENTICATED, FAILED_PRECONDITION, PERMISSION_DENIED, NOT_FOUND, UNIMPLEMENTED, RESOURCE_EXHAUSTED, INTERNAL, UNAVAILABLE]

google.rpc.Code name for the error

413

The request body is over the 1 MB (1,048,576 byte) limit, or was sent with chunked transfer encoding. Requests must include a Content-Length header.

Schema — OPTIONAL
error object
code integer

HTTP status code (same as the HTTP response status)

message string

Human-readable explanation of the error

status string

Possible values: [INVALID_ARGUMENT, UNAUTHENTICATED, FAILED_PRECONDITION, PERMISSION_DENIED, NOT_FOUND, UNIMPLEMENTED, RESOURCE_EXHAUSTED, INTERNAL, UNAVAILABLE]

google.rpc.Code name for the error

429

Rate limit exceeded for score suggestions (shared with the feedback endpoint). Retry after the number of seconds given in the message.

Schema — OPTIONAL
error object
code integer

HTTP status code (same as the HTTP response status)

message string

Human-readable explanation of the error

status string

Possible values: [INVALID_ARGUMENT, UNAUTHENTICATED, FAILED_PRECONDITION, PERMISSION_DENIED, NOT_FOUND, UNIMPLEMENTED, RESOURCE_EXHAUSTED, INTERNAL, UNAVAILABLE]

google.rpc.Code name for the error

503

Scoring is temporarily unavailable. Retry after a few seconds (or the Retry-After interval, if the response gives one).

Schema — OPTIONAL
error object
code integer

HTTP status code (same as the HTTP response status)

message string

Human-readable explanation of the error

status string

Possible values: [INVALID_ARGUMENT, UNAUTHENTICATED, FAILED_PRECONDITION, PERMISSION_DENIED, NOT_FOUND, UNIMPLEMENTED, RESOURCE_EXHAUSTED, INTERNAL, UNAVAILABLE]

google.rpc.Code name for the error