# previewWorkflowAiText

Preview what an AI text step with this systemPrompt would write to 1 to 5 contacts, through the real generation path. Sends nothing and saves nothing; one model call per contact. Each result has generatedText, or a declineReason (the prompt's own rules said not to text them, a valid no-send), or an errorMessage.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "previewWorkflowAiText", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `systemPrompt`: `String!` (required)
- `contactIds`: `[ID!]!` (required)

## Response (data, an example)

```json
{
  "workflowAutomationsMutation": {
    "simulateWorkflowTextGeneration": [
      {
        "contactId": "<ID>",
        "contactName": "…",
        "generatedText": "…",
        "declineReason": "…",
        "errorMessage": "…"
      }
    ]
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "previewWorkflowAiText",
    "variables": {
      "systemPrompt": "<String>",
      "contactIds": [
        "<contactIds>"
      ]
    }
  }'
```
