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.

Getting Started

Before you can use the SendLayer API, you’ll need to authorize 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. An API key is used to authenticate API requests.

Installation

Run the command below to install the SendLayer SDK:

npm install sendlayer

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:

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);

SendLayer API also allows you to send emails to multiple recipients, include BCC and CC addresses, attach files to your email messages.

See our guide to learn more about sending emails using SendLayer API.

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: