Request rewrite
Rewrite drafted messages per an instruction (e.g. 'shorter, drop the exclamation, lead with the talk'). Targets specific speakers via speaker_ids, specific drafts via message_ids, or the whole campaign if neither is given. By default rewrites EVERY slot (M1/M2/M3) for each targeted speaker — pass slots (e.g. [1] to touch only M1) to scope it to specific slot numbers instead; when message_ids is given without an explicit slots, it's inferred from those messages' own slot numbers, so 'fix this one M1' only touches that M1, not the M2/M3 next to it. Untouched slots are never reworded or re-scored. Rewrites pass the same hard-fail QA gate as fresh drafts, scoped to the slots being rewritten: a rewrite is skipped (not saved) if it introduces a hard fail anywhere or leaves one on a slot it touched; hard fails that already sat on untouched slots do not block it and are listed in the summary so you can rewrite those slots next. People run a few at a time; a rewrite too big to finish while the call waits (wait_ms) keeps going in the background and answers status running with a job_id: read its real counts (rewritten, skipped with reasons, left) with get_rewrite_job. Pass dry_run=true to see cost_preview (model calls, no credits) before committing. A whole-campaign call targets only people with an unsent draft in those slots. A summary that starts 'Nothing was rewritten' changed no draft: report that plainly with its reason and any setup cause it names, propose the fix, and never call it done.
Request
curl -X POST "https://sayintel.com/api/public/v1/campaigns/<campaign_id>/rewrites" \
-H "Authorization: Bearer $SAYINTEL_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"instruction": "<instruction>"}'Try it out
Sent as a bearer token to this site only, and kept in this tab's session storage. It is never written to disk or sent anywhere else.
Path parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| campaign_id | path | string | yes | — |
Body
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| instruction | body | string | yes | — |
| speaker_ids | body | array | no | — |
| message_ids | body | array | no | — |
| slots | body | array | no | Restrict the rewrite to these slot numbers (1=M1, 2=M2, 3=M3). Omit to rewrite every slot the speaker has. When message_ids is given and this is omitted, it's inferred from those messages' own slots. |
| wait_ms | body | number | no | Wait this long inline before answering with a job_id (default 30000; 20000 in Q's chat). |
| dry_run | body | boolean | no | When true nothing is written, started, or spent. The tool returns only cost_preview so an agent can estimate credits first. |
| idempotency_key | body | string | no | Optional retry guard. Reusing the same key with the same arguments replays the first result instead of running the action twice; reusing it with different arguments is rejected. |
| workspace | body | string | no | Optional. Make this change on another account where you hold an ADMIN seat on the whole account: pass the workspace_id that list_workspaces returns. Omit to use your own account. Refused for viewer and member seats and for client or conference seats. Never sends. |
| acting_account | body | string | no | Which sayintel login this call acts on: an account_id or email from list_accounts. Required once logins are linked to this connection. |
Response
{
"ok": true,
"tool": "request_rewrite",
"kind": "write",
"data": { ... },
"error": null
}Notes
- Scope required: write. How scopes work.
- Accepts Idempotency-Key. A retry with the same key replays the first result instead of repeating the work.
- Accepts dry_run: true and always returns cost_preview before spending anything.
- Same capability over MCP as the tool request_rewrite. MCP setup.