Create enrichment¶
POST/
Live Discover API · Live Discover
Create a new enrichment.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
Request body¶
Content type: application/json
Request body fields
namestringrequiredEnrichment name.
Must match the pattern
Must match the pattern
^[\p{L}\p{N}][-\p{L}\p{N}. ]*[\p{L}\p{N}]$. Must be 1–255 characters long.descriptionstringrequiredEnrichment description.
Must match the pattern
Must match the pattern
^[-\p{L}\p{N}\d ,.]+$. Must be 1–1024 characters long.urlstringrequiredEnrichment URL. This must start with
Must match the pattern
http:// or https:// and contain at least one of the supported variables (ipAddress, dns, port, sha256, md5) delimited by $$. Variables may be used only after the first / following the domain name.Must match the pattern
^https?://[^/$]+[/][^$]*(?:[$]{2}(?:ipAddress|dns|port|sha256|md5)[$]{2}[^$]*)+$. Must be 17–1024 characters long.typestring (enum)requiredEnrichment type.
Must be one of:
Must be one of:
ipAddress, md5, sha256, dns, port, geolocation.Request samples¶
curl -X POST "https://api-<data-region>.central.sophos.com/live-discover/v1/enrichment-pivots" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
\"name\": \"VirusTotal\",
\"description\": \"Lookup the IP Address on Virus Total\",
\"url\": \"https://enrichment.example.com/lookup?ip=\$\$ipAddress\$\$\",
\"type\": \"ipAddress\"
}"
import requests
response = requests.post(
"https://api-<data-region>.central.sophos.com/live-discover/v1/enrichment-pivots",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
json={ 'name': 'VirusTotal',
'description': 'Lookup the IP Address on Virus Total',
'url': 'https://enrichment.example.com/lookup?ip=$$ipAddress$$',
'type': 'ipAddress'},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
"Content-Type" = "application/json"
}
$body = '{
"name": "VirusTotal",
"description": "Lookup the IP Address on Virus Total",
"url": "https://enrichment.example.com/lookup?ip=$$ipAddress$$",
"type": "ipAddress"
}'
Invoke-RestMethod -Method POST -Uri "https://api-<data-region>.central.sophos.com/live-discover/v1/enrichment-pivots" -Headers $headers -Body $body -ContentType "application/json"
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, err := http.NewRequest("POST", "https://api-<data-region>.central.sophos.com/live-discover/v1/enrichment-pivots", strings.NewReader(`{
"name": "VirusTotal",
"description": "Lookup the IP Address on Virus Total",
"url": "https://enrichment.example.com/lookup?ip=$$ipAddress$$",
"type": "ipAddress"
}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api-<data-region>.central.sophos.com/live-discover/v1/enrichment-pivots", {
method: "POST",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "VirusTotal",
"description": "Lookup the IP Address on Virus Total",
"url": "https://enrichment.example.com/lookup?ip=$$ipAddress$$",
"type": "ipAddress"
}),
});
const data = await response.json();
console.log(data);
Responses¶
201 — New enrichment.¶
Response fields
idstring (uuid)Enrichment ID.
tenantobjectTenant these resources belong to.
Show child attributesHide child attributes
idstring (uuid)requirednamestringsourceTypestring (enum)requiredEnrichment source type.
Must be one of:
Must be one of:
canned, custom.namestringrequiredEnrichment name.
descriptionstringrequiredEnrichment description.
typestring (enum)requiredEnrichment type.
Must be one of:
Must be one of:
ipAddress, md5, sha256, dns, port, geolocation.urlstringrequiredEnrichment URL.
createdAtstring (datetime)When the enrichment was created.
createdByobjectPrincipal reference.
Show child attributesHide child attributes
idstring (uuid)requiredPrincipal ID. This is the client ID for service principals.
typestring (enum)requiredPrincipal type.
Must be one of:
Must be one of:
user, service.namestringPrincipal name. This doesn't apply to service principals.
accountTypestringAccount type.
Must be one of:
Must be one of:
partner, tenant, organization.updatedAtstring (datetime)When the enrichment was last updated.
updatedByobjectPrincipal reference.
Show child attributesHide child attributes
idstring (uuid)requiredPrincipal ID. This is the client ID for service principals.
typestring (enum)requiredPrincipal type.
Must be one of:
Must be one of:
user, service.namestringPrincipal name. This doesn't apply to service principals.
accountTypestringAccount type.
Must be one of:
Must be one of:
partner, tenant, organization.Errors¶
| Status | Meaning |
|---|---|
400 | Bad request. |
403 | Forbidden. |
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
201¶
{
"id": "00000000-0000-0000-0000-000000000000",
"tenant": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "string"
},
"sourceType": "canned",
"name": "string",
"description": "string",
"type": "ipAddress",
"url": "string",
"createdAt": "string",
"createdBy": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "user",
"name": "string",
"accountType": "partner"
},
"updatedAt": "string",
"updatedBy": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "user",
"name": "string",
"accountType": "partner"
}
}
See the guide for a narrative walkthrough of this API.