Help Center

Reseller API Reference

Resellers can integrate with the MailChannels WHMCS module or leverage our reseller API to roll your own integration.

Overview

This pre-release documentation is likely to contain errors or omissions.

Version 1.0

URI Scheme: Host: api.mailchannels.net BasePath: /reseller/v1 Schemes: HTTPS

Consumes: application/json

Produces: application/json

Paths

GET /downloads/plugins/{filename}

Downloads cPanel, WHMCS, or Plesk plugin.

Parameters

Type Name Description Required Schema Default
QueryParameter account_id The sub account id (required for the Plesk or cPanel plugin) false string  
QueryParameter smtp_password The smtp_password for the account (required for the Plesk or cPanel plugin) false string  
PathParameter filename The plugin to be downloaded. Currently only supported names are 'mailchannels-cpanel', 'mailchannels-plesk', and 'mailchannels-whmcs'. true string  

Responses

HTTP Code Description Scheme
QueryParameter account_id The sub account id (required for the Plesk or cPanel plugin)
QueryParameter smtp_password The smtp_password for the account (required for the Plesk or cPanel plugin)
PathParameter filename The plugin to be downloaded. Currently only supported names are 'mailchannels-cpanel', 'mailchannels-plesk', and 'mailchannels-whmcs'

Produces: application/zip

GET /sub_accounts

Lists all enabled sub-accounts. Use show_all parameter to show disabled accounts.

Parameters

Type Name Description Required Schema Default
QueryParameter offset Index into the result set at which to start returning results. false integer 0
QueryParameter limit The number of sub accounts to return at a time. false integer 20
QueryParameter show_all Include disabled sub accounts in the response. false boolean false

Responses

HTTP Code Description Scheme
200 Success Account array
400 Bad Request ErrorResponse
500 UnknownError ErrorResponse

POST /sub_accounts

Creates a sub account.

Parameters

Type Name Description Required Schema Default
BodyParameter Account The newly created sub account. true NewSubAccount  

Responses

HTTP Code Description Scheme
200 Success Account
400 Bad Request ErrorResponse
403 Forbidden ErrorResponse
409 Conflict ErrorResponse

GET /sub_accounts/stats

Retrieve statistics for all sub-accounts

Parameters

Type Name Description Required Schema Default
QueryParameter offset Index into sub accounts at which to start returning results false integer 0
QueryParameter limit The number of sub accounts to return at a time. false integer 20
QueryParameter start_date The earliest date for which statistics will be returned. All data from start of day UTC will be included. By default, the start_date is 10 days ago. false string (date)  
QueryParameter end_date The latest date for which statistics will be returned. All data to end of day UTC will be included. By default, the end_date is today. false string (date)  

Responses

HTTP Code Description Scheme
200 Success UsageRecord array
400 Bad Request ErrorResponse
404 Not Found ErrorResponse
500 UnknownError ErrorResponse

GET /sub_accounts/{account_id}

Retrieve a sub account.

Parameters

Type Name Description Required Schema Default
PathParameter account_id The sub account id. true string  

Responses

HTTP Code Description Scheme
200 Success Account
404 Not Found ErrorResponse

PUT /sub_accounts/{account_id}

Update a sub account.

Parameters

Type Name Description Required Schema Default
PathParameter account_id The sub account id. true string  
BodyParameter sub_account   true Account  

Responses

HTTP Code Description Scheme
200 Success No Content
400 Bad Request ErrorResponse
404 Not Found ErrorResponse
409 Conflict ErrorResponse

POST /sub_accounts/{account_id}

Cancel a sub account.

Parameters

Type Name Description Required Schema Default
PathParameter account_id The sub account id. true string  
BodyParameter command Contains the command to execute on the sub account. Currently, the only supported command is cancel. true SubAccountCommand  

Responses

HTTP Code Description Scheme
200 Success No Content
400 Bad Request ErrorResponse
404 Not Found ErrorResponse

POST /sub_accounts/{account_id}/smtp_password

Replace existing SMTP password with a newly generated one.

Parameters

Type Name Description Required Schema Default
PathParameter account_id   true string  

Responses

HTTP Code Description Scheme
200 Success SMTPPasswordResponse
400 Bad Request ErrorResponse
404 Not Found ErrorResponse

GET /sub_accounts/{account_id}/stats

Retrieve statistics for a sub account.

Parameters

Type Name Description Required Schema Default
PathParameter account_id The sub account id. true string  
QueryParameter start_date The earliest date for which statistics will be returned. All data from start of day UTC will be included. By default, the start_date is 10 days ago. false string (date)  
QueryParameter end_date The latest date for which statistics will be returned. All data to end of day UTC will be included. By default, the end_date is today. false string (date)  

Responses

HTTP Code Description Scheme
200 Success UsageRecord
400 Bad Request ErrorResponse
404 Not Found ErrorResponse
409 Conflict ErrorResponse

Definitions

Account

Name Description Required Schema Default
account_id   false string  
smtp_passwords An array of SMTP passwords. Currently, sub accounts may have only a single password. SMTP passwords cannot be updated through the sub account resource. See '#/paths/sub_accou nts/{account_id}/s mtp_password' to update SMTP passwords. false string array  
company   false string  
website   false string  
address    false  string   
city    false  string   
province    false  string   
post_code   false  string   
country   false  string   
phone   false  string   
enabled    false  string   

ErrorResponse

Name Description Required Schema Default
trace_id   false string  
message    false string  
errors   false string array  
field_errors   false FieldError array  

FieldError

Name Description Required Schema Default
message   false string  
field   false string  
rejected_value   false string array  

NewSubAccount

Name Description Required Schema Default
first_name   true string  
last_name   true string  
email_address   true string  
company   true string  
website   true string   
address   true string   
city   true string   
province   true string   
post_code   true string   
country   true string   
phone   true string   

SMTPPasswordResponse

Name Description Required Schema Default
account_id   true string  
smtp_password   true string  

StatsRecord

Name Description Required Schema Default
date   false string  
sent   false integer  
queued   false integer  
delivered   false integer  
bounced   false integer  

SubAccountCommand

Name Description Required Schema Default
cancel   false boolean  

UsageRecord

Name Description Required Schema Default
account_id   false string  
usage   false StatsRecord array  

Questions?Open a support ticket (reseller-support@mailchannels.com).

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.

Powered by Zendesk