Add hostnames as assets
POSThttps://api.fortwatch.ai/app/discovery/hosts/add
Makes up to 200 discovered hostnames assets of their project, as adding them one by one would. A host past the plan's included assets is refused: an API key or OAuth app cannot buy a paid slot.
Request body
JSON, required.
| Field | Type | Description |
|---|---|---|
ids | integer[] | Required. The ids of the discovered hostnames to add. |
acceptExtraCharge | boolean |
Example request
curl -X POST "https://api.fortwatch.ai/app/discovery/hosts/add" \
-H "Authorization: Bearer $FORTWATCH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
1
],
"acceptExtraCharge": true
}'Response 200
The request succeeded.
| Field | Type | Description |
|---|---|---|
resultsrequired | object[] | |
idrequired | number | |
hostrequired | string | |
assetId | number | |
created | boolean | |
error | string |
{
"results": [
{
"id": 42,
"host": "app.example.com",
"assetId": 42,
"created": true,
"error": "string"
}
]
}Errors
400 | The request is not valid: a field is missing or has the wrong shape (the message names it). |
401 | No valid credentials: the API key or access token is missing, revoked or expired (INVALID_API_KEY, INVALID_TOKEN). |
403 | Not allowed: the key or token lacks this scope (SCOPE_REQUIRED), the route is dashboard-only (SESSION_REQUIRED), or a plan limit applies. |
429 | Too many requests (RATE_LIMITED): wait the seconds Retry-After gives. |
Every code is explained in Errors.