> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replyify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate AI Draft

> Use AI to generate a follow-up email draft

Uses AI to generate a draft follow-up email based on the conversation history, contact context, client service description, and calendar availability.

**Consumes 1 AI credit** per generation (including regeneration).

## Path Parameters

<ParamField path="id" type="string" required>
  The follow-up ID to generate a draft for
</ParamField>

## Response

<ResponseField name="success" type="boolean">Whether the generation was successful</ResponseField>
<ResponseField name="ai_generated_message" type="string">The generated email draft</ResponseField>
<ResponseField name="to_emails" type="array">Recipient email addresses</ResponseField>
<ResponseField name="next_follow_up_time" type="string">AI-suggested next follow-up time</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://app.replyify.ai/api/follow-ups/fu_abc123/generate" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://app.replyify.ai/api/follow-ups/fu_abc123/generate",
    {
      method: "POST",
      headers: { Authorization: "Bearer YOUR_API_KEY" },
    }
  );
  const { ai_generated_message } = await response.json();
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "success": true,
  "ai_generated_message": "Hi John, wanted to circle back on our conversation about project management tools...",
  "to_emails": [
    { "name": "John Smith", "email_address": "john@example.com" }
  ],
  "cc_emails": [],
  "next_follow_up_time": "2025-02-05T09:30:00-05:00"
}
```

<Info>
  Regenerating a draft for the same follow-up consumes another AI credit. The new draft replaces the previous one.
</Info>
