# Domain
User must configure the mail domain to send emails by SendCloud.
You can query, add or modify the domain.
# Query (Batch Query)
Query domain through this interface.
URL
https://api2.sendcloud.net/api/domain/list
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
name | string | no | domain name, multiple names are separated by semicolons |
type | int | no | domain type: 0 (testing domain), 1(common domain) |
verify | string | no | domain verification value; for example, verify=1 , query the domain with verification value of 1; verify is >22 , query the domain with verification value greater than or equal to 22; verifyis <12 , query the domain with verification value less than or equal to 12 |
Tips:
Domain verification value is the value returned when SendCloud verify domain configuration.Users are required to configure domains following the guide in delivery settings
-> domain
. Here is a list of ways to calculate whether configuration items have been verified with the returned value:
type | calculation method | description |
---|---|---|
dkim | verify & 1 == 1 | DKIM configuration verified |
spf | verify & 2 == 2 | SPF configuration verified |
mx | verify & 4 == 4 | MX configuration verified |
dmarc | verify & 16 ==16 | DMARC configuration verified |
Example:
verify = 0 | Any configuration items is not verified
verify = 3 | dkim and spf are verified
verify = 7 | dkim , spf and mx are verified
verify = 22 | spf , dmarc and mx are verified
verify = 23 | dkim, spf, mx, dmarc configuration verified
2
3
4
5
Request Example
https://api2.sendcloud.net/api/domain/list?apiUser=***&apiKey=***&name=ifaxin.com
http://api2.sendcloud.net/api/domain/list?apiUser=***&apiKey=***&type=0&verify=>3
Returned value description
Parameter | Description |
---|---|
name | domain name |
type | domain type |
verify | verification value |
spf.domain | host record of SPF |
spf.value | configuration value of SPF |
dkim.domain | host record of DKIM |
dkim.value | configuration value of DKIM |
mx.domain | host record of MX |
mx.value | configuration value of MX |
dmarc.domain | host record of Dmarc |
dmarc.value | configuration value of Dmarc |
gmtCreated | time of domain creation |
gmtUpdated | time of domain modification |
ipType | 0:share , 1:independent |
Returned Value Example
{
"result": true,
"statusCode": 200,
"message": "request was successful",
"info": {
"dataList": [
{
"name": "test456.com",
"type": "ordinary",
"verify": 0,
"spf.domain": "test456.com",
"spf.value": "v=spf1 include:spf.sendcloud.org -all",
"dkim.domain": "mail._domainkey.test456.com",
"dkim.value": "k=rsa;p=***",
"mx.domain": "test456.com",
"mx.value": "mx2.sendcloud.org",
"dmarc.domain": "_dmarc.test456.com",
"dmarc.value": "v=DMARC1;p=***",
"gmtCreated": "2014-11-01 22:41:52",
"gmtUpdated": "2015-09-25 10:56:06",
"ipType":0
}
],
"count": 1
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Add
Add domains through this interface
URL
https://api2.sendcloud.net/api/domain/add
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
name | string | yes | domain name |
Tips:
1.Domain name cannot contain `sendcloud`, `ifaxin`
2.Domain name cannot be longer than 250 characters
3.Each user can add up to 5 domains
2
3
Request Example
https://api2.sendcloud.net/api/domain/add?apiUser=***&apiKey=***&name=mail.liubida.cn
Returned value description
Return to eligible domain information.
Parameter | Description |
---|---|
name | domain name |
type | domain type |
verify | verification value |
spf.domain | host record of SPF |
spf.value | configuration value of SPF |
dkim.domain | host record of DKIM |
dkim.value | configuration value of DKIM |
mx.domain | host record of MX |
mx.value | configuration value of MX |
dmarc.domain | host record of Dmarc |
dmarc.value | configuration value of Dmarc |
gmtCreated | time of domain creation |
gmtUpdated | time of domain modification |
Returned value example
{
statusCode: 200,
info: {
data: {
"name": "***",
"type": "ordinary",
"verify": 0,
"spf.domain": "***",
"spf.value": "v=spf1 include:spf.sendcloud.org ~all",
"dkim.domain": "***",
"dkim.value": "k=rsa;p=***",
"dmarc.domain": "***",
"dmarc.value": "***",
"gmtCreated": "2014-11-01 22:41:52",
"gmtUpdated": "2015-09-25 10:56:06"
}
},
message: "request was successful",
result: true
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Modify
Modify domains through this interface
URL
https://api2.sendcloud.net/api/domain/update
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
name | string | yes | domain name |
newName | string | yes | new name of domain |
Tips:
Domains with verified configuration cannot be modified
Request Example
https://api2.sendcloud.net/api/domain/update?apiUser=***&apiKey=***&name=mail.liubida.cn&name=email.liubida.cn
Returned value description
Return to eligible domain information.
Parameter | Description |
---|---|
name | domain name |
type | domain type |
verify | verification value |
spf.domain | host record of SPF |
spf.value | configuration value of SPF |
dkim.domain | host record of DKIM |
dkim.value | configuration value of DKIM |
mx.domain | host record of MX |
mx.value | configuration value of MX |
dmarc.domain | host record of Dmarc |
dmarc.value | configuration value of Dmarc |
gmtCreated | time of domain creation |
gmtUpdated | time of domain modification |
Returned value example
{
statusCode: 200,
info: {
data: {
"name": "***",
"type": "ordinary",
"verify": 30,
"spf.domain": "***",
"spf.value": "v=spf1 include:spf.sendcloud.org ~all",
"dkim.domain": "***",
"dkim.value": "k=rsa;p=***",
"dmarc.domain": "***",
"dmarc.value": "***",
"gmtCreated": "2014-11-01 22:41:52",
"gmtUpdated": "2015-09-25 10:56:06"
}
},
message: "request was successful",
result: true
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Verify
Verify domains through this interface
URL
https://api2.sendcloud.net/api/domain/checkConfig
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
name | string | no | domain name |
Note
Return to domains with verified configuration.
Request Example
https://api2.sendcloud.net/api/domain/checkConfig?apiUser=***&apiKey=***&name=mail.liubida.cn
Returned value description
Return to eligible domain information.
parameter | Description |
---|---|
name | domain name |
type | domain type |
MX | true or false |
SPF | true or false |
DKIM | true or false |
DMARC | true or false |
isConfigSuccess | true or false |
message | description |
Returned Value Example
{
"result": true,
"statusCode": 200,
"message": "request was successful",
"info": {
"dataList": [
{
"name": "zhouwj.cn",
"isConfigSuccess": true,
"configInfo": {
"MX": true,
"SPF": true,
"DKIM": true,
"DMARC": false
},
"message": "",
"type": 0
}
]
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Delete
Delete domains through this interface
URL
https://api2.sendcloud.net/api/domain/delete
HTTP Request Method
post get
Parameter Description
parameter | type | required or not | description |
---|---|---|---|
apiUser | string | yes | API_USER |
apiKey | string | yes | API_KEY |
name | string | no | domain name |
Tips:
- The configured domain that has already passed cannot be deleted.
- Domains associated with API_USER cannot be deleted.
- Test domains cannot be deleted.
Request Example
https://api2.sendcloud.net/api/domain/delete?apiUser=***&apiKey=***&name=mail.liubida.cn
Returned value description
parameter | description |
---|---|
count | amount of deleted domains |
Returned Value Example`
{
"statusCode": 200,
"info": {
"count": 1
},
"message": "request was successful",
"result": true
}
2
3
4
5
6
7
8