https://api.track.toggl.com/api/v9/workspaces/{workspace_id}/alerts
Handles POST alert requests.
- cURL
- Go
- Ruby
- JavaScript
- Python
- Rust
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
Body
| Name | Type | Description |
|---|---|---|
| request | Object | Alert data |
Response
200
| 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
| Name | Type | Description |
|---|---|---|
| code | string | - |
| message | string | - |
400
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
Internal Server Error