Entity Relations
This API endpoint provides relationship information about a specific threat intelligence entity in a graph format, showing how the entity is connected to other entities in the ThreatWinds platform.
Endpoint: https://apis.threatwinds.com/api/analytics/v1/entity/{id}/relations
Parameters
Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Optional | Bearer token from an active session. Authentication is optional but improves rate limits. |
| api-key | string | Optional | API key. Authentication is optional but improves rate limits. |
| api-secret | string | Optional | API secret. Authentication is optional but improves rate limits. |
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The unique identifier of the entity you want to retrieve relations for |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Maximum number of related entities to return (default: 50, max: 100) |
| levels | integer | No | Number of relationship levels to include in the graph (default: 3, max: 5) |
Note: Out-of-range
limitandlevelsvalues are silently clamped to their respective defaults rather than rejected with a 400 error. Non-numeric or negative values are treated as missing parameters and fall back to defaults. Maximum values are clamped tolimit=100andlevels=5.
Request
To get relations for a specific entity, use a GET request, for example:
curl -X 'GET' \
'https://apis.threatwinds.com/api/analytics/v1/entity/ip-abc123/relations?limit=10&levels=2' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <YOUR_BEARER_TOKEN>'
Or using API key and secret:
curl -X 'GET' \
'https://apis.threatwinds.com/api/analytics/v1/entity/ip-abc123/relations?limit=10&levels=2' \
-H 'accept: application/json' \
-H 'api-key: <YOUR_API_KEY>' \
-H 'api-secret: <YOUR_API_SECRET>'
Response
A successful response returns a JSON object containing graph data with nodes and relations:
| Field | Description |
|---|---|
| nodes | Array of entity objects representing the nodes in the graph. Each node includes id, type, @timestamp, bestReputation, worstReputation, lastSeen, reputation, accuracy, tags, visibleBy, wellKnown, and attributes (entity-specific attributes, keys vary by entity type). The value field within attributes can be any valid JSON type |
| relations | Array of relationship objects connecting the nodes. Each relation has a source and target entity ID |
Example response:
{
"nodes": [
{
"id": "ip-abc123",
"type": "ip",
"reputation": 3,
"accuracy": 3,
"wellKnown": true,
"lastSeen": "2023-06-15T14:30:00Z",
"tags": ["dns", "google", "public"],
"visibleBy": ["public"],
"attributes": {
"ip": "8.8.8.8"
}
},
{
"id": "domain-xyz789",
"type": "domain",
"reputation": 3,
"accuracy": 3,
"wellKnown": false,
"lastSeen": "2023-06-10T12:00:00Z",
"tags": ["dns", "google"],
"visibleBy": ["public"],
"attributes": {
"domain": "dns.google"
}
}
],
"relations": [
{
"source": "ip-abc123",
"target": "domain-xyz789"
}
]
}
Error Response Headers
For responses with error status codes, the following headers are included:
| Header | Description |
|---|---|
| x-error | Human-readable error message describing what went wrong |
| x-error-id | Unique identifier for error tracking and support |
Error Codes
| Status Code | Description | Possible Cause |
|---|---|---|
| 400 | Bad Request | Invalid entity ID or invalid query parameters |
| 401 | Unauthorized | Invalid authentication credentials |
| 404 | Not Found | Entity ID does not exist — entity could not be found in the database |
| 500 | Internal Server Error | Server-side error; please contact support if persistent |
Note: If the entity exists but has no relations, the response returns 200 with an empty graph containing only the root entity node.