Import API
The files and their columns: Import from CSV. The CLI equivalent is
dtvsol import …. Authentication and errors: see the API overview.
GET /import/template/{kind}
Section titled “GET /import/template/{kind}”The template of a kind (plans, networks, clients, services): {"ok": true, "kind": "clients", "csv": "mac,ip,name,…\nAA:BB:CC:00:00:05,10.21.0.5,…\n"}.
POST /import/{kind}
Section titled “POST /import/{kind}”Checks the file and, with apply, imports it.
| Name | In | Type | Notes |
|---|---|---|---|
kind |
path | string | plans, networks, clients or services. |
csv |
body | string | The file’s text. Up to 50,000 lines. |
apply |
body | boolean | Import. Without it nothing changes. |
skip_errors |
body | boolean | With apply: import the good lines. Without it, one bad line imports nothing. |
curl -s -X POST "http://ROUTER-IP:8880/import/clients" -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" --data-binary @- <<EOF{"csv": "mac,ip,name\nAA:BB:CC:00:00:05,10.21.0.5,Juan Perez\n", "apply": false}EOF{ "ok": true, "kind": "clients", "dry_run": true, "lines": 2, "good": 1, "clean": false, "errors": [{"line": 3, "error": "IP 10.99.99.9 does not belong to any interface on this server"}], "count": 1, "done": ["AA:BB:CC:00:00:05"], "note": null}line is the line of the file (the header is line 1). dry_run: false when it imported; done
then lists what was imported (its first 500; count all). 400 for a header with an unknown or
missing column.
This site was written with the help of AI and checked by our team.