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
Install via command line
gem install sendx-ruby-sdk
Install via Gemfile
source "https://rubygems.pkg.github.com/sendx" do
gem "sendx-ruby-sdk", "1.1.0"
end
Please follow the installation procedure and then run the following code:
# Load the gem
require 'sendx-ruby-sdk'
# Setup authorization
SendX.configure do |config|
# Configure API key authorization: TeamApiKey
config.api_key['X-Team-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-Team-ApiKey'] = 'Bearer'
end
api_instance = SendX::ContactApi.new
contact_request = SendX::ContactRequest.new(
email: "john@doe.com",
first_name: "John",
last_name: "Doe",
company: "SendX",
last_tracked_ip: "34.94.159.140",
tags: ["tag_MKdhTovsTJDetCyrJmRySL"],
custom_fields: {
'custom_field_MKdhTovsTJDetCyrJmRySe' => "VIP",
"custom_field_MKdhTovsTFDetCyrJerRySL"=> "Subscribers"
},
)
begin
# Create a contact
result = api_instance.create_contact(contact_request)
p result
rescue SendX::ApiError => e
puts "Error when calling ContactApi->create_contact: #{e}"
endAll URIs are relative to https://api.sendx.io/api/v1/rest
- SendX::CustomEventRequest
- SendX::DeleteResponse
- SendX::ErrorResponse
- SendX::EventResponse
- SendX::EventsRevenuePostbackGet200Response
- SendX::EventsRevenuePostbackGet400Response
- SendX::EventsRevenuePostbackGet500Response
- SendX::IdentifyRequest
- SendX::IdentifyResponse
- SendX::LinkStat
- SendX::MessageResponse
- SendX::PostbackResponse
- SendX::RestECampaign
- SendX::RestEContact
- SendX::RestECustomField
- SendX::RestEList
- SendX::RestEPost
- SendX::RestEPostCategory
- SendX::RestEPostTag
- SendX::RestESender
- SendX::RestETag
- SendX::RestETemplate
- SendX::RestEWebhook
- SendX::RestRCampaign
- SendX::RestRContact
- SendX::RestRCustomField
- SendX::RestRList
- SendX::RestRMember
- SendX::RestRPost
- SendX::RestRPostCategory
- SendX::RestRPostTag
- SendX::RestRSender
- SendX::RestRTag
- SendX::RestRTemplate
- SendX::RestRWebhook
- SendX::RestReportData
- SendX::RevenueEventRequest
- SendX::TemplateEmailMessage
- SendX::TrackRequest
- SendX::TrackResponse
- SendX::WebhookObject
- SendX::XEmailMessage
- SendX::XEmailResponse
- SendX::XFrom
- SendX::XReplyTo
- SendX::XTo
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: X-Team-ApiKey
- Location: HTTP header
