Skip to main content

Overview

The AutoSend skill gives AI coding agents the context they need to send transactional emails, manage contacts, and use templates via the AutoSend REST API. Once installed, your AI agent can generate accurate integration code without any additional prompting. The skill is distributed through skills.sh and can be installed with a single command.

Installation

1

Run the install command

Run the following command in your project root:
npx skills add https://github.com/autosendhq/skills --skill AutoSend
This automatically detects your AI coding agent and installs the skill file in the correct location.
2

Set up your API key

Set your AutoSend API key as an environment variable:
export AUTOSEND_API_KEY=as_your_key_here
Or add it to your .env file:
.env
AUTOSEND_API_KEY=as_your_key_here
Get your API key from the API Keys page in your AutoSend dashboard under Settings > API Keys > Generate API Key.
3

Verify the installation

Ask your AI agent to send an email using AutoSend. It should generate code that uses the correct API endpoint, authentication, and request format without any additional prompting.Example prompt:
Send a welcome email to a new user using AutoSend. The user's email is in the `user.email` variable.

Supported Platforms

The AutoSend skill works with the following AI coding agents:
PlatformSkill File Location
Cursor.cursor/rules/autosend.mdc
Claude Code.claude/CLAUDE.md
Codex.codex/skills/
Antigravity.agent/skills/
Windsurf.windsurfrules
OpenCodeAgent-specific config
Gemini CLIAgent-specific config
GitHub CopilotAgent-specific config
AmpAgent-specific config
Kimi CLIAgent-specific config
The npx skills add command automatically detects which agent you’re using and places the skill file in the right location.

Sample Prompts

After installing the skill, your AI coding agent has full context about the AutoSend API. Here are some prompts to get started:
Send a welcome email to new users after signup using AutoSend.
When a user registers, save their contact info to AutoSend with their name and email
so we can send them marketing campaigns later.
Create an API route that sends an order confirmation email using an AutoSend template
with dynamic variables for orderNumber, customerName, and orderTotal.
Add a function to upsert a contact in AutoSend whenever a user updates their profile,
and add them to the "newsletter" list.

Prerequisites

Before using the AutoSend API in your project, make sure you have:
1

Create an AutoSend account

Sign up at autosend.com to get started.
2

Add a sending domain

Go to Settings > Domains > Add Domain and select your AWS region.
3

Configure DNS records

Copy the generated DNS records (DKIM, SPF, DMARC) and add them to your DNS provider.
4

Verify domain ownership

Click Verify Ownership in the AutoSend dashboard. Wait 5–30 minutes for the status to turn green. See the domain setup guide for details.
5

Generate an API key

Go to Settings > API Keys > Generate API Key in your AutoSend dashboard.
6

Set the environment variable

export AUTOSEND_API_KEY=as_your_key_here

What’s Included

The skill provides your AI agent with full context about the AutoSend API, including authentication, endpoints, request/response formats, and error handling.

Authentication

DetailValue
Base URLhttps://api.autosend.com/v1
Auth HeaderAuthorization: Bearer YOUR_API_KEY
Content-Typeapplication/json (required for all POST/PUT requests)

Email Operations

Send Email — POST /v1/mails/send

Send a single transactional email.
ParameterTypeRequiredDescription
fromobjectYesSender — { "email": "...", "name": "..." }
toobjectYesRecipient — { "email": "...", "name": "..." }
subjectstringYesEmail subject line
htmlstringNoHTML body
textstringNoPlain text body
templateIdstringNoTemplate ID (replaces html/text)
dynamicDataobjectNoTemplate variable substitutions
ccarrayNoCC recipients — [{ "email": "...", "name": "..." }]
bccarrayNoBCC recipients — [{ "email": "...", "name": "..." }]
replyToobjectNoReply-to address — { "email": "...", "name": "..." }
attachmentsarrayNoFile attachments — [{ "filename": "...", "content": "..." }]
Response:
{
	"success": true,
	"data": { "emailId": "email_abc123" }
}

Send with Template — POST /v1/mails/send with templateId

Use a template instead of inline HTML, with dynamic variables for personalization.
ParameterTypeRequiredDescription
templateIdstringYesTemplate identifier
dynamicDataobjectNoKey-value pairs for template variables
Common template IDs:
TemplateIDTypical Variables
Order Confirmationtmpl_order_confirmationorderNumber, customerName, orderTotal, estimatedDelivery
Welcome Emailtmpl_welcomefirstName, activationLink, supportEmail
Password Resettmpl_password_resetresetLink, expiresIn
Example request:
{
	"from": { "email": "[email protected]", "name": "Your App" },
	"to": { "email": "[email protected]", "name": "Jane Doe" },
	"subject": "Welcome!",
	"templateId": "tmpl_welcome",
	"dynamicData": {
		"firstName": "Jane",
		"activationLink": "https://yourapp.com/activate"
	}
}

Bulk Send — POST /v1/mails/bulk

Send to up to 100 recipients in a single API call.
ParameterTypeRequiredDescription
fromobjectYesShared sender — { "email": "...", "name": "..." }
subjectstringNoShared subject (required unless template provides it)
htmlstringNoShared HTML body
textstringNoShared plain text body
templateIdstringNoTemplate ID for templated emails
dynamicDataobjectNoShared default template variables
recipientsarrayYesArray of recipient objects (max 100)
Recipient object:
ParameterTypeRequiredDescription
emailstringYesRecipient email address
namestringNoRecipient display name
dynamicDataobjectNoPer-recipient variables (overrides shared)
ccarrayNoPer-recipient CC
bccarrayNoPer-recipient BCC
Response:
{
	"success": true,
	"data": {
		"batchId": "batch_abc123",
		"totalRecipients": 2,
		"successCount": 2,
		"failedCount": 0
	}
}

Contact Management

Create Contact — POST /v1/contacts

ParameterTypeRequiredDescription
emailstringYesContact email address
firstNamestringNoContact first name
lastNamestringNoContact last name
userIdstringNoExternal user ID
listIdsarrayNoLists to add contact to — ["list_abc", "list_xyz"]
customFieldsobjectNoCustom field values
Response:
{
	"success": true,
	"data": {
		"id": "contact_abc123",
		"email": "[email protected]",
		"firstName": "Jane",
		"lastName": "Smith",
		"listIds": ["list_abc"],
		"customFields": {},
		"createdAt": "2025-01-15T00:00:00Z",
		"updatedAt": "2025-01-15T00:00:00Z"
	}
}

Get Contact — GET /v1/contacts/:id

ParameterTypeRequiredDescription
idstringYesContact ID (path parameter)
Response: Returns the full contact object (same shape as Create Contact response).

Upsert Contact — POST /v1/contacts/email

Creates a new contact or updates an existing one by email address. If the contact exists, it updates the record; otherwise it creates a new contact.
ParameterTypeRequiredDescription
emailstringYesContact email address
firstNamestringNoContact first name
lastNamestringNoContact last name
userIdstringNoExternal user ID
listIdsarrayNoLists to add contact to
customFieldsobjectNoCustom field values
Response: Returns the full contact object (same shape as Create Contact response).

Delete Contact — DELETE /v1/contacts/:id

ParameterTypeRequiredDescription
idstringYesContact ID (path parameter)
Response:
{
	"success": true
}

Error Codes

StatusCodeDescription
400VALIDATION_FAILEDBad request — missing or invalid parameters
401UNAUTHORIZEDInvalid or missing API key
402PAYMENT_REQUIREDPlan upgrade needed
403FORBIDDENInsufficient permissions
404NOT_FOUNDResource not found
429RATE_LIMIT_EXCEEDEDToo many requests — retry with backoff
500SERVER_ERRORInternal server error

Next Steps