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.
Requests act through the API key's project: policy requests address the organisation's policies by ID, and GET/projects/:projectId/policy and PUT/projects/:projectId/policy read and choose the policy the project moderates with. The 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 409policy/revision-conflict: retrieve it again and retry.
Switch automatic updates on or off for one of the organisation's own preset policies: on turns a pinned policy live, so it always has the latest preset settings, and off pins a live policy at its current preset release.
What the policy does with each category, its allowances and restrictions
revision*number
Changes with every saved change. Send it with each change; a policy changed since is refused with policy/revision-conflict.
preset*object (optional)
Where a policy started from a built-in preset
projectIds[]*string[]
Projects this policy moderates, as their default policy or through one of their upload presets
createdAt*number
When the policy was created, in milliseconds since the Unix epoch
updatedAtnumber (optional)
When the policy was last changed, in milliseconds since the Unix epoch
Endpoint details
List Policies
List a page of the moderation policies of the API key's organisation, oldest first. Policies are shared by the organisation's projects; Get Project Policy says which one a project uses.
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.
Create Policy
Create a moderation policy in the API key'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.
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.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Get Policy
Get one of the organisation's moderation policies by ID
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.
404policy/not-found
Policy not found. Check the policy ID in the portal.
500server/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 `live` policy pins it as a copy under the same ID. Only policies that no other project uses can be changed through a project's key.
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.
404policy/not-found
Policy not found. Check the policy ID in the portal.
409policy/revision-conflict
The policy changed. Retrieve it again and retry with its current revision.
409policy/projects-changed
The projects using this policy changed. Retrieve it again and review the affected projects before saving.
409policy/used-by-another-project
Another project uses this policy, so it can only be changed from the portal or that project.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Reset Policy
Restore the settings of the preset release a `pinned` or `copy` policy is pinned to, discarding its edits
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.
404policy/not-found
Policy not found. Check the policy ID in the portal.
409policy/revision-conflict
The policy changed. Retrieve it again and retry with its current revision.
409policy/projects-changed
The projects using this policy changed. Retrieve it again and review the affected projects before saving.
409policy/used-by-another-project
Another project uses this policy, so it can only be changed from the portal or that project.
400policy/no-preset
This policy has no preset baseline.
409policy/preset-version-conflict
The preset changed. Review the latest differences and retry with its version.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Upgrade Policy
Move a `pinned` or `copy` policy whose settings are unchanged from its preset release to the latest release of the preset
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.
404policy/not-found
Policy not found. Check the policy ID in the portal.
409policy/revision-conflict
The policy changed. Retrieve it again and retry with its current revision.
409policy/projects-changed
The projects using this policy changed. Retrieve it again and review the affected projects before saving.
409policy/used-by-another-project
Another project uses this policy, so it can only be changed from the portal or that project.
400policy/no-preset
This policy has no preset baseline.
409policy/preset-version-conflict
The preset changed. Review the latest differences and retry with its version.
409policy/preset-update-unavailable
Only an unchanged copy of an older preset version can be updated. Reset or review your changes first.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Set Policy Automatic Updates
Switch automatic updates on or off for one of the organisation's own preset policies: on turns a `pinned` policy `live`, so it always has the latest preset settings, and off pins a `live` policy at its current preset release.
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.
404policy/not-found
Policy not found. Check the policy ID in the portal.
409policy/revision-conflict
The policy changed. Retrieve it again and retry with its current revision.
409policy/projects-changed
The projects using this policy changed. Retrieve it again and review the affected projects before saving.
409policy/used-by-another-project
Another project uses this policy, so it can only be changed from the portal or that project.
409policy/preset-version-conflict
The preset changed. Review the latest differences and retry with its version.
409policy/automatic-updates-unavailable
Automatic updates can only be switched on for a saved copy of one of the organisation's own preset policies, and off for one that has them.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Delete Policy
Delete a policy that no project or upload preset uses. Only policies that no other project uses can be deleted through a project's key.
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.
404policy/not-found
Policy not found. Check the policy ID in the portal.
409policy/in-use
Projects or upload presets still use this policy. Choose another policy for each of them before deleting it.
409policy/used-by-another-project
Another project uses this policy, so it can only be changed from the portal or that project.
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Get Project Policy
Get the policy the project moderates with. Uploads through an upload preset that names its own policy use that one 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.
404project/not-found
Project not found
500server/internal-error
An internal error occurred. Retry later, and quote requestId to support.
Assign Policy
Choose the policy the project moderates with. Later uploads use it, except those through an upload preset that names its own policy.
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
404policy/not-found
Policy not found. Check the policy ID in the portal.
500server/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