Skip to main content

Senderr API Reference

Welcome to the Senderr API! Our RESTful API enables you to programmatically access your email template library, render templates with custom variables, and send emails using your purchased or created templates.

Base URL

All API requests should be made to:
https://senderr.dev/api/v1
For development and testing:
http://localhost:3000/api/v1

Authentication

Senderr API supports two authentication methods: Include your API key in the request header:
curl -H "X-API-Key: your-api-key-here" \
     https://senderr.dev/api/v1/library
Or using the Authorization header:
curl -H "Authorization: Bearer your-api-key-here" \
     https://senderr.dev/api/v1/library

2. Session Authentication (Browser-based)

When making requests from a logged-in browser session, authentication is handled automatically via secure HTTP-only cookies.

Getting Your API Key

  1. Log in to your Senderr Dashboard
  2. Navigate to Settings → API Keys
  3. Click “Generate New API Key”
  4. Copy and securely store your key
API keys provide full access to your account. Keep them secure and never expose them in client-side code.

Rate Limits

API usage is limited based on your subscription plan:
PlanMonthly API CallsEmail Sending
Free500 calls/month100 emails/month
MonthlyUnlimited10,000 emails/month
AnnualUnlimited50,000 emails/month
Rate limit information is included in response headers:
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 450
X-RateLimit-Reset: 2024-02-01T00:00:00Z
X-RateLimit-Plan: free

Error Handling

The API uses conventional HTTP response codes and returns JSON error responses:
{
  "error": "Template not found",
  "message": "This template is not in your library",
  "success": false,
  "code": "TEMPLATE_NOT_FOUND"
}

Common HTTP Status Codes

CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Access denied (template not purchased)
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Pagination

List endpoints support pagination using limit and offset parameters:
curl "https://senderr.dev/api/v1/library?limit=20&offset=40" \
     -H "X-API-Key: your-api-key"

SDKs and Libraries

Official SDKs are coming soon. For now, you can use any HTTP client library in your preferred programming language.

Quick Start Examples

const senderr = {
  apiKey: 'your-api-key',
  baseUrl: 'https://senderr.dev/api/v1',

  async request(endpoint, options = {}) {
    const response = await fetch(`${this.baseUrl}${endpoint}`, {
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': this.apiKey,
        ...options.headers
      },
      ...options
    });
    return response.json();
  },

  // Get your template library
  async getLibrary() {
    return this.request('/library');
  },

  // Send an email
  async sendEmail(templateId, to, subject, variables) {
    return this.request('/send', {
      method: 'POST',
      body: JSON.stringify({
        template_id: templateId,
        to,
        subject,
        variables
      })
    });
  }
};

// Usage
const library = await senderr.getLibrary();
console.log(`You have ${library.templates.length} templates`);

Next Steps

Support

Need help with the API? Contact our support team: