InsionInsion
TypeScript

Moderate a record

Persist a record and return its moderation result immediately

Call moderateARecord when moderation must complete before your application continues.

const result = await client.moderateARecord({
  clientId: "post-123",
  name: "A post",
  entity: "post",
  content: "Hello world",
  metadata: { source: "community" },
});

clientId, name, entity, and content are required. content can be text or an object with text, imageUrls, and externalUrls. Include user to associate the record with a user, or set passthrough: true to moderate without persisting record or user content.

Returns ModerateResponse, including the record ID, moderation status, matching rule IDs, and moderation ID.

Request fields

FieldRequiredDescription
clientIdYesYour stable identifier for this record.
nameYesA title or name for the record.
entityYesThe record kind, such as post, comment, or message.
contentYesText, or text with image and external URLs.
metadataNoUp to 50 serializable values for filtering and context.
userNoThe associated user profile.
passthroughNoModerate without storing the record or user content.

Check result.status for the moderation decision and result.categoryIds for the rules that matched.

On this page