Info
Welcome to SpectreMail API.
Authentication:
Log in to your account, go to the API page and generate a new {API Token} if you don't have one.
Note: You should know that, you cannot renew your {API Token} more than once per 24
hours.
Use tha {API Token} in the header section of your request: 'headers' => { 'Authorization' => 'Bearer {API Token}' }
If your api is wrong or expired, you will get the following response: {"error": "Unauthenticated."}
Note: Repeated requests with wrong or expired {API Token} will block the IP address that is
sending the requests
Use tha {API Token} in the header section of your request: 'headers' => { 'Authorization' => 'Bearer {API Token}' }
Requests:
- GET
- POST
- DELETE
Response Codes:
- 200
- 400
- 401
- 403
- 404
- 405
- 406
- 409
- 429
Refere to this link to learn more: Code Status
Response Type:
JSON
Domain Manager
Get Public Domains
This request will return an array of public domains
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/domains" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/domains"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/domains',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/domains'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"domains": [
"domain1.com",
"domain2.com",
"domain3.com",
"domain4.com"
]
}
HTTP Request
GET api/domains
Get Your Private Domains
This request will return: 1- An array of objects where each one contains your domain information. 2- An array of domains
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/domains/private/dolorum" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/domains/private/dolorum"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/domains/private/dolorum',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/domains/private/dolorum'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"domains": [
{
"domain": "private-domain1.com",
"pointing": true,
"create_date": "2020-Apr-24 02:01:59 UTC",
"update_date": "2020-Apr-24 02:01:59 UTC"
},
{
"domain": "private-domain2.com",
"pointing": false,
"create_date": "2020-Apr-22 15:56:35 UTC",
"update_date": "2020-Apr-22 15:56:35 UTC"
}
]
}
HTTP Request
GET api/domains/private/{array?}
URL Parameters
Parameter | Status | Description |
---|---|---|
array |
optional | Use the parameter array to get your domains as an array. |
Add Private Domains
This request will add your private domain to your account so you can create mails and you will be able to send messages from these mails
Example request:
curl -X POST \
"https://www.spectremail.com/api/domains/private/add" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"domain_name":"et"}'
const url = new URL(
"https://www.spectremail.com/api/domains/private/add"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"domain_name": "et"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/domains/private/add',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'domain_name' => 'et',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/domains/private/add'
payload = {
"domain_name": "et"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "your private domain has been added, but you can't use it before refreshing the domain on your account page or through the api to check whether the dns mx records point to our server"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid domain name"
}
Example response (405):
{
"status": "failure",
"error": "limitation",
"info": "you have reached the maximum number of private domains"
}
Example response (409):
{
"status": "failure",
"error": "exists",
"info": "the domain already exists"
}
HTTP Request
POST api/domains/private/add
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
domain_name |
string | required | The domain name which you would like to add to your account. |
Remove Private Domains
This request will remove your private domain with all its mails and messages
Example request:
curl -X POST \
"https://www.spectremail.com/api/domains/private/remove" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"domain_name":"expedita"}'
const url = new URL(
"https://www.spectremail.com/api/domains/private/remove"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"domain_name": "expedita"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/domains/private/remove',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'domain_name' => 'expedita',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/domains/private/remove'
payload = {
"domain_name": "expedita"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "the domain: domain_name has been deleted"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid domain name"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "unknown domain"
}
HTTP Request
POST api/domains/private/remove
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
domain_name |
string | required | The domain name which you would like to remove from your account. |
Refresh Private Domains
This request will check if your private domain is pointing to our server and return the status of the private domain.
Example request:
curl -X POST \
"https://www.spectremail.com/api/domains/private/refresh" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"domain_name":"animi"}'
const url = new URL(
"https://www.spectremail.com/api/domains/private/refresh"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"domain_name": "animi"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/domains/private/refresh',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'domain_name' => 'animi',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/domains/private/refresh'
payload = {
"domain_name": "animi"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "your domain is pointing to our server, you can use it now"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "unknown domain"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "unknown domain"
}
Example response (406):
{
"status": "failure",
"error": "not configured",
"info": "your domain is not pointing to our server"
}
HTTP Request
POST api/domains/private/refresh
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
domain_name |
string | required | The domain name which you would like to check its dns mx records. |
Mail Manager
Get All Accounts
This request will return all mails accounts
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/accounts/all" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/accounts/all"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/accounts/all',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/accounts/all'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"accounts": [
{
"name": "jm5zfql",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-26 18:52:04 UTC"
},
{
"name": "tppbclz",
"domain": "domain3.com",
"email": "[email protected]",
"received_msgs": 7,
"create_time": "2020-Apr-26 18:52:04 UTC"
},
{
"name": "fepmlxl",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-26 18:52:04 UTC"
},
{
"name": "spm6flc",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 1,
"create_time": "2020-Apr-26 18:52:04 UTC"
},
{
"name": "hello1",
"domain": "domain3.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-22 15:56:53 UTC"
},
{
"name": "x6lvbhf7dli8thg620xs",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "kyufc6yf04enrhruowym",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 3,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "9lxd1ivg37thnbeuxens",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "evkzcsvxz2l694l439ek",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "tqfuevbdk6vy56q4llie",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "3svd6fd5atwj98mi0q90",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 2,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "ei39dltodyfajocoqiqi",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "wse",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:41:18 UTC"
},
{
"name": "112557we",
"domain": "domain2.com",
"email": "[email protected]",
"received_msgs": 3,
"create_time": "2020-Apr-15 15:50:30 UTC"
},
{
"name": "dewedewdwwed6",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 1,
"create_time": "2020-Apr-13 18:16:59 UTC"
},
{
"name": "dewe",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-13 18:14:34 UTC"
},
{
"name": "rr73602n1477",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-12 15:48:26 UTC"
},
{
"name": "wy1nx378513w",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-12 15:40:04 UTC"
},
{
"name": "mjc4a3gr7iyy",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 8,
"create_time": "2020-Apr-11 22:57:23 UTC"
},
{
"name": "ff01hslsjtan",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-11 22:28:04 UTC"
},
{
"name": "wfv604312111",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-11 22:24:55 UTC"
},
{
"name": "ldwdw",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-09 18:42:36 UTC"
},
{
"name": "dewkl3",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 17,
"create_time": "2020-Apr-06 21:44:52 UTC"
},
{
"name": "dewkl",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 29,
"create_time": "2020-Apr-06 21:44:29 UTC"
},
{
"name": "lnsfr99",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-05 19:41:15 UTC"
}
],
"pagination": {
"total": 28,
"count": 25,
"per_page": 25,
"current_page": 1,
"total_pages": 2,
"prev_page": null,
"next_page": "https:\/\/www.spectremail.com\/api\/accounts\/all?page=2",
"last_page": 2
}
}
Example response (404):
{
"status": "failure",
"info": "there are no accounts!"
}
HTTP Request
GET api/accounts/all
Get Domain Mails Accounts
This request will return all mails accounts belonging to a specific domain
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/accounts/4/all" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/accounts/4/all"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/accounts/4/all',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/accounts/4/all'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"accounts": [
{
"name": "x6lvbhf7dli8thg620xs",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "kyufc6yf04enrhruowym",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "9lxd1ivg37thnbeuxens",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "evkzcsvxz2l694l439ek",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "tqfuevbdk6vy56q4llie",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "3svd6fd5atwj98mi0q90",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "ei39dltodyfajocoqiqi",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:43:03 UTC"
},
{
"name": "wse",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 0,
"create_time": "2020-Apr-20 20:41:18 UTC"
},
{
"name": "112557we",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 3,
"create_time": "2020-Apr-15 15:50:30 UTC"
}
],
"pagination": {
"total": 9,
"count": 9,
"per_page": 25,
"current_page": 1,
"total_pages": 1,
"prev_page": null,
"next_page": null,
"last_page": 1
}
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid domain name"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "there are no accounts!"
}
HTTP Request
GET api/accounts/{domain}/all
URL Parameters
Parameter | Status | Description |
---|---|---|
domain |
required | The domain which you want to get its mails accounts |
Get Mail By Token
This request will return the mail assigned with the given token with latest received messages.
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/account/token/1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/account/token/1"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/account/token/1',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/token/1'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"mailInfo": {
"name": "12345e67",
"domain": "domain.com",
"email": "[email protected]",
"messages": 1,
"duration": "1 week",
"created_at": "2020-04-03T23:54:12.000000Z",
"inbox": [
{
"email": "[email protected]",
"msg_number": 1,
"sender_name": "base64 encoded name",
"sender_email": "sender-name@sender-domain",
"subject": "base64 encoded subject",
"received_at": "2020-04-04 21:12:00",
"message": "base64 encoded message",
"attachments": [
{
"link": "link to attachment",
"type": "audio\/mpeg",
"size": "1087849"
},
{
"link": "link to attachment",
"type": "image\/png",
"size": "113939"
}
],
"opened": true
}
]
}
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid mail token"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "the account was not found!"
}
HTTP Request
GET api/account/token/{mailToken}
URL Parameters
Parameter | Status | Description |
---|---|---|
token |
required | The token which belongs to the targeted mail. |
Get a Specific Mail Account
This request will return a specific mail account info
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/account/14/11" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/account/14/11"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/account/14/11',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/14/11'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"accounts": {
"name": "112557we",
"domain": "domain1.com",
"email": "[email protected]",
"received_msgs": 3,
"create_time": "2020-Apr-15 15:50:30 UTC"
}
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters!"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "the account was not found!"
}
HTTP Request
GET api/account/{domain}/{name}
URL Parameters
Parameter | Status | Description |
---|---|---|
domain |
required | The domain of the account you want to get its info |
name |
required | The name of the account you want to get its info |
Activate/Deactivate Forwarding
This request will activate or deactivate forwarding on specific mail.
Example request:
curl -X POST \
"https://www.spectremail.com/api/account/forward" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"activate":true,"from":"natus","to":"mollitia"}'
const url = new URL(
"https://www.spectremail.com/api/account/forward"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"activate": true,
"from": "natus",
"to": "mollitia"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/account/forward',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'activate' => true,
'from' => 'natus',
'to' => 'mollitia',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/forward'
payload = {
"activate": true,
"from": "natus",
"to": "mollitia"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "forwarding is active now"
}
Example response (200):
{
"status": "success",
"info": "forwarding is inactive now"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters \/\/or error related to the invalid data"
}
Example response (400):
{
"status": "failure",
"error": "activation",
"info": "forwarding already active\/inactive"
}
Example response (404):
{
"status": "failure",
"domains": "unknown mail"
}
Example response (404):
{
"status": "failure",
"domains": "unknown combination of from-to"
}
HTTP Request
POST api/account/forward
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
activate |
boolean | required | True to activate forwarding. False to deactivate forwarding |
from |
string | required | The mail which its messages should be forwarded. This parameter required on activation and deactivation |
to |
string | required | The email address to which you want to forward messages. This parameter required on activation and deactivation |
Change Mail Password
This request will change your mail password.
Example request:
curl -X POST \
"https://www.spectremail.com/api/account/password" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"email":"vero","password":"eaque"}'
const url = new URL(
"https://www.spectremail.com/api/account/password"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"email": "vero",
"password": "eaque"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/account/password',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'email' => 'vero',
'password' => 'eaque',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/password'
payload = {
"email": "vero",
"password": "eaque"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "mail password has been changed"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters \/\/or error related to the invalid data"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"domains": "unknown mail"
}
HTTP Request
POST api/account/password
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
email |
string | required | The targeted mail |
password |
string | required | The new password between 8 and 20 characters |
Create a New Mail Account
This request create a new mail account and return new mail info
Example request:
curl -X POST \
"https://www.spectremail.com/api/account/add" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"domain":"rem","name":"nam","duration":"consequuntur"}'
const url = new URL(
"https://www.spectremail.com/api/account/add"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"domain": "mydomain.com",
"name": "any-name",
"duration": "unlimited",
"password": "rlw@#lce965ce"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/account/add',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
"domain" => "mydomain.com",
"name" => "any-name",
"duration" => "unlimited",
"password" => "rlw@#lce965ce"
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/add'
payload = {
"domain": "mydomain.com",
"name": "any-name",
"duration": "unlimited",
"password": "rlw@#lce965ce"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"accounts": {
"status": "success",
"email": "[email protected]",
"name": "name",
"domain": "domain1.com",
"duration": "duration",
"token": "Mail Token",
"info": "a new account has been created"
}
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters! or errors related to the invalid data"
}
Example response (404):
{
"status": "failure",
"error": "not available",
"info": "domain is not available yet, please report this"
}
Example response (405):
{
"status": "failure",
"error": "limitation",
"info": "mails limit has been reached"
}
Example response (409):
{
"status": "failure",
"error": "exists",
"info": "the account already exists"
}
HTTP Request
POST api/account/add
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
domain |
string | required | The domain which the new mail belongs to |
name |
string | required | The name of the new mail. length of the name must be between 2-40 if you are using a private domain, but if you are using public domains, then the length must not be 12 characters. Name can includes only letters, numbers, dot(.) and dash(-) |
duration |
string | required | The specified timeToLive duration of the new mail. Available durations: "1 hour", "6 hours", "12 hours", "1 day", "1 week", "1 month", "unlimited" where "unlimited" only available for private domains |
password |
string | required | The password you will use to login to WebMail or remotely using pop3,imap, and smtp protocols, but if your package was the free package you will not be able to use it. Length 8 - 20 characters. |
Create a New Mutiple Mails Accounts
This request will create mutiple new mails accounts and return the mails info
Example request:
curl -X POST \
"https://www.spectremail.com/api/account/add/multiple" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"number":4,"name_length":6,"domain":"non","duration":"vitae"}'
const url = new URL(
"https://www.spectremail.com/api/account/add/multiple"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"number": 4,
"name_length": 9,
"domain": "mydomain.com",
"duration": "unlimited",
"password": "rlw@#lce965ce"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/account/add/multiple',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
"number" => 4,
"name_length" => 9,
"domain" => "mydomain.com",
"duration" => "unlimited",
"password" => "rlw@#lce965ce"
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/add/multiple'
payload = {
"number": 4,
"name_length": 9,
"domain": "mydomain.com",
"duration": "unlimited",
"password": "rlw@#lce965ce"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "9 new accounts have been created",
"mails": [
{
"email": "[email protected]",
"name": "iyxccya3diy",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "dp76fcwfxuo",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "1amuvt2j2ei",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "iqohhpjaqb4",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "uscqmoxqwcf",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "2bbortcjnm6",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "uk5gc7pdgp6",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "ivzddvjvk19",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
},
{
"email": "[email protected]",
"name": "iuku2xkwzac",
"domain": "domain.com",
"duration": "1 month",
"token": "Mail Token"
}
]
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters! \/\/or error related to the invalid data"
}
Example response (404):
{
"status": "failure",
"error": "not available",
"info": "domain is not available yet, please report this"
}
Example response (405):
{
"status": "failure",
"error": "limitation",
"info": "mails limit has been reached"
}
HTTP Request
POST api/account/add/multiple
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
number |
integer | required | The number of mails you want to create |
name_length |
integer | required | The length of the name of the mails you want to create |
domain |
string | required | The domain which the new mail belongs to |
duration |
string | required | The specified time to live duration of the new mail. Available durations: "1 hour", "6 hours", "12 hours", "1 day", "1 week", "1 month", "unlimited" where unlimited only available for private domains |
password |
string | required | The password you will use to login to WebMail or remotely using pop3,imap, and smtp protocols, but if your package was the free package you will not be able to use it. Length 8 - 20 characters. |
Drop Mail Account
This request will delete a specified mail account
Example request:
curl -X POST \
"https://www.spectremail.com/api/account/drop" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"domain":"error","name":"cumque"}'
const url = new URL(
"https://www.spectremail.com/api/account/drop"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"domain": "error",
"name": "cumque"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/account/drop',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'domain' => 'error',
'name' => 'cumque',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/drop'
payload = {
"domain": "error",
"name": "cumque"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "the account successfully deleted"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters! \/\/or error related to the invalid data"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "the account was not found!"
}
HTTP Request
POST api/account/drop
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
domain |
string | required | The domain which the mail belongs to |
name |
string | required | The name of the mail account you want to delete |
Drop Mails Accounts
This request will delete a group of selected mails accounts
Example request:
curl -X POST \
"https://www.spectremail.com/api/account/drop/multiple" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"domain":"enim","names":[]}'
const url = new URL(
"https://www.spectremail.com/api/account/drop/multiple"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"domain": "enim",
"names": []
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/account/drop/multiple',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'domain' => 'enim',
'names' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/drop/multiple'
payload = {
"domain": "enim",
"names": []
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "the accounts successfully deleted"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters!"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid names"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "some accounts are invalid",
"accounts": [
{
"status": "invalid",
"name": "uflmthw",
"domain": "domain.com",
"info": "the account was not found!"
},
{
"status": "invalid",
"name": "zdbdd2s",
"domain": "domain.com",
"info": "the account was not found!"
},
{
"status": "invalid",
"name": "vbcly1o",
"domain": "domain.com",
"info": "the account was not found!"
},
{
"status": "invalid",
"name": "av8hvc7",
"domain": "domain.com",
"info": "the account was not found!"
},
{
"status": "invalid",
"name": "weklwemdlkw",
"domain": "domain.com",
"info": "the account was not found!"
},
{
"status": "invalid",
"name": "s vmw+978",
"domain": "domain.com",
"info": {
"name": "Invalid name, allowed (a-z 0-9 - .) starts and ends with a letter or a nubmer"
}
},
{
"status": "invalid",
"name": "wdklmdwkle6",
"domain": "domain.com",
"info": "the account was not found!"
},
{
"status": "invalid",
"name": "dewkdwlw",
"domain": "domain.com",
"info": "the account was not found!"
}
]
}
HTTP Request
POST api/account/drop/multiple
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
domain |
string | required | The domain which the mail belongs to |
names |
array | required | Array contains the names of the mails you want to delete, no more than 100 names |
Message Manager
Refresh Inbox
This request will check your inbox to search only for new messages, and return the number of new messages
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/account/6/11/inbox/refresh" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/account/6/11/inbox/refresh"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/account/6/11/inbox/refresh',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/6/11/inbox/refresh'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"new": 1
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters!"
}
Example response (405):
{
"status": "failure",
"error": "limitation",
"info": "inbox is full"
}
HTTP Request
GET api/account/{domain}/{name}/inbox/refresh
URL Parameters
Parameter | Status | Description |
---|---|---|
domain |
required | The domain of the mail account which the inbox you want to refresh belongs to |
name |
required | The name of the mail account which the inbox you want to refresh belongs to |
Get Messages
This request will return a group of messages. You can choose to return all, read or unread messages, then you can choose an action to apply to these messages, such as marking them as read, unread or delete them
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/account/11/6/inbox/messages/sit/neque" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/account/11/6/inbox/messages/sit/neque"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/account/11/6/inbox/messages/sit/neque',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/11/6/inbox/messages/sit/neque'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"messages": [
{
"email": "[email protected]",
"msg_number": 7,
"sender_name": "base64 encoded name",
"sender_email": "sender_name@sender_domain",
"subject": "base64 encoded subject",
"received_at": "2020-03-27 21:10:02",
"message": "base64 encoded message",
"attachments": [
{
"name": "attachment name",
"link": "link to attachment",
"type": "audio\/mpeg",
"size": "1087849"
},
{
"name": "attachment name",
"link": "link to attachment",
"type": "image\/png",
"size": "113939"
}
],
"opened": false
},
{
"email": "[email protected]",
"msg_number": 6,
"sender_name": "base64 encoded name",
"sender_email": "[email protected]",
"subject": "base64 encoded subject",
"received_at": "2020-03-25 11:08:21",
"message": "base64 encoded message",
"attachments": [],
"opened": false
},
{
"email": "[email protected]",
"msg_number": 5,
"sender_name": "base64 encoded name",
"sender_email": "[email protected]",
"subject": "base64 encoded subject",
"received_at": "2020-03-24 02:10:16",
"message": "base64 encoded message",
"attachments": [],
"opened": true
},
{
"email": "[email protected]",
"msg_number": 4,
"sender_name": "base64 encoded name",
"sender_email": "[email protected]",
"subject": "base64 encoded subject",
"received_at": "2020-03-24 02:08:57",
"message": "base64 encoded message",
"attachments": [],
"opened": false
},
{
"email": "[email protected]",
"msg_number": 3,
"sender_name": "base64 encoded name",
"sender_email": "[email protected]",
"subject": "base64 encoded subject",
"received_at": "2020-03-24 01:53:47",
"message": "base64 encoded message",
"attachments": [
{
"link": "link to attachment",
"type": "image\/jpeg",
"size": "54788"
}
],
"opened": false
}
],
"pagination": {
"total": 5,
"count": 5,
"per_page": 5,
"current_page": 1,
"total_pages": 1,
"prev_page": null,
"next_page": null,
"last_page": 1
}
}
Example response (200):
{
"status": "success",
"messages": "none! \/\/for ex: if you want unread messages but you don't have unread messages because all your messages have been marken as read"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters! \/\/or error related to the invalid data"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "the account was not found!"
}
HTTP Request
GET api/account/{domain}/{name}/inbox/messages/{tag?}/{action?}
URL Parameters
Parameter | Status | Description |
---|---|---|
domain |
required | The domain of the mail account which the messages you want to get belong to |
name |
required | The name of the mail account which the messages you want to get belong to |
tag |
optional | The tag of the messages you want to get. The tag can be one of the following: read, unread or all. The defaul value is unread |
action |
optional | The action which you want to apply to these messages. The action parameter can be one of the following: read to mark messages as read, unread to mark messages as unread, remove will return messages before remove them. NOTE: To use the action parameter, the tag parameter must be used as well |
Get a Message
This request will return a specific message by message id, then you can choose an action to apply to this message, such as marking the message as read, unread, delete or send it to a new email address
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/account/20/2/inbox/message/18/doloremque/" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/account/20/2/inbox/message/18/doloremque/"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/account/20/2/inbox/message/18/doloremque/',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/account/20/2/inbox/message/18/doloremque/'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"message": [
{
"email": "[email protected]",
"msg_number": 7,
"sender_name": "base64 encoded name",
"sender_email": "sender_name@sender_domain",
"subject": "base64 encoded subject",
"received_at": "2020-03-27 21:10:02",
"message": "base64 encoded message",
"attachments": [
{
"name": "attachment name",
"link": "link to attachment",
"type": "audio\/mpeg",
"size": "1087849"
},
{
"name": "attachment name",
"link": "link to attachment",
"type": "image\/png",
"size": "113939"
}
],
"opened": false
}
]
}
Example response (200):
{
"status": "success",
"message": [
{
"email": "[email protected]",
"msg_number": 7,
"sender_name": "base64 encoded name",
"sender_email": "sender_name@sender_domain",
"subject": "base64 encoded subject",
"received_at": "2020-03-27 21:10:02",
"message": "base64 encoded message",
"attachments": [
{
"name": "attachment name",
"link": "link to attachment",
"type": "audio\/mpeg",
"size": "1087849"
},
{
"name": "attachment name",
"link": "link to attachment",
"type": "image\/png",
"size": "113939"
}
],
"opened": false
}
],
"info": "the message successfully deleted"
}
Example response (200):
{
"status": "success",
"info": "message was sent successfully"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters! \/\/or error related to the invalid data"
}
Example response (403):
{
"status": "failure",
"error": "limitation",
"info": "sending limit has been reached"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "the account was not found!"
}
Example response (404):
{
"status": "failure",
"error": "invalid",
"info": "unknown message id!"
}
Example response (500):
{
"status": "failure",
"error": "internal",
"info": "message was not sent!"
}
Example response (500):
{
"status": "failure",
"error": "internal",
"info": "something went wrong!"
}
HTTP Request
GET api/account/{domain}/{name}/inbox/message/{msgID}/{action?}/{sendTo?}
URL Parameters
Parameter | Status | Description |
---|---|---|
domain |
required | The domain of the mail account which the message you want to get belongs to |
name |
required | The name of the mail account which the message you want to get belongs to |
msgID |
required | The id of the message you want to get. The id must be in the following form "msg-{id}" where id the message number you get from the previous requests |
action |
optional | The action which you want to apply on these messages. The action parameter can be one of the following: read to mark the message as read, unread to mark the message as unread, remove will return message before remove it or send to send the message |
send_to |
optional | The email address which you want to send a message to. NOTE: To use this send_to parameter you have to use the action parameter as well and must be action="send" like .../msg-{id}/send/[email protected] |
Send Custom Message
Only available for private domains. This request will send a new message to a choosen email address. You can send to up 100 recipients and you can send attachments too.
Example request:
curl -X POST \
"https://www.spectremail.com/api/message/send" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}" \
-d '{"send_to":[],"subject":"magni","from_name":"nulla","from_email":"aut","message":"et","attachments":[]}'
const url = new URL(
"https://www.spectremail.com/api/message/send"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
let body = {
"send_to": [],
"subject": "magni",
"from_name": "nulla",
"from_email": "aut",
"message": "et",
"attachments": []
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://www.spectremail.com/api/message/send',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
'json' => [
'send_to' => [],
'subject' => 'magni',
'from_name' => 'nulla',
'from_email' => 'aut',
'message' => 'et',
'attachments' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/message/send'
payload = {
"send_to": [],
"subject": "magni",
"from_name": "nulla",
"from_email": "aut",
"message": "et",
"attachments": []
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"info": "message was sent successfully"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid parameters",
"errors": "array of invalid parameters"
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid attachments array",
"attachments": [
"Array of objects of invalid attachments"
]
}
Example response (400):
{
"status": "failure",
"error": "invalid",
"info": "invalid name for some attachments",
"attachments": [
"Array of objects of invalid attachments"
]
}
Example response (400):
{
"status": "failure",
"error": "not found",
"info": "some attachments were not found",
"attachments": [
"Array of objects of attachments which were not found on the container server"
]
}
Example response (400):
{
"status": "failure",
"error": "forbidden",
"info": "forbidden, connection was closed by the website you are trying to get attachments from!",
"attachments": [
"Array of objects of attachments which the container server forbid connetion to get these attachments"
]
}
Example response (403):
{
"status": "failure",
"error": "limitation",
"info": "you can't send to more than a 100 recipients"
}
Example response (403):
{
"status": "failure",
"error": "limitation",
"info": "you can't send from public domains"
}
Example response (403):
{
"status": "failure",
"error": "limitation",
"info": "you can't send more than 10 attachments"
}
Example response (403):
{
"status": "failure",
"error": "limitation",
"info": "attachment size exceed limit, attachments size: ATTACHMENTS_SIZE Bytes, allowed size: ALLOWED_SIZE Bytes"
}
Example response (403):
{
"status": "failure",
"error": "limitation",
"info": "sending limit will be exceeded"
}
Example response (404):
{
"status": "failure",
"error": "not found",
"info": "unknown from_email address"
}
Example response (500):
{
"status": "failure",
"error": "internal",
"info": "message was not sent!"
}
Example response (500):
{
"status": "failure",
"error": "internal",
"info": "something went wrong!"
}
HTTP Request
POST api/message/send
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
send_to |
array | required | Array of recipients where each recipient is a valid email address. Array size much not exceed a 100 recipients |
subject |
string | required | The subject of the message |
from_name |
string | required | Your name or the name you would like to display to the recipient |
from_email |
string | required | The email address of the mail account you want to send the message from. You must create this mail account before you be able to send a message from |
message |
string | required | The message you want to send. This message could be a simple text or html |
attachments |
array | optional | optional Array of attachments you want to send, where each attachment is an object that has 2 properties. The first property is: "url" which must has a value of a valid attachment link, where the link must end with extension or extenstion before "?". The second property is: "name" which must has a value of a valid name for the attachment |
User Data
APIs for managing token and getting general info
Get Your Requests
Get the number of your requests.
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/requests/autem" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/requests/autem"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/requests/autem',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/requests/autem'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"requests": 2842
}
HTTP Request
GET api/requests/{total}
URL Parameters
Parameter | Status | Description |
---|---|---|
total |
required | Use the parameter total = "total" to get the total remaning requests in your package, or total = "today" to get the total requests you have sent today. For ex: api/requests/total or api/requests/today |
Get Your Sent Messages Number
Get the number of the messages you have sent.
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/messages/sent/tempore" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/messages/sent/tempore"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/messages/sent/tempore',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/messages/sent/tempore'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"sent": 57
}
HTTP Request
GET api/messages/sent/{total}
URL Parameters
Parameter | Status | Description |
---|---|---|
total |
required | Use the parameter total = "total" to get the total messages you have sent since your registeration, or total = "today" to get the total messages you have sent today. . For ex: api/messages/sent/total or api/messages/sent/today |
Get Your Received Messages Number
Get the number of the messages you have received.
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/messages/received/itaque" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/messages/received/itaque"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/messages/received/itaque',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/messages/received/itaque'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"received": 179
}
HTTP Request
GET api/messages/received/{total}
URL Parameters
Parameter | Status | Description |
---|---|---|
total |
required | Use the parameter total = "total" to get the total messages you have received since your registeration, or total = "today" to get the total messages you have received today. For ex: api/messages/received/total or api/messages/received/today |
Get Mails Number
Get the number of the mails you have created.
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/mails/created/officiis" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/mails/created/officiis"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/mails/created/officiis',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/mails/created/officiis'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"mails": 81
}
HTTP Request
GET api/mails/created/{total}
URL Parameters
Parameter | Status | Description |
---|---|---|
total |
required | Use the parameter total = "total" to get the total mails you have created since your registeration, or total = "today" to get the total mails you have created today. For ex: api/mails/created/total or api/mails/created/today |
Refresh Your Token
This request will remove your current token and create a new one
Example request:
curl -X GET \
-G "https://www.spectremail.com/api/token/new" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/token/new"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://www.spectremail.com/api/token/new',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/token/new'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"new-token": "Bearer {API Token}",
"old-token": "invalid",
"info": "you can change your token once per 24 hours"
}
Example response (401):
{
"status": "failure",
"error": "unauthorized",
"info": "unauthorized"
}
Example response (405):
{
"status": "failure",
"error": "limitation",
"info": "you can change your token once per 24 hours, remaining: hh:mm:ss"
}
Example response (500):
{
"status": "failure",
"error": "internal",
"info": "could not create token"
}
HTTP Request
GET api/token/new
Remove Your Token
This request will remove your current token without creating a new one
Example request:
curl -X DELETE \
"https://www.spectremail.com/api/token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {API Token}"
const url = new URL(
"https://www.spectremail.com/api/token"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {API Token}",
};
fetch(url, {
method: "DELETE",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://www.spectremail.com/api/token',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {API Token}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://www.spectremail.com/api/token'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {API Token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"info": "api token has been removed"
}
Example response (500):
{
"status": "failure",
"error": "internal",
"info": "api token was not removed"
}
HTTP Request
DELETE api/token