InsionInsion
Java

Moderate a record

Persist a record and return its moderation result immediately

ModerateResponse result = client.moderateARecord(
    ModerateRequest.builder()
        .clientId("post-123")
        .name("A post")
        .entity("post")
        .content(Content.of("Hello world"))
        .build()
);

The request builder requires clientId, name, entity, and content. It also supports clientUrl, metadata, user, and passthrough. Set passthrough(true) to moderate without persisting record or user content.

ModerateResponse includes the record ID, status, moderation ID, and matched category IDs. Use this method when the application needs a decision immediately.

Method signature

ModerateResponse moderateARecord(ModerateRequest request)
ModerateResponse moderateARecord(ModerateRequest request, RequestOptions options)

Request builder

Builder methodRequiredDescription
clientId(String)YesYour stable record identifier.
name(String)YesRecord title or name.
entity(String)YesRecord type, such as post or comment.
content(Content)YesText or structured text with URLs.
clientUrl(String)NoURL of the original content.
metadata(Map<String, Object>)NoCustom context for the record.
user(UserInput)NoThe associated user profile.
passthrough(boolean)NoAvoid persisting record and user content.

Read result.getStatus() to determine the decision and result.getCategoryIds() to find the matching rules.

On this page