Endpoints API
Overview
Endpoints represent network devices by their MAC address. This is the most commonly used ERS resource for network access control automation.
Base URL |
|
Auth |
Basic Authentication (ERS Admin) |
Content-Type |
|
Pagination |
|
Filtering |
|
Setup
# Load credentials
dsource d000 dev/network
# ERS API configuration
ISE_HOST="${ISE_PAN_IP}"
ISE_PORT="9060"
ISE_AUTH="${ISE_API_USER}:${ISE_API_PASS}"
BASE_URL="https://${ISE_HOST}:${ISE_PORT}/ers/config"
Operations
List All Endpoints
# List all endpoints (curl)
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint" \
-H "Accept: application/json" | jq '.SearchResult.resources[] | {name, id}'
# List all endpoints (netapi)
netapi ise get-endpoints
{
"SearchResult": {
"total": 142,
"resources": [
{
"id": "abc123-def456-ghi789",
"name": "C8:5B:76:C6:59:62",
"link": {
"rel": "self",
"href": "https://ise-01:9060/ers/config/endpoint/abc123-def456-ghi789",
"type": "application/json"
}
}
]
}
}
Get Endpoint by MAC
# Get endpoint by MAC (curl)
MAC="C8:5B:76:C6:59:62"
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/name/${MAC}" \
-H "Accept: application/json" | jq '.ERSEndPoint'
# Get endpoint by MAC (netapi)
netapi ise get-endpoint "C8:5B:76:C6:59:62"
{
"ERSEndPoint": {
"id": "abc123-def456-ghi789",
"name": "C8:5B:76:C6:59:62",
"mac": "C8:5B:76:C6:59:62",
"profileId": "profileId-value",
"staticProfileAssignment": false,
"groupId": "groupId-value",
"staticGroupAssignment": true,
"portalUser": "",
"identityStore": "",
"identityStoreId": "",
"link": {
"rel": "self",
"href": "https://ise-01:9060/ers/config/endpoint/abc123-def456-ghi789"
}
}
}
Get Endpoint by ID
# Get endpoint by ID (curl)
ENDPOINT_ID="abc123-def456-ghi789"
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/${ENDPOINT_ID}" \
-H "Accept: application/json" | jq '.ERSEndPoint'
Create Endpoint
# Create endpoint (curl)
MAC="AA:BB:CC:DD:EE:FF"
# First, get the group ID
GROUP_ID=$(curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpointgroup/name/Linux-Workstations" \
-H "Accept: application/json" | jq -r '.EndPointGroup.id')
# Create the endpoint
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X POST \
-d "{
\"ERSEndPoint\": {
\"name\": \"${MAC}\",
\"mac\": \"${MAC}\",
\"groupId\": \"${GROUP_ID}\",
\"staticGroupAssignment\": true
}
}"
# Create endpoint (netapi)
netapi ise create-endpoint "AA:BB:CC:DD:EE:FF" --group "Linux-Workstations"
Create with Custom Attributes
# Create endpoint with description and custom attributes
MAC="AA:BB:CC:DD:EE:FF"
GROUP_ID="your-group-id"
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X POST \
-d "{
\"ERSEndPoint\": {
\"name\": \"${MAC}\",
\"mac\": \"${MAC}\",
\"description\": \"Linux workstation - Research Lab\",
\"groupId\": \"${GROUP_ID}\",
\"staticGroupAssignment\": true,
\"customAttributes\": {
\"customAttributes\": {
\"Department\": \"Research\",
\"Owner\": \"jsmith\"
}
}
}
}"
Update Endpoint
# Update endpoint (curl)
MAC="C8:5B:76:C6:59:62"
NEW_GROUP_ID="new-group-id"
# First get the endpoint ID
ENDPOINT_ID=$(curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/name/${MAC}" \
-H "Accept: application/json" | jq -r '.ERSEndPoint.id')
# Update the endpoint
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/${ENDPOINT_ID}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X PUT \
-d "{
\"ERSEndPoint\": {
\"id\": \"${ENDPOINT_ID}\",
\"name\": \"${MAC}\",
\"mac\": \"${MAC}\",
\"groupId\": \"${NEW_GROUP_ID}\",
\"staticGroupAssignment\": true
}
}"
# Update endpoint group (netapi)
netapi ise update-endpoint "C8:5B:76:C6:59:62" --group "New-Group-Name"
Delete Endpoint
# Delete endpoint (curl)
MAC="AA:BB:CC:DD:EE:FF"
# Get endpoint ID
ENDPOINT_ID=$(curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/name/${MAC}" \
-H "Accept: application/json" | jq -r '.ERSEndPoint.id')
# Delete
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/${ENDPOINT_ID}" \
-X DELETE
echo "Deleted endpoint ${MAC}"
# Delete endpoint (netapi)
netapi ise delete-endpoint "AA:BB:CC:DD:EE:FF"
Bulk Operations
Bulk Create
# Bulk create endpoints (curl)
GROUP_ID="your-group-id"
cat > /tmp/endpoints.json << EOF
{
"ERSEndPointBulkRequest": {
"operationType": "create",
"resourceMediaType": "application/json",
"ERSEndPoint": [
{"mac": "AA:BB:CC:DD:EE:01", "groupId": "${GROUP_ID}", "staticGroupAssignment": true},
{"mac": "AA:BB:CC:DD:EE:02", "groupId": "${GROUP_ID}", "staticGroupAssignment": true},
{"mac": "AA:BB:CC:DD:EE:03", "groupId": "${GROUP_ID}", "staticGroupAssignment": true}
]
}
}
EOF
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/bulk/submit" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X PUT \
-d @/tmp/endpoints.json
Bulk Delete
# Bulk delete endpoints (curl)
cat > /tmp/delete-endpoints.json << 'EOF'
{
"ERSEndPointBulkRequest": {
"operationType": "delete",
"resourceMediaType": "application/json",
"idList": [
"endpoint-id-1",
"endpoint-id-2",
"endpoint-id-3"
]
}
}
EOF
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/bulk/submit" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-X PUT \
-d @/tmp/delete-endpoints.json
Filtering
Filter Operators
# ERS Filter Operators
EQ - Equals
NEQ - Not Equals
STARTSW - Starts With
ENDSW - Ends With
CONTAINS - Contains
GT - Greater Than
LT - Less Than
GE - Greater Than or Equal
LE - Less Than or Equal
# Examples
filter=mac.STARTSW.C8:5B
filter=name.CONTAINS.workstation
filter=staticGroupAssignment.EQ.true
Pagination
# Pagination loop (curl)
PAGE=1
SIZE=100
TOTAL=0
while true; do
RESULT=$(curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint?size=${SIZE}&page=${PAGE}" \
-H "Accept: application/json")
COUNT=$(echo "$RESULT" | jq '.SearchResult.resources | length')
TOTAL=$((TOTAL + COUNT))
echo "Page ${PAGE}: ${COUNT} results"
echo "$RESULT" | jq -r '.SearchResult.resources[].name'
[[ "$COUNT" -lt "$SIZE" ]] && break
((PAGE++))
done
echo "Total endpoints: ${TOTAL}"
Count Endpoints
# Count total endpoints (curl)
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint?size=1" \
-H "Accept: application/json" | jq '.SearchResult.total'
# Count endpoints (netapi)
netapi ise get-endpoints --format json | jq 'length'
Export to CSV
# Export endpoints to CSV (curl)
echo "MAC,Group ID,Static Assignment" > endpoints.csv
PAGE=1
SIZE=100
while true; do
RESULT=$(curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint?size=${SIZE}&page=${PAGE}" \
-H "Accept: application/json")
COUNT=$(echo "$RESULT" | jq '.SearchResult.resources | length')
# Get full details for each endpoint
for id in $(echo "$RESULT" | jq -r '.SearchResult.resources[].id'); do
curl -sk -u "${ISE_AUTH}" \
"${BASE_URL}/endpoint/${id}" \
-H "Accept: application/json" | \
jq -r '.ERSEndPoint | [.mac, .groupId, .staticGroupAssignment] | @csv' >> endpoints.csv
done
[[ "$COUNT" -lt "$SIZE" ]] && break
((PAGE++))
done
echo "Exported to endpoints.csv"
# Export endpoints to CSV (netapi)
netapi ise get-endpoints --format json | \
jq -r '["MAC","Group","Static"] as $h | $h, (.[] | [.mac, .groupId, .staticGroupAssignment]) | @csv' \
> endpoints.csv
Common Patterns
Verify Endpoint Exists
# Verify endpoint exists and get details
MAC="C8:5B:76:C6:59:62"
if endpoint=$(netapi ise get-endpoint "${MAC}" --format json 2>/dev/null); then
echo "Endpoint found:"
echo "$endpoint" | jq '{mac, groupId, staticGroupAssignment}'
else
echo "Endpoint ${MAC} not found"
exit 1
fi
Search and Update
# Find endpoints without group and assign to default group
DEFAULT_GROUP_ID="your-default-group-id"
# Find ungrouped endpoints
netapi ise get-endpoints --format json | \
jq -r '.[] | select(.staticGroupAssignment == false) | .mac' | \
while read mac; do
echo "Assigning ${mac} to default group"
netapi ise update-endpoint "${mac}" --group-id "${DEFAULT_GROUP_ID}"
done
Request/Response Schema
ERSEndPoint Object
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
No (auto) |
UUID assigned by ISE |
|
string |
No |
Display name (defaults to MAC) |
|
string |
Yes |
MAC address (XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX) |
|
string |
No |
Free-text description |
|
string |
No |
Endpoint group UUID |
|
boolean |
No |
Lock group assignment (default: false) |
|
string |
No |
Profiler profile UUID |
|
boolean |
No |
Lock profile assignment |
|
string |
No |
Associated portal user |
|
string |
No |
Identity store name |
|
string |
No |
Identity store UUID |
|
object |
No |
Custom attribute key-value pairs |
Error Codes
| Code | Meaning | Resolution |
|---|---|---|
400 |
Invalid MAC format |
Use format |
401 |
Unauthorized |
Verify credentials, check ERS Admin role |
404 |
Endpoint not found |
Verify MAC exists: |
409 |
Endpoint already exists |
Use PUT to update, or DELETE first |
422 |
Invalid group ID |
Verify group exists: |