---
title: "How to add hosts using OP5 Monitor REST API"
description: "Adding hosts in OP5 Monitor can be done using the REST API with a CSV input file. The provided sample script demonstrates this process at a proof of concept level and includes example files for formatting guidance."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020057034-op5-monitor-how-to-add-hosts-using-op5-monitor-rest-api/index.html"
---
This sample script adds hosts from a CSV file using the REST API in OP5 Monitor. This is provided on a "Proof of concept" level, so test before use. Also, see an example input file on how the CSV file should be formatted.

*[add\_hosts\_api.sh](/faq/downloads/op5/360020057034-inline-attachment-1-add_hosts_api.sh)*

*[hosts.csv](/faq/downloads/op5/360020057034-inline-attachment-2-hosts.csv)*

Usage:

```
[agalorio@pugo ~]$ chmod 777 add_hosts_api.sh
[agalorio@pugo ~]$ ./add_hosts_api.sh hosts.csv
[DONE] Host: server1 Added
[DONE] PING Added on server1
[DONE] Host: server2 Added
[DONE] PING Added on server2
[DONE] Host: server3 Added
[DONE] PING Added on server3
[DONE] Host: server4 Added
[DONE] PING Added on server4
[DONE] Host: server5 Added
[DONE] PING Added on server5
[DONE] Host: server6 Added
[DONE] PING Added on server6
[DONE] Host: server7 Added
[DONE] PING Added on server7
[DONE] Host: server8 Added
[DONE] PING Added on server8
Do you want to save current configuration? (y/n)y
Saving configuration ......
"Changes saved"
[agalorio@pugo ~]$
```

## Related downloads

- [hosts.csv](/faq/downloads/op5/360020057034-360030010473-hosts.csv)
- [add_hosts_api.sh](/faq/downloads/op5/360020057034-6167778126237-add_hosts_api.sh)


