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
| Keyword | Required | Type | Description |
|---|---|---|---|
client_id | Yes | String | Your stable identifier for the record. |
name | Yes | String | Record title or name. |
entity | Yes | String | Record kind, such as post, comment, or message. |
content | Yes | String or content object | Text to moderate, optionally with image and external URLs. |
client_url | No | String | URL of the original content. |
metadata | No | Hash | Custom record context. |
user | No | Insion::Types::UserInput or hash | Associated user profile. |
passthrough | No | Boolean | Do 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.