SwitchHero API and integration guides
Follow these steps to start using the SwitchHero API:
You can create your API key from the control panel:
curl -X POST https://api.switchhero.com/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "your_password"}'
To list your switches:
curl -X GET https://api.switchhero.com/v1/switches \
-H "Authorization: Bearer YOUR_API_KEY"
All API requests must use a Bearer token:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600
}
{
"ip": "192.168.1.1",
"name": "Core Switch 1",
"model": "Cisco Catalyst 9300",
"credentials": {
"username": "admin",
"password": "secure_password"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| ip | string | Yes | Switch IP address |
| name | string | Yes | Switch display name |
| model | string | No | Switch model |
{
"ports": [
{
"id": 1,
"name": "GigabitEthernet1/0/1",
"status": "up",
"speed": "1000",
"duplex": "full",
"vlan": 1
}
]
}