Route

Last updated:2025-03-27

You can use the API to query, add, modify, and delete receiving routes. The route you configured needs to be recorded through MX configuration first. We can forward reply message to the mailbox you specify or push the message to the specified URL.

Query( batch)

URL

https://email.api.engagelab.cc/v1/routes
          https://email.api.engagelab.cc/v1/routes

        
This code block in the floating window

HTTP Request Method

GET
          GET

        
This code block in the floating window

Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Parameter Description

parameter type required or not description
offset int no offset position, [0-], defaults to 0
limit int no amount, [0-100],defaults to 100

Request Example

curl "https://email.api.engagelab.cc/v1/routes?offset=0&limit=200" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
          curl "https://email.api.engagelab.cc/v1/routes?offset=0&limit=200" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"

        
This code block in the floating window

Returned Value Description

parameter description
route_id route ID
expression receiving route
action URL/Email
api_user_route When the action is set to "Email" this parameter is required.

Returned Value Example:

Response-success HTTP Status: 200

{ "result": [ { "route_id": 1, "expression":"xjmfc", "action":"test@engagelab.com" "create_time": "2022-11-14T14:27:48+0800", "update_time": "2022-11-14T14:27:48+0800", "api_user_route":"test" } ], "total": 1, "count": 1 }
          {
       "result": [
            {    
                "route_id": 1,
                "expression":"xjmfc",
                "action":"test@engagelab.com"
                "create_time": "2022-11-14T14:27:48+0800",
                "update_time": "2022-11-14T14:27:48+0800""api_user_route":"test"
            }
        ],
        "total": 1,
        "count": 1
 }

        
This code block in the floating window

Query

URL

https://email.api.engagelab.cc/v1/routes/{route_id}
          https://email.api.engagelab.cc/v1/routes/{route_id}

        
This code block in the floating window

HTTP Request Method

GET
          GET

        
This code block in the floating window

Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Request Example

curl -X GET "https://email.api.engagelab.cc/v1/routes/112" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>" --header "Content-Type: application/json"
          curl -X GET "https://email.api.engagelab.cc/v1/routes/112" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 

        
This code block in the floating window

Returned Value Description

parameter description
route_id route ID
expression receiving route
action URL/Email
api_user_route When the action is set to "Email" this parameter is required.

Returned Value Example:

Response-success

HTTP Status: 200

{ "result": { "route_id": 1, "expression":"xjmfc", "action":"test@engagelab.com", "api_user_route": "sctest", "create_time": "2022-11-14T14:27:48+0800", "update_time": "2022-11-14T14:27:48+0800" } }
          {
       "result": {    
                "route_id": 1,
                "expression":"xjmfc",
                "action":"test@engagelab.com",
                "api_user_route": "sctest",
                "create_time": "2022-11-14T14:27:48+0800",
                "update_time": "2022-11-14T14:27:48+0800"
          }
 }

        
This code block in the floating window

Add

A user can add up to 1000 receiving routes.

URL

https://email.api.engagelab.cc/v1/routes
          https://email.api.engagelab.cc/v1/routes

        
This code block in the floating window

HTTP Request Method

POST
          POST

        
This code block in the floating window

Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Parameter Description

parameter type required or not description
expression string yes receiving route. Format is 'regular expression@domain'; it can also be a specific email address. The domain/email domain must be a verified or usable sending domain.
action string yes URL/Email
api_user_route string * When the action is set to "Email" this parameter is required. When forwarding to an email, this API-USER will be used for forwarding and sending.

Request Example

curl -X POST "https://email.api.engagelab.cc/v1/routes" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>" --header "Content-Type: application/json" --data '{ "expression":"hongkong@aizl.net", "action":"test@engagelab.com" }'
          curl -X POST "https://email.api.engagelab.cc/v1/routes" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "expression":"hongkong@aizl.net",
  "action":"test@engagelab.com"
}'

        
This code block in the floating window

Returned Value Description

parameter description
route_id route ID
expression receiving route
action URL /Email
api_user_route When the action is set to "Email" this parameter is required.

Returned Value Example:

{ "result": { "route_id": 598802, "expression":".*@123.com", "action":"test@engagelab.com" "api_user_route":"test233" "create_time": "2022-11-14T14:27:34+0800", "update_time": "2022-11-14T14:27:34+0800" } }
          {
   "result": {
            "route_id": 598802,
            "expression":".*@123.com",
            "action":"test@engagelab.com"
            "api_user_route":"test233"
            "create_time": "2022-11-14T14:27:34+0800",
            "update_time": "2022-11-14T14:27:34+0800"
    }
}

        
This code block in the floating window

Modify

URL

https://email.api.engagelab.cc/v1/routes/{route_id}
          https://email.api.engagelab.cc/v1/routes/{route_id}

        
This code block in the floating window

HTTP Request Method

PUT
          PUT

        
This code block in the floating window

Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Parameter Description

parameter type required or not description
expression string * receiving route
action string * URL/ Email
api_user_route string * When the action is set to "Email" this parameter is required.

Request Example

curl -X PUT "https://email.api.engagelab.cc/v1/routes/12333" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>" --header "Content-Type: application/json" --data '{ "expression":"travel", "action":"test@engagelab.com" }'
          curl -X PUT "https://email.api.engagelab.cc/v1/routes/12333" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
  "expression":"travel",
  "action":"test@engagelab.com"
}'

        
This code block in the floating window

Returned Value Description

parameter description
count count of modified receiving route

Returned Value Example:

Response-success

HTTP Status: 200

{ "count": 1 }
          {
    "count": 1
}

        
This code block in the floating window

Response-error

HTTP Status :401

{ "code": 30000, "message": "Authentication failed." }
                    
{
    "code": 30000,
    "message": "Authentication failed."
}

        
This code block in the floating window

Delete

URL

https://email.api.engagelab.cc/v1/routes/{route_id}
          https://email.api.engagelab.cc/v1/routes/{route_id}

        
This code block in the floating window

HTTP Request Method

DELETE
          DELETE

        
This code block in the floating window

Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Request Example

curl -X DELETE "https://email.api.engagelab.cc/v1/routes/21122" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>"
          curl -X DELETE "https://email.api.engagelab.cc/v1/routes/21122" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>"

        
This code block in the floating window

Returned Value Description

parameter description
count count of deleted receiving route

Returned Value Example:

{ "count": 1 }
                   
{
    "count": 1
}

        
This code block in the floating window
在文档中心打开
icon
Contact Sales