Layers
Partner APIAPI referenceApproval

Content-review policy

Read or change a project's content-review policy. Three modes (auto_approve / review_first_n / review_all), plus the live queue depth.

View as Markdown

The content-review policy controls whether generated content needs human approval before it can be scheduled or published. See the Content review concept for the full mental model.

GET /v1/projects/:projectId/content-review-policy

Read the current policy + the live pendingCount (queue depth).

curl https://api.layers.com/v1/projects/$PROJECT_ID/content-review-policy \
  -H "Authorization: Bearer $LAYERS_API_KEY"
await fetch(
  `https://api.layers.com/v1/projects/${projectId}/content-review-policy`,
  { headers: { "Authorization": `Bearer ${process.env.LAYERS_API_KEY}` } },
);
requests.get(
    f"https://api.layers.com/v1/projects/{project_id}/content-review-policy",
    headers={"Authorization": f"Bearer {os.environ['LAYERS_API_KEY']}"},
)

Response

{
  "projectId": "5e9c0b1e-…",
  "policy": "review_first_n",
  "firstN": 3,
  "pendingCount": 1,
  "updatedAt": "2026-04-25T22:55:10.996Z"
}
FieldTypeNotes
projectIdUUIDEcho of the path param.
policy"auto_approve" | "review_first_n" | "review_all"The active mode.
firstNint (1–50)Present only when policy === "review_first_n".
pendingCountint ≥ 0Live count of containers on this project currently in approvalStatus: "pending". Server-computed, read-only.
updatedAtISO-8601Last PATCH timestamp. Absent if the policy has never been set (defaults to auto_approve).

PATCH /v1/projects/:projectId/content-review-policy

Change the policy. Body is a discriminated union: firstN is required when policy === "review_first_n" and forbidden otherwise.

curl -X PATCH \
  "https://api.layers.com/v1/projects/$PROJECT_ID/content-review-policy" \
  -H "Authorization: Bearer $LAYERS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"policy":"review_first_n","firstN":5}'
curl -X PATCH \
  "https://api.layers.com/v1/projects/$PROJECT_ID/content-review-policy" \
  -H "Authorization: Bearer $LAYERS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"policy":"review_all"}'
curl -X PATCH \
  "https://api.layers.com/v1/projects/$PROJECT_ID/content-review-policy" \
  -H "Authorization: Bearer $LAYERS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"policy":"auto_approve"}'

Request body

FieldTypeRequiredNotes
policyenumyesOne of auto_approve, review_first_n, review_all.
firstNint (1–50)conditionalRequired iff policy === "review_first_n". Forbidden in the other two modes.

Response

The same shape as GET. updatedAt is set to the server time of the patch.

Errors

Status / codeWhen
422 VALIDATIONMissing firstN when policy === "review_first_n".
422 VALIDATIONfirstN supplied when policy is auto_approve or review_all.
422 VALIDATIONfirstN outside [1, 50].
404 NOT_FOUNDProject does not belong to the calling org.

How it interacts with content generation

When the API creates a content_container (via POST /v1/projects/:id/content or any other workflow that produces a container), it consults this policy:

  • auto_approve → new container's approvalStatus = "not_required".
  • review_allapprovalStatus = "pending".
  • review_first_napprovalStatus = "pending" if the project has fewer than firstN containers in a terminal review state (approved or rejected); otherwise "not_required". The transition self-disables — once N have cleared, the project effectively becomes auto_approve for new containers.

Use POST /v1/content/:containerId/approve and reject to move pending containers through review.

On this page