openapi: 3.0.3
info:
title: SendClean Email API
description: |
The SendClean Email API is a RESTful HTTP API for sending transactional emails, managing SMTP users,
sending/tracking domains, webhooks, and account information.
## Base URL
All API calls are relative to:
```
https://api.sendclean.net/v1.0
```
## Authentication
Every request requires `owner_id` and `token` fields in the request body (JSON POST).
## Request Format
- All API calls use **HTTP POST** (except `sendTemplateHTTPGet` which uses HTTP GET).
- Request bodies must be `Content-Type: application/json`.
- Any non-200 HTTP response code indicates an error.
## Response Format
All responses return JSON with a `status` field of either `"success"` or `"error"`.
## Error Types
| Type | Description |
|------|-------------|
| `ValidationError` | Invalid or missing required parameters |
| `GeneralError` | Unexpected server-side error |
| `AuthenticationError` | `owner_id` and `token` did not match |
version: 1.0.0
contact:
email: support@sendclean.com
servers:
- url: https://api.sendclean.net/v1.0
description: Production API server
tags:
- name: SMTP Users
description: Manage SMTP sub-users (create, edit, reset password, list)
- name: Sending Domains
description: Add, verify, list, and delete sending domains
- name: Tracking Domains
description: Add, check, list, and delete tracking domains
- name: Webhooks
description: Configure event webhooks for email delivery events
- name: Messages
description: Send transactional emails and retrieve message info
- name: Accounts
description: Retrieve account/user details
components:
schemas:
AuthFields:
type: object
required:
- owner_id
- token
properties:
owner_id:
type: string
description: A valid SendClean User ID
example: example_owner_id
token:
type: string
description: A valid API token
example: example_token
SuccessResponse:
type: object
properties:
status:
type: string
enum:
- success
example: success
message:
type: string
example: Operation successful
ErrorResponse:
type: object
properties:
status:
type: string
enum:
- error
example: error
code:
type: integer
example: -1
name:
type: string
enum:
- ValidationError
- GeneralError
- AuthenticationError
example: AuthenticationError
message:
type: string
example: Token MissMatch
SmtpUser:
type: object
properties:
smtp_user_name:
type: string
example: smtps456546
password:
type: string
example: cgvddgrsd
status:
type: string
enum:
- Enable
- Disable
example: Enable
total_limit:
type: integer
example: 200
hourly_limit:
type: integer
example: 20
AddSmtpRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- total_limit
- hourly_limit
properties:
total_limit:
type: integer
description: Total sending limit (positive integer)
example: 100
hourly_limit:
type: integer
description: Hourly sending limit (positive integer)
example: 10
AddSmtpResponse:
type: object
properties:
status:
type: string
enum:
- success
message:
type: string
example: SMTP User Created
smtp_user_name:
type: string
example: smtp12345
smtp_password:
type: string
example: asfsf4w343
EditSmtpRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- smtp_user_name
properties:
smtp_user_name:
type: string
description: A valid SMTP user name
example: smtp12345
total_limit:
type: integer
description: New total limit (positive integer)
example: 80
hourly_limit:
type: integer
description: New hourly limit (positive integer)
example: 15
status:
type: string
enum:
- Enable
- Disable
description: Enable or disable the SMTP user
example: Disable
ResetSmtpPasswordRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- smtp_user_name
properties:
smtp_user_name:
type: string
description: A valid SMTP user name
example: smtp12345
ResetSmtpPasswordResponse:
type: object
properties:
status:
type: string
enum:
- success
message:
type: string
example: password reseted
smtp_user_name:
type: string
example: smtp12345
smtp_password:
type: string
example: 2fg345gy6r7
ListSmtpRequest:
$ref: '#/components/schemas/AuthFields'
ListSmtpResponse:
type: object
properties:
status:
type: string
enum:
- success
smtp_list:
type: array
items:
$ref: '#/components/schemas/SmtpUser'
DomainRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- domain
properties:
domain:
type: string
description: Fully qualified domain name
example: abc.com
CheckSendingDomainResponse:
type: object
properties:
status:
type: string
enum:
- success
domain:
type: string
example: abc.com
dkim:
type: object
properties:
valid:
type: string
enum:
- 'Yes'
- 'No'
example: 'Yes'
spf:
type: object
properties:
valid:
type: string
enum:
- 'Yes'
- 'No'
example: 'No'
valid_signing:
type: string
enum:
- 'Yes'
- 'No'
example: 'No'
VerifySendingDomainRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- domain
- mailbox
properties:
domain:
type: string
example: abc.com
mailbox:
type: string
description: Mailbox name to send verification instructions to
example: john
SendingDomainListEntry:
type: object
properties:
domain:
type: string
example: abc.com
create_date:
type: integer
format: int64
description: Creation timestamp in microseconds
example: 67457775764
dkim:
type: object
properties:
valid:
type: string
enum:
- 'Yes'
- 'No'
spf:
type: object
properties:
valid:
type: string
enum:
- 'Yes'
- 'No'
verify_domain:
type: object
properties:
valid:
type: string
enum:
- 'Yes'
- 'No'
ListSendingDomainResponse:
type: object
properties:
status:
type: string
enum:
- success
sending_domain_list:
type: array
items:
$ref: '#/components/schemas/SendingDomainListEntry'
CheckTrackingDomainResponse:
type: object
properties:
status:
type: string
enum:
- success
domain:
type: string
example: abc.com
valid_tracking:
type: string
enum:
- 'Yes'
- 'No'
example: 'Yes'
cname:
type: object
properties:
valid:
type: string
enum:
- 'Yes'
- 'No'
example: 'Yes'
TrackingDomainListEntry:
type: object
properties:
domain:
type: string
example: abc.com
create_date:
type: integer
format: int64
description: Creation timestamp in microseconds
example: 67457775764
cname:
type: object
properties:
valid:
type: string
enum:
- 'Yes'
- 'No'
ListTrackingDomainResponse:
type: object
properties:
status:
type: string
enum:
- success
tracking_domain_list:
type: array
items:
$ref: '#/components/schemas/TrackingDomainListEntry'
AddWebhookRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- url
properties:
url:
type: string
description: Webhook URL. Must respond with 'God bless you, SendClean'
example: https://example.com/webhook
event:
type: string
description: Comma-separated list of events to subscribe to
example: send,open,click,soft_bounce,hard_bounce,spam
description:
type: string
description: Human-readable description
example: My webhook for open and click events
store_log:
type: string
enum:
- Enable
- Disable
example: Enable
EditWebhookRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- webhook_id
- url
properties:
webhook_id:
type: string
example: '424353445757557577457'
url:
type: string
description: Updated webhook URL. Must respond with 'God bless you, SendClean'
example: https://example.com/webhook
event:
type: string
example: open,click
description:
type: string
example: Updated description
store_log:
type: string
enum:
- Enable
- Disable
WebhookIdRequest:
allOf:
- $ref: '#/components/schemas/AuthFields'
- type: object
required:
- webhook_id
properties:
webhook_id:
type: string
description: A valid webhook ID
example: '424353445757557577457'
KeyResetWebhookResponse:
type: object
properties:
status:
type: string
enum:
- success
message:
type: string
example: Webhook key reseted
webhook_id:
type: string
example: '424353445757557577457'
key:
type: string
example: 2fg345gy6r7
WebhookListEntry:
type: object
properties:
webhook_id:
type: string
example: '424353445757557577457'
url:
type: string
example: http://abc.com/wh1.php
event:
type: string
example: open,click
key:
type: string
example: cgvddgrsd
store_log:
type: string
enum:
- Enable
- Disable
description:
type: string
example: this webhook for only open and click
create_date:
type: integer
format: int64
example: 754453534
ListWebhookResponse:
type: object
properties:
status:
type: string
enum:
- success
webhook_list:
type: array
items:
$ref: '#/components/schemas/WebhookListEntry'
WebhookInfoResponse:
type: object
properties:
status:
type: string
enum:
- success
webhook_data:
type: object
properties:
webhook_id:
type: string
example: '405602261459333060372'
url:
type: string
example: http://xyz.com/webhook3.php
event:
type: string
example: open
description:
type: string
example: webhook for open events
store_log:
type: string
enum:
- Enable
- Disable
key:
type: string
example: aVLnPysvkKUU95AFrb47Zr
create_date:
type: integer
format: int64
example: 1459333060
last_success:
type: integer
format: int64
description: Timestamp of last successful delivery
example: 1459366666
total_event:
type: integer
description: Total events sent to this webhook URL
example: 23
Recipient:
type: object
required:
- email
properties:
email:
type: string
format: email
example: recipient@example.com
name:
type: string
description: Optional display name
example: Recipient Name
type:
type: string
enum:
- to
- cc
- bcc
default: to
description: Header type for the recipient
Attachment:
type: object
properties:
type:
type: string
description: MIME type of the attachment
example: text/plain
name:
type: string
description: File name of the attachment
example: myfile.txt
content:
type: string
format: byte
description: Base64-encoded content of the attachment
example: ZXhhbXBsZSBmaWxl
EmbeddedImage:
type: object
properties:
type:
type: string
description: MIME type — must start with "image/"
example: image/png
name:
type: string
description: Content ID for the image. Reference in HTML as
example: IMAGECID
content:
type: string
format: byte
description: Base64-encoded image content
example: ZXhhbXBsZSBmaWxl
MessageHeaders:
type: object
description: Optional custom headers for the message
properties:
Reply-To:
type: string
format: email
example: reply@example.com
X-Unique-Id:
type: string
description: Custom message ID for tracking via getMessageInfo
example: my-unique-id-123
X-STes-TrackOpen:
type: string
enum:
- 'yes'
- 'no'
description: Enable or disable open tracking
X-STes-TrackClick:
type: string
enum:
- html
- text
- both
- 'no'
description: Enable or disable click tracking
X-STes-Autotext:
type: string
enum:
- 'yes'
- 'no'
description: Auto-generate plain-text version from HTML
X-STes-AutoHtml:
type: string
enum:
- 'yes'
- 'no'
description: Auto-generate HTML version from plain text
X-STes-TrackingDomain:
type: string
description: Custom domain for tracking opens and clicks
X-STes-SigningDomain:
type: string
description: Custom domain for SPF/DKIM signing
X-STes-ReturnPathDomain:
type: string
description: Custom domain for the return-path
SendMailMessage:
type: object
description: The message payload for sendMail
properties:
html:
type: string
description: Full HTML content of the email. Either html or text is required.
example:
Your order is confirmed.
text: Hello! Your order is confirmed. subject: Order Confirmation from_email: noreply@yourdomain.com from_name: Your Company to: - email: customer@example.com name: Customer Name type: to headers: Reply-To: support@yourdomain.com X-Unique-Id: order-12345 attachments: - type: application/pdf name: invoice.pdf content: ZXhhbXBsZSBmaWxl responses: '200': description: Message queued for delivery content: application/json: schema: oneOf: - $ref: '#/components/schemas/SendMailResponse' - $ref: '#/components/schemas/ErrorResponse' examples: success: value: status: success message: message have been Queued ... error: value: status: error code: -1 name: AuthenticationError message: Token MissMatch /messages/sendTemplate: post: tags: - Messages summary: Send email using a saved template description: | Sends a transactional email using a pre-created template. Use `dynamic_value` to replace template placeholders (case-sensitive field names). operationId: sendTemplate requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/SendTemplateRequest' example: owner_id: example id token: example token smtp_user_name: smtp12345 message: template_id: Template_Id_123 subject: Welcome to our service from_email: noreply@yourdomain.com from_name: Your Company to: - email: customer@example.com name: Customer Name type: to dynamic_value: NAME: John Email: customer@example.com headers: Reply-To: support@yourdomain.com X-Unique-Id: welcome-john-001 responses: '200': description: Template message queued content: application/json: schema: oneOf: - $ref: '#/components/schemas/SendMailResponse' - $ref: '#/components/schemas/ErrorResponse' examples: success: value: status: success message: 250 Message Queued... /messages/sendTemplateHTTPGet: get: tags: - Messages summary: Send template email via HTTP GET description: | Sends a transactional email using a template via HTTP GET. Designed for simple integrations such as IVR webhooks where POST with JSON body is not practical. **All parameter values must be URL-encoded.** Example: ``` GET https://api.sendclean.net/v1.0/messages/sendTemplateHTTPGet?owner_id=YOUR_ID&token=YOUR_TOKEN &smtp_user_name=smtp12345&template_id=TMPL_ID&subject=Hello &from_email=info%40example.com&to=customer%40example.com &dynamic_value%5BNAME%5D=John&dynamic_value%5BEmail%5D=john%40example.com ``` operationId: sendTemplateHTTPGet parameters: - name: owner_id in: query required: true schema: type: string description: A valid SendClean User ID - name: token in: query required: true schema: type: string description: A valid API token - name: smtp_user_name in: query required: true schema: type: string description: A valid SMTP user name example: smtp12345 - name: template_id in: query required: true schema: type: string description: Previously created template ID - name: subject in: query required: true schema: type: string description: URL-encoded email subject - name: from_email in: query required: true schema: type: string description: URL-encoded sender email address - name: to in: query required: true schema: type: string description: URL-encoded recipient email address - name: dynamic_value[NAME] in: query required: false schema: type: string description: URL-encoded dynamic value for NAME placeholder - name: dynamic_value[Email] in: query required: false schema: type: string description: URL-encoded dynamic value for Email placeholder responses: '200': description: Template message queued content: application/json: schema: oneOf: - $ref: '#/components/schemas/SendMailResponse' - $ref: '#/components/schemas/ErrorResponse' examples: success: value: status: success message: 250 Message Queued... /messages/getMessageInfo: post: tags: - Messages summary: Get message delivery and engagement info description: | Retrieves delivery status, open data, and click data for messages matching a given `X-Unique-Id`. Supports pagination via `skip_page`. operationId: getMessageInfo requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MessageInfoRequest' example: owner_id: example id token: example token x_unique_id: order-12345 skip_page: 0 responses: '200': description: Message info records content: application/json: schema: oneOf: - $ref: '#/components/schemas/MessageInfoResponse' - $ref: '#/components/schemas/ErrorResponse' /accounts/userDetails: post: tags: - Accounts summary: Get account/user details description: Returns profile and account information for the authenticated user. operationId: getUserDetails requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/AuthFields' example: owner_id: example id token: example token responses: '200': description: Account details content: application/json: schema: oneOf: - $ref: '#/components/schemas/AccountDetailResponse' - $ref: '#/components/schemas/ErrorResponse'