# Apply the comments (new revision)

`POST https://api.cream-ai.de/api/v1/films/{id}/comments/apply`

Applies the open comments of the latest finished revision (all, or the ones in `comment_ids`) as a new revision of the film, like “Apply comments” in mint. Answers `202` with an operation of type `film.comments_apply` (`Location` points to `/api/v1/operations/{id}`). When it has succeeded, `result.id` is the new revision. The same `Idempotency-Key` with the same body always returns the same operation, also after 24 hours; a different body returns `422 idempotency_mismatch`. Errors before the start leave no operation: `409 film_cancelled` (the film was cancelled through the API), `409 film_not_ready` (no finished film or the film is being changed), `409 no_open_comments`, `409 comments_not_open` (`details.comment_ids` are no longer open), `409 correction_in_progress` (a new revision is already being created; `details.operation_id` if it was started through the API), `409 film_busy` (retry after `Retry-After` seconds), `402 insufficient_credits`. Credits are booked like in mint, on the user who ordered the film (`requested_by`). If mint restarts while the comments are being applied, the operation fails with `interrupted_by_restart`; the comments are open again and you can apply them again with a new `Idempotency-Key`. The approval of a film always stays with a person in mint.

Scopes: `feedback:write`, `films:revise`

## Parameters

- `id` (path, required): Id of the film (id from POST /films or GET /films).
- `Idempotency-Key` (header, required): Unique key of this write request (1–128 visible ASCII characters, e.g. a UUID). Retries with the same key return the stored response.

## Request body

- `comment_ids` (nullable array of strings): Only these comments (all must still be open, otherwise 409 comments_not_open). Without it: all open comments of the latest finished revision.

## Returns

- 202: The operation that creates the new revision (also for a repeated Idempotency-Key).

## Errors

- 400: Invalid request (invalid_request, invalid_json, invalid_cursor, idempotency_key_required, invalid_idempotency_key, parent_not_found, max_depth_exceeded, narration_too_long, user_not_in_company, template_not_found, category_not_found, feedback_kind_unsupported, upload_not_found).
- 401: Missing, malformed, revoked or expired API key (unauthorized).
- 402: Not enough credits for the new revision (insufficient_credits). Retry after topping up.
- 403: Not allowed (forbidden_scope, ip_not_allowed, company_inactive, api_not_enabled).
- 404: Not found (not_found).
- 409: film_cancelled (the film was cancelled through the API), film_not_ready, no_open_comments, comments_not_open (details.comment_ids), correction_in_progress or film_busy (with Retry-After).
- 413: Request body too large (payload_too_large).
- 415: Request body is not JSON (unsupported_media_type).
- 422: Idempotency-Key reused with a different request (idempotency_mismatch).
- 429: Too many requests (rate_limited).
- 500: Internal error (internal). Quote the request id when you contact support.
- 503: Temporarily unavailable (service_unavailable). Retry later (after Retry-After seconds, if sent).

## Example request

```sh
curl -X POST "https://api.cream-ai.de/api/v1/films/k7m2xq9v4t8n1b5r3c6d0wza/comments/apply" \
  -H "Authorization: Bearer $MINT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Example response (202)

```json
{
  "object": "operation",
  "id": "op_4d9b2e7a1c6f3d8b5e0a2c7f9b4d1e6a",
  "type": "film.comments_apply",
  "status": "queued",
  "created_at": "2026-11-11T15:10:00Z",
  "updated_at": "2026-11-11T15:10:00Z",
  "result": null,
  "error": null
}
```
