Skip to main content

API / Import

MethodEndpointDescription
GETapi/import/subscribersGets a import statistics.
GETapi/import/subscribers/logsGet a import statistics .
POSTapi/import/subscribersUpload a ZIP file or CSV file to bulk import subscribers.
DELETEapi/import/subscribersStops and deletes a import.

GET api/import/subscribers

Gets import status.

Example Request
curl -u "username:username" -X GET 'http://localhost:9000/api/import/subscribers'
Example Response
{
"data": {
"name": "",
"total": 0,
"imported": 0,
"status": "none"
}
}

GET api/import/subscribers/logs

Gets import logs.

Example Request
curl -u "username:username" -X GET 'http://localhost:9000/api/import/subscribers/logs'
Example Response
{
"data": "2020/04/08 21:55:20 processing 'import.csv'\n2020/04/08 21:55:21 imported finished\n"
}

POST api/import/subscribers

Post a CSV (optionally zipped) file to do a bulk import. The request should be a multipart form POST.

Parameters
NameParameter typeData typeRequired/OptionalDescription
paramsRequest bodyStringRequiredStringified JSON with import params
fileRequest bodyFileRequiredFile to upload

params (JSON string)

    {
"mode": "subscribe", // subscribe or blocklist
"delim": ",", // delimiter in the uploaded file
"lists":[1], // array of list IDs to import into
"overwrite": true // overwrite existing entries or skip them?
}

DELETE api/import/subscribers

Stops and deletes an import.

Example Request
curl -u "username:username" -X DELETE 'http://localhost:9000/api/import/subscribers' 
Example Response
{
"data": {
"name": "",
"total": 0,
"imported": 0,
"status": "none"
}
}