Meraki API Tutorial: How to Get Your Organization ID and Network ID
When transitioning from configuring Cisco Meraki networks manually via the GUI dashboard to automating network deployments with the Meraki API, the very first hurdle is gathering your foundational identifiers. Before you can clone a site, update firewall rules, or provision new hardware programmatically, you need two critical pieces of information: your Meraki Organization ID and your Meraki Network ID.
In this step-by-step guide, we will walk through how to enable API access, generate your secure API key, and use both Postman and Python to retrieve your Organization and Network IDs so you can start automating your network deployments.
Step 1: Enable API Access in the Meraki Dashboard
By default, API access is disabled for Meraki organizations as a security measure. To interact with the dashboard programmatically, you must explicitly permit API access.
-
Log in to your Cisco Meraki Dashboard.
-
Navigate to Organization > Settings (or Configuration settings).
-
Scroll down to the Dashboard API access section.
-
Check the box that says Enable API access.
-
Save your changes at the bottom of the page.
Step 2: Generate Your Meraki API Key
Your API key acts as your secure password for all API calls. Treat it with the exact same security as your administrator password.
-
Click on your user profile icon in the top right corner of the dashboard.
-
Select My profile.
-
Scroll down to the API access section.
-
Click the button to Generate new API key.
-
Copy the key and store it securely in a password manager. Note: Once you close this window, you will not be able to view the full key again.
Step 3: Setting Up Your API Headers
Whether you are using Postman (a popular API testing GUI tool) or writing a Python script, every single request to the Meraki API requires specific headers to authenticate you and format the data properly.
You must include these in every call:
-
X-Cisco-Meraki-API-Key:
<Your_Generated_API_Key> -
Content-Type:
application/json -
Accept:
application/json
Step 4: Get Your Meraki Organization ID
To get a list of your networks or manipulate any global settings, you first need to know which Organization you are querying. We will hit the /organizations endpoint to pull this data.
Using Postman:
-
Open Postman and create a new
GETrequest. -
Enter the URL:
https://api.meraki.com/api/v1/organizations -
Under the Headers tab, add
X-Cisco-Meraki-API-Keyas the key and paste your actual API key as the value. AddContent-Typewith the valueapplication/json. -
Click Send. The response payload at the bottom will return a JSON array containing your Organization Name and its corresponding
id. Save thatidstring.
Using Python: For robust network automation, Python is the industry standard. Here is the complete, ready-to-run Python code to process this request:
import requests
import json
# Define the Meraki endpoint URL for Organizations
url = "https://api.meraki.com/api/v1/organizations"
# Set up the required headers for authentication and data format
headers = {
"X-Cisco-Meraki-API-Key": "YOUR_API_KEY_HERE",
"Content-Type": "application/json",
"Accept": "application/json"
}
# Execute the GET request
response = requests.get(url, headers=headers)
# Parse the JSON response
organizations = response.json()
# Print the output nicely formatted
print(json.dumps(organizations, indent=4))
Look at the terminal output and locate the id field. This is your Organization ID.
Step 5: Get Your Meraki Network ID
Now that you have your Organization ID, you can query the API to list all the individual networks (e.g., branches, teleworker setups, HQ) belonging to that organization.
Using Postman:
-
Create a new
GETrequest in Postman. -
Enter the URL:
https://api.meraki.com/api/v1/organizations/{organizationId}/networks(Make sure to replace{organizationId}with the actual ID string you grabbed in Step 4). -
Ensure your headers (
X-Cisco-Meraki-API-KeyandContent-Type) are set just like before. -
Click Send. The JSON output will generate a list of all your configured networks, including their
name(like “Branch 1” or “Net Prepare DR 1”) and their specificid.
Using Python: Here is the Python script to retrieve your network IDs dynamically:
import requests
import json
# Replace with your actual Organization ID from Step 4
org_id = "YOUR_ORG_ID_HERE"
# Define the endpoint URL dynamically using an f-string
url = f"https://api.meraki.com/api/v1/organizations/{org_id}/networks"
# Set up the required headers
headers = {
"X-Cisco-Meraki-API-Key": "YOUR_API_KEY_HERE",
"Content-Type": "application/json",
"Accept": "application/json"
}
# Execute the GET request
response = requests.get(url, headers=headers)
# Parse and format the JSON response
networks = response.json()
# Print the output
print(json.dumps(networks, indent=4))
Scroll through the JSON output in your console to find the network you want to manage or clone. The id field associated with that specific network name is your Network ID.
Next Steps: Moving Toward Automation
With your Organization ID and Network ID safely documented, you have officially unlocked the foundation of Meraki API automation. From here, you can use these IDs to execute more advanced functions: cloning existing networks to spin up new sites instantly, copying configuration templates across branches, binding devices, or updating firewall and VPN settings programmatically
Read More : Python NETCONF Automation with NCclient
Bhardwaj Vishnu is a Network Security Engineer with hands-on expertise in enterprise firewall management, network automation, and multi-vendor infrastructure. He holds Fortinet NSE 4/NSE 5, a Cisco CCNA, and the full Cisco Meraki certification track. He architects FortiGate security policies, manages Cisco Meraki MX/MS/MR deployments, and handles enterprise routing and switching. Every guide on netconfig.io comes from direct production experience — real CLI commands, verified configs.