https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id}
Updates existing subscription enabled status.
- 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(); let json = client.request(Method::PATCH, "https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id}".to_string()).json(&serde_json::json!(\{"enabled":"boolean"\})) .header(CONTENT_TYPE, "application/json") .send() .await? .json() .await?; println!("{:#?}", json); Ok(())}
Parameters
Path
name | type | required | description |
---|---|---|---|
workspace_id | integer | true | Numeric ID of the workspace |
subscription_id | integer | true | Numeric ID of the subscription |
Body
Name | Type | Description |
---|---|---|
enabled | boolean | Controls whether the subscription will be enabled or disabled |
Response
200
Name | Type | Description |
---|---|---|
created_at | string | - |
deleted_at | string | - |
description | string | - |
enabled | boolean | - |
event_filters | Array of SubscriptionEventFilter | - |
has_pending_events | boolean | - |
secret | string | - |
subscription_id | integer | - |
updated_at | string | - |
url_callback | string | - |
user_id | integer | - |
validated_at | string | - |
workspace_id | integer | - |
400
Possible error messages:
- URL endpoint {url_callback} responded with status {HTTP status code} instead of 200
- URL endpoint {url_callback} request failed with error: {HTTP error}
- User {user_id} already reached the limit of {allowed limit} enabled subscriptions for workspace {workspace_id}
403
User not found/accessible for workspace
404
subscription {subscription_id} for workspace {workspace_id} was not found
500
Internal Server Error