---
title: "Alerts"
method: PUT
path: "/workspaces/{workspace_id}/alerts/{alert_id}"
tags: ["alerts"]
---

# Alerts

`PUT /workspaces/{workspace_id}/alerts/{alert_id}`

## Request

- Base URL: `https://localhost:8080/api/v9`
- URL: `https://localhost:8080/api/v9/workspaces/{workspace_id}/alerts/{alert_id}`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/toggl/apis/toggl-api/docs/workspaces/:workspace_id/alerts/:alert_id/put.ts> (a function with typed inputs; its response is checked against the schema)

Handles PUT alert requests.

## Request body

- object
  - `project_id` integer
  - `receiver_roles` string[]
  - `receiver_users` integer[]
  - `source_kind` string
  - `threshold_type` string
  - `thresholds` integer[]

## Response `200`

Successful operation.

- ModelsAlert
  - `errors` ModelsAlertError[]
    - `code` string
    - `message` string
  - `id` integer
  - `object_type` integer
  - `project_id` integer
  - `receiver_groups` string
  - `receiver_roles` string
  - `receiver_users` string
  - `receivers` integer
  - `source_kind` string
  - `threshold` integer
  - `threshold_type` string
  - `thresholds` string: using pq types is a workaround to enable reading postgres arrays into go types we should wrap these pq types to avoid polluting our domain
  - `wid` integer

## Other responses

- `400`: Possible errors:<ul><li>invalid workspace ID</li><li>source kind can't be blank</li><li>project can't be blank</li><li>project not supported for this source kind</li><li>threshold type can't be blank</li><li>thresholds can't be blank</li><li>receivers can't be blank</li><li>alert type out of range</li><li>receiver type out of range</li><li>threshold out of range</li><li>source kind out of range</li><li>threshold type out of range</li><li>receiver role out of range</li></ul>
- `500`: Internal Server Error

---

[API](https://skmtc.dev/toggl/apis/toggl-api.md) - [All operations](https://skmtc.dev/toggl/apis/toggl-api/llms.txt) - [OpenAPI document](https://skmtc.dev/toggl/apis/toggl-api/revisions/3085aee16990?raw)
