FortWatchFortWatchDocs
Menu

Add hostnames as assets

POSThttps://api.fortwatch.ai/app/discovery/hosts/add
Scope assets:writeOperation ID addDiscoveredHosts

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.

FieldTypeDescription
idsinteger[]Required. The ids of the discovered hostnames to add.
acceptExtraChargeboolean

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.

FieldTypeDescription
resultsrequiredobject[]
idrequirednumber
hostrequiredstring
assetIdnumber
createdboolean
errorstring
json
{
  "results": [
    {
      "id": 42,
      "host": "app.example.com",
      "assetId": 42,
      "created": true,
      "error": "string"
    }
  ]
}

Errors

400The request is not valid: a field is missing or has the wrong shape (the message names it).
401No valid credentials: the API key or access token is missing, revoked or expired (INVALID_API_KEY, INVALID_TOKEN).
403Not allowed: the key or token lacks this scope (SCOPE_REQUIRED), the route is dashboard-only (SESSION_REQUIRED), or a plan limit applies.
429Too many requests (RATE_LIMITED): wait the seconds Retry-After gives.