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

# Quickstart

> Learn how to quickly setup and use SendLayer SDKs

## Overview

SendLayer API provides a playground for developers to interact with various endpoints and send API requests. With the API, you can send emails, create and manage webhooks. Additionally, you can retrieve and monitor events related to your SendLayer account.

Before you can use the SendLayer API, you'll need to [authorize your domain]('https://sendlayer.com/docs/authorizing-your-domain/). Domain verification is an important steps and it helps proves domain ownership and improves email deliverability.

After authorizing your domain, you'll need to create/retrieve your [API key]('https://sendlayer.com/docs/managing-api-keys/'). An API key is used to authenticate API requests.

### Installation

Run the command below to install the SendLayer SDK:

<CodeGroup>
  ```bash javascript theme={null}
  npm install sendlayer
  ```

  ```bash python theme={null}
  pip install sendlayer
  ```

  ```bash php theme={null}
  composer require sendlayer/sendlayer-php
  ```

  ```bash ruby theme={null}
  gem install sendlayer
  ```

  ```bash go theme={null}
  go get github.com/sendlayer/sendlayer-go
  ```
</CodeGroup>

### Sending an Email

Once, you've installed the SDK, you can import it directly into your codebase and interact with the API. Here's an example of how to send an email using the SendLayer API:

<CodeGroup>
  ```javascript JavaScript theme={null}
  import { SendLayer } from 'sendlayer';

  // Initialize the email client
  const sendlayer = new SendLayer('your-api-key');

  const params = {
    from: 'sender@example.com',
    to:'recipient@example.com', // or array of recipients
    subject: 'Test Email',
    text: 'This is a test email'
  }

  // Send a simple email
  const response = await sendlayer.Emails.send(params);
  ```

  ```python Python theme={null}
  from sendlayer import SendLayer

  # Initialize the email client with your API key
  sendlayer = SendLayer("your-api-key")

  # Send an email
  response = sendlayer.Emails.send(
      sender="sender@example.com",
      to="recipient@example.com",
      subject="Test Email",
      text="This is a test email"
  )
  ```

  ```php PHP theme={null}
  <?php
  require_once 'vendor/autoload.php';

  use SendLayer\SendLayer;

  // Initialize the email client with your API key
  $sendlayer = new SendLayer('your-api-key');

  // Send an email
  $response = $sendlayer->Emails->send([
    'from' => 'sender@example.com',
    'to' => 'recipient@example.com',
    'subject' => 'Test Email',
    'text' => 'This is a test email'
  ]);
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'sendlayer'

  sendlayer = SendLayer::SendLayer.new('your-api-key')

  response = sendlayer.emails.send(
    from: 'sender@example.com',
    to: 'recipient@example.com',
    subject: 'Test Email',
    text: 'This is a test email'
  )
  ```

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

  import (
  	"fmt"
  	"log"
  	"github.com/sendlayer/sendlayer-go"
  )

  func main() {
  	// Initialize the email client with your API key
  	sl := sendlayer.New("your-api-key")

  	// Send an email
  	resp, err := sl.Emails.Send(&sendlayer.SendEmailRequest{
  		From:    "sender@example.com",
  		To:      "recipient@example.com",
  		Subject: "Test Email",
  		Text:    "This is a test email",
  	})
  	if err != nil {
  		log.Fatal(err)
  	}

  	fmt.Println("Email sent! Message ID:", resp.MessageID)
  }
  ```

  ```bash cURL theme={null}
  curl --request POST \
    --url https://console.sendlayer.com/api/v1/email \
    --header 'Authorization: Bearer <apiKey>' \
    --header 'Content-Type: application/json' \
    --data '{
    "From": {
      "name": "Paulie Paloma",
      "email": "paulie@example.com"
    },
    "To": [
      {
        "name": "Pattie Paloma",
        "email": "pattie@exampledomain.com"
      }
    ],
    "Subject": "This is the email subject",
    "ContentType": "HTML",
    "HTMLContent": "<html><body><p>This is a test email sent with the <a href=\"https://sendlayer.com\">SendLayer</a> API!</p></body></html>"
  }'
  ```
</CodeGroup>

<Warning>If you're using the `cURL` option, make sure to replace `<apiKey>` with your SendLayer API key in the request header.</Warning>

SendLayer API also allows you to send emails to [multiple recipients](/guides/send-email-to-multiple-recipients), include BCC and CC addresses, [attach files](/guides/send-email-with-attachments) to your email messages.

<Note>See our guide to learn more about [sending emails using SendLayer API](/guides/send-email).</Note>

## Client SDKs

SendLayer offers SDK libraries for popular programming languages that simplify the process of integrating with the API. We currently offer/support the following SDKs:

<CardGroup cols={2}>
  <Card title="Node.js" icon="node-js" href="/sdks/nodejs">
    Learn how to use the SendLayer's Node.js SDK
  </Card>

  <Card title="Python" icon="python" href="/sdks/python">
    Learn how to use SendLayer's Python SDK.
  </Card>

  <Card title="PHP" icon="php" href="/sdks/php">
    Learn how to use SendLayer's PHP SDK.
  </Card>

  <Card title="Ruby" icon="gem" href="/sdks/ruby/send-with-ruby">
    Learn how to use SendLayer's Ruby SDK.
  </Card>

  <Card title="Go" icon="golang" href="/sdks/go/send-with-go">
    Learn how to use SendLayer's Go SDK.
  </Card>
</CardGroup>
