---
title: "Write Cs Agent Draft"
method: POST
path: "/api/rooster/cs/tickets/{ticket_id}/agent-draft"
tags: ["rooster"]
---

# Write Cs Agent Draft

`POST /api/rooster/cs/tickets/{ticket_id}/agent-draft`

## Request

- Base URL: `https://api.pigeonly.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pigeonly.com/api/rooster/cs/tickets/{ticket_id}/agent-draft`
- Auth: none declared

Dumb persist: writes `body.text`, composed entirely by the calling
agent, as an unsent `ticket_messages` row. Calls NO model -- see
app/modules/rooster/agent_draft.py. Idempotent the same way
draft_cs_reply is: if this ticket already carries an unsent agent draft,
that draft is returned as-is (`created: false`) and no second row is
ever stacked.

`prepared_act` (rule CS-65): checked first (422, nothing written, when it is refused), then
recorded beside the draft. On a reused draft the existing draft's own act stands and this
call's is dropped, the same way a re-supplied `text` and `proposed_status` already are.

## Path parameters

- `ticket_id` string, uuid, required

## Request body

- AgentDraftRequest
  - `text` string, required
  - `agent_provider` string, nullable
  - `agent_model` string, nullable
  - `agent_harness` string, nullable
  - `proposed_status` 'open' | 'waiting_on_customer' | 'resolved', nullable
  - `proposed_status_reason` string, nullable
  - `prepared_act` PreparedActRequest, nullable: An account act Rooster prepares WITH his draft (Frederick, 2026-10-22, issue #6922, rule CS-65: "let's have him create drafts and then they submit it"). Nothing is performed here: a person's Submit performs it, with the caps. `params` are the kind's own fields from the lookup's `acts_you_may_prepare` (a real invoice, send or plan of the customer); `reason` is what the person reads beside it.
    - `kind` string, required
    - `params` object
    - `reason` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-23** `fe4631f8863e`: 1 info
  - added the new optional request property `prepared_act`

[Operation history](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/changes/api/rooster/cs/tickets/:ticket_id/agent-draft/post.md)

---

[API](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os.md) - [All operations](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/llms.txt) - [OpenAPI document](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/revisions/14571c4b7007?raw)
