Skip to content

Assets API

Create, read, update, and delete target assets via the API.

MethodEndpointDescription
GET/assetsList all assets
GET/assets/{id}Get asset by ID
GET/projects/{id}/assetsList project assets
POST/assetsCreate asset
PUT/assets/{id}Update asset
DELETE/assets/{id}Delete asset
{
"id": "asset_abc123",
"project_id": "proj_xyz789",
"name": "Web Server 01",
"type": "server",
"ip_address": "192.168.1.10",
"hostname": "web01.example.com",
"ports": [
{"port": 80, "protocol": "tcp", "service": "http"},
{"port": 443, "protocol": "tcp", "service": "https"}
],
"os": "Ubuntu 22.04 LTS",
"status": "tested",
"notes": "Primary web server",
"tags": ["production", "web"],
"findings_count": 3,
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-16T14:30:00Z"
}
GET /assets
ParameterTypeDescription
pageintegerPage number
limitintegerItems per page
project_idstringFilter by project
typestringFilter by type
statusstringFilter by status
searchstringSearch name/IP/hostname
Terminal window
curl -X GET "https://{tenant}.nforged.com/api/v1/assets?project_id=proj_xyz789&type=server" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"success": true,
"data": [
{
"id": "asset_abc123",
"name": "Web Server 01",
"ip_address": "192.168.1.10",
"type": "server",
"status": "tested"
}
],
"meta": {
"page": 1,
"limit": 50,
"total": 45,
"pages": 1
}
}
GET /assets/{id}
Terminal window
curl -X GET "https://{tenant}.nforged.com/api/v1/assets/asset_abc123" \
-H "Authorization: Bearer YOUR_TOKEN"
POST /assets
FieldTypeRequiredDescription
project_idstringYesProject ID
namestringYesAsset name
typestringNoAsset type
ip_addressstringNoIP address
hostnamestringNoHostname
portsarrayNoPort information
osstringNoOperating system
statusstringNoTesting status
notesstringNoNotes
tagsarrayNoTags
Terminal window
curl -X POST "https://{tenant}.nforged.com/api/v1/assets" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"project_id": "proj_xyz789",
"name": "Database Server",
"type": "server",
"ip_address": "192.168.1.20",
"hostname": "db01.example.com",
"ports": [
{"port": 3306, "protocol": "tcp", "service": "mysql"}
],
"os": "Ubuntu 22.04",
"status": "not_tested"
}'
PUT /assets/{id}
Terminal window
curl -X PUT "https://{tenant}.nforged.com/api/v1/assets/asset_abc123" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "tested",
"notes": "Testing completed 2024-01-16"
}'
DELETE /assets/{id}
Terminal window
curl -X DELETE "https://{tenant}.nforged.com/api/v1/assets/asset_abc123" \
-H "Authorization: Bearer YOUR_TOKEN"

Import multiple assets:

POST /assets/bulk
{
"project_id": "proj_xyz789",
"assets": [
{"name": "Server 1", "ip_address": "192.168.1.1"},
{"name": "Server 2", "ip_address": "192.168.1.2"}
]
}

Import assets from Nmap XML:

POST /projects/{id}/import/nmap
Terminal window
curl -X POST "https://{tenant}.nforged.com/api/v1/projects/proj_xyz789/import/nmap" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@scan.xml"
TypeDescription
serverServer system
workstationDesktop/laptop
network_deviceRouter, switch, firewall
web_applicationWeb app
mobile_applicationMobile app
apiAPI endpoint
cloud_resourceCloud service
iot_deviceIoT device
otherOther type
ValueDescription
not_testedNot yet tested
in_progressCurrently testing
testedTesting complete
out_of_scopeExcluded

Next: Learn about the Reports API