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
| Field | Required | Purpose |
|---|---|---|
ClientID | Yes | Stable application record identifier. |
Name | Yes | Record title or name. |
Entity | Yes | Record kind, such as post or comment. |
Content | Yes | Text or structured content with image/external URLs. |
ClientURL | No | Original-content URL. |
Metadata | No | Custom record context. |
User | No | Associated user profile. |
Passthrough | No | Moderate 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.