InsionInsion
Rust

Ingest a record

Create or update a record for asynchronous moderation.

ingest_a_record accepts IngestRecordRequest, a tuple wrapper around RecordInput. Use it when moderation will complete asynchronously through your webhook integration rather than when the current caller needs a decision.

let record = RecordInput::builder()
    .client_id("post-123")
    .name("Product update")
    .entity("post")
    .content(Content::String("Read the product update".to_string()))
    .user(UserInput::builder().client_id("author-7").username("alex").build()?)
    .build()?;

let response = client
    .ingest_a_record(&IngestRecordRequest(record), None)
    .await?;
println!("record = {}, message = {}", response.id, response.success_response_fields.message);

Signature and request shape

async fn ingest_a_record(
    &self,
    request: &IngestRecordRequest,
    options: Option<RequestOptions>,
) -> Result<IngestRecordResponse, ApiError>

Build RecordInput with required client_id, name, entity, and content; it also supports client_url, metadata, and user. Then wrap it as IngestRecordRequest(record). This is a generated newtype, so passing &RecordInput directly does not match the method signature.

Response and lifecycle

The response embeds SuccessResponse in success_response_fields, whose message confirms the request. It also has the Insion record id, optional moderation, and optional user. moderation: None means no moderation ID was queued; it is not a final compliant result. Preserve the record ID and use webhook events as the authoritative asynchronous outcome. Choose Moderate a record when a synchronous decision is required.

On this page