Skip to main content

Subscriptions

GET Retrieves existing subscriptions for the requested workspace ID.

https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}

Retrieves existing subscriptions for the requested workspace ID.

curl  https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id} \
-H "Content-Type: application/json"

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace

Response

[
{
"created_at": {
"description": "Time of creation",
"type": "string"
},
"deleted_at": {
"description": "Time of deletion",
"type": "string"
},
"description": {
"description": "Description for this subscription, which is unique for its workspace",
"type": "string"
},
"enabled": {
"description": "Whether the subscription is enabled to notify events",
"type": "boolean"
},
"event_filters": {
"description": "List of filters to select events to notifiy",
"items": [
{
"action": {
"description": "Type of modification applied to the business entity",
"type": "string"
},
"entity": {
"description": "Toggl Track business entity to which this filter applies",
"type": "string"
}
}
]
},
"has_pending_events": {
"description": "Whether there are events pending to be delivered to this subscription",
"type": "boolean"
},
"secret": {
"description": "Allows to validate whether the received events have been sent by Toggl",
"type": "string"
},
"subscription_id": {
"description": "ID of the Webhooks subscription",
"type": "integer"
},
"updated_at": {
"description": "Time of last update",
"type": "string"
},
"url_callback": {
"description": "URL endpoint where events will be notified",
"type": "string"
},
"user_id": {
"description": "Subscription's creator ID",
"type": "integer"
},
"validated_at": {
"description": "Time for when this subscription has been validated",
"type": "string"
},
"workspace_id": {
"description": "Subscription's workspace ID",
"type": "integer"
}
}
]

POST Creates a subscription.

https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}

Creates a subscription for the requested workspace ID.

curl -X POST https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id} \
-H "Content-Type: application/json" \
-d '{"created_at":"string","deleted_at":"string","description":"string","enabled":"boolean","event_filters":[{"action":"string","entity":"string"}],"has_pending_events":"boolean","secret":"string","subscription_id":"integer","updated_at":"string","url_callback":"string","user_id":"integer","validated_at":"string","workspace_id":"integer"}'

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace

Body

nametypedescription
created_atstringTime of creation
deleted_atstringTime of deletion
descriptionstringDescription for this subscription, which is unique for its workspace
enabledbooleanWhether the subscription is enabled to notify events
event_filtersArray of
nametypedescription
actionstringType of modification applied to the business entity
entitystringToggl Track business entity to which this filter applies
List of filters to select events to notifiy
has_pending_eventsbooleanWhether there are events pending to be delivered to this subscription
secretstringAllows to validate whether the received events have been sent by Toggl
subscription_idintegerID of the Webhooks subscription
updated_atstringTime of last update
url_callbackstringURL endpoint where events will be notified
user_idintegerSubscription's creator ID
validated_atstringTime for when this subscription has been validated
workspace_idintegerSubscription's workspace ID

Response

{
"created_at": {
"description": "Time of creation",
"type": "string"
},
"deleted_at": {
"description": "Time of deletion",
"type": "string"
},
"description": {
"description": "Description for this subscription, which is unique for its workspace",
"type": "string"
},
"enabled": {
"description": "Whether the subscription is enabled to notify events",
"type": "boolean"
},
"event_filters": {
"description": "List of filters to select events to notifiy",
"items": [
{
"action": {
"description": "Type of modification applied to the business entity",
"type": "string"
},
"entity": {
"description": "Toggl Track business entity to which this filter applies",
"type": "string"
}
}
]
},
"has_pending_events": {
"description": "Whether there are events pending to be delivered to this subscription",
"type": "boolean"
},
"secret": {
"description": "Allows to validate whether the received events have been sent by Toggl",
"type": "string"
},
"subscription_id": {
"description": "ID of the Webhooks subscription",
"type": "integer"
},
"updated_at": {
"description": "Time of last update",
"type": "string"
},
"url_callback": {
"description": "URL endpoint where events will be notified",
"type": "string"
},
"user_id": {
"description": "Subscription's creator ID",
"type": "integer"
},
"validated_at": {
"description": "Time for when this subscription has been validated",
"type": "string"
},
"workspace_id": {
"description": "Subscription's workspace ID",
"type": "integer"
}
}

PUT Update existing subscription.

https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id}

Updates existing subscription given its ID and workspace ID.

curl -X PUT https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id} \
-H "Content-Type: application/json" \
-d '{"created_at":"string","deleted_at":"string","description":"string","enabled":"boolean","event_filters":[{"action":"string","entity":"string"}],"has_pending_events":"boolean","secret":"string","subscription_id":"integer","updated_at":"string","url_callback":"string","user_id":"integer","validated_at":"string","workspace_id":"integer"}'

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
subscription_idintegertrueNumeric ID of the subscription

Body

nametypedescription
created_atstringTime of creation
deleted_atstringTime of deletion
descriptionstringDescription for this subscription, which is unique for its workspace
enabledbooleanWhether the subscription is enabled to notify events
event_filtersArray of
nametypedescription
actionstringType of modification applied to the business entity
entitystringToggl Track business entity to which this filter applies
List of filters to select events to notifiy
has_pending_eventsbooleanWhether there are events pending to be delivered to this subscription
secretstringAllows to validate whether the received events have been sent by Toggl
subscription_idintegerID of the Webhooks subscription
updated_atstringTime of last update
url_callbackstringURL endpoint where events will be notified
user_idintegerSubscription's creator ID
validated_atstringTime for when this subscription has been validated
workspace_idintegerSubscription's workspace ID

Response

{
"created_at": {
"description": "Time of creation",
"type": "string"
},
"deleted_at": {
"description": "Time of deletion",
"type": "string"
},
"description": {
"description": "Description for this subscription, which is unique for its workspace",
"type": "string"
},
"enabled": {
"description": "Whether the subscription is enabled to notify events",
"type": "boolean"
},
"event_filters": {
"description": "List of filters to select events to notifiy",
"items": [
{
"action": {
"description": "Type of modification applied to the business entity",
"type": "string"
},
"entity": {
"description": "Toggl Track business entity to which this filter applies",
"type": "string"
}
}
]
},
"has_pending_events": {
"description": "Whether there are events pending to be delivered to this subscription",
"type": "boolean"
},
"secret": {
"description": "Allows to validate whether the received events have been sent by Toggl",
"type": "string"
},
"subscription_id": {
"description": "ID of the Webhooks subscription",
"type": "integer"
},
"updated_at": {
"description": "Time of last update",
"type": "string"
},
"url_callback": {
"description": "URL endpoint where events will be notified",
"type": "string"
},
"user_id": {
"description": "Subscription's creator ID",
"type": "integer"
},
"validated_at": {
"description": "Time for when this subscription has been validated",
"type": "string"
},
"workspace_id": {
"description": "Subscription's workspace ID",
"type": "integer"
}
}

DELETE Remove existing subscription.

https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id}

Remove existing subscription given its ID and workspace ID.

curl -X DELETE https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id} \
-H "Content-Type: application/json"

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
subscription_idintegertrueNumeric ID of the subscription

Response

{
"created_at": {
"description": "Time of creation",
"type": "string"
},
"deleted_at": {
"description": "Time of deletion",
"type": "string"
},
"description": {
"description": "Description for this subscription, which is unique for its workspace",
"type": "string"
},
"enabled": {
"description": "Whether the subscription is enabled to notify events",
"type": "boolean"
},
"event_filters": {
"description": "List of filters to select events to notifiy",
"items": [
{
"action": {
"description": "Type of modification applied to the business entity",
"type": "string"
},
"entity": {
"description": "Toggl Track business entity to which this filter applies",
"type": "string"
}
}
]
},
"has_pending_events": {
"description": "Whether there are events pending to be delivered to this subscription",
"type": "boolean"
},
"secret": {
"description": "Allows to validate whether the received events have been sent by Toggl",
"type": "string"
},
"subscription_id": {
"description": "ID of the Webhooks subscription",
"type": "integer"
},
"updated_at": {
"description": "Time of last update",
"type": "string"
},
"url_callback": {
"description": "URL endpoint where events will be notified",
"type": "string"
},
"user_id": {
"description": "Subscription's creator ID",
"type": "integer"
},
"validated_at": {
"description": "Time for when this subscription has been validated",
"type": "string"
},
"workspace_id": {
"description": "Subscription's workspace ID",
"type": "integer"
}
}

PATCH Updates an existing subscription enabled status given its ID and workspace ID.

https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id}

Updates existing subscription enabled status.

curl -X PATCH https://api.track.toggl.com/webhooks/api/v1/subscriptions/{workspace_id}/{subscription_id} \
-H "Content-Type: application/json" \
-d '{"enabled":"boolean"}'

Parameters

Path

nametyperequireddescription
workspace_idintegertrueNumeric ID of the workspace
subscription_idintegertrueNumeric ID of the subscription

Body

nametypedescription
enabledbooleanControls whether the subscription will be enabled or disabled

Response

{
"created_at": {
"description": "Time of creation",
"type": "string"
},
"deleted_at": {
"description": "Time of deletion",
"type": "string"
},
"description": {
"description": "Description for this subscription, which is unique for its workspace",
"type": "string"
},
"enabled": {
"description": "Whether the subscription is enabled to notify events",
"type": "boolean"
},
"event_filters": {
"description": "List of filters to select events to notifiy",
"items": [
{
"action": {
"description": "Type of modification applied to the business entity",
"type": "string"
},
"entity": {
"description": "Toggl Track business entity to which this filter applies",
"type": "string"
}
}
]
},
"has_pending_events": {
"description": "Whether there are events pending to be delivered to this subscription",
"type": "boolean"
},
"secret": {
"description": "Allows to validate whether the received events have been sent by Toggl",
"type": "string"
},
"subscription_id": {
"description": "ID of the Webhooks subscription",
"type": "integer"
},
"updated_at": {
"description": "Time of last update",
"type": "string"
},
"url_callback": {
"description": "URL endpoint where events will be notified",
"type": "string"
},
"user_id": {
"description": "Subscription's creator ID",
"type": "integer"
},
"validated_at": {
"description": "Time for when this subscription has been validated",
"type": "string"
},
"workspace_id": {
"description": "Subscription's workspace ID",
"type": "integer"
}
}
© 2022 Toggl. All rights reserved.