# Email whoever holds a role on a deal

Queues an email to the member in one role on one DEAL — `opener` (the agent) or `closer` — read off the deal when the call is made, so a workflow written before a reassignment reaches the person who holds the deal now. `content` is required, `subject` and `content_html` optional, `account_identifier` names the sending inbox (the caller's default when empty). Goes through the same outbox and sending-inbox check as POST /v1/comms/send and answers the same {conversation, message}. A role nobody holds is a 400 naming the role; the caller must be able to see the row and the role's column. Deals only. `template_id` sends a workspace email template filled from this deal instead of `content`.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/rows/{rowId}/assignee/{role}/email`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| rowId | path | string | Yes |
| role | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "account_identifier": "string",
    "content": "string",
    "content_html": "string",
    "subject": "string",
    "template_id": 1
  },
  "params": {
    ":key": "string",
    ":role": "string",
    ":rowId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "conversation": {
    "account_identifier": "string",
    "contact_identifier": "string",
    "contact_name": "string",
    "contact_role": "string",
    "created_at": "string",
    "id": 1,
    "is_archived": true,
    "is_muted": true,
    "is_pinned": true,
    "is_starred": true,
    "last_message_at": "string",
    "last_message_direction": "string",
    "last_message_preview": "string",
    "medium": "string",
    "ownerAccountId": "",
    "records": [
      {
        "definition_id": "",
        "definition_key": "string",
        "linked_at": "string",
        "name": "string",
        "row_id": "",
        "status": "string",
        "status_label": "string",
        "status_tone": "string"
      }
    ],
    "subject": "string",
    "unread_count": 1,
    "visibility": "string"
  },
  "message": {
    "call": {
      "ai_summary": "string",
      "answered_at": "string",
      "duration_seconds": 1,
      "ended_at": "string",
      "provider": "string",
      "recording_count": 1,
      "recording_url": "string",
      "result": "string",
      "started_at": "string",
      "transcript": "string"
    },
    "content": "string",
    "content_html": "string",
    "conversation_id": 1,
    "delivered_at": "string",
    "delivery": {
      "attempts": 1,
      "claimed_at": "string",
      "claimed_by": "string",
      "error": "string",
      "next_attempt_at": "string",
      "settled_at": "string",
      "state": "string"
    },
    "direction": "string",
    "external_id": "",
    "id": 1,
    "is_deleted": true,
    "medium": "string",
    "occurred_at": "string",
    "parent_message_id": 1,
    "read_at": "string",
    "recorded_at": "string",
    "sender_id": 1,
    "sender_name": "string",
    "sender_type": "string",
    "status": "string",
    "subject": "string",
    "text": {
      "error_code": "string",
      "error_message": "string",
      "media_count": 1,
      "provider": "string",
      "segment_count": 1
    }
  }
}
```

### 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"
}
```
