Import selected devices as nodes, atomically.
const url = 'https://example.com/api/v1/meraki/import';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"devices":[{"lan_ip":"example","model":"example","name":"example","network_id":"example","network_name":"example","product_type":"example","serial":"example"}],"file_by_prefix":true,"monitored_network_ids":["example"],"org_uuid":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/meraki/import \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "devices": [ { "lan_ip": "example", "model": "example", "name": "example", "network_id": "example", "network_name": "example", "product_type": "example", "serial": "example" } ], "file_by_prefix": true, "monitored_network_ids": [ "example" ], "org_uuid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'A device whose address falls inside exactly one folder’s IP range is filed in that folder; every other device goes under the organization’s folder, in a folder named after its network. Already-imported serials are skipped rather than rejected, so importing again after a partial selection does the obvious thing instead of erroring on the ones already there.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
One device to import. Only serial is read (ADR-164 decision 39): everything else about the
device — its name, model, network and address — is taken from what this organization’s last
sync recorded, never from the request. A page opened before Meraki renamed a device used to
create the node under the old name, and the node then never followed a rename again. The other
fields are accepted and ignored, so a client that still sends them keeps working.
object
Ignored; the inventory’s address is used.
Ignored.
Ignored; the inventory’s name is used.
Ignored.
Ignored.
Ignored.
File each device into the folder whose IP range holds its address, when exactly one does;
false files every device under the organization’s network folders. Absent means the
organization’s own file_by_prefix setting — what its page shows and the sync uses.
Networks to start watching along with the import — normally the ones devices are in.
Collection asks the Dashboard about watched networks only, so a device imported from a
network that stays unwatched becomes a node nothing is collected for. Absent or empty
changes no network. ⚠️ With automatic import on, watching a network also makes the next
sync import every other device in it.
Examplegenerated
{ "devices": [ { "lan_ip": "example", "model": "example", "name": "example", "network_id": "example", "network_name": "example", "product_type": "example", "serial": "example" } ], "file_by_prefix": true, "monitored_network_ids": [ "example" ], "org_uuid": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “Responses”How many devices became nodes and how they were filed; already-imported serials are skipped, and an MX whose network’s LAN side has not been read yet is not imported (waiting_lan)
What an import created, and where it put it.
object
Devices asked for that are already a node of another organization (the device was moved between organizations in Meraki). A serial is one node deployment-wide, so they were skipped.
How those devices were filed. The four add up to imported, except that all four are zero
when filing by IP range was off for this import: the request’s file_by_prefix, or the
organization’s own setting when the request leaves it out.
object
Two or more folders claimed the address equally; filed under the network folder.
Filed into the one folder whose IP range holds the device’s address.
Meraki reported no address; filed under the network folder.
No folder’s range holds the address; filed under the network folder.
Devices that became nodes. A serial that already was one is not counted.
Whether any folder carries an IP range at all. False means filed.unmatched says nothing
about the devices: there was nothing for an address to match.
MX that were asked for and not imported, because their network’s LAN side has not been read yet (ADR-164 decision 39) — their address, and so their folder, is not known. The next sync reads it; import them after that.
Examplegenerated
{ "bound_elsewhere": 1, "filed": { "ambiguous": 1, "matched": 1, "no_address": 1, "unmatched": 1 }, "imported": 1, "ranges_configured": true, "waiting_lan": 1}A serial this organization’s inventory does not hold (unknown_serial)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No valid bearer token
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Role lacks ManageConfig, or the account is restricted to folders (scope_unsupported)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No such organization
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Inventory storage is unavailable (skeleton mode)
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}