# Add hostnames as assets

`POST /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.

Scope: `assets:write`.

## Request body

- `ids` (integer[]): Required. The ids of the discovered hostnames to add.
- `acceptExtraCharge` (boolean)

## Example

```bash
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.

- `results` (object[], required)
  - `id` (number, required)
  - `host` (string, required)
  - `assetId` (number)
  - `created` (boolean)
  - `error` (string)

```json
{
  "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.
