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

# Quickstart

> Send your first emails with AutoSend email API in less than 10 minutes.

export const APP_PATHS = {
  home: '/',
  quickstart: '/quickstart',
  domainConfiguration: '/domain',
  apiReference: '/api-reference',
  sendEmail: '/api-reference/mails/send',
  bulkSendEmail: '/api-reference/mails/bulk',
  upsertContactApiRef: '/api-reference/contacts/upsert-contact',
  transactional: '/transactional-emails',
  emailActivity: '/transactional-emails/email-activity',
  emailTemplates: '/transactional-emails/email-templates',
  sendingEmail: '/quickstart/email-using-api',
  transactionalTroubleshooting: '/transactional-emails/troubleshooting',
  marketing: '/marketing-emails',
  campaigns: '/marketing-emails/campaigns',
  contacts: '/marketing-emails/contacts',
  contactsIntroduction: '/marketing-emails/contacts/introduction',
  contactsImportCsv: '/marketing-emails/contacts/import-csv',
  contactsLists: '/marketing-emails/contacts/lists',
  contactsSegments: '/marketing-emails/contacts/segments',
  contactsCustomFields: '/marketing-emails/contacts/contact-properties',
  contactsContactProperties: '/marketing-emails/contacts/contact-properties',
  createContactPropertyApiRef: '/api-reference/contact-properties/create',
  listContactPropertiesApiRef: '/api-reference/contact-properties/list',
  getContactPropertyApiRef: '/api-reference/contact-properties/get-by-name',
  deleteContactPropertyApiRef: '/api-reference/contact-properties/delete',
  sender: '/marketing-emails/sender',
  unsubscribeGroups: '/others/unsubscribe-groups',
  webhookIntroduction: '/others/webhooks/introduction',
  webhookEventType: '/others/webhooks/event-type',
  webhookRetries: '/others/webhooks/retries',
  webhookVerifyRequests: '/others/webhooks/verify-requests',
  dynamicTemplates: '/dynamic-templates',
  guides: '/guides',
  sitemap: '/sitemap.xml',
  team: '/others/team',
  automations: '/automations',
  events: '/automations/events',
  sendEventApi: '/api-reference/events/send-event',
  smtpIntroduction: '/quickstart/smtp',
  betterAuth: '/guides/better-auth',
  convexGuide: '/guides/convex',
  templateVariables: '/transactional-emails/variables',
  suppressions: '/others/suppressions',
  rateLimit: '/api-reference/rate-limit',
  nodejsSdk: '/sdk/nodejs',
  smtpIntegrationGuides: '/guides/smtp',
  apiKeys: '/api-keys',
  encryptedPayloads: '/others/encrypted-payloads',
  apiReferenceIntroduction: '/api-reference/introduction',
  lovableGuide: '/ai/integrations/lovable',
  aiIntroduction: '/ai/introduction',
  aiSkills: '/ai/skills',
  aiMcpServer: '/ai/mcp-server',
  aiLovable: '/ai/integrations/lovable',
  aiBolt: '/ai/integrations/bolt',
  aiV0: '/ai/integrations/v0',
  aiReplit: '/ai/integrations/replit',
  mcpClaude: '/ai/mcp-clients/claude',
  mcpCursor: '/ai/mcp-clients/cursor',
  mcpCopilot: '/ai/mcp-clients/copilot',
  mcpWindsurf: '/ai/mcp-clients/windsurf',
  mcpCodex: '/ai/mcp-clients/codex',
  mcpAntigravity: '/ai/mcp-clients/antigravity',
  mcpChatgpt: '/ai/mcp-clients/chatgpt',
  mcpRaycast: '/ai/mcp-clients/raycast',
  domainWarmup: '/marketing-emails/domain-warmup',
  projects: '/projects',
  createAutomationApi: '/api-reference/automations/create-automation',
  migrationSendgrid: '/migration/sendgrid',
  migrationResend: '/migration/resend',
  auth0CustomAction: '/guides/auth0-custom-action',
  accountBilling: '/others/account/billing',
  accountUsage: '/others/account/usage',
  inboundIntroduction: '/inbound/introduction',
  listInboundMessagesApi: '/api-reference/inbound-emails/list-messages',
  getInboundMessageApi: '/api-reference/inbound-emails/get-message',
  downloadInboundAttachmentApi: '/api-reference/inbound-emails/download-attachment',
  replyToInboundMessageApi: '/api-reference/inbound-emails/reply-to-message',
  wikiDailySendingLimit: '/wiki/daily-sending-limit'
};

<Steps>
  <Step title="Add Sending Domain" titleSize="h3">
    Before sending emails, you need to verify ownership of your sending domain by adding DNS records. This ensures high deliverability and authenticates your emails.

    * Add your domain or subdomain (we recommend using a subdomain like `mail.yourdomain.com`)
    * Configure DNS records (DKIM, SPF, DMARC)
    * Verify domain ownership

    <a href={APP_PATHS.domainConfiguration} title="Domain Configuration ">Learn how to add a domain</a>
  </Step>

  <Step title="Generate API Keys" titleSize="h3">
    Create secure API keys to authenticate your requests to the AutoSend API. Each key can be named for easy management (e.g., "Production", "Staging", "Marketing").

    * Generate API keys from your dashboard.
    * Copy and securely store your secret key.
    * Use the key in your API requests.

    <a href={APP_PATHS.apiKeys} title="Domain Configuration ">See authentication guide</a>
  </Step>

  <Step title="Send Your First Email" titleSize="h3">
    With your domain verified and API key ready, you can start sending emails immediately using our REST API.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://api.autosend.com/v1/mails/send \
       -H "Authorization: Bearer YOUR_API_KEY" \
       -H "Content-Type: application/json" \
       -d '{
      "to": {
      "email": "customer@example.com",
      "name": "Jane Doe"
      },
      "from": {
      "email": "hello@mail.yourdomain.com",
      "name": "Your Company"
      },
      "subject": "Welcome to Our Platform!",
      "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>"
      }'
      ```

      ```javascript NodeJS theme={null}
      fetch("https://api.autosend.com/v1/mails/send", {
        method: "POST",
        headers: {
          "Authorization": "Bearer YOUR_API_KEY", // Replace with your API key
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          from: {
            email: "no-reply@example.com",
            name: "AutoSend",
          },
          to: {
            email: "user@example.com",
            name: "Test User",
          },
          subject: "Welcome to AutoSend 🎉",

          // Option 1: Send using template
          templateId: "your_template_id",

          // Option 2: Send using raw HTML or text
          html: "<h1>Hello User</h1><p>Thanks for joining AutoSend!</p>",
          text: "Hello User, Thanks for joining AutoSend!",

          // Optional: Unsubscribe group for compliance
          unsubscribeGroupId: "12345",
        }),
      })
        .then((response) => response.json())
        .then((data) => {
          console.log(" Email sent successfully: ", data);
        })
        .catch((error) => {
          console.error("Error sending email:", error);
        });
      ```

      ```rust Rust theme={null}
      use reqwest::header::{AUTHORIZATION, CONTENT_TYPE};
      use serde_json::json;
      use tokio;

      #[tokio::main]
      async fn main() -> Result<(), Box<dyn std::error::Error>> {
          // API endpoint
          let url = "https://api.autosend.com/v1/mails/send";

          // Build request JSON payload
          let payload = json!({
              "from": {
                  "email": "no-reply@example.com",
                  "name": "AutoSend"
              },
              "to": {
                  "email": "user@example.com",
                  "name": "Test User"
              },
              "subject": "Welcome to AutoSend 🎉",
              // Option 1: template
              "templateId": "your_template_id",
              // Option 2: raw HTML / text
              "html": "<h1>Hello User</h1><p>Thanks for joining AutoSend!</p>",
              "text": "Hello User,
      Thanks for joining AutoSend!",
              // Optional: unsubscribe group
              "unsubscribeGroupId": "12345"
          });

          // Create HTTP client
          let client = reqwest::Client::new();

          // Send POST request
          let res = client
              .post(url)
              .header(AUTHORIZATION, "Bearer YOUR_API_KEY") // replace with your key
              .header(CONTENT_TYPE, "application/json")
              .json(&payload)
              .send()
              .await?;

          // Print response
          let status = res.status();
          let body = res.text().await?;
          println!("Status: {}", status);
          println!("Body: {}", body);

          Ok(())
      }
      ```

      ```go Go theme={null}
      package main

      import (
      	"bytes"
      	"encoding/json"
      	"fmt"
      	"io/ioutil"
      	"net/http"
      )

      func main() {
      	url := "https://api.autosend.com/v1/mails/send"

      	// Build request body
      	payload := map[string]interface{}{
      		"from": map[string]string{
      			"email": "no-reply@example.com",
      			"name":  "AutoSend",
      		},
      		"to": map[string]string{
      			"email": "user@example.com",
      			"name":  "Test User",
      		},
      		"subject": "Welcome to AutoSend 🎉",

      		// Option 1: Send using template
      		"templateId": "your_template_id",

      		// Option 2: Send using raw HTML or text
      		"html": "<h1>Hello User</h1><p>Thanks for joining AutoSend!</p>",
      		"text": "Hello User,
      Thanks for joining AutoSend!",

      		// Optional: Unsubscribe group for compliance
      		"unsubscribeGroupId": "12345",
      	}

      	jsonData, err := json.Marshal(payload)
      	if err != nil {
      		fmt.Println("Error marshalling JSON:", err)
      		return
      	}

      	// Create request
      	req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      	if err != nil {
      		fmt.Println("Error creating request:", err)
      		return
      	}

      	req.Header.Set("Authorization", "Bearer YOUR_API_KEY") // Replace with real API key
      	req.Header.Set("Content-Type", "application/json")

      	// Send request
      	client := &http.Client{}
      	resp, err := client.Do(req)
      	if err != nil {
      		fmt.Println("Error sending request:", err)
      		return
      	}
      	defer resp.Body.Close()

      	// Read response
      	body, err := ioutil.ReadAll(resp.Body)
      	if err != nil {
      		fmt.Println("Error reading response:", err)
      		return
      	}

      	fmt.Println("Response status:", resp.Status)
      	fmt.Println("Response body:", string(body))
      }
      ```

      ```php PHP theme={null}
      <?php

      $url = "https://api.autosend.com/v1/mails/send";

      $data = [
          "from" => [
              "email" => "no-reply@example.com",
              "name"  => "AutoSend"
          ],
          "to" => [
              "email" => "user@example.com",
              "name"  => "Test User"
          ],
          "subject" => "Welcome to AutoSend 🎉",

          // Option 1: Send using template
          "templateId" => "your_template_id",

          // Option 2: Send using raw HTML or text
          "html" => "<h1>Hello User</h1><p>Thanks for joining AutoSend!</p>",
          "text" => "Hello User,
      Thanks for joining AutoSend!",

          // Optional: Unsubscribe group for compliance
          "unsubscribeGroupId" => "12345"
      ];

      $ch = curl_init($url);

      curl_setopt($ch, CURLOPT_HTTPHEADER, [
          "Authorization: Bearer YOUR_API_KEY", // replace with your API key
          "Content-Type: application/json"
      ]);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

      $response = curl_exec($ch);

      if(curl_errno($ch)){
          echo "Curl error: " . curl_error($ch);
      } else {
          echo "Response: " . $response;
      }

      curl_close($ch);
      ```

      ```c# C# theme={null}
      using System;
      using System.Net.Http;
      using System.Net.Http.Headers;
      using System.Text;
      using System.Threading.Tasks;
      using Newtonsoft.Json; // Install Newtonsoft.Json via NuGet

      class Program
      {
          static async Task Main(string[] args)
          {
              var url = "https://api.autosend.com/v1/mails/send";

              var payload = new
              {
                  from = new { email = "no-reply@example.com", name = "AutoSend" },
                  to = new { email = "user@example.com", name = "Test User" },
                  subject = "Welcome to AutoSend 🎉",

                  // Option 1: Template
                  templateId = "your_template_id",

                  // Option 2: Raw HTML / text
                  html = "<h1>Hello User</h1><p>Thanks for joining AutoSend!</p>",
                  text = "Hello User,
      Thanks for joining AutoSend!",

                  // Optional unsubscribe group
                  unsubscribeGroupId = "12345"
              };

              using (var client = new HttpClient())
              {
                  client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");  // Replace with your API key

                  var json = JsonConvert.SerializeObject(payload);
                  var content = new StringContent(json, Encoding.UTF8, "application/json");

                  var response = await client.PostAsync(url, content);
                  var responseBody = await response.Content.ReadAsStringAsync();

                  Console.WriteLine($"Status: {response.StatusCode}");
                  Console.WriteLine($"Response: {responseBody}");
              }
          }
      }
      ```

      ```java Java theme={null}
      import java.io.OutputStream;
      import java.io.InputStream;
      import java.net.HttpURLConnection;
      import java.net.URL;
      import java.nio.charset.StandardCharsets;

      public class SendEmail {
          public static void main(String[] args) {
              try {
                  String url = "https://api.autosend.com/v1/mails/send";
                  URL obj = new URL(url);
                  HttpURLConnection con = (HttpURLConnection) obj.openConnection();

                  // Set request method and headers
                  con.setRequestMethod("POST");
                  con.setRequestProperty("Authorization", "Bearer YOUR_API_KEY"); // Replace with your API key
                  con.setRequestProperty("Content-Type", "application/json");
                  con.setDoOutput(true);

                  // JSON payload
                  String jsonPayload = """
                  {
                      "from": {"email": "no-reply@example.com", "name": "AutoSend"},
                      "to": {"email": "user@example.com", "name": "Test User"},
                      "subject": "Welcome to AutoSend 🎉",
                      
                      "templateId": "your_template_id",
                      
                      "html": "<h1>Hello User</h1><p>Thanks for joining AutoSend!</p>",
                      "text": "Hello User,\nThanks for joining AutoSend!",
                      
                      "unsubscribeGroupId": "12345"
                  }
                  """;

                  // Send request
                  try (OutputStream os = con.getOutputStream()) {
                      byte[] input = jsonPayload.getBytes(StandardCharsets.UTF_8);
                      os.write(input, 0, input.length);
                  }

                  // Read response
                  int status = con.getResponseCode();
                  InputStream responseStream = (status < HttpURLConnection.HTTP_BAD_REQUEST)
                          ? con.getInputStream()
                          : con.getErrorStream();

                  String response = new String(responseStream.readAllBytes(), StandardCharsets.UTF_8);
                  System.out.println("Status: " + status);
                  System.out.println("Response: " + response);

              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
      ```

      ```python Python theme={null}
      import requests

      url = "https://api.autosend.com/v1/mails/send"

      payload = {
          "from": {
              "email": "no-reply@example.com",
              "name": "AutoSend"
          },
          "to": {
              "email": "user@example.com",
              "name": "Test User"
          },
          "subject": "Welcome to AutoSend 🎉",

          # Option 1: Send using template
          "templateId": "your_template_id",

          # Option 2: Send using raw HTML or text
          "html": "<h1>Hello User</h1><p>Thanks for joining AutoSend!</p>",
          "text": "Hello User,
      Thanks for joining AutoSend!",

          # Optional: Unsubscribe group for compliance
          "unsubscribeGroupId": "12345"
      }

      headers = {
          "Authorization": "Bearer YOUR_API_KEY",  # Replace with your API key
          "Content-Type": "application/json"
      }

      response = requests.post(url, json=payload, headers=headers)

      print("Status Code:", response.status_code)
      print("Response:", response.text)
      ```
    </CodeGroup>
  </Step>
</Steps>
