# "Workspaces" Endpoint - POST Alerts

**URL:** <https://community.toggl.com/t/workspaces-endpoint-post-alerts/344>\
**Category:** API References\
**Tags:** workspace, api, endpoints, post, alerts\
**Created:** [December 2, 2024, 3:07pm UTC](https://community.toggl.com/t/workspaces-endpoint-post-alerts/344 "2024-12-02T15:07:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Support](https://yyz2.discourse-cdn.com/flex012/user_avatar/community.toggl.com/support/32/1577_2.png) [@Support](https://community.toggl.com/u/Support)\
**Post date:** [December 2, 2024, 3:07pm UTC](https://community.toggl.com/t/workspaces-endpoint-post-alerts/344/1 "2024-12-02T15:07:49Z")

</div>

```auto
https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts

```

Handles POST alert requests.

- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust

```auto
extern crate tokio;extern crate serde_json;use reqwest::{Client};use reqwest::header::{CONTENT_TYPE};#[tokio::main]async fn main() -> Result<(), reqwest::Error> { let client = Client::new().basic_auth("<email>", "<password>"); let json = client.request(Method::POST, "https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts".to_string()).json(&serde_json::json!(\{\})) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}

```

### Parameters[​](https://engineering.toggl.com/docs/api/workspaces/#parameters-5)

#### Body[​](https://engineering.toggl.com/docs/api/workspaces/#body-3)

| Name | Type | Description |
| --- | --- | --- |
| request | Object | Alert data |

### Response[​](https://engineering.toggl.com/docs/api/workspaces/#response-6)

#### 200[​](https://engineering.toggl.com/docs/api/workspaces/#200-6)

| Name | Type | Description |
| --- | --- | --- |
| client\_id | integer | - |
| client\_name | string | - |
| errors | Array of object | - |
| id | integer | - |
| object\_type | integer | - |
| project\_color | string | - |
| project\_id | integer | - |
| project\_name | string | - |
| 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 | - |

##### errors[​](https://engineering.toggl.com/docs/api/workspaces/#errors)

| Name | Type | Description |
| --- | --- | --- |
| code | string | - |
| message | string | - |

#### 400[​](https://engineering.toggl.com/docs/api/workspaces/#400-3)

Possible errors:

- invalid workspace ID
- source kind can’t be blank
- project can’t be blank
- project not supported for this source kind
- threshold type can’t be blank
- thresholds can’t be blank
- receivers can’t be blank
- alert type out of range
- receiver type out of range
- threshold out of range
- source kind out of range
- threshold type out of range
- receiver role out of range

#### 500[​](https://engineering.toggl.com/docs/api/workspaces/#500-2)

Internal Server Error
