An asset is one piece of submitted content (text, a file or a URL) together with its classification results. Use these endpoints to upload, list, update, move, retry and delete assets.
client.assets.classify() selects wait=true, and client.assets.create() selects wait=false. Text, images, documents and websites support both flows. Audio and video always run asynchronously and return with classification.moderation.statuspending, even with wait=true. See Waiting for the decision for the complete flow.
Start a multipart upload by streaming the first part's raw bytes as the request body, with the X-CalmLens-Upload: part header and the file's Content-Type.
Upload a file through an upload preset by sending its raw bytes as the request body, with the X-CalmLens-Upload: content header and the file's Content-Type.
Delete up to 500 assets, or remove their stored content, in one request.
Endpoint details
Create Asset
Upload a new asset to a project. Images up to 10 MiB, audio and video up to 50 MiB and 120 seconds, and other files up to 5,000 MiB can be sent in one request. Images up to 20 MiB, and any file within its limit, can also be sent in sequential parts with a multipart upload, which can resume after a failed part; CalmLens accumulates parts and enforces the final total, and checks `totalSizeInBytes` up front when you send it. Retained multipart image originals are served through CalmLens CDN URLs. Send an `Idempotency-Key` header to retry safely without creating a second asset.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
413upload/too-large
The file is larger than allowed. details.limitBytes is the limit, and details.source says whether it is the plan's (`plan`) or the upload preset's (`preset`).
422image/invalid
The image is corrupt or cannot be decoded. Upload a valid image file.
415upload/unsupported-type
The file type is not accepted. details.source is `calmlens` when CalmLens cannot store and process it (use a concrete MIME type such as image/png, application/pdf or text/plain) or `preset` when the upload preset doesn't allow it.
422image/too-large
The image exceeds a processing limit: details.limit is `bytes`, `pixels` or `dimension`. Reduce its size before uploading.
422document/too-many-items
The document holds more embedded images or audio and video files than can be moderated: details.limit is `images` or `media` and details.maximum the most allowed. Split it into smaller documents.
403usage/free-uploads-exhausted
This project's organisation has used its free uploads. Set up billing to continue uploading.
402usage/uploads-paused
Uploads to this project are paused by its organisation's usage limits. See details.reason; an owner can review them in Billing.
400remote-url/invalid
Remote URLs must use HTTP or HTTPS and cannot target private networks, localhost names or URL credentials.
422remote-url/unavailable
The URL responded with an error status. Check that it is publicly reachable.
400remote-url/too-many-redirects
The remote URL redirected too many times.
403remote-url/not-allowed
This project doesn't accept URLs from this domain. Change the allowed or blocked domains under Project settings.
429upload/website-rate-limit-reached
This project has submitted too many websites in the last minute. Wait for the Retry-After period, or lower the pace of submissions.
409asset/duplicate-external-id
An asset with this externalId already exists in the project.
404folder/not-found
Folder not found
400upload-payload/invalid
Upload payload is invalid.
409upload/use-upload-part
Use uploadPart for multipart upload parts after the first part
404upload-preset/not-found
Upload preset not found. Check the preset ID in the portal.
403upload-preset/disabled
This upload preset is paused. Turn it on in the portal to accept uploads.
400upload-preset/field-not-allowed
This field is set by the upload preset or the upload token and can't be changed by the upload.
400idempotency/invalid-key
The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
409idempotency/key-reused
This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
409idempotency/request-in-progress
A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Upload Asset File
Upload a file by sending its raw bytes as the request body, with the `X-CalmLens-Upload: content` header and the file's `Content-Type`. Asset fields are query parameters. This is the upload path the SDKs use for files. Send an `Idempotency-Key` header to retry safely without creating a second asset.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
413upload/too-large
The file is larger than allowed. details.limitBytes is the limit, and details.source says whether it is the plan's (`plan`) or the upload preset's (`preset`).
422image/invalid
The image is corrupt or cannot be decoded. Upload a valid image file.
415upload/unsupported-type
The file type is not accepted. details.source is `calmlens` when CalmLens cannot store and process it (use a concrete MIME type such as image/png, application/pdf or text/plain) or `preset` when the upload preset doesn't allow it.
422image/too-large
The image exceeds a processing limit: details.limit is `bytes`, `pixels` or `dimension`. Reduce its size before uploading.
422document/too-many-items
The document holds more embedded images or audio and video files than can be moderated: details.limit is `images` or `media` and details.maximum the most allowed. Split it into smaller documents.
403usage/free-uploads-exhausted
This project's organisation has used its free uploads. Set up billing to continue uploading.
402usage/uploads-paused
Uploads to this project are paused by its organisation's usage limits. See details.reason; an owner can review them in Billing.
409asset/duplicate-external-id
An asset with this externalId already exists in the project.
404folder/not-found
Folder not found
400upload-payload/invalid
Upload payload is invalid.
404upload-preset/not-found
Upload preset not found. Check the preset ID in the portal.
403upload-preset/disabled
This upload preset is paused. Turn it on in the portal to accept uploads.
400upload-preset/field-not-allowed
This field is set by the upload preset or the upload token and can't be changed by the upload.
400idempotency/invalid-key
The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
409idempotency/key-reused
This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
409idempotency/request-in-progress
A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Start Multipart File Upload
Start a multipart upload by streaming the first part's raw bytes as the request body, with the `X-CalmLens-Upload: part` header and the file's `Content-Type`. Pass `partNumber=1`, `isFinal`, the part's `sizeInBytes` and, if known, the file's `totalSizeInBytes` as query parameters, then send later parts to Upload Asset Part. The `wait` choice is saved with the upload and applies when the final part arrives.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
413upload/too-large
The file is larger than allowed. details.limitBytes is the limit, and details.source says whether it is the plan's (`plan`) or the upload preset's (`preset`).
422image/invalid
The image is corrupt or cannot be decoded. Upload a valid image file.
415upload/unsupported-type
The file type is not accepted. details.source is `calmlens` when CalmLens cannot store and process it (use a concrete MIME type such as image/png, application/pdf or text/plain) or `preset` when the upload preset doesn't allow it.
422image/too-large
The image exceeds a processing limit: details.limit is `bytes`, `pixels` or `dimension`. Reduce its size before uploading.
422document/too-many-items
The document holds more embedded images or audio and video files than can be moderated: details.limit is `images` or `media` and details.maximum the most allowed. Split it into smaller documents.
403usage/free-uploads-exhausted
This project's organisation has used its free uploads. Set up billing to continue uploading.
402usage/uploads-paused
Uploads to this project are paused by its organisation's usage limits. See details.reason; an owner can review them in Billing.
409asset/duplicate-external-id
An asset with this externalId already exists in the project.
404folder/not-found
Folder not found
400upload-payload/invalid
Upload payload is invalid.
404upload-preset/not-found
Upload preset not found. Check the preset ID in the portal.
403upload-preset/disabled
This upload preset is paused. Turn it on in the portal to accept uploads.
400upload-preset/field-not-allowed
This field is set by the upload preset or the upload token and can't be changed by the upload.
400idempotency/invalid-key
The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
409idempotency/key-reused
This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
409idempotency/request-in-progress
A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Upload Asset Part
Upload a sequential part for an in-progress asset upload. Each non-final part must be at least 5 MiB, an upload has at most 10,000 parts, and image uploads in parts must total at most 20 MiB. The final part uses the `wait` choice saved when the upload started unless you pass `wait` here. To stream raw bytes instead of JSON, send the `X-CalmLens-Upload: part` header and pass `partNumber`, `isFinal` and `sizeInBytes` as query parameters.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404asset/not-found
Asset not found
413upload/too-large
The file is larger than allowed. details.limitBytes is the limit, and details.source says whether it is the plan's (`plan`) or the upload preset's (`preset`).
422image/invalid
The image is corrupt or cannot be decoded. Upload a valid image file.
415upload/unsupported-type
The file type is not accepted. details.source is `calmlens` when CalmLens cannot store and process it (use a concrete MIME type such as image/png, application/pdf or text/plain) or `preset` when the upload preset doesn't allow it.
422image/too-large
The image exceeds a processing limit: details.limit is `bytes`, `pixels` or `dimension`. Reduce its size before uploading.
400upload-payload/invalid
Upload payload is invalid.
409upload/not-open
Asset is not accepting additional parts
409upload-part/invalid-number
Multipart upload part number is invalid.
409upload/missing
Multipart upload state is missing
400upload/size-mismatch
The uploaded parts do not add up to the totalSizeInBytes declared when the multipart upload started.
400idempotency/invalid-key
The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
409idempotency/key-reused
This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
409idempotency/request-in-progress
A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Create Preset Upload
Upload a file from a browser or app through an upload preset, without an API key. The preset sets the folder, visibility, accepted file types and size limit. To start a multipart upload, send the first `part` instead of `content`. Send the upload token signed by your server as `Authorization: Bearer <token>`; presets open to anyone need no token. Browsers must send an `Origin` the preset allows. The response includes the decision only when the preset shows it to uploaders.
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404upload-preset/not-found
Upload preset not found. Check the preset ID in the portal.
403upload-preset/disabled
This upload preset is paused. Turn it on in the portal to accept uploads.
403upload-preset/origin-not-allowed
This site isn't allowed to upload through this upload preset.
401upload-preset/token-required
This upload preset only accepts uploads with an upload token. Sign one on your server with uploadTokens.sign and pass it to the client.
401upload-token/invalid
The upload token is invalid. Sign a new one on your server with an active API key for this project.
401upload-token/expired
The upload token has expired. Sign a new one on your server.
429upload-preset/daily-limit-reached
You have reached this upload preset's daily upload limit. Try again after midnight UTC.
415upload/unsupported-type
The file type is not accepted. details.source is `calmlens` when CalmLens cannot store and process it (use a concrete MIME type such as image/png, application/pdf or text/plain) or `preset` when the upload preset doesn't allow it.
413upload/too-large
The file is larger than allowed. details.limitBytes is the limit, and details.source says whether it is the plan's (`plan`) or the upload preset's (`preset`).
400upload-preset/field-not-allowed
This field is set by the upload preset or the upload token and can't be changed by the upload.
409upload-token/used
The upload token has already been used. Each token uploads one asset.
422image/invalid
The image is corrupt or cannot be decoded. Upload a valid image file.
422image/too-large
The image exceeds a processing limit: details.limit is `bytes`, `pixels` or `dimension`. Reduce its size before uploading.
403usage/free-uploads-exhausted
This project's organisation has used its free uploads. Set up billing to continue uploading.
402usage/uploads-paused
Uploads to this project are paused by its organisation's usage limits. See details.reason; an owner can review them in Billing.
400upload-payload/invalid
Upload payload is invalid.
400idempotency/invalid-key
The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
409idempotency/key-reused
This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
409idempotency/request-in-progress
A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Upload Preset File
Upload a file through an upload preset by sending its raw bytes as the request body, with the `X-CalmLens-Upload: content` header and the file's `Content-Type`. To start a multipart upload, send `X-CalmLens-Upload: part` with `partNumber=1`, `isFinal` and `sizeInBytes`. Send the upload token signed by your server as `Authorization: Bearer <token>`; presets open to anyone need no token. Browsers must send an `Origin` the preset allows.
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
404upload-preset/not-found
Upload preset not found. Check the preset ID in the portal.
403upload-preset/disabled
This upload preset is paused. Turn it on in the portal to accept uploads.
403upload-preset/origin-not-allowed
This site isn't allowed to upload through this upload preset.
401upload-preset/token-required
This upload preset only accepts uploads with an upload token. Sign one on your server with uploadTokens.sign and pass it to the client.
401upload-token/invalid
The upload token is invalid. Sign a new one on your server with an active API key for this project.
401upload-token/expired
The upload token has expired. Sign a new one on your server.
429upload-preset/daily-limit-reached
You have reached this upload preset's daily upload limit. Try again after midnight UTC.
415upload/unsupported-type
The file type is not accepted. details.source is `calmlens` when CalmLens cannot store and process it (use a concrete MIME type such as image/png, application/pdf or text/plain) or `preset` when the upload preset doesn't allow it.
413upload/too-large
The file is larger than allowed. details.limitBytes is the limit, and details.source says whether it is the plan's (`plan`) or the upload preset's (`preset`).
400upload-preset/field-not-allowed
This field is set by the upload preset or the upload token and can't be changed by the upload.
409upload-token/used
The upload token has already been used. Each token uploads one asset.
422image/invalid
The image is corrupt or cannot be decoded. Upload a valid image file.
422image/too-large
The image exceeds a processing limit: details.limit is `bytes`, `pixels` or `dimension`. Reduce its size before uploading.
403usage/free-uploads-exhausted
This project's organisation has used its free uploads. Set up billing to continue uploading.
402usage/uploads-paused
Uploads to this project are paused by its organisation's usage limits. See details.reason; an owner can review them in Billing.
400upload-payload/invalid
Upload payload is invalid.
400idempotency/invalid-key
The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
409idempotency/key-reused
This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
409idempotency/request-in-progress
A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Upload Preset Part
Upload the next part of a multipart upload started through an upload preset. It takes the same body and query as Upload Asset Part, including raw bytes with `X-CalmLens-Upload: part`. The upload token that started the upload keeps working for its parts for up to a day after it expires. Send the upload token signed by your server as `Authorization: Bearer <token>`; presets open to anyone need no token. Browsers must send an `Origin` the preset allows.
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404upload-preset/not-found
Upload preset not found. Check the preset ID in the portal.
403upload-preset/disabled
This upload preset is paused. Turn it on in the portal to accept uploads.
403upload-preset/origin-not-allowed
This site isn't allowed to upload through this upload preset.
401upload-preset/token-required
This upload preset only accepts uploads with an upload token. Sign one on your server with uploadTokens.sign and pass it to the client.
401upload-token/invalid
The upload token is invalid. Sign a new one on your server with an active API key for this project.
401upload-token/expired
The upload token has expired. Sign a new one on your server.
413upload/too-large
The file is larger than allowed. details.limitBytes is the limit, and details.source says whether it is the plan's (`plan`) or the upload preset's (`preset`).
404asset/not-found
Asset not found
422image/invalid
The image is corrupt or cannot be decoded. Upload a valid image file.
415upload/unsupported-type
The file type is not accepted. details.source is `calmlens` when CalmLens cannot store and process it (use a concrete MIME type such as image/png, application/pdf or text/plain) or `preset` when the upload preset doesn't allow it.
422image/too-large
The image exceeds a processing limit: details.limit is `bytes`, `pixels` or `dimension`. Reduce its size before uploading.
400upload-payload/invalid
Upload payload is invalid.
409upload/not-open
Asset is not accepting additional parts
409upload-part/invalid-number
Multipart upload part number is invalid.
409upload/missing
Multipart upload state is missing
400upload/size-mismatch
The uploaded parts do not add up to the totalSizeInBytes declared when the multipart upload started.
400idempotency/invalid-key
The Idempotency-Key header must be 1 to 255 printable ASCII characters, such as a UUID.
409idempotency/key-reused
This Idempotency-Key was already used for a different request. Use a new key for each distinct request.
409idempotency/request-in-progress
A request with this Idempotency-Key is still being processed. Retry after the Retry-After delay to receive its result.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Retrieve Preset Upload
Check an upload made through an upload preset. Only assets uploaded through that preset are found, and the status is included only when the preset shows decisions to uploaders. Send the upload token signed by your server as `Authorization: Bearer <token>`; presets open to anyone need no token. Browsers must send an `Origin` the preset allows.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
400cursor/invalid
The cursor is invalid or belongs to a different query.
400filter/invalid
The filter has invalid syntax or names a field that can't be filtered.
404project/not-found
Project not found
404folder/not-found
Folder not found
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Search assets
Search accessible assets by keyword or natural language. Images are indexed automatically; enable audio and video search in project settings to include those media types. Results are the best `pageSize` matches (at most 20), ranked by relevance, so this endpoint has no cursor: refine the query, or list assets with a filter, to see more.
const response =await client.assets.search({
"query": "a red car at night",
"mode": "hybrid",
"pageSize": 10});
Response
query*string
items[]*object[]
semanticStatus*SemanticStatusEnum
Allowed values
disabledreadyindexingunavailable
Error Codes
401api-key/missing
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
404project/not-found
Project not found
503search/unavailable
Search is temporarily unavailable. Retry later.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
404asset/not-found
Asset not found
404project/not-found
Project not found
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
400cursor/invalid
The cursor is invalid or belongs to a different query.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Get Asset Timeline
Page through every segment of an audio or video asset's findings timeline, in time order. The asset's `classification.moderation.timeline.segmentCount` says how many there are. Lists nothing for other assets or while a copyright hold is on, and returns `asset/held` while a safety hold is on
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
404asset/not-found
Asset not found
423asset/held
The asset is held and this request can't change or deliver it. details.hold is `safety` for a safety hold or `copyright` for a copyright claim.
400cursor/invalid
The cursor is invalid or belongs to a different query.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Retry Asset
Process an asset whose `classification.status` is `failed` again. It returns to `processing` and is moderated like a new upload. The moderation decision must still be pending and the asset must not be under a safety hold. Processing needs available file content, inline text, or an eligible website URL to load again.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
404asset/not-found
Asset not found
409asset/not-retryable
Only assets that failed to process (status error) can be retried.
409asset/content-unavailable
This asset's content is no longer stored, so it can't be processed again. Upload it again instead.
423asset/held
The asset is held and this request can't change or deliver it. details.hold is `safety` for a safety hold or `copyright` for a copyright claim.
409asset/review-changed
The asset changed during review. Refresh and review the current decision.
429upload/website-rate-limit-reached
This project has submitted too many websites in the last minute. Wait for the Retry-After period, or lower the pace of submissions.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Explain Asset Decision
Complete the policy evidence behind an asset's moderation decision. To decide quickly, moderation skips questions whose answers could not change any action, so a report marked `moderation.explanationComplete: false` can credit a different rule, or show a different policy score, than a complete report would. Explaining answers those questions for the same content and returns the asset with `moderation.explanationComplete: true`; every action stays as decided. A decision made under policy settings that have since changed can't be explained as made: re-run it with `rerun: true` instead.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404asset/not-found
Asset not found
409asset/not-decided
This asset has no automatic moderation decision to explain yet.
409asset/policy-changed
The project's moderation policy has changed since this decision, so it can't be explained as made. Re-run moderation with the current policy instead.
409asset/reviewed
A reviewer has decided this asset, so its moderation can't be re-run.
409asset/not-retryable
Only assets that failed to process (status error) can be retried.
409asset/content-unavailable
This asset's content is no longer stored, so it can't be processed again. Upload it again instead.
423asset/held
The asset is held and this request can't change or deliver it. details.hold is `safety` for a safety hold or `copyright` for a copyright claim.
409asset/review-changed
The asset changed during review. Refresh and review the current decision.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Decide Asset
Record a reviewer's decision on an asset, replacing the policy's. The asset's `classification.moderation.status` becomes the decision, the matching `asset.<status>` event is sent with the request's `actor` (the API key, or the person an assistant's key acts for), and the decision and note are added to its review history. An asset still pending moderation can only be blocked or purged. Purging also needs `assets:delete` and permanently deletes the stored content.
const response =await client.assets.decide({
"decision": "blocked",
"note": "Spam reported by three members",
"assetId": "asset_5Gm2Rk8XqT3wLp9VbN4c"});
Response
Asset
Error Codes
401api-key/missing
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404asset/not-found
Asset not found
409asset/processing
Wait for the asset to finish uploading and processing before deciding it.
409asset/decision-not-allowed
This asset has no moderation decision yet, so it can only be blocked or purged. Allow, limit or age-restrict it once moderation has decided it.
409asset/decision-unchanged
The asset already has this moderation status.
409asset/content-purged
This asset's content was purged, so it can only be blocked. Upload it again to have it moderated afresh.
409asset/review-changed
The asset changed during review. Refresh and review the current decision.
423asset/held
The asset is held and this request can't change or deliver it. details.hold is `safety` for a safety hold or `copyright` for a copyright claim.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404asset/not-found
Asset not found
500asset/update-failed
Failed to update asset
409asset/duplicate-external-id
An asset with this externalId already exists in the project.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Move Asset
Move an asset into a folder, or to the project root
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404asset/not-found
Asset not found
500asset/update-failed
Failed to update asset
423asset/held
The asset is held and this request can't change or deliver it. details.hold is `safety` for a safety hold or `copyright` for a copyright claim.
404folder/not-found
Folder not found
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Remove Asset Content
Remove stored content, including the content derived from it in child assets, while retaining the asset records
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
404asset/not-found
Asset not found
500asset/update-failed
Failed to update asset
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Delete Asset
Delete an uploaded asset, its child assets and their stored content from a project. Child assets (those with a `parentId`) are deleted only with the asset they were extracted from.
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
404asset/not-found
Asset not found
409asset/child-not-deletable
This asset was extracted from another asset (its `parentId`), so it can't be deleted on its own. Delete the asset it was extracted from instead, which deletes it too.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Run Asset Batch Operation
Delete up to 500 assets, or remove their stored content, in one request. Every asset must exist in the project, the API key needs `assets:delete` for its folder, and `delete` takes only uploaded assets, not child assets (those with a `parentId`); otherwise nothing is queued. The response gives the operation's `batchId` and confirms that it is queued. It then runs in the background: `delete` deletes each asset with its child assets and stored content and records `asset.deleted`, and `remove-content` removes the content as a removal would (reason `requested`) and records `asset.content-removed`; each of those events carries the `batch-id` fact. Assets under a safety hold, or in a folder the key can no longer delete from when the operation runs, are skipped and record no event. To follow the operation, read the events feed filtered by those types or by asset.
ID of the batch operation. The asset.deleted and asset.content-removed events it records carry it as their batch-id fact.
status*literal
queued: the operation runs in the background after the response.
assetCount*number
Number of distinct assets the operation covers.
Error Codes
401api-key/missing
Authentication required. Send your project API key in the X-Api-Key header.
401api-key/invalid
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403api-key/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
403auth/permission-denied
This API key lacks a permission the request needs (details.permission names it, such as assets:download for an asset's folder), or the resource belongs to another project.
400validation/invalid-request
The request's parameters, query or body are invalid. details.issues lists each problem, with its path and issue code.
415request/unsupported-content-type
Send the request body as application/json.
404project/not-found
Project not found
404asset/not-found
Asset not found
409asset/child-not-deletable
This asset was extracted from another asset (its `parentId`), so it can't be deleted on its own. Delete the asset it was extracted from instead, which deletes it too.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
The asset object
Every endpoint that returns an asset returns this object. Its state is nested in three objects described in the asset lifecycle: upload, classification and content. classification.moderation follows the report format in Reading classification results. Child assets that CalmLens extracts during processing, such as images in a document, are assets too: their parentId is the asset they came from, and GET/assets/:assetId/children lists them.
The page object
List endpoints return a page of assets.
AssetPage
items[]*Asset[]
The items on this page
nextCursor*string (optional)
Pass as cursor for the next page; null when no more items remain
hasMore*boolean
Whether another page follows this one
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