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

# Create Email AI Agent

> Create email-based AI assistants for automated responses and recruiter workflows.

### Authorizations

<ParamField header="Authorization" type="string" required>
  Enter your ContactSwing JWT Bearer token.
</ParamField>

### Request Body

<ParamField body="name" type="string" required>
  Assistant display name. Example: `"My Email Agent"`
</ParamField>

<ParamField body="type" type="string" required>
  Assistant type: `"EMAIL"`
</ParamField>

<ParamField body="model" type="string" required>
  LLM model: `"cw-llm-1"`
</ParamField>

<ParamField body="instructions" type="string" required>
  Detailed recruiter instructions and candidate profiles
</ParamField>

<ParamField body="prompts" type="object">
  Agent prompts with `agent` and `goal`

  <ParamField body="agent" type="string" />

  <ParamField body="goal" type="string" />
</ParamField>

<ParamField body="kb_id" type="string">
  Knowledge base ID
</ParamField>

### Email-Specific Settings

<ParamField body="gen_ai_response" type="string">
  Response mode: `"SEMI_TOUCH"`
</ParamField>

<ParamField body="email_setup" type="string">
  Email role: `"Responder"`
</ParamField>

<ParamField body="labels" type="string">
  Email labels/categories
</ParamField>

<ParamField body="action_ids" type="string[]">
  Linked action IDs `[]`
</ParamField>

### Response

**201 Created** - Email assistant created successfully

<ResponseField name="ctx_id" type="string">Request context ID</ResponseField>

<ResponseField name="data" type="object">
  <ResponseField name="assistant_id" type="string">New assistant ID</ResponseField>
  <ResponseField name="name" type="string">Assistant name</ResponseField>
</ResponseField>

**400 Bad Request** - Invalid email configuration

**401 Unauthorized** - Invalid token
