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

# SendLayer Developer Documentation

> Send transactional email with the SendLayer API, SDKs, CLI and AI tools. Start here to find the quickstart, guides and the API reference.

Email API, SDKs and AI toolsSend transactional email from your app in minutesSend order confirmations, password resets and notifications with the REST API or an SDK for Node.js, Python, PHP, Ruby or Go. Then track delivery with events and webhooks.

[Read the quickstart](https://developers.sendlayer.com/quickstart/introduction.md)
[Browse the API reference](https://developers.sendlayer.com/api-reference/introduction.md)

## Send your first email

**1. Authorize your sending domain**

[Authorize your domain](https://sendlayer.com/docs/authorizing-your-domain/) in SendLayer. This proves that you own it and helps your email reach the inbox.

**2. Get your API key**

Create or copy an API key in your SendLayer account. See [managing API keys](https://sendlayer.com/docs/managing-api-keys/).

**3. Install an SDK and send**

```javascript Node.js theme={null}
// npm install sendlayer
import { SendLayer } from 'sendlayer';

const sendlayer = new SendLayer('your-api-key');

await sendlayer.Emails.send({
  from: 'sender@example.com',
  to: 'recipient@example.com',
  subject: 'Test Email',
  text: 'This is a test email'
});
```

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

sendlayer = SendLayer("your-api-key")

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
// composer require sendlayer/sendlayer-php
require_once 'vendor/autoload.php';

use SendLayer\SendLayer;

$sendlayer = new SendLayer('your-api-key');

$sendlayer->Emails->send(
  from: 'sender@example.com',
  to: 'recipient@example.com',
  subject: 'Test Email',
  text: 'This is a test email'
);
```

```ruby Ruby theme={null}
# gem install sendlayer
require 'sendlayer'

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

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

```go Go theme={null}
// go get github.com/sendlayer/sendlayer-go
package main

import (
	"fmt"
	"log"

	"github.com/sendlayer/sendlayer-go"
)

func main() {
	sl := sendlayer.New("your-api-key")

	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": { "email": "sender@example.com" },
  "To": [{ "email": "recipient@example.com" }],
  "Subject": "Test Email",
  "ContentType": "Text",
  "PlainContent": "This is a test email"
}'
```

The [quickstart](https://developers.sendlayer.com/quickstart/introduction.md) walks through each step in more detail.

## Build with AI

Connect SendLayer to the AI tools you already use.

> [card] [MCP server](https://developers.sendlayer.com/integrations/ai-tools/mcp-server.md)
>
> Send email, check delivery and manage webhooks from Claude, ChatGPT, Cursor and other assistants.

> [card] [CLI](https://developers.sendlayer.com/integrations/ai-tools/cli.md)
>
> Send email, query events and test webhooks from your terminal or CI pipeline.

> [card] [Agent Skills](https://developers.sendlayer.com/integrations/ai-tools/agent-skills.md)
>
> Teach coding agents such as Claude Code, Cursor and Codex to write correct SendLayer code.

## SDKs

> [card] [Node.js](https://developers.sendlayer.com/sdks/nodejs/introduction.md)
>
> Next.js, Express.js, Nuxt

> [card] [Python](https://developers.sendlayer.com/sdks/python/introduction.md)
>
> Flask, FastAPI

> [card] [PHP](https://developers.sendlayer.com/sdks/php/introduction.md)
>
> Laravel

> [card] [Ruby](https://developers.sendlayer.com/sdks/ruby/send-with-ruby.md)
>
> Ruby on Rails

> [card] [Go](https://developers.sendlayer.com/sdks/go/send-with-go.md)
>
> Go modules

> [card] [Install an SDK](https://developers.sendlayer.com/quickstart/installation.md)
>
> Every package manager

## Guides

&#x20;Sending email

<ul>
  <li>[Send an email →](https://developers.sendlayer.com/guides/send-email.md)</li>
  <li>[Send to multiple recipients, CC and BCC →](https://developers.sendlayer.com/guides/send-email-to-multiple-recipients.md)</li>
  <li>[Send attachments →](https://developers.sendlayer.com/guides/send-email-with-attachments.md)</li>
</ul>

&#x20;Tracking delivery

<ul>
  <li>[Retrieve email events →](https://developers.sendlayer.com/guides/get-events.md)</li>
  <li>[Manage webhooks →](https://developers.sendlayer.com/guides/manage-webhooks.md)</li>
</ul>

## API reference

All requests go to `https://console.sendlayer.com/api/v1/` and authenticate with your API key in an `Authorization: Bearer <apiKey>` header.

| Method | Endpoint | What it does |
| - | - | - |
| POST | [`/email`](https://developers.sendlayer.com/api-reference/endpoint/email) | Send an email |
| GET | [`/events`](https://developers.sendlayer.com/api-reference/endpoint/events) | Get the delivery events of your email |
| GET | [`/webhooks`](https://developers.sendlayer.com/api-reference/endpoint/webhooks/get) | List your webhooks |
| POST | [`/webhooks`](https://developers.sendlayer.com/api-reference/endpoint/webhooks/post) | Create a webhook |
| DELETE | [`/webhooks/{id}`](https://developers.sendlayer.com/api-reference/endpoint/webhooks/delete) | Delete a webhook |

See also [error codes](https://developers.sendlayer.com/api-reference/error-codes.md) and [rate limits](https://developers.sendlayer.com/api-reference/rate-limit.md).

## Resources

> [card] [Changelog](https://developers.sendlayer.com/changelog.md)

> [card] [Help docs](https://sendlayer.com/docs)

> [card] [Contact support](https://sendlayer.com/contact/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.