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 method | Required | Description |
|---|---|---|
clientId(String) | Yes | Your stable record identifier. |
name(String) | Yes | Record title or name. |
entity(String) | Yes | Record type, such as post or comment. |
content(Content) | Yes | Text or structured text with URLs. |
clientUrl(String) | No | URL of the original content. |
metadata(Map<String, Object>) | No | Custom context for the record. |
user(UserInput) | No | The associated user profile. |
passthrough(boolean) | No | Avoid persisting record and user content. |
Read result.getStatus() to determine the decision and result.getCategoryIds() to find the matching rules.