Audit a YouTube script before recording
audit_scriptRun Prepublish's full audit on a YouTube script the user has already written. Returns hook, structure and pacing scores, a script-level attention-risk map naming the passages most likely to lose viewers, and a copy-paste rewrite for each flagged passage. Choose this when the user has a finished or near-finished draft and wants to know what is weak before they record. Do not use it to generate a script, to review a published video, or to check grammar. An email is optional: the result comes back in the conversation either way. This is a text-only check of an unrecorded script. It maps relative attention risk inside the draft. It does not measure or predict published YouTube retention, and it cannot account for delivery, editing, thumbnail, topic or distribution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Optional. Only when the user gave an address and wants the result link by email: Prepublish stores it with the audit, emails the result link to it, and may send a short series of follow-up emails about the audit that include an unsubscribe link. Leave it out otherwise; the audit runs without it. Never invent an address. When the caller is authenticated with a Prepublish API key the account address is used, so do not ask for one in that case. | ||
| audience | No | Target audience, only if the user said it. | |
| category | No | Video category, only if the user said it. | |
| script_text | Yes | The script text as the user wrote it. Paste it verbatim; do not rewrite, summarise or clean it first. | |
| video_title | Yes | The title the user plans to publish under. The audit checks whether the script delivers this promise. | |
| video_duration_seconds | No | Intended runtime in seconds, only if the user stated one. Used for pacing; never assumed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notice | Yes | The scope limit that accompanies every Prepublish result. Repeat it to the user rather than dropping it. | |
| status | No | Present only when the audit had not settled inside this call; the value is "running". | |
| analysis | No | The settled audit: status (and error_message when it failed), video_title, overall_score with hook_score, structure_score and pacing_score, ready_to_record, one_key_improvement, score_explanations, the attention_map (position_pct, hold_index, note, sentiment), the improvements in priority order (priority, category, title, location, original_quote and, for the passages on this plan, improved and why), locked_count, and policy_preflight. The script text itself and internal bookkeeping are not included. Absent while the audit is still running. | |
| next_step | No | Present only when the audit is still running: what to do to collect it. | |
| analysis_id | Yes | Prepublish id for this audit. Pass it to get_audit to re-read the result later. | |
| open_in_browser | Yes | Permalink to the same audit on prepublish.ai. |