npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2026 – Pkg Stats / Ryan Hefner

sendx-javascript-sdk

v2.0.0

Published

# SendX REST API Documentation ## πŸš€ Introduction The SendX API is organized around REST principles. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response cod

Readme

SendX JavaScript SDK

πŸš€ Introduction

The SendX API is organized around REST principles. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Key Features:

  • πŸ”’ Security: Team-based authentication with optional member-level access
  • 🎯 Resource-Oriented: RESTful design with clear resource boundaries
  • πŸ“Š Rich Data Models: Three-layer model system (Input/Output/Internal)
  • πŸ”— Relationships: Automatic prefix handling for resource relationships
  • πŸ“ˆ Scalable: Built for high-volume email marketing operations

πŸ—οΈ Architecture Overview

SendX uses a three-layer model architecture:

  1. Input Models (RestE*): For API requests
  2. Output Models (RestR*): For API responses with prefixed IDs
  3. Internal Models: Core business logic (not exposed in API)

πŸ” Security & Authentication

SendX uses API key authentication:

Team API Key

X-Team-ApiKey: YOUR_TEAM_API_KEY
  • Required for all requests
  • Team-level access to resources
  • Available in SendX Settings β†’ Team API Key

πŸ†” Encrypted ID System

SendX uses encrypted IDs for security and better developer experience:

  • Internal IDs: Sequential integers (not exposed)
  • Encrypted IDs: 22-character alphanumeric strings
  • Prefixed IDs: Resource-type prefixes in API responses (contact_<22-char-id>)

ID Format

All resource IDs follow this pattern:

<resource_prefix>_<22_character_alphanumeric_string>

Example:

{
  "id": "contact_BnKjkbBBS500CoBCP0oChQ",
  "lists": ["list_OcuxJHdiAvujmwQVJfd3ss", "list_0tOFLp5RgV7s3LNiHrjGYs"],
  "tags": ["tag_UhsDkjL772Qbj5lWtT62VK", "tag_fL7t9lsnZ9swvx2HrtQ9wM"]
}

πŸ“š Resource Prefixes

| Resource | Prefix | Example | |----------|--------|---------| | Contact | contact_ | contact_BnKjkbBBS500CoBCP0oChQ | | Campaign | campaign_ | campaign_LUE9BTxmksSmqHWbh96zsn | | List | list_ | list_OcuxJHdiAvujmwQVJfd3ss | | Tag | tag_ | tag_UhsDkjL772Qbj5lWtT62VK | | Sender | sender_ | sender_4vK3WFhMgvOwUNyaL4QxCD | | Template | template_ | template_f3lJvTEhSjKGVb5Lwc5SWS | | Custom Field | field_ | field_MnuqBAG2NPLm7PZMWbjQxt | | Webhook | webhook_ | webhook_9l154iiXlZoPo7vngmamee | | Post | post_ | post_XyZ123aBc456DeF789GhI | | Post Category | post_category_ | post_category_YzS1wOU20yw87UUHKxMzwn | | Post Tag | post_tag_ | post_tag_123XyZ456AbC | | Member | member_ | member_JkL012MnO345PqR678 |

🎯 Best Practices

Error Handling

  • Always check status codes: 2xx = success, 4xx = client error, 5xx = server error
  • Read error messages: Descriptive messages help debug issues
  • Handle rate limits: Respect API rate limits for optimal performance

Data Validation

  • Email format: Must be valid email addresses
  • Required fields: Check documentation for mandatory fields
  • Field lengths: Respect maximum length constraints

Performance

  • Pagination: Use offset/limit for large datasets
  • Batch operations: Process multiple items when supported
  • Caching: Cache responses when appropriate

πŸ› οΈ SDKs & Integration

Official SDKs available for:

πŸ“ž Support

Need help? Contact us:

  • πŸ’¬ Website Chat: Available on sendx.io
  • πŸ“§ Email: [email protected]
  • πŸ“š Documentation: Full guides at help.sendx.io

API Endpoint: https://api.sendx.io/api/v1/rest

<img src="https://run.pstmn.io/button.svg" alt="Run In Postman" style="width: 128px; height: 32px;">

Installation

For Node.js

npm

To install it via npm:

npm install sendx-javascript-sdk 

Getting Started

Please follow the installation instruction and execute the following JS code:

import sendx from 'sendx-javascript-sdk';

let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
var TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = "YOUR API KEY"


let apiInstance = new sendx.ContactApi(); // ContactApi |
let contactRequest = new sendx.ContactRequest(); // ContactRequest |

contactRequest.email = "[email protected]";
contactRequest.firstName = "Jane";
contactRequest.lastName = "Doe";
contactRequest.company = "Tech Solutions Inc.";
contactRequest.lastTrackedIp = "34.94.159.140";
contactRequest.customFields = { "1231nfenife213": "VIP", "1434bife23bfij32": "Special Offer Subscriber" };
contactRequest.lists = ["234b324bjed32", "234bij3e2eyv3v2i"];
contactRequest.tags = ["234bijn2ei2jbu4", "2342bijhb2ijneni"];

apiInstance.createContact(contactRequest).then((data) => {
    console.log('API called successfully. Contact created: ' + JSON.stringify(data, null, 2));
}, (error) => {
    console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.sendx.io/api/v1/rest

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- sendx.CampaignApi | createCampaign | POST /campaign | Create campaign sendx.CampaignApi | deleteCampaign | DELETE /campaign/{identifier} | Delete campaign sendx.CampaignApi | getAllCampaigns | GET /campaign | Get all campaigns sendx.CampaignApi | getCampaign | GET /campaign/{identifier} | Get campaign by ID sendx.ContactApi | createContact | POST /contact | Create a new contact sendx.ContactApi | deleteContact | DELETE /contact/{identifier} | Delete contact sendx.ContactApi | getAllContacts | GET /contact | Get all contacts sendx.ContactApi | getContact | GET /contact/{identifier} | Get contact by ID sendx.ContactApi | unsubscribeContact | POST /contact/unsubscribe/{identifier} | Unsubscribe contact sendx.ContactApi | updateContact | PUT /contact/{identifier} | Update contact sendx.CustomFieldApi | createCustomField | POST /customfield | Create custom field sendx.CustomFieldApi | deleteCustomField | DELETE /customfield/{identifier} | Delete custom field sendx.CustomFieldApi | getAllCustomFields | GET /customfield | Get all custom fields sendx.CustomFieldApi | getCustomField | GET /customfield/{identifier} | Get custom field by ID sendx.CustomFieldApi | updateCustomField | PUT /customfield/{identifier} | Update custom field sendx.EmailSendingApi | sendEmail | POST /send/email | Send transactional email sendx.EmailSendingApi | sendEmailWithTemplate | POST /send/template | Send email using template sendx.EventApi | eventsCustomPostbackGet | GET /events/custom/postback | Custom Event Postback URL sendx.EventApi | eventsRevenuePostbackGet | GET /events/revenue/postback | Revenue Event Postback URL sendx.EventsApi | trackCustomEvent | POST /events/custom | Track custom event sendx.EventsApi | trackRevenueEvent | POST /events/revenue | Track revenue event sendx.ListApi | createList | POST /list | Create list sendx.ListApi | deleteList | DELETE /list/{identifier} | Delete list sendx.ListApi | getAllLists | GET /list | Get all lists sendx.ListApi | getList | GET /list/{identifier} | Get list by ID sendx.ListApi | updateList | PUT /list/{identifier} | Update list sendx.PostApi | createPost | POST /post | Create blog post sendx.PostApi | deletePost | DELETE /post/{identifier} | Delete post sendx.PostApi | getAllPosts | GET /post | Get all posts sendx.PostApi | getPost | GET /post/{identifier} | Get post by ID sendx.PostApi | updatePost | PUT /post/{identifier} | Update post sendx.PostCategoryApi | createPostCategory | POST /post/category | Create post category sendx.PostCategoryApi | deletePostCategory | DELETE /post/category/{identifier} | Delete post category sendx.PostCategoryApi | getAllPostCategories | GET /post/category | Get all post categories sendx.PostCategoryApi | getPostCategory | GET /post/category/{identifier} | Get post category by ID sendx.PostCategoryApi | updatePostCategory | PUT /post/category/{identifier} | Update post category sendx.PostTagApi | createPostTag | POST /post/tag | Create post tag sendx.PostTagApi | deletePostTag | DELETE /post/tag/{identifier} | Delete post tag sendx.PostTagApi | getAllPostTags | GET /post/tag | Get all post tags sendx.PostTagApi | getPostTag | GET /post/tag/{identifier} | Get post tag by ID sendx.PostTagApi | updatePostTag | PUT /post/tag/{identifier} | Update post tag sendx.ReportApi | getCampaignReport | GET /report/campaign/{identifier} | Get campaign report sendx.SenderApi | createSender | POST /sender | Create sender sendx.SenderApi | getAllSenders | GET /sender | Get all senders sendx.TagApi | createTag | POST /tag | Create tag sendx.TagApi | deleteTag | DELETE /tag/{identifier} | Delete tag sendx.TagApi | getAllTags | GET /tag | Get all tags sendx.TagApi | getTag | GET /tag/{identifier} | Get tag by ID sendx.TagApi | updateTag | PUT /tag/{identifier} | Update tag sendx.TeamMemberApi | getAllTeamMembers | GET /team/member | Get all team members sendx.TeamMemberApi | getTeamMember | GET /team/member/{identifier} | Get a team member by ID sendx.TemplateApi | createEmailTemplate | POST /template/email | Create email template sendx.TemplateApi | deleteEmailTemplate | DELETE /template/email/{identifier} | Delete template sendx.TemplateApi | getAllEmailTemplates | GET /template/email | Get all templates sendx.TemplateApi | getEmailTemplate | GET /template/email/{identifier} | Get template by ID sendx.TemplateApi | updateEmailTemplate | PUT /template/email/{identifier} | Update template sendx.TrackingApi | identifyContact | POST /contact/identify | Identify contact sendx.TrackingApi | trackContact | POST /contact/track | Track contact sendx.WebhookApi | createWebhook | POST /webhook | Create webhook sendx.WebhookApi | deleteWebhook | DELETE /webhook/{identifier} | Delete webhook sendx.WebhookApi | getAllWebhooks | GET /webhook | Get all webhooks sendx.WebhookApi | getWebhook | GET /webhook/{identifier} | Get webhook by ID sendx.WebhookApi | updateWebhook | PUT /webhook/{identifier} | Update webhook

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

TeamApiKey

  • Type: API key
  • API key parameter name: X-Team-ApiKey
  • Location: HTTP header