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
SendX uses a three-layer model architecture:
- Input Models (
RestE*): For API requests - Output Models (
RestR*): For API responses with prefixed IDs - Internal Models: Core business logic (not exposed in API)
SendX uses API key authentication:
X-Team-ApiKey: YOUR_TEAM_API_KEY- Required for all requests
- Team-level access to resources
- Available in SendX Settings → Team API Key
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>)
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 | 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 |
- 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
- Email format: Must be valid email addresses
- Required fields: Check documentation for mandatory fields
- Field lengths: Respect maximum length constraints
- Pagination: Use offset/limit for large datasets
- Batch operations: Process multiple items when supported
- Caching: Cache responses when appropriate
Official SDKs available for:
Need help? Contact us:
- 💬 Website Chat: Available on sendx.io
- 📧 Email: hello@sendx.io
- 📚 Documentation: Full guides at help.sendx.io
API Endpoint: https://api.sendx.io/api/v1/rest
For more information, please visit https://sendx.io
Building the API client library requires:
- Java 1.8+
- Maven (3.8.3+)/Gradle (7.2+)
To install the API client library to your local Maven repository, simply execute:
mvn clean installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deployRefer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>io.sendx</groupId>
<artifactId>sendx-java-sdk</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
repositories {
mavenCentral() // Needed if the 'sendx-java-sdk' jar has been published to maven central.
mavenLocal() // Needed if the 'sendx-java-sdk' jar has been published to the local maven repo.
}
dependencies {
implementation "io.sendx:sendx-java-sdk:2.0.0"
}Please follow the installation instruction and execute the following Java code:
// Import classes:
import sendx_java_sdk.ApiClient;
import sendx_java_sdk.ApiException;
import sendx_java_sdk.Configuration;
import sendx_java_sdk.auth.*;
import sendx_java_sdk.*;
import sendx_java_sdk.CampaignApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.sendx.io/api/v1/rest");
// Configure API key authorization: TeamApiKey
ApiKeyAuth TeamApiKey = (ApiKeyAuth) defaultClient.getAuthentication("TeamApiKey");
TeamApiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.setApiKeyPrefix("Token");
ContactApi apiInstance = new ContactApi(defaultClient);
ContactRequest contactRequest = new ContactRequest(); // ContactRequest |
contactRequest.setFirstName("John")
contactRequest.setLastName("Doe")
contactRequest.setEmail("john.doe@sendx.io")
contactRequest.setCompany("SendX")
contactRequest.setLastTrackedIp("32.342.12.322")
// Set tags as a list of strings
List<String> tags = Arrays.asList("sner1jin3ij34b4", "234bjk2n42ednj32";
contactRequest.setTags(tags)
try {
OperationResponse result = apiInstance.createContact(contactRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CampaignApi#createCampaign");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}All URIs are relative to https://api.sendx.io/api/v1/rest
- CustomEventRequest
- DeleteResponse
- ErrorResponse
- EventResponse
- EventsRevenuePostbackGet200Response
- EventsRevenuePostbackGet400Response
- EventsRevenuePostbackGet500Response
- IdentifyRequest
- IdentifyResponse
- LinkStat
- MessageResponse
- PostbackResponse
- RestECampaign
- RestEContact
- RestECustomField
- RestEList
- RestEPost
- RestEPostCategory
- RestEPostTag
- RestESender
- RestETag
- RestETemplate
- RestEWebhook
- RestRCampaign
- RestRContact
- RestRCustomField
- RestRList
- RestRMember
- RestRPost
- RestRPostCategory
- RestRPostTag
- RestRSender
- RestRTag
- RestRTemplate
- RestRWebhook
- RestReportData
- RevenueEventRequest
- TemplateEmailMessage
- TrackRequest
- TrackResponse
- WebhookObject
- XAttachment
- XEmailMessage
- XEmailResponse
- XFrom
- XReplyTo
- XTo
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: X-Team-ApiKey
- Location: HTTP header
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.
