追踪域名
管理您的追踪域名。
查询
获取追踪域名列表
URL
https://email.api.engagelab.cc/v1/tracking-domains
HTTP请求方式
GET
请求Header
Header | 类型 | 必须 | 说明 |
---|---|---|---|
Authorization | String | true | Basic base64(apiUser:apiKey) |
Query 参数说明
参数 | Type | 必须 | 说明 |
---|---|---|---|
name | string | no | 域名名称 |
offset | int | no | 记录偏移量, [0-], 默认为 0 |
limit | int | no | 数量, [0-100], 默认为 100 |
请求示例
curl "https://email.api.engagelab.cc/v1/tracking-domains?name=engagelab.com"
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
响应说明
参数 | 说明 |
---|---|
domain_id | 域名 ID |
name | 域名名称 |
cname | 有关域名CNAME记录的详细信息 |
verify | 配置是否成功(true或false) |
verify_message | 描述 CNAME 记录的消息,如果记录正确则为 null |
required_record | 要配置的 CNAME 记录 |
existed_record | 用户配置的CNAME记录 |
cert | 有关域名证书的详细信息 |
verify | 配置是否成功(true或false) |
verify_message | 证书未上传、证书配置中、证书已生效、证书已过期 |
expired_date | 到期日期 |
create_time | 域名创建时间 |
update_time | 域名修改时间 |
响应示例
Response-success
HTTP Status: 200
{
"result": [
{
"domain_id": 1000403,
"name": "track.leonww.asia",
"create_time": "2025-04-18T13:27:38+0800",
"update_time": "2025-09-04T12:32:56+0800",
"cname": {
"verify": true,
"verify_message": "The configuration is successful",
"required_record": "track01.engagelab.email",
"existed_record": "track01.engagelab.email"
},
"cert": {
"verify": true,
"verify_message": "the certificate has taken effect",
"expired_date": "2025-12-02T07:59:59+0800"
}
},
{
"domain_id": 1000402,
"name": "track.myMail.com",
"create_time": "2025-04-18T13:05:57+0800",
"update_time": "2025-04-18T13:05:57+0800",
"cname": {
"verify": false,
"verify_message": "The cname record is not configured",
"required_record": "track01.engagelab.email",
"existed_record": ""
},
"cert": {
"verify": false,
"verify_message": "the certificate has not been uploaded",
"expired_date": ""
}
}
],
"total": 2,
"count": 2
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
添加
为您的帐户添加追踪域名。
URL
https://email.api.engagelab.cc/v1/tracking-domains
Content-Type:
application/json; charset=utf-8
HTTP 请求方式
POST
请求 Headers
Header | 类型 | 必须 | 说明 |
---|---|---|---|
Authorization | String | true | Basic base64(apiUser:apiKey) |
Body 参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
name | string | yes | 域名名称 |
注意:
您最多可以添加 5 个自定义跟踪域名。域名配置一旦验证通过,将无法修改。错误的配置可能会导致邮件中的链接无法点击、跟踪数据不准确等问题。
由于 Chrome 和其他浏览器的升级,未来 HTTP 资源的加载将被禁止,这可能会导致内容被错误标记(例如,标记为不安全),从而导致跟踪数据问题。强烈建议您在 HTTPS 配置中上传 SSL 证书并启用 HTTPS 跟踪。在 HTTPS 配置中上传 SSL 证书并启用 HTTPS 跟踪。
请求示例
curl -X POST "https://email.api.engagelab.cc/v1/tracking-domains"
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
--header "Content-Type: application/json"
--data '{
"name":"track.leonww.asia"
}'
响应说明
参数 | 说明 |
---|---|
domain_id | 域名 ID |
name | 域名名称 |
cname | 有关域名CNAME记录的详细信息 |
verify | 配置是否成功(true或false) |
verify_message | 描述 CNAME 记录的消息,如果记录正确则为 null |
required_record | 要配置的 CNAME 记录 |
existed_record | 用户配置的CNAME记录 |
create_time | 域名创建时间 |
update_time | 域名修改时间 |
响应示例
Response-success
HTTP Status: 200
{
"result":
{
"domain_id": 1000423,
"name": "track.leonww.asia",
"create_time": "2025-09-03T13:42:41+0800",
"update_time": "2025-09-03T13:42:41+0800",
"cname": {
"verify": false,
"verify_message": "The cname record is not configured",
"required_record": "track01.engagelab.email",
"existed_record": ""
}
}
}
Response-error
HTTP Status :400
{
"code": 31003,
"message": "Domain name format error"
}
修改
通过此接口修改追踪域名。
URL
https://email.api.engagelab.cc/v1/tracking-domains/{domain_id}
Content-Type:
application/json; charset=utf-8
HTTP 请求方式
PUT
请求 Headers
Header | 类型 | 必须 | 说明 |
---|---|---|---|
Authorization | String | true | Basic base64(apiUser:apiKey) |
Body 参数说明
Parameter | Type | Required or not | Description |
---|---|---|---|
name | string | yes | 域名。它必须符合域名格式,只能包含字母数字字符、连字符 (-) 和句点 (.),长度必须在 4 到 255 个字符之间(例如,mail.test.best)。 |
请求示例
curl -X PUT "https://email.api.engagelab.cc/v1/tracking-domains/22332"
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
--header "Content-Type: application/json"
--data '{
"name":"aizl.net",
}'
响应示例
Response-success
HTTP Status: 200
{
"count": 1
}
Response-error
HTTP Status :400
{
"code": 31003,
"message": "Domain name format error"
}
验证
通过此接口验证追踪域名
URL
https://email.api.engagelab.cc/v1/tracking-domains/{domain_id}/verify
HTTP 请求方式
GET
注意
返回已验证配置的域名。
请求 Headers
curl -X POST "https://email.api.engagelab.cc/v1/tracking-domains/123/verify"
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
响应说明
参数 | 说明 |
---|---|
domain_id | 域名 ID |
name | 域名名称 |
cname | 有关域名CNAME记录的详细信息 |
verify | 配置是否成功(true或false) |
verify_message | 描述 CNAME 记录的消息,如果记录正确则为 null |
required_record | 要配置的 CNAME 记录 |
existed_record | 用户配置的CNAME记录 |
cert | 有关域名证书的详细信息 |
verify | 配置是否成功(true或false) |
verify_message | 证书未上传、证书配置中、证书已生效、证书已过期 |
expired_date | 到期日期 |
create_time | 域名创建时间 |
update_time | 域名修改时间 |
响应示例
Response-success
HTTP Status: 200
{
"result": {
"domain_id": 1000403,
"name": "track.leonww.asia",
"create_time": "2025-04-18T13:27:38+0800",
"update_time": "2025-09-04T12:32:56+0800",
"cname": {
"verify": true,
"verify_message": "The configuration is successful",
"required_record": "track01.engagelab.email",
"existed_record": "track01.engagelab.email"
},
"cert": {
"verify": true,
"verify_message": "the certificate has taken effect",
"expired_date": "2025-12-02T07:59:59+0800"
}
}
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
添加证书
添加追踪域名的证书
URL
https://email.api.engagelab.cc/v1/tracking-domains/{domain_id}/cert
Content-Type:
application/json; charset=utf-8
HTTP 请求方式
POST
Body 参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
cert_content | string | yes | 表示证书内容。该值必须采用 PEM 编码。 |
cert_key | string | yes | 表示证书私钥。该值必须采用 PEM 编码。 |
请求示例
curl -X POST "https://email.api.engagelab.cc/v1/tracking-domains/123/cert"
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
--data '{
"cert_content":"...",
"cert_key":"...",
}'
响应说明
参数 | 说明 |
---|---|
domain_id | 域名 ID |
name | 域名名称 |
cert | 有关域名证书的详细信息 |
verify | 配置是否成功(true或false) |
verify_message | 证书未上传、证书配置中、证书已生效、证书已过期 |
expired_date | 到期日期 |
create_time | 域名创建时间 |
update_time | 域名修改时间 |
响应示例
Response-success
HTTP Status: 200
{
"result": {
"domain_id": 1000403,
"name": "track.leonww.asia",
"create_time": "2025-04-18T13:27:38+0800",
"update_time": "2025-09-04T12:32:56+0800",
"cert": {
"verify": false,
"verify_message": "the certificate is being configured",
"expired_date": "2025-12-02T07:59:59+0800"
}
}
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
更新证书
更新追踪域名的证书
URL
https://email.api.engagelab.cc/v1/tracking-domains/{domain_id}/cert
Content-Type:
application/json; charset=utf-8
HTTP 请求方式
PUT
Body 参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
cert_content | string | yes | 表示证书内容。该值必须采用 PEM 编码。 |
cert_key | string | yes | 表示证书私钥。该值必须采用 PEM 编码。 |
请求示例
curl -X PUT "https://email.api.engagelab.cc/v1/tracking-domains/{domain_id}/cert"
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
Response-success
HTTP Status: 200
{
"count": 1
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}
更新 API_USER
更新与 API_USER 关联的跟踪域和跟踪开关配置
URL
https://email.api.engagelab.cc/v1/api_users/{api_user}
Content-Type:
application/json; charset=utf-8
HTTP 请求方式
PUT
Body 参数说明
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
domain_name | string | no | API_USER 绑定的域名 |
track_domain_name | string | no | API_USER 绑定的追踪域名 |
open_tracking | boolean | no | 是否启用开放追踪。值:false(禁用)、true(启用)。默认为 false。 |
click_tracking | boolean | no | 是否启用点击跟踪。值:false(禁用)、true(启用);默认为 false。 |
unsubscribe_tracking | boolean | no | 是否启用取消订阅跟踪。值:false(禁用)、true(启用);默认为 true。 |
请求示例
curl -X PUT "https://email.api.engagelab.cc/v1/api_users/{api_user}"
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
Response-success
HTTP Status: 200
{
"count": 1
}
Response-error
HTTP Status :401
{
"code": 30000,
"message": "Unauthorized."
}