> ## 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 Action

> Create email notification actions with Gmail integration.

### Authorizations

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

### Request Body

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

<ParamField body="description" type="string" required>
  Action purpose. Example: `Send email when user requests communication `
</ParamField>

<ParamField body="action_timing" type="string" required>
  When to trigger: `"DURING"`
</ParamField>

<ParamField body="type" type="string" required>
  Action type: `"SEND_EMAIL"`
</ParamField>

<ParamField body="webhook" type="object">
  Webhook configuration (optional)

  <ParamField body="mandatory" type="boolean" default="true">
    Send static content flag
  </ParamField>
</ParamField>

<ParamField body="email" type="object" required>
  Email configuration object

  <ParamField body="to" type="object" required>
    Recipient email addresses

    <ParamField body="value" type="string[]" required>
      Enter your message.
    </ParamField>
  </ParamField>

  <ParamField body="from" type="string" required>
    Sender email. Example: [tech.space.me@gmail.com](mailto:tech.space.me@gmail.com)
  </ParamField>

  <ParamField body="from_type" type="string" required>
    Email provider: `"gmail" `
  </ParamField>

  <ParamField body="user_id" type="string" required>
    User ID for authentication
  </ParamField>

  <ParamField body="cc" type="string">
    CC recipients (comma-separated)
  </ParamField>

  <ParamField body="bcc" type="string">
    BCC recipients (comma-separated)
  </ParamField>

  <ParamField body="subject" type="object" required>
    Email subject line

    <ParamField body="value" type="string" required>
      Enter your message.
    </ParamField>
  </ParamField>

  <ParamField body="body" type="object" required>
    Email content (HTML supported)
    <ResponseField name="value" type="string">"<p>Hello</p>"</ResponseField>

    <ParamField body="value" type="string" required>
      Enter your message.
    </ParamField>
  </ParamField>

  <ParamField body="attachment" type="object">
    File attachments {}
  </ParamField>

  <ParamField body="send_static_contect" type="boolean" default="true">
    Send static content flag
  </ParamField>

  <ParamField body="response_message_context" type="string" default="I’ve just sent you an email. Please let me know if you received it.">
    Response message context Example: `I’ve just sent you an email. Please let me know if you received it.`
  </ParamField>
</ParamField>

### Response

**201 Created** - Email action created successfully

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

<ResponseField name="data" type="object">
  <ResponseField name="action_id" type="string">New email action ID</ResponseField>
  <ResponseField name="name" type="string">Action name</ResponseField>
  <ResponseField name="type" type="string">"SEND\_EMAIL"</ResponseField>
</ResponseField>

**400 Bad Request** - Invalid email configuration

**401 Unauthorized** - Invalid token
