Company Management
Test Company Webhook
Changed onSend a single test event to a company webhook so you can validate your receiver before going live.
The request is delivered exactly like a real one: HTTPS POST, Content-Type: application/json, the same {"event": {...}, "sourcetype": "..."} envelope, and your token sent as entered in the auth_header header. Use it to confirm authentication, body parsing, index or sourcetype routing, and any parsing of the MongoDB Extended JSON fields.
- Event type: by default the test matches the webhook's current mode: a hudsonrock:data event when data_alert is true, otherwise a hudsonrock:alert event. Pass type to test the other format.
- Test marker: every test event carries "test": true inside event. Real events never include this field, so you can drop test events from production rules and playbooks.
- Content: test events contain placeholder data only. Summary alerts list the company's monitored domains with zero counts. Data alerts contain one anonymized employee record built around the company's first domain, with TEST- placeholder values for secrets.
- Unsaved configuration: pass webhook in the body to test a URL, token and header before saving them. Otherwise the company's stored webhook is used; if there is none, 409 Conflict is returned.
- Result: the response reports whether your endpoint returned a 2xx (delivered), the HTTP status, the response time, the first 1 KB of the response body, and the exact payload we sent. A rejected or unreachable endpoint still returns 200 from this API, with delivered: false.
- Limits: the test makes one attempt with a 10-second timeout and doesn't follow redirects. Destinations that resolve to private, loopback or link-local addresses are refused. You can send one test per company every 10 seconds; more frequent calls return 429.
If the authenticated user belongs to an organization with synced_data: true, only the user with organization.role: "owner" can call this endpoint. Other members receive 403 Forbidden.
post/companies/{companyId}/webhook/test
Request
- Base URLhttps://api.hudsonrock.com/json/v3
- AuthAPI key in header api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
companyIdstring required
Example:65f0a1b2c3d4e5f6a7b8c9d0
Unique identifier of the target company
Request body
Example request
{
"type": "data",
"webhook": {
"url": "https://example.com/webhooks/acme",
"token": "11111111-2222-3333-4444-555555555555",
"auth_header": "Authorization"
}
}Response
The test event was sent (or attempted). Check delivered for the outcome.
Example response
{
"delivered": true,
"status_code": 200,
"response_time_ms": 184,
"response_body": "{\"text\":\"Success\",\"code\":0}",
"type": "alert",
"payload": {
"event": {
"Example Corp": {
"example.com": {
"employees": 2,
"third_party": 1,
"externals": 0,
"clients": 14,
"apps": 0,
"supply_chain": 0
},
"example.net": {
"employees": 0,
"third_party": 0,
"externals": 0,
"clients": 0,
"apps": 0,
"supply_chain": 0
}
},
"earliest_timestamp": 1760486400
},
"sourcetype": "hudsonrock:alert"
}
}Changes
- info
endpoint added
- info