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

# Група

::: info

* Имајте у виду да `follow_up_possible` можда неће радити очекивано. Могуће
  вредности су `yes` или `new_ticket`!
* Ако желите да креирате или ажурирате **подгрупе**, користите `::` као раздвајач
  за називе. Такође морате навести целу хијерархију у
  називу. Пример: `Sales::Europe::South`
  :::

## Преглед листе

Потребна дозвола: `admin.group`

`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
    ]
  }
]

```

:::

## Прикажи

Потребна дозвола: `admin.group`

`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
  ]
}

```

:::

## Креирај

Потребна дозвола: `admin.group`

`POST`-захтев послат на: `/api/v1/groups`

:::: details

::: tabs key:reqres

\=== Захтев

```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!"
}

```

\=== Одговор

```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": []
}

```

:::
::::

## Освежавање

Потребна дозвола: `admin.group`

`PUT`-захтев послат на: `/api/v1/groups/{id}`

:::: details

::: tabs key:reqres

\=== Захтев

```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!"
}

```

\=== Одговор

```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": []
}

```

:::
::::

## Обриши

Потребна дозвола: `admin.group`

`DELETE`-захтев послат на: `/api/v1/groups/{id}`

::: danger

**Ово је трајно брисање**:

Имајте у виду да се брисање група не може поништити.

Брисање организација са референцама (нпр. у токовима активности или
тикетима) није могуће путем API-ја - то ће бити означено као
`"error": "Can't delete, object has references."`. Ово *није* грешка.

Размислите о постављању задужених група у статус неактивно или обезбедите премештање
свих постојећих тикета на нове групе.

:::

::: details

```json
// HTTP-Code 200 OK

{}

```

:::
