InsionInsion
Ruby

Moderate a record

Persist a record and return its moderation result immediately

result = client.moderate_a_record(
  client_id: "post-123", name: "A post", entity: "post", content: "Hello world",
  metadata: { source: "community" },
)

Arguments

client_id, name, entity, and content are required. content may be text or structured content with URLs. Optional arguments are client_url, metadata, user, and passthrough.

Set passthrough: true to moderate without persisting record or user content. The ModerateResponse includes the record ID, status, moderation ID, and matching category IDs. Use this method when the calling workflow must receive a decision immediately.

Method shape

client.moderate_a_record(request_options: {}, **params)

Parameters

KeywordRequiredTypeDescription
client_idYesStringYour stable identifier for the record.
nameYesStringRecord title or name.
entityYesStringRecord kind, such as post, comment, or message.
contentYesString or content objectText to moderate, optionally with image and external URLs.
client_urlNoStringURL of the original content.
metadataNoHashCustom record context.
userNoInsion::Types::UserInput or hashAssociated user profile.
passthroughNoBooleanDo not persist record or user content.

Response and request options

The method returns Insion::Types::ModerateResponse. Read its moderation status and category IDs before deciding whether to publish content. Pass request_options: to override base_url, set timeout_in_seconds, or supply additional headers, query parameters, or body parameters for this call.

On this page