# Draft a message with Neo

Writes a first pass at an email or text about one record and files it in the approval queue, unsent. Takes the record (definitionKey, rowId), a medium (email or sms), an intent saying what the message is for, the recipient, an optional tone (shorter, warmer or firmer), an optional note in the person's own words, and an optional templateId to rewrite from. The answer STREAMS as server-sent events and ends with the draft row's id, its subject and body, and any figure in the words the record's own facts do not support. It never sends: approving the draft and sending it are separate acts.

Access class: `workspace`.

## Endpoint

`POST /v1/comms/drafts/ai`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "definitionKey": "string",
    "intent": "string",
    "medium": "string",
    "merchantNotes": "string",
    "note": "string",
    "recipient": "string",
    "rowId": "",
    "templateId": 1,
    "tone": "string"
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
