---
url: https://next.zammad.org/cs/reference/rest-api/group.md
---

# Skupina

::: info

* Upozorňujeme, že `follow_up_possible` nemusí fungovat podle očekávání.
  Možné hodnoty jsou `yes` nebo `new_ticket`!
* Pokud chcete vytvářet nebo aktualizovat **podskupiny**, použijte jako
  oddělovač v názvech `::`. V názvu také musíte uvést celou
  hierarchii. Příklad: `Sales::Europe::South`
  :::

## Výpis

Požadované oprávnění: `admin.group`

Odeslaný požadavek `GET`: `/api/v1/groups`

::: details

```json
// HTTP-Code 200 OK

[
  {
    "id": 1,
    "signature_id": 1,
    "email_address_id": null,
    "name": "Sales",
    "assignment_timeout": null,
    "follow_up_possible": "yes",
    "follow_up_assignment": true,
    "active": true,
    "note": "Standard Group/Pool for Tickets.",
    "updated_by_id": 1,
    "created_by_id": 1,
    "created_at": "2021-11-03T11:51:13.449Z",
    "updated_at": "2021-11-03T11:57:16.357Z",
    "user_ids": [
      3,
      4,
      5
    ]
  },
  {
    "id": 2,
    "signature_id": null,
    "email_address_id": null,
    "name": "Support::2nd Level",
    "assignment_timeout": null,
    "follow_up_possible": "yes",
    "follow_up_assignment": true,
    "active": true,
    "note": null,
    "updated_by_id": 1,
    "created_by_id": 1,
    "created_at": "2021-11-03T11:57:15.802Z",
    "updated_at": "2021-11-03T11:57:16.361Z",
    "user_ids": [
      3,
      4,
      5
    ]
  },
  {
    "id": 3,
    "signature_id": null,
    "email_address_id": null,
    "name": "IT Internal",
    "assignment_timeout": null,
    "follow_up_possible": "yes",
    "follow_up_assignment": true,
    "active": true,
    "note": null,
    "updated_by_id": 1,
    "created_by_id": 1,
    "created_at": "2021-11-03T11:57:15.807Z",
    "updated_at": "2021-11-03T11:57:16.365Z",
    "user_ids": [
      3,
      4,
      5
    ]
  }
]

```

:::

## Zobrazení

Požadované oprávnění: `admin.group`

Odeslaný požadavek `GET`: `/api/v1/groups/{id}`

::: details

```json
// HTTP-Code 200 OK

{
  "id": 2,
  "signature_id": null,
  "email_address_id": null,
  "name": "2nd Level",
  "assignment_timeout": null,
  "follow_up_possible": "yes",
  "follow_up_assignment": true,
  "active": true,
  "note": null,
  "updated_by_id": 1,
  "created_by_id": 1,
  "created_at": "2021-11-03T11:57:15.802Z",
  "updated_at": "2021-11-03T11:57:16.361Z",
  "user_ids": [
    3,
    4,
    5
  ]
}

```

:::

## Vytvoření

Požadované oprávnění: `admin.group`

Odeslaný požadavek `POST`: `/api/v1/groups`

:::: details

::: tabs key:reqres

\=== Požadavek

```json
{
  "name": "Amazing Group",
  "signature_id": 1,
  "email_address_id": 3,
  "assignment_timeout": 180,
  "follow_up_possible": "new_ticket",
  "follow_up_assignment": false,
  "active": true,
  "note": "Look at my group, my group is amazing!"
}

```

\=== Odpověď

```json
// HTTP-Code 201 Created

{
  "id": 7,
  "signature_id": 1,
  "email_address_id": 3,
  "name": "Amazing Group",
  "assignment_timeout": 180,
  "follow_up_possible": "new_ticket",
  "follow_up_assignment": false,
  "active": true,
  "note": "Look at my group, my group is amazing!",
  "updated_by_id": 3,
  "created_by_id": 3,
  "created_at": "2021-11-08T13:09:41.526Z",
  "updated_at": "2021-11-08T13:09:41.526Z",
  "user_ids": []
}

```

:::
::::

## Aktualizace

Požadované oprávnění: `admin.group`

Odeslaný požadavek `PUT`: `/api/v1/groups/{id}`

:::: details

::: tabs key:reqres

\=== Požadavek

```json
{
  "name": "Amazing Group",
  "signature_id": 1,
  "email_address_id": 3,
  "assignment_timeout": 0,
  "follow_up_possible": "new_ticket",
  "follow_up_assignment": true,
  "active": true,
  "note": "Look at my group, my group is amazing!"
}

```

\=== Odpověď

```json
// HTTP-Code 200 OK

{
  "id": 7,
  "signature_id": 1,
  "email_address_id": 3,
  "name": "Amazing Group",
  "assignment_timeout": 0,
  "follow_up_possible": "new_ticket",
  "follow_up_assignment": true,
  "active": true,
  "note": "Look at my group, my group is amazing!",
  "updated_by_id": 3,
  "created_by_id": 3,
  "created_at": "2021-11-08T13:09:41.526Z",
  "updated_at": "2021-11-08T13:36:24.571Z",
  "user_ids": []
}

```

:::
::::

## Smazání

Požadované oprávnění: `admin.group`

Odeslaný požadavek `DELETE`: `/api/v1/groups/{id}`

::: danger

**Jde o trvalé odstranění**:

Odstranění skupin nelze vrátit zpět.

Skupiny s odkazy např. v toku aktivit nebo
tiketech nelze přes API odstranit – signalizuje to
`"error": "Can't delete, object has references."`. *Nejde* o chybu.

Zvažte místo toho nastavení dotčených skupin jako neaktivních, nebo přesuňte
všechny existující tikety do nových skupin.

:::

::: details

```json
// HTTP-Code 200 OK

{}

```

:::
