# Devo creare gruppi in massa utilizzando l'API

**URL:** <https://meta.discourse.org/t/i-need-to-mass-create-groups-using-the-api/241055>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [5 Ottobre 2022, 6:56pm UTC](https://meta.discourse.org/t/i-need-to-mass-create-groups-using-the-api/241055 "2022-10-05T18:56:58Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![boyan.biandov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/boyan.biandov/32/276124_2.png) [@boyan.biandov](https://meta.discourse.org/u/boyan.biandov)\
**Post date:** [5 Ottobre 2022, 6:56pm UTC](https://meta.discourse.org/t/i-need-to-mass-create-groups-using-the-api/241055/1 "2022-10-05T18:56:58Z")

</div>

Ciao a tutti,

Devo creare gruppi in massa utilizzando l’API ma il JSON NON accetta un array di valori multipli, funziona solo se creo un gruppo per chiamata API.

> **[Discourse API Docs](https://docs.discourse.org/#tag/Groups/operation/createGroup)**

Idealmente vorrei effettuare una chiamata di creazione e avere i nomi come array JSON ma ciò genera lo stato:  
500 (Internal Server Error)

Mi aspettavo che quanto segue funzionasse ma non è così: aiutatemi! Stiamo parlando di oltre 200 gruppi, sto usando POST per https://{defaultHost}/admin/groups.json proprio come richiesto dalla documentazione.

```plaintext
{
  "group": [
    {
      "name": "X"
    },
    {
      "name": "Y"
    },
    {
      "name": "Z"
    }
]
}

```

---

_[View the full topic](https://meta.discourse.org/t/i-need-to-mass-create-groups-using-the-api/241055)._
