A moderation policy decides what happens to content in each category. Policies belong to your organisation and its projects share them. Each project moderates with one policy, and an upload preset can name another for the uploads it accepts.
Every request names a project. Its API key needs policies:read to list and retrieve policies, and policies:write to create, change, delete and assign them. A key can change or delete only policies that no other project uses or owns, so it never changes how another project is moderated; change those in the portal.
Every change sends the policy's revision. A policy changed since you read it is refused with policy/revision-conflict: retrieve it again and retry.
Every policy of the project's organisation, oldest first
projectPolicyId*string
ID of the policy the project moderates with
Error Codes
401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/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, such as assets:delete for an asset's folder, or the resource belongs to another project.
400validation/invalid-type
A field has the wrong type. details.issues lists each problem.
400validation/too-small
A value is below its minimum. details.issues lists each problem.
400validation/too-big
A value is above its maximum. details.issues lists each problem.
400validation/invalid-format
A string is not in the required format, such as an ID or URL. details.issues lists each problem.
400validation/invalid-value
A field has a value it cannot take. details.issues lists each problem.
400validation/unknown-field
The request has a field this endpoint does not accept.
404project/not-found
Project not found
500misc/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Create Policy
Create a moderation policy in the project's organisation, from settings or as a copy of a built-in preset. It moderates nothing until you assign it to a project or name it on an upload preset.
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/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, such as assets:delete for an asset's folder, or the resource belongs to another project.
400validation/invalid-type
A field has the wrong type. details.issues lists each problem.
400validation/too-small
A value is below its minimum. details.issues lists each problem.
400validation/too-big
A value is above its maximum. details.issues lists each problem.
400validation/invalid-format
A string is not in the required format, such as an ID or URL. details.issues lists each problem.
400validation/invalid-value
A field has a value it cannot take. details.issues lists each problem.
400validation/unknown-field
The request has a field this endpoint does not accept.
404project/not-found
Project not found
404policy/not-found
Policy not found. Check the policy ID in the portal.
500misc/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Update Policy
Change a policy's name, description or settings. Changes apply to later moderation. Saving a policy that follows automatic updates pins it as a copy under the same ID. Only policies that no other project uses or owns can be changed through a project's key.
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/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, such as assets:delete for an asset's folder, or the resource belongs to another project.
400validation/invalid-type
A field has the wrong type. details.issues lists each problem.
400validation/too-small
A value is below its minimum. details.issues lists each problem.
400validation/too-big
A value is above its maximum. details.issues lists each problem.
400validation/invalid-format
A string is not in the required format, such as an ID or URL. details.issues lists each problem.
400validation/invalid-value
A field has a value it cannot take. details.issues lists each problem.
400validation/unknown-field
The request has a field this endpoint does not accept.
415validation/unsupported-content-type
Send the request body as application/json.
404project/not-found
Project not found
404policy/not-found
Policy not found. Check the policy ID in the portal.
500misc/internal-error
An internal error occurred. Retry later, and quote requestId to support.
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