Asset lifecycle and moderation

An asset is a file, remote URL, or extracted child submitted for classification. Its upload, classification, moderation and content states each have a status, described below.

ObjectAnswersStatuses
uploadWhether source content has arrived, including multipart progress.uploading, completed
classificationClassification progress and results for each capability.queued, processing, completed, failed
classification.moderationSafety findings, policy assessment and the decision in force, which also decides delivery.pending, allowed, limited, age-restricted, blocked, purged
contentWhether CalmLens holds the content: the source, its preview and extracted text.temporary, stored, removed

upload.updatedAt, classification.updatedAt and content.updatedAt record changes to each state. classification.completedAt records when classification finished. A manual decision records its time in the review entry’s reviewedAt; it does not change the classification timestamps.

Upload and classification

StateMeaning
uploadingA multipart upload is open and expects the next sequential part. upload.partsReceived counts the parts received so far.
queuedClassification hasn't started because the asset is waiting for its content, such as a multipart upload still receiving parts.
processingThe upload is complete and classification is waiting for a worker or running.
completedClassification finished. classification.completedAt records completion; classification.moderation holds the safety findings and status.
failedProcessing could not complete. Background processing retries temporary failures automatically for up to about 15 minutes, and the asset stays processing meanwhile; content that can never be processed, such as a corrupt file, fails at once. classification.moderation.status stays pending. Retry processing, or block or purge the asset in the portal or with POST /assets/:assetId/decision. A reviewer can't allow, limit or age-restrict an asset whose processing failed.

An asset is settled once classification.status is completed or failed: moderation has decided it, or processing failed.

Moderation

classification.moderation.status is the base decision in force. Every project serves jurisdictions with regional rules, so also apply the viewer-specific action before publication or delivery. You can wait for it in the upload request or receive it as an event; see Waiting for the decision.

classification.moderation.statusMeaning
pendingNo decision yet: the asset is uploading, processing, or processing failed.
allowedDelivered normally, subject to the other delivery checks below.
limitedDelivered like an allowed asset. Your app reduces its reach; see Limited assets.
age-restrictedRefused unless the request confirms age with viewerClaims.ageConfirmed: true, including API-key and signed-URL requests. Your app decides who sees it; see Age-restricted assets.
blockedNot delivered. Content kept with keepContentAfterProcessing stays available to short-lived portal review links.
purgedNot delivered, and the stored content was deleted.

The other classification.moderation fields explain the status:

FieldMeaning
automatedStatusThe status automated moderation decided: allowed, limited, age-restricted, blocked or purged. Absent until moderation decides. A reviewer's decision does not change it. flaggedCategories lists the categories acted on and source identifies what determined the action. See Mandatory and regional decisions.
manualReviewsReview history, oldest first. Each entry has id, decision, note, decidedBy, reviewedAt and applied. decidedBy.type is user for a person (or an assistant acting for one) or api-key for an API key, and decidedBy.id is that user's or key's ID, null when it wasn't recorded. Reviewers' names and emails are shown only in the portal. applied is false for a review queue decision that confirmed the asset without changing its status. Empty until an asset is reviewed.

A reviewer's decision takes precedence over the automated one: status follows the latest applied manual review, while automatedStatus, source, flaggedCategories, categories and raw retain the automated findings and assessment. Reviewing an asset does not change classification.completedAt.

Content

content.statusMeaning
temporaryCalmLens holds the content only until processing finishes, because keepContentAfterProcessing is false, or until a pending human review of its decision is done.
storedCalmLens retains the content.
removedThe content was deleted. content.removalReason says why.
content.removalReasonRemoved because
policyYour policy's purge action deleted it.
retentionkeepContentAfterProcessing was false, so it was deleted once processing finished.
requestedYou removed it through the API or the portal, or a reviewer purged the asset.
parent-removedIt was derived from a parent asset whose content was removed.
disposedIt was disposed of after a safety hold.

content also describes the file:

FieldMeaning
formatThe file's MIME type.
extensionThe file extension.
sizeInBytesThe file's size. Kept after the content is removed.
checksumsChecksums of the stored bytes.
extractedTextText read from the file; see OCR and image reports.
safetyHoldSet when delivery is restricted for suspected illegal content.
width, heightThe uploaded image's or video's size in pixels. Kept after the content is removed.
durationSecondsThe length of audio and video once analysed.
pageCountThe number of pages or slides of a document or presentation, when known.
perceptualHashImage assets only. A 256-bit PDQ  hash in 64 hexadecimal characters, the format shared lists of known images use. Hashes 31 or fewer bits apart are usually the same picture. Kept after the content is removed.
perceptualHashQualityImage assets only. Below 50, the hash comes from a flat or featureless image, so leave it out of comparisons.
metadataMetadata embedded in an uploaded image; see File metadata.
renderedThe displayable file the CDN serves at /rendered, or null when there is none.
previewThe still image the CDN serves at /preview, or null when there is none.

content.rendered has these fields:

FieldMeaning
kindWhat the file is: image, pdf, video or audio Preview. Choose the element that shows it from this.
formatThe file's MIME type. An image is served in the best format the browser accepts, unless a transform sets one.
width, heightThe full view's size in pixels, for images and video; null for PDFs and audio.
peaks PreviewAudio only: up to 512 loudness peaks from 0 to 1, evenly spaced over the audio, for drawing a waveform.

content.preview has these fields:

FieldMeaning
width, heightThe still image's size before it is sized or transformed.
thumbhashA small placeholder to show while any view of the asset loads, also served as a PNG at /placeholder.
averageColorThe still image's average colour, another placeholder for any view of the asset.

rendered and preview are set exactly when the CDN can serve them, and are null once the content is removed and while a safety or copyright hold is on. What the CDN serves lists them for each asset type.

Check content.status before loading the asset, since a removed asset keeps its size and hash.

Delivery while moderation runs

The CDN checks the current status, not the original policy action, on both cache hits and misses. All applicable checks below must pass; an allowed status alone does not guarantee delivery. Content must exist, and private requests must be authorised.

CheckEffect on CDN delivery
upload.status uploadingNever.
classification.status queued or processingNo by default: Block assets until moderation finishes is on, so only assets that have passed moderation are served, including their previews, lenses, transforms and signed URLs. A project that turns it off serves retained content as soon as the upload completes.
classification.moderation.status allowed or limitedPasses the moderation gate. Other checks still apply.
classification.moderation.status age-restrictedOnly to requests that confirm age with viewerClaims.ageConfirmed: true, including API-key and signed-URL requests. See Age-restricted assets.
classification.moderation.status blockedOnly through a short-lived portal review link when the content is retained. Ordinary delivery is blocked.
classification.moderation.status purgedNever.
classification.status failedNever. Retry processing to make the asset servable again.

Removed content and assets under a safety or copyright hold are never served either. A reviewer decision on removed content only sets the status (see Reports and reviews). Blocked requests return 403 asset/not-available.

Failure reasons

While classification.status is failed, classification.failureReason says why, and the asset.failed event carries the same value in its failure-reason fact. It is null at any other status.

ReasonMeaningWhat to do
file-too-largeThe file is over the size limit for its type, an image is over the byte or pixel limit for processing, a spreadsheet or presentation is over its cell, sheet or slide limit, or a website shows an image over 10 MiB.Upload a smaller file.
duration-limitAudio or video is longer than 120 seconds before billing is set up, or longer than 30 minutes after Preview. See Coverage and limits.Trim it, split it into separate uploads, or set up billing.
resolution-limitVideo is larger than 4096 × 2160 pixels.Re-encode it at a lower resolution.
unsupported-formatThe file's format isn't supported, or it is too damaged to identify.Convert it to a supported format.
undecodable-contentThe format is recognised, but the content can't be decoded: the file is corrupt or uses an unsupported codec.Re-encode or re-export it.
multiple-tracksAudio or video has more than one audio or video track.Keep one track of each kind.
type-mismatchThe content doesn't match the asset type, such as a video file uploaded as audio.Upload it with the right MIME type.
free-uploads-exhaustedBefore billing is set up, the upload contains more text than free uploads allow. See Pricing.Set up billing, then retry the asset.
media-limitThe organisation started its 600 minutes of long audio and video in the last 24 hours.Retry the asset once earlier long media is more than a day old.
uploads-pausedThe expected cost of long audio or video would pass a spend limit or project budget that pauses uploads.Raise the limit, or retry the asset once usage allows it.
too-many-itemsA document, spreadsheet or presentation holds more embedded images or audio and video files than can be moderated, or a website is too long or shows too many images. See Spreadsheets and presentations and Website moderation.Split it into smaller documents or pages.
processing-errorProcessing couldn't complete, for example because a service was unavailable.Retry the asset.

Reasons caused by the content itself fail the same way on every retry; replace the content with a new upload instead. A document or website whose child failed fails with that child's reason, or processing-error when the child's failure can be retried or a child is missing.

Recover from processing failure

  1. Retrieve the asset and inspect classification.status and classification.failureReason. Keep it unpublished while processing has failed or hasn't finished.
  2. Retry with POST /assets/:assetId/retry only when classification is failed, moderation is still pending, no safety hold applies, and processable content remains. This can be stored file bytes, inline text, or an eligible website URL that CalmLens can load again. A website retry checks the page as it exists now.
  3. The retry returns the asset to processing. Wait for a status event or poll with a timeout, handling another failure as well as a completed decision. Keep the existing asset ID and application record.
  4. If the content is unavailable, or you need to correct the submitted file, upload a fresh copy with a new asset ID and unique externalId. Link it to a new pending version of your application record. A retry cannot restore deleted bytes or replace an already reviewed decision.
const response = await client.assets.retry({
  "assetId": "asset_5Gm2Rk8XqT3wLp9VbN4c"
});

The retry endpoint documents its error codes. Repeating a CDN request does not retry classification. Retry only reprocesses failed assets: it can't recheck a decided asset, for example for the EU after you opt in (see Existing assets and rollout).

Retention and visibility

processingOptions.keepContentAfterProcessing defaults to false. When it is false, the content is temporary while the asset processes, and CalmLens deletes it once processing finishes, whatever the decision. content.status then becomes removed with removalReason retention. The asset record and report remain, but its content cannot be served from the CDN. If processing fails, the content is kept so the asset can be retried. If the decision is sampled for human review, the content is kept, but not delivered, until the review is decided or for at most 14 days.

Set keepContentAfterProcessing: true when you intend to serve content, generate previews, retain extracted text, or apply CDN transforms. The content is then stored until your policy purges it or you remove it.

visibility defaults to private and only controls access to retained content:

  • public content is available without authentication.
  • private content requires a signed URL, or an API key or portal session with Download assets for the asset's folder; see Asset URLs.

Visibility does not cause content to be retained. A public asset with keepContentAfterProcessing: false still has no source content to serve.

Reports and reviews

Use Reading classification results for scores and evaluation coverage, and Policies and actions for actions and exceptions.

Reviewers set the status in the portal, or your app records their decision with POST /assets/:assetId/decision: allowed, limited, age-restricted, blocked or purged. An asset still pending moderation can only be blocked or purged. Purging needs assets:delete as well as assets:update. Blocking doesn't delete content, so if it was kept, a later review can restore delivery. Purging permanently deletes the content after explicit confirmation, and a later review cannot restore it.

A reviewer can also decide an asset whose content was already removed, for example by default retention. The decision then only sets the status, which apps that host their own copy of the content follow; the CDN still has nothing to deliver. A purged asset, whether purged by your policy or a reviewer, can only be blocked afterwards: allowing, limiting or age-restricting it is refused with 409 asset/content-purged.

Each review records its decision and note and is appended to classification.moderation.manualReviews, so a later decision can override an earlier one without erasing its explanation. A decision on the asset page or through the API requires a note; in the human review queue, only changing the outcome does. The matching event carries the note, and its actor is the user or api-key that decided; the portal names the person or key. Qualifier-based explanations are shown in the category details.

Child assets

Documents and websites can produce child assets for extracted content: a document's text, its embedded images and audio and video files and, for a presentation, images of the slides that are rendered (see Spreadsheets and presentations). The parent's status follows its children, and its classification.moderation.source is then children. The first matching row decides it:

WhenParent
Any child is blocked or purgedblocked
Any child's processing failed, or a child is missingClassification fails, with the child's reason
Every child is decided and any is age-restrictedage-restricted
Every child is decided and any is limitedlimited
Every child is decided and allowedallowed

A document is decided only from all of its children, so it is never allowed while any of them is undecided, failed or missing. Once the parent has its decision, it keeps it: only a reviewer's or appeal decision changes it again. Inspect the children for their individual reports.

A reviewer's decision on the parent takes precedence over its children. A reviewer's decision on a child changes the parent only like this:

ParentChild decided asParent afterwards
Decided by a reviewerblocked or purgedblocked, which then stands as the parent's reviewer decision
Decided by a reviewerAny other statusUnchanged
Decided by its childrenAny statusDecided again from its children, as in the table above

When this changes the parent's status, its asset.blocked (or other status) event names the reviewer as its actor, with child-asset and child-status facts for the child and its decision. The portal asks the reviewer to confirm before a decision on a child can change its parent.

client.assets.listChildren({ assetId })

A spreadsheet's text child reads sheet by sheet, each starting with a # Sheet "Name" line and then a line per row, such as Row 12: A=Widget | C=1200 (formula: =SUM(C1:C11)). A presentation's reads slide by slide, each starting with a # Slide 3 line, followed by the slide's text and Alt text:, Notes: and Comment: lines. A Word or OpenDocument text document's reads in order, a table row per line with its cells separated by |, followed by Header:, Footnote:, Endnote:, Footer:, Comment: and Alt text: lines; tracked deletions read as [deleted: …] where they were. Hidden sheets, rows, columns and slides are marked (hidden).

Images with OCR enabled store extracted text in their own content.extractedText field and combine its text moderation with the image report. See OCR and image reports for retention and combined results.

Deletion choices

  • Remove content deletes stored bytes while retaining the asset record, metadata, and moderation history. content.status becomes removed with removalReason requested. It also removes the content derived from those bytes in child assets, such as the text and images extracted from documents and websites, while keeping the child records; their removalReason is parent-removed.
  • Delete asset deletes the record itself, together with its child assets and their content. A child asset is part of its parent's decision, so it can't be deleted on its own: deleting one, alone or in a batch, is refused with 409 asset/child-not-deletable. Delete the parent instead, or remove the child's content, which leaves the parent's decision as it is. Deleting a project or account deletes all of its assets.
  • Batch operations remove the content of, or delete, up to 500 assets in one request with client.assets.batch() (POST /projects/:projectId/assets/batch). They run in the background and skip assets under a safety hold.

The CDN stops serving removed or deleted content within seconds, including copies cached at the edge. Child assets under their own safety hold keep their content until the hold is resolved.

Last updated

Signing in

Signing out

Cookies on CalmLens

We use essential cookies for sign-in and security. With your permission, functional cookies remember your preferences and Google Analytics measures website use and signups. Optional ad measurement cookies link Google ad clicks to signups. Personalised advertising stays off. Manage cookies