InsionInsion
Go

Moderate a record

Persist a record and return its moderation result immediately

result, err := client.ModerateARecord(ctx, &sdk.ModerateRequest{
  ClientID: "post-123", Name: "A post", Entity: "post",
  Content: &sdk.Content{String: "Hello world"},
})

Signature

ModerateARecord(context.Context, *sdk.ModerateRequest, ...option.RequestOption) (*sdk.ModerateResponse, error)

ClientID, Name, Entity, and Content are required. The request also supports the record URL, metadata, user, and passthrough fields. Use this method when the caller needs the returned moderation status and category IDs before proceeding.

Request fields and result

FieldRequiredPurpose
ClientIDYesStable application record identifier.
NameYesRecord title or name.
EntityYesRecord kind, such as post or comment.
ContentYesText or structured content with image/external URLs.
ClientURLNoOriginal-content URL.
MetadataNoCustom record context.
UserNoAssociated user profile.
PassthroughNoModerate without storing record or user content.

On success, inspect the response status, moderation ID, and category IDs. On failure, the response is nil and error is non-nil. Add per-call headers, retries, or a custom base URL through trailing option.RequestOption values.

On this page