---
url: https://next.zammad.org/it/reference/rest-api/sla.md
---

# Service-level agreements (SLA)

::: tip
Gli SLA dipendono dai [calendari di Zammad](/it/reference/rest-api/calendar).
:::

## Elenca

Permesso richiesto: `admin.sla`

Richiesta `GET` inviata: `/api/v1/slas`

::: details

Risposta:

```json
// HTTP-Code 200 OK

[
  {
    "id": 2,
    "calendar_id": 1,
    "name": "new sla",
    "first_response_time": 120,
    "response_time": null,
    "update_time": 120,
    "solution_time": 120,
    "condition": {
      "ticket.state_id": {
        "operator": "is",
        "value": "2"
      }
    },
    "updated_by_id": 3,
    "created_by_id": 3,
    "created_at": "2021-11-10T12:54:39.368Z",
    "updated_at": "2021-11-10T12:54:39.368Z"
  }
]

```

:::

## Mostra

Permesso richiesto: `admin.sla`

Richiesta `GET` inviata: `/api/v1/slas/{id}`

::: details

```json
// HTTP-Code 200 OK

{
  "id": 2,
  "calendar_id": 1,
  "name": "new sla",
  "first_response_time": 120,
  "response_time": null,
  "update_time": 120,
  "solution_time": 120,
  "condition": {
    "ticket.state_id": {
      "operator": "is",
      "value": "2"
    }
  },
  "updated_by_id": 3,
  "created_by_id": 3,
  "created_at": "2021-11-10T12:54:39.368Z",
  "updated_at": "2021-11-10T12:54:39.368Z"
}

```

:::

## Crea

Permesso richiesto: `admin.sla`

Richiesta `POST` inviata: `/api/v1/slas`

:::: details

::: tabs key:reqres

\=== Richiesta

```json
{
  "name": "new sla",
  "first_response_time": "120",
  "response_time": "",
  "update_time": "120",
  "solution_time": "120",
  "condition": {
    "ticket.state_id": {
      "operator": "is",
      "value": "2"
    }
  },
  "calendar_id": "1"
}

```

\=== Risposta

```json
// HTTP-Code 201 Created

{
  "id": 2,
  "calendar_id": 1,
  "name": "new sla",
  "first_response_time": 120,
  "response_time": null,
  "update_time": 120,
  "solution_time": 120,
  "condition": {
    "ticket.state_id": {
      "operator": "is",
      "value": "2"
    }
  },
  "updated_by_id": 3,
  "created_by_id": 3,
  "created_at": "2021-11-10T12:54:39.368Z",
  "updated_at": "2021-11-10T12:54:39.368Z"
}

```

:::
::::

## Aggiornamento

Permesso richiesto: `admin.sla`

Richiesta `PUT` inviata: `/api/v1/slas/{id}`

:::: details

::: tabs key:reqres

\=== Richiesta

```json
{
  "name": "update sla",
  "first_response_time": "120",
  "response_time": "",
  "update_time": "120",
  "solution_time": "120",
  "condition": {
    "ticket.state_id": {
      "operator": "is",
      "value": "2"
    }
  },
  "calendar_id": "1",
  "id": 2
}

```

\=== Risposta

```json
// HTTP-Code 200 OK

{
  "id": 2,
  "calendar_id": 1,
  "name": "update sla",
  "first_response_time": 120,
  "response_time": null,
  "update_time": 120,
  "solution_time": 120,
  "condition": {
    "ticket.state_id": {
      "operator": "is",
      "value": "2"
    }
  },
  "updated_by_id": 3,
  "created_by_id": 3,
  "created_at": "2021-11-10T12:54:39.368Z",
  "updated_at": "2021-11-10T13:02:52.053Z"
}

```

:::
::::

## Elimina

Permesso richiesto: `admin.sla`

Richiesta `DELETE` inviata: `/api/v1/slas/{id}`

::: danger
**Questa è una rimozione permanente!**

Tieni presente che rimuovere configurazioni SLA non può essere annullato.
:::

::: details

Risposta:

```json
// HTTP-Code 200 OK

{}

```

:::
