diff --git a/independent-publisher-connectors/Toggl Track/ConnectorPackage.zip b/independent-publisher-connectors/Toggl Track/ConnectorPackage.zip new file mode 100644 index 0000000000..0da913ab1b Binary files /dev/null and b/independent-publisher-connectors/Toggl Track/ConnectorPackage.zip differ diff --git a/independent-publisher-connectors/Toggl Track/apiDefinition.swagger.json b/independent-publisher-connectors/Toggl Track/apiDefinition.swagger.json new file mode 100644 index 0000000000..3b1d54ecca --- /dev/null +++ b/independent-publisher-connectors/Toggl Track/apiDefinition.swagger.json @@ -0,0 +1,4567 @@ +{ + "swagger": "2.0", + "info": { + "title": "Toggl Track", + "description": "The only time tracking software that builds custom reports from your team's time data to maximize productivity and revenue. Our time tracking solution records a calendar timeline of all your work activities throughout the day.", + "version": "1.0.0", + "contact": { + "name": "Troy Taylor", + "url": "https://www.hitachisolutions.com", + "email": "ttaylor@hitachisolutions.com" + } + }, + "host": "api.track.toggl.com", + "basePath": "/api/v9", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/me": { + "get": { + "summary": "Get current user", + "description": "Returns details for the current user.", + "operationId": "GetMe", + "parameters": [ + { + "$ref": "#/parameters/WithRelatedDataQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/UserResponse" + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "404": { + "description": "Could not load user data." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users" + ] + }, + "put": { + "summary": "Update current user", + "description": "Updates details for the current user.", + "operationId": "UpdateMe", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "User update data.", + "required": true, + "schema": { + "$ref": "#/definitions/UserUpdateRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/UserBasicResponse" + } + }, + "400": { + "description": "Bad Request. Invalid request data." + }, + "403": { + "description": "User does not have access to this resource." + } + }, + "tags": [ + "Users" + ] + } + }, + "/me/clients": { + "get": { + "summary": "Get user clients", + "description": "Get clients for the current user.", + "operationId": "GetMeClients", + "parameters": [ + { + "$ref": "#/parameters/SinceQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Client" + } + } + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Clients" + ] + } + }, + "/me/features": { + "get": { + "summary": "Get user features", + "description": "Get features available to the current user.", + "operationId": "GetMeFeatures", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkspaceFeatures" + } + } + }, + "403": { + "description": "Operation Forbidden." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users" + ] + } + }, + "/me/location": { + "get": { + "summary": "Get user location", + "description": "Returns the client's IP-based location. If no data is present, empty response will be yielded.", + "operationId": "GetMeLocation", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/LocationResponse" + } + }, + "404": { + "description": "Country with given ISO code not found." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users" + ] + } + }, + "/me/logged": { + "get": { + "summary": "Check authentication", + "description": "Used to check if authentication works.", + "operationId": "GetMeLogged", + "responses": { + "200": { + "description": "OK" + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users" + ] + } + }, + "/me/organizations": { + "get": { + "summary": "Get user organizations", + "description": "Get all organizations a given user is part of.", + "operationId": "GetMeOrganizations", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Organization" + } + } + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Organizations" + ] + } + }, + "/me/projects": { + "get": { + "summary": "Get user projects", + "description": "Get projects for the current user.", + "operationId": "GetMeProjects", + "parameters": [ + { + "$ref": "#/parameters/IncludeArchivedQuery" + }, + { + "$ref": "#/parameters/SinceQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + } + } + }, + "400": { + "description": "Invalid include_archived parameter." + }, + "403": { + "description": "Operation Forbidden." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Projects" + ] + } + }, + "/me/projects/paginated": { + "get": { + "summary": "Get user projects paginated", + "description": "Get paginated projects for the current user.", + "operationId": "GetMeProjectsPaginated", + "parameters": [ + { + "$ref": "#/parameters/StartProjectIdQuery" + }, + { + "$ref": "#/parameters/SinceQuery" + }, + { + "$ref": "#/parameters/PerPageQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + } + } + }, + "403": { + "description": "Operation Forbidden." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Projects" + ] + } + }, + "/me/tags": { + "get": { + "summary": "Get user tags", + "description": "Returns tags for the current user.", + "operationId": "GetMeTags", + "parameters": [ + { + "$ref": "#/parameters/SinceQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + } + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Tags" + ] + } + }, + "/me/tasks": { + "get": { + "summary": "Get user tasks", + "description": "Returns tasks from projects in which the user is participating.", + "operationId": "GetMeTasks", + "parameters": [ + { + "$ref": "#/parameters/MetaQuery" + }, + { + "$ref": "#/parameters/SinceQuery" + }, + { + "$ref": "#/parameters/IncludeNotActiveQuery" + }, + { + "$ref": "#/parameters/OffsetQuery" + }, + { + "$ref": "#/parameters/PerPageQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Task" + } + } + }, + "400": { + "description": "Invalid include_not_active parameter." + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Tasks" + ] + } + }, + "/me/track_reminders": { + "get": { + "summary": "Get track reminders", + "description": "Returns a list of track reminders.", + "operationId": "GetMeTrackReminders", + "responses": { + "200": { + "description": "Returns a list of track reminders.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TrackReminder" + } + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users" + ] + } + }, + "/me/web-timer": { + "get": { + "summary": "Get web timer", + "description": "Get web timer configuration.", + "operationId": "GetMeWebTimer", + "responses": { + "200": { + "description": "Successful operation." + }, + "403": { + "description": "Operation Forbidden." + }, + "404": { + "description": "Resource can not be found." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users" + ] + } + }, + "/me/workspaces": { + "get": { + "summary": "Get user workspaces", + "description": "Lists workspaces for given user.", + "operationId": "GetMeWorkspaces", + "parameters": [ + { + "$ref": "#/parameters/SinceQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Workspace" + } + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Workspaces" + ] + } + }, + "/me/time_entries": { + "get": { + "summary": "Get time entries", + "description": "Lists latest time entries.", + "operationId": "GetMeTimeEntries", + "parameters": [ + { + "$ref": "#/parameters/MetaQuery" + }, + { + "$ref": "#/parameters/IncludeSharingQuery" + }, + { + "$ref": "#/parameters/SinceQuery" + }, + { + "$ref": "#/parameters/BeforeQuery" + }, + { + "$ref": "#/parameters/StartDateQuery" + }, + { + "$ref": "#/parameters/EndDateQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeEntry" + } + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Time Entries" + ] + } + }, + "/me/time_entries/current": { + "get": { + "summary": "Get current time entry", + "description": "Load running time entry for user ID.", + "operationId": "GetCurrentTimeEntry", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TimeEntry" + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "404": { + "description": "Resource can not be found." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Time Entries" + ] + } + }, + "/me/time_entries/{time_entry_id}": { + "get": { + "summary": "Get time entry by ID", + "description": "Load time entry by ID that is accessible by the current user.", + "operationId": "GetTimeEntryById", + "parameters": [ + { + "$ref": "#/parameters/TimeEntryIdInPath" + }, + { + "$ref": "#/parameters/MetaQuery" + }, + { + "$ref": "#/parameters/IncludeSharingQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TimeEntry" + } + }, + "404": { + "description": "Resource can not be found." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Users", + "Time Entries" + ] + } + }, + "/workspaces/{workspace_id}/time_entries": { + "post": { + "summary": "Create time entry", + "description": "Creates a new workspace TimeEntry.", + "operationId": "CreateTimeEntry", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/MetaQuery" + }, + { + "name": "body", + "in": "body", + "description": "Time entry data.", + "required": true, + "schema": { + "$ref": "#/definitions/TimeEntryRequest" + } + } + ], + "responses": { + "200": { + "description": "A workspace TimeEntry.", + "schema": { + "$ref": "#/definitions/TimeEntry" + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Time Entries" + ] + } + }, + "/workspaces/{workspace_id}/time_entries/{time_entry_id}": { + "delete": { + "summary": "Delete time entry", + "description": "Deletes a workspace time entry.", + "operationId": "DeleteTimeEntry", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/TimeEntryIdInPath" + } + ], + "responses": { + "200": { + "description": "Returns only status code." + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Time Entries" + ] + }, + "put": { + "summary": "Update time entry", + "description": "Updates a workspace time entry.", + "operationId": "UpdateTimeEntry", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/TimeEntryIdInPath" + }, + { + "$ref": "#/parameters/MetaQuery" + }, + { + "$ref": "#/parameters/IncludeSharingQuery" + }, + { + "name": "body", + "in": "body", + "description": "Time entry update data.", + "required": true, + "schema": { + "$ref": "#/definitions/TimeEntryRequest" + } + } + ], + "responses": { + "200": { + "description": "A workspace TimeEntry.", + "schema": { + "$ref": "#/definitions/TimeEntry" + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Time Entries" + ] + } + }, + "/workspaces/{workspace_id}/time_entries/bulk/{time_entry_ids}": { + "patch": { + "summary": "Bulk edit time entries", + "description": "Bulk editing time entries. Patch will be executed partially when there are errors with some records. No transaction, no rollback.", + "operationId": "BulkEditTimeEntries", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/TimeEntryIdsInPath" + }, + { + "$ref": "#/parameters/MetaQuery" + }, + { + "name": "body", + "in": "body", + "description": "Patch operations.", + "required": true, + "schema": { + "$ref": "#/definitions/PatchOperations" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/BulkEditResponse" + } + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Time Entries" + ] + } + }, + "/workspaces/{workspace_id}/time_entries/{time_entry_id}/stop": { + "patch": { + "summary": "Stop time entry", + "description": "Stops a workspace time entry.", + "operationId": "StopTimeEntry", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/TimeEntryIdInPath" + } + ], + "responses": { + "200": { + "description": "The stopped workspace TimeEntry.", + "schema": { + "$ref": "#/definitions/TimeEntry" + } + }, + "400": { + "description": "Invalid or missing time_entry_id." + }, + "403": { + "description": "User does not have access to this resource." + }, + "404": { + "description": "Time entry not found." + }, + "409": { + "description": "Time entry already stopped." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Time Entries" + ] + } + }, + "/organizations/{organization_id}/workspaces/{workspace_id}/workspace_users": { + "get": { + "summary": "Get workspace users (organization level)", + "description": "Returns any users who belong to the workspace directly or through at least one group.", + "operationId": "GetOrganizationWorkspaceUsers", + "parameters": [ + { + "$ref": "#/parameters/OrganizationIdInPath" + }, + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/PageQuery" + }, + { + "$ref": "#/parameters/PerPageQuery" + }, + { + "$ref": "#/parameters/CustomRatesQuery" + }, + { + "$ref": "#/parameters/ActiveQuery" + }, + { + "$ref": "#/parameters/NameQuery" + }, + { + "$ref": "#/parameters/SearchQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkspaceUser" + } + } + }, + "403": { + "description": "Forbidden." + }, + "404": { + "description": "Resource can not be found." + } + }, + "tags": [ + "Organizations", + "Workspaces", + "Users" + ] + } + }, + "/workspaces/{workspace_id}": { + "get": { + "summary": "Get single workspace", + "description": "Get information of single workspace.", + "operationId": "GetWorkspace", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Workspace" + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces" + ] + } + }, + "/workspaces/{workspace_id}/rates/{level}/{level_id}": { + "get": { + "summary": "Get rates list", + "description": "Get rates by level (workspace|project|task|user).", + "operationId": "GetWorkspaceRates", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/LevelInPath" + }, + { + "$ref": "#/parameters/LevelIdInPath" + }, + { + "$ref": "#/parameters/RateTypeQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Rate" + } + } + }, + "400": { + "description": "Invalid parameters." + }, + "402": { + "description": "Billable rates are available for Starter and higher plans." + }, + "403": { + "description": "User cannot access billable rate(s)." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Rates" + ] + } + }, + "/workspaces/{workspace_id}/statistics": { + "get": { + "summary": "Get workspace statistics", + "description": "Returns workspace admins list, members count and groups count.", + "operationId": "GetWorkspaceStatistics", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/WorkspaceStatistics" + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces" + ] + } + }, + "/workspaces/{workspace_id}/time_entry_constraints": { + "get": { + "summary": "Get workspace time entry constraints", + "description": "Get the time entry constraints for a given workspace.", + "operationId": "GetWorkspaceTimeEntryConstraints", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/TimeEntryConstraints" + } + }, + "400": { + "description": "Workspace not found." + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces" + ] + } + }, + "/workspaces/{workspace_id}/track_reminders": { + "get": { + "summary": "Get workspace track reminders", + "description": "Returns a list of track reminders.", + "operationId": "GetWorkspaceTrackReminders", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + } + ], + "responses": { + "200": { + "description": "Returns a list of track reminders.", + "schema": { + "$ref": "#/definitions/TrackRemindersResponse" + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces" + ] + } + }, + "/workspaces/{workspace_id}/users": { + "get": { + "summary": "Get workspace users", + "description": "List all users for a given workspace.", + "operationId": "GetWorkspaceUsers", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/ExcludeDeletedQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkspaceUserSimple" + } + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Users" + ] + } + }, + "/workspaces/{workspace_id}/project_users": { + "get": { + "summary": "Get workspace project users", + "description": "List all projects users for a given workspace.", + "operationId": "GetWorkspaceProjectUsers", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/ProjectIdsQuery" + }, + { + "$ref": "#/parameters/UserIdQuery" + }, + { + "$ref": "#/parameters/WithGroupMembersQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/ProjectUser" + } + } + }, + "400": { + "description": "Invalid parameters." + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Projects", + "Users" + ] + } + }, + "/workspaces/{workspace_id}/projects": { + "get": { + "summary": "Get workspace projects", + "description": "Get projects for given workspace.", + "operationId": "GetWorkspaceProjects", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/SortPinnedQuery" + }, + { + "$ref": "#/parameters/ActiveQuery" + }, + { + "$ref": "#/parameters/SinceQuery" + }, + { + "$ref": "#/parameters/BillableQuery" + }, + { + "$ref": "#/parameters/UserIdsQuery" + }, + { + "$ref": "#/parameters/ClientIdsQuery" + }, + { + "$ref": "#/parameters/GroupIdsQuery" + }, + { + "$ref": "#/parameters/ProjectIdsQuery" + }, + { + "$ref": "#/parameters/StatusesQuery" + }, + { + "$ref": "#/parameters/NameQuery" + }, + { + "$ref": "#/parameters/PageQuery" + }, + { + "$ref": "#/parameters/SortFieldQuery" + }, + { + "$ref": "#/parameters/SortOrderQuery" + }, + { + "$ref": "#/parameters/OnlyTemplatesQuery" + }, + { + "$ref": "#/parameters/OnlyMeQuery" + }, + { + "$ref": "#/parameters/PerPageQuery" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + } + } + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Projects" + ] + } + }, + "/workspaces/{workspace_id}/projects/{project_id}": { + "get": { + "summary": "Get workspace project", + "description": "Get project for given workspace.", + "operationId": "GetWorkspaceProject", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "$ref": "#/parameters/ProjectIdInPath" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Project" + } + }, + "400": { + "description": "Invalid project_id." + }, + "403": { + "description": "User does not have access to this resource." + }, + "500": { + "description": "Internal Server Error." + } + }, + "tags": [ + "Workspaces", + "Projects" + ] + } + }, + "/webhooks/api/v1/subscriptions/{workspace_id}/time_entry_created": { + "x-ms-notification-content": { + "description": "Details for Time Entry Created", + "schema": { + "$ref": "#/definitions/TimeEntryWebhookEvent" + } + }, + "post": { + "summary": "When a time entry is created", + "description": "Triggers when a new time entry is created in the workspace.", + "operationId": "OnTimeEntryCreated", + "x-ms-trigger": "single", + "x-ms-trigger-hint": "To see it work now, create a new time entry.", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "url_callback", + "description", + "enabled" + ], + "properties": { + "url_callback": { + "type": "string", + "description": "URL endpoint where events will be notified.", + "x-ms-summary": "Callback URL", + "x-ms-notification-url": true, + "x-ms-visibility": "internal" + }, + "description": { + "type": "string", + "description": "Description for this subscription.", + "x-ms-summary": "Description", + "x-ms-visibility": "internal", + "default": "Power Automate Time Tracking Trigger" + }, + "enabled": { + "type": "boolean", + "description": "Whether the subscription is enabled.", + "x-ms-summary": "Enabled", + "x-ms-visibility": "internal", + "default": true + }, + "event_filters": { + "type": "array", + "description": "List of filters to select events to notify.", + "x-ms-summary": "Event Filters", + "x-ms-visibility": "internal", + "items": { + "type": "object", + "properties": { + "entity": { + "type": "string", + "description": "Toggl Track business entity to filter.", + "x-ms-summary": "Entity" + }, + "action": { + "type": "string", + "description": "Type of modification applied to the entity.", + "x-ms-summary": "Action" + } + } + } + } + } + } + } + ], + "responses": { + "201": { + "description": "Subscription created successfully", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Bad request" + }, + "403": { + "description": "User not found/accessible for workspace" + } + }, + "tags": [ + "Triggers", + "Time Entries" + ], + "x-ms-visibility": "important" + } + }, + "/webhooks/api/v1/subscriptions/{workspace_id}/time_entry_updated": { + "x-ms-notification-content": { + "description": "Details for Time Entry Updated", + "schema": { + "$ref": "#/definitions/TimeEntryWebhookEvent" + } + }, + "post": { + "summary": "When a time entry is updated", + "description": "Triggers when an existing time entry is modified in the workspace.", + "operationId": "OnTimeEntryUpdated", + "x-ms-trigger": "single", + "x-ms-trigger-hint": "To see it work now, update an existing time entry.", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "url_callback", + "description", + "enabled" + ], + "properties": { + "url_callback": { + "type": "string", + "description": "URL endpoint where events will be notified.", + "x-ms-summary": "Callback URL", + "x-ms-notification-url": true, + "x-ms-visibility": "internal" + }, + "description": { + "type": "string", + "description": "Description for this subscription.", + "x-ms-summary": "Description", + "x-ms-visibility": "internal", + "default": "Power Automate Time Tracking Trigger" + }, + "enabled": { + "type": "boolean", + "description": "Whether the subscription is enabled.", + "x-ms-summary": "Enabled", + "x-ms-visibility": "internal", + "default": true + }, + "event_filters": { + "type": "array", + "description": "List of filters to select events to notify.", + "x-ms-summary": "Event Filters", + "x-ms-visibility": "internal", + "items": { + "type": "object", + "properties": { + "entity": { + "type": "string", + "description": "Toggl Track business entity to filter.", + "x-ms-summary": "Entity" + }, + "action": { + "type": "string", + "description": "Type of modification applied to the entity.", + "x-ms-summary": "Action" + } + } + } + } + } + } + } + ], + "responses": { + "201": { + "description": "Subscription created successfully", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Bad request" + }, + "403": { + "description": "User not found/accessible for workspace" + } + }, + "tags": [ + "Triggers", + "Time Entries" + ], + "x-ms-visibility": "important" + } + }, + "/webhooks/api/v1/subscriptions/{workspace_id}/time_entry_deleted": { + "x-ms-notification-content": { + "description": "Details for Time Entry Deleted", + "schema": { + "$ref": "#/definitions/TimeEntryWebhookEvent" + } + }, + "post": { + "summary": "When a time entry is deleted", + "description": "Triggers when a time entry is deleted from the workspace.", + "operationId": "OnTimeEntryDeleted", + "x-ms-trigger": "single", + "x-ms-trigger-hint": "To see it work now, delete a time entry.", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "url_callback", + "description", + "enabled" + ], + "properties": { + "url_callback": { + "type": "string", + "description": "URL endpoint where events will be notified.", + "x-ms-summary": "Callback URL", + "x-ms-notification-url": true, + "x-ms-visibility": "internal" + }, + "description": { + "type": "string", + "description": "Description for this subscription.", + "x-ms-summary": "Description", + "x-ms-visibility": "internal", + "default": "Power Automate Time Tracking Trigger" + }, + "enabled": { + "type": "boolean", + "description": "Whether the subscription is enabled.", + "x-ms-summary": "Enabled", + "x-ms-visibility": "internal", + "default": true + }, + "event_filters": { + "type": "array", + "description": "List of filters to select events to notify.", + "x-ms-summary": "Event Filters", + "x-ms-visibility": "internal", + "items": { + "type": "object", + "properties": { + "entity": { + "type": "string", + "description": "Toggl Track business entity to filter.", + "x-ms-summary": "Entity" + }, + "action": { + "type": "string", + "description": "Type of modification applied to the entity.", + "x-ms-summary": "Action" + } + } + } + } + } + } + } + ], + "responses": { + "201": { + "description": "Subscription created successfully", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Bad request" + }, + "403": { + "description": "User not found/accessible for workspace" + } + }, + "tags": [ + "Triggers", + "Time Entries" + ], + "x-ms-visibility": "important" + } + }, + "/webhooks/api/v1/subscriptions/{workspace_id}/time_entry_started": { + "x-ms-notification-content": { + "description": "Details for Time Entry Started", + "schema": { + "$ref": "#/definitions/TimeEntryWebhookEvent" + } + }, + "post": { + "summary": "When a time entry is started", + "description": "Triggers when a time entry is started (timer begins) in the workspace.", + "operationId": "OnTimeEntryStarted", + "x-ms-trigger": "single", + "x-ms-trigger-hint": "To see it work now, start a new time entry timer.", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "url_callback", + "description", + "enabled" + ], + "properties": { + "url_callback": { + "type": "string", + "description": "URL endpoint where events will be notified.", + "x-ms-summary": "Callback URL", + "x-ms-notification-url": true, + "x-ms-visibility": "internal" + }, + "description": { + "type": "string", + "description": "Description for this subscription.", + "x-ms-summary": "Description", + "x-ms-visibility": "internal", + "default": "Power Automate Time Tracking Trigger" + }, + "enabled": { + "type": "boolean", + "description": "Whether the subscription is enabled.", + "x-ms-summary": "Enabled", + "x-ms-visibility": "internal", + "default": true + }, + "event_filters": { + "type": "array", + "description": "List of filters to select events to notify.", + "x-ms-summary": "Event Filters", + "x-ms-visibility": "internal", + "items": { + "type": "object", + "properties": { + "entity": { + "type": "string", + "description": "Toggl Track business entity to filter.", + "x-ms-summary": "Entity" + }, + "action": { + "type": "string", + "description": "Type of modification applied to the entity.", + "x-ms-summary": "Action" + } + } + } + } + } + } + } + ], + "responses": { + "201": { + "description": "Subscription created successfully", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Bad request" + }, + "403": { + "description": "User not found/accessible for workspace" + } + }, + "tags": [ + "Triggers", + "Time Entries" + ], + "x-ms-visibility": "important" + } + }, + "/webhooks/api/v1/subscriptions/{workspace_id}/time_entry_stopped": { + "x-ms-notification-content": { + "description": "Details for Time Entry Stopped", + "schema": { + "$ref": "#/definitions/TimeEntryWebhookEvent" + } + }, + "post": { + "summary": "When a time entry is stopped", + "description": "Triggers when a running time entry is stopped in the workspace.", + "operationId": "OnTimeEntryStopped", + "x-ms-trigger": "single", + "x-ms-trigger-hint": "To see it work now, stop a running time entry timer.", + "parameters": [ + { + "$ref": "#/parameters/WorkspaceIdInPath" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "required": [ + "url_callback", + "description", + "enabled" + ], + "properties": { + "url_callback": { + "type": "string", + "description": "URL endpoint where events will be notified.", + "x-ms-summary": "Callback URL", + "x-ms-notification-url": true, + "x-ms-visibility": "internal" + }, + "description": { + "type": "string", + "description": "Description for this subscription.", + "x-ms-summary": "Description", + "x-ms-visibility": "internal", + "default": "Power Automate Time Tracking Trigger" + }, + "enabled": { + "type": "boolean", + "description": "Whether the subscription is enabled.", + "x-ms-summary": "Enabled", + "x-ms-visibility": "internal", + "default": true + }, + "event_filters": { + "type": "array", + "description": "List of filters to select events to notify.", + "x-ms-summary": "Event Filters", + "x-ms-visibility": "internal", + "items": { + "type": "object", + "properties": { + "entity": { + "type": "string", + "description": "Toggl Track business entity to filter.", + "x-ms-summary": "Entity" + }, + "action": { + "type": "string", + "description": "Type of modification applied to the entity.", + "x-ms-summary": "Action" + } + } + } + } + } + } + } + ], + "responses": { + "201": { + "description": "Subscription created successfully", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Bad request" + }, + "403": { + "description": "User not found/accessible for workspace" + } + }, + "tags": [ + "Triggers", + "Time Entries" + ], + "x-ms-visibility": "important" + } + } + }, + "definitions": { + "UserResponse": { + "type": "object", + "properties": { + "2fa_enabled": { + "type": "boolean", + "description": "Two-factor authentication enabled status.", + "x-ms-summary": "2FA Enabled" + }, + "api_token": { + "type": "string", + "description": "API token, will be omitted if empty.", + "x-ms-summary": "API Token" + }, + "at": { + "type": "string", + "description": "Last update timestamp.", + "x-ms-summary": "Last Updated" + }, + "authorization_updated_at": { + "type": "string", + "description": "Timestamp when the authorization user session object was last updated.", + "x-ms-summary": "Authorization Updated" + }, + "beginning_of_week": { + "type": "integer", + "format": "int32", + "description": "User's first day of the week (0=Sunday, 1=Monday, etc.).", + "x-ms-summary": "Beginning of Week" + }, + "clients": { + "type": "array", + "items": { + "$ref": "#/definitions/Client" + }, + "description": "Clients, null if with_related_data was not set to true.", + "x-ms-summary": "Clients" + }, + "country_id": { + "type": "integer", + "format": "int32", + "description": "User's country ID.", + "x-ms-summary": "Country ID" + }, + "created_at": { + "type": "string", + "description": "User creation timestamp.", + "x-ms-summary": "Created At" + }, + "default_workspace_id": { + "type": "integer", + "format": "int32", + "description": "User's default workspace ID.", + "x-ms-summary": "Default Workspace ID" + }, + "email": { + "type": "string", + "description": "User's email address.", + "x-ms-summary": "Email" + }, + "fullname": { + "type": "string", + "description": "User's full name.", + "x-ms-summary": "Full Name" + }, + "has_password": { + "type": "boolean", + "description": "Whether user has a password set.", + "x-ms-summary": "Has Password" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "User ID.", + "x-ms-summary": "User ID" + }, + "image_url": { + "type": "string", + "description": "User's profile image URL.", + "x-ms-summary": "Image URL" + }, + "intercom_hash": { + "type": "string", + "description": "Intercom hash, will be omitted if empty.", + "x-ms-summary": "Intercom Hash" + }, + "oauth_providers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "OAuth providers available to the user.", + "x-ms-summary": "OAuth Providers" + }, + "openid_email": { + "type": "string", + "description": "OpenID email address.", + "x-ms-summary": "OpenID Email" + }, + "openid_enabled": { + "type": "boolean", + "description": "OpenID authentication enabled status.", + "x-ms-summary": "OpenID Enabled" + }, + "options": { + "type": "object", + "description": "User options, will be omitted if empty.", + "x-ms-summary": "Options" + }, + "projects": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + }, + "description": "Projects, null if with_related_data was not set to true.", + "x-ms-summary": "Projects" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + }, + "description": "Tags, null if with_related_data was not set to true.", + "x-ms-summary": "Tags" + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/Task" + }, + "description": "Tasks, null if with_related_data was not set to true.", + "x-ms-summary": "Tasks" + }, + "time_entries": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeEntry" + }, + "description": "Time entries, null if with_related_data was not set to true.", + "x-ms-summary": "Time Entries" + }, + "timezone": { + "type": "string", + "description": "User's timezone.", + "x-ms-summary": "Timezone" + }, + "updated_at": { + "type": "string", + "description": "User last update timestamp.", + "x-ms-summary": "Updated At" + }, + "workspaces": { + "type": "array", + "items": { + "$ref": "#/definitions/Workspace" + }, + "description": "Workspaces, null if with_related_data was not set to true.", + "x-ms-summary": "Workspaces" + } + } + }, + "UserBasicResponse": { + "type": "object", + "properties": { + "2fa_enabled": { + "type": "boolean", + "description": "Two-factor authentication enabled status.", + "x-ms-summary": "2FA Enabled" + }, + "api_token": { + "type": "string", + "description": "API token, will be omitted if empty.", + "x-ms-summary": "API Token" + }, + "at": { + "type": "string", + "description": "Last update timestamp.", + "x-ms-summary": "Last Updated" + }, + "beginning_of_week": { + "type": "integer", + "format": "int32", + "description": "User's first day of the week.", + "x-ms-summary": "Beginning of Week" + }, + "country_id": { + "type": "integer", + "format": "int32", + "description": "User's country ID.", + "x-ms-summary": "Country ID" + }, + "created_at": { + "type": "string", + "description": "User creation timestamp.", + "x-ms-summary": "Created At" + }, + "default_workspace_id": { + "type": "integer", + "format": "int32", + "description": "User's default workspace ID.", + "x-ms-summary": "Default Workspace ID" + }, + "email": { + "type": "string", + "description": "User's email address.", + "x-ms-summary": "Email" + }, + "fullname": { + "type": "string", + "description": "User's full name.", + "x-ms-summary": "Full Name" + }, + "has_password": { + "type": "boolean", + "description": "Whether user has a password set.", + "x-ms-summary": "Has Password" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "User ID.", + "x-ms-summary": "User ID" + }, + "image_url": { + "type": "string", + "description": "User's profile image URL.", + "x-ms-summary": "Image URL" + }, + "openid_email": { + "type": "string", + "description": "OpenID email address.", + "x-ms-summary": "OpenID Email" + }, + "openid_enabled": { + "type": "boolean", + "description": "OpenID authentication enabled status.", + "x-ms-summary": "OpenID Enabled" + }, + "options": { + "type": "object", + "description": "User options, will be omitted if empty.", + "x-ms-summary": "Options" + }, + "timezone": { + "type": "string", + "description": "User's timezone.", + "x-ms-summary": "Timezone" + }, + "updated_at": { + "type": "string", + "description": "User last update timestamp.", + "x-ms-summary": "Updated At" + } + } + }, + "UserUpdateRequest": { + "type": "object", + "properties": { + "beginning_of_week": { + "type": "integer", + "format": "int32", + "description": "User's first day of the week. Sunday: 0, Monday: 1, etc.", + "x-ms-summary": "Beginning of Week" + }, + "country_id": { + "type": "integer", + "format": "int32", + "description": "User's country ID.", + "x-ms-summary": "Country ID" + }, + "current_password": { + "type": "string", + "description": "User's current password (used to change the current password).", + "x-ms-summary": "Current Password" + }, + "default_workspace_id": { + "type": "integer", + "format": "int32", + "description": "User's default workspace ID.", + "x-ms-summary": "Default Workspace ID" + }, + "email": { + "type": "string", + "description": "User's email address.", + "x-ms-summary": "Email" + }, + "fullname": { + "type": "string", + "description": "User's full name.", + "x-ms-summary": "Full Name" + }, + "password": { + "type": "string", + "description": "User's new password (current one must also be provided).", + "x-ms-summary": "New Password" + }, + "timezone": { + "type": "string", + "description": "User's timezone.", + "x-ms-summary": "Timezone" + } + } + }, + "Client": { + "type": "object", + "properties": { + "archived": { + "type": "boolean", + "description": "Is true if the client is archived.", + "x-ms-summary": "Archived" + }, + "at": { + "type": "string", + "description": "When was the last update.", + "x-ms-summary": "Last Updated" + }, + "creator_id": { + "type": "integer", + "format": "int32", + "description": "ID of the user who created the client.", + "x-ms-summary": "Creator ID" + }, + "external_reference": { + "type": "string", + "description": "External reference to the Track Client entity.", + "x-ms-summary": "External Reference" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Client ID.", + "x-ms-summary": "Client ID" + }, + "integration_ext_id": { + "type": "string", + "description": "External ID of the linked entity in the external system.", + "x-ms-summary": "Integration External ID" + }, + "integration_ext_type": { + "type": "string", + "description": "External type of the linked entity in the external system.", + "x-ms-summary": "Integration External Type" + }, + "integration_provider": { + "type": "object", + "description": "Provider that has an entity linked to this Toggl Track entity.", + "x-ms-summary": "Integration Provider" + }, + "name": { + "type": "string", + "description": "Name of the client.", + "x-ms-summary": "Client Name" + }, + "notes": { + "type": "string", + "description": "Client notes.", + "x-ms-summary": "Notes" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of authorization permissions for this client.", + "x-ms-summary": "Permissions" + }, + "total_count": { + "type": "integer", + "format": "int32", + "description": "Total field to store the total count.", + "x-ms-summary": "Total Count" + }, + "wid": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "Project": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "description": "Whether the project is active or archived.", + "x-ms-summary": "Active" + }, + "actual_hours": { + "type": "integer", + "format": "int32", + "description": "Actual hours spent on project.", + "x-ms-summary": "Actual Hours" + }, + "actual_seconds": { + "type": "integer", + "format": "int32", + "description": "Actual seconds spent on project.", + "x-ms-summary": "Actual Seconds" + }, + "at": { + "type": "string", + "description": "Last updated date.", + "x-ms-summary": "Last Updated" + }, + "auto_estimates": { + "type": "boolean", + "description": "Auto estimates enabled.", + "x-ms-summary": "Auto Estimates" + }, + "billable": { + "type": "boolean", + "description": "Whether the project is billable.", + "x-ms-summary": "Billable" + }, + "can_track_time": { + "type": "boolean", + "description": "Whether time can be tracked to this project.", + "x-ms-summary": "Can Track Time" + }, + "cid": { + "type": "integer", + "format": "int32", + "description": "Client ID legacy field.", + "x-ms-summary": "Client ID (Legacy)" + }, + "client_id": { + "type": "integer", + "format": "int32", + "description": "Client ID.", + "x-ms-summary": "Client ID" + }, + "client_name": { + "type": "string", + "description": "Client name.", + "x-ms-summary": "Client Name" + }, + "color": { + "type": "string", + "description": "Project color.", + "x-ms-summary": "Color" + }, + "created_at": { + "type": "string", + "description": "Creation date.", + "x-ms-summary": "Created At" + }, + "currency": { + "type": "string", + "description": "Project currency.", + "x-ms-summary": "Currency" + }, + "current_period": { + "type": "object", + "description": "Current project period, premium feature.", + "x-ms-summary": "Current Period" + }, + "end_date": { + "type": "string", + "description": "Project end date.", + "x-ms-summary": "End Date" + }, + "estimated_hours": { + "type": "integer", + "format": "int32", + "description": "Estimated hours for project.", + "x-ms-summary": "Estimated Hours" + }, + "estimated_seconds": { + "type": "integer", + "format": "int32", + "description": "Estimated seconds for project.", + "x-ms-summary": "Estimated Seconds" + }, + "external_reference": { + "type": "string", + "description": "External reference to the Track Project Entity.", + "x-ms-summary": "External Reference" + }, + "fixed_fee": { + "type": "number", + "format": "double", + "description": "Fixed fee, premium feature.", + "x-ms-summary": "Fixed Fee" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Project ID.", + "x-ms-summary": "Project ID" + }, + "integration_ext_id": { + "type": "string", + "description": "External ID of the linked entity in the external system.", + "x-ms-summary": "Integration External ID" + }, + "integration_ext_type": { + "type": "string", + "description": "External type of the linked entity in the external system.", + "x-ms-summary": "Integration External Type" + }, + "integration_provider": { + "type": "object", + "description": "Provider that has an entity linked to this Toggl Track entity.", + "x-ms-summary": "Integration Provider" + }, + "is_private": { + "type": "boolean", + "description": "Whether the project is private.", + "x-ms-summary": "Is Private" + }, + "name": { + "type": "string", + "description": "Project name.", + "x-ms-summary": "Project Name" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Project permissions.", + "x-ms-summary": "Permissions" + }, + "pinned": { + "type": "boolean", + "description": "Whether the project is pinned.", + "x-ms-summary": "Pinned" + }, + "rate": { + "type": "number", + "format": "double", + "description": "Hourly rate for project.", + "x-ms-summary": "Hourly Rate" + }, + "rate_last_updated": { + "type": "string", + "description": "When rate was last updated.", + "x-ms-summary": "Rate Last Updated" + }, + "recurring": { + "type": "boolean", + "description": "Whether the project is recurring, premium feature.", + "x-ms-summary": "Recurring" + }, + "recurring_parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/RecurringParameter" + }, + "description": "Project recurring parameters, premium feature.", + "x-ms-summary": "Recurring Parameters" + }, + "start_date": { + "type": "string", + "description": "Project start date.", + "x-ms-summary": "Start Date" + }, + "status": { + "type": "string", + "description": "Status of the project (upcoming, active, ended, archived, deleted).", + "x-ms-summary": "Status" + }, + "template": { + "type": "boolean", + "description": "Whether project is a template.", + "x-ms-summary": "Template" + }, + "template_id": { + "type": "integer", + "format": "int32", + "description": "Template ID if project is based on template.", + "x-ms-summary": "Template ID" + }, + "total_count": { + "type": "integer", + "format": "int32", + "description": "Total number of projects found.", + "x-ms-summary": "Total Count" + }, + "wid": { + "type": "integer", + "format": "int32", + "description": "Workspace ID legacy field.", + "x-ms-summary": "Workspace ID (Legacy)" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "ProjectsResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Project" + }, + "description": "List of projects.", + "x-ms-summary": "Projects" + } + } + }, + "RecurringParameter": { + "type": "object", + "properties": { + "custom_period": { + "type": "integer", + "format": "int32", + "description": "Custom period, used when period field is 'custom'.", + "x-ms-summary": "Custom Period" + }, + "estimated_seconds": { + "type": "integer", + "format": "int32", + "description": "Estimated seconds.", + "x-ms-summary": "Estimated Seconds" + }, + "parameter_end_date": { + "type": "string", + "description": "Parameter end date.", + "x-ms-summary": "Parameter End Date" + }, + "parameter_start_date": { + "type": "string", + "description": "Recurring start date.", + "x-ms-summary": "Parameter Start Date" + }, + "period": { + "type": "string", + "description": "Recurring period.", + "x-ms-summary": "Period" + }, + "project_start_date": { + "type": "string", + "description": "Project start date.", + "x-ms-summary": "Project Start Date" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "at": { + "type": "string", + "description": "When was created/last modified.", + "x-ms-summary": "Last Modified" + }, + "creator_id": { + "type": "integer", + "format": "int32", + "description": "ID of the user who created the tag.", + "x-ms-summary": "Creator ID" + }, + "deleted_at": { + "type": "string", + "description": "When was deleted.", + "x-ms-summary": "Deleted At" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Tag ID.", + "x-ms-summary": "Tag ID" + }, + "integration_ext_id": { + "type": "string", + "description": "External ID of the linked entity in the external system.", + "x-ms-summary": "Integration External ID" + }, + "integration_ext_type": { + "type": "string", + "description": "External type of the linked entity in the external system.", + "x-ms-summary": "Integration External Type" + }, + "integration_provider": { + "type": "object", + "description": "Provider that has an entity linked to this Toggl Track entity.", + "x-ms-summary": "Integration Provider" + }, + "name": { + "type": "string", + "description": "Tag name.", + "x-ms-summary": "Tag Name" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tag permissions.", + "x-ms-summary": "Permissions" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "TagsResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + }, + "description": "List of tags.", + "x-ms-summary": "Tags" + } + } + }, + "Task": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "description": "False when the task has been done.", + "x-ms-summary": "Active" + }, + "at": { + "type": "string", + "description": "When the task was created/last modified.", + "x-ms-summary": "Last Modified" + }, + "avatar_url": { + "type": "string", + "description": "Avatar URL.", + "x-ms-summary": "Avatar URL" + }, + "client_name": { + "type": "string", + "description": "Client name.", + "x-ms-summary": "Client Name" + }, + "estimated_seconds": { + "type": "integer", + "format": "int32", + "description": "Estimated seconds for task.", + "x-ms-summary": "Estimated Seconds" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Task ID.", + "x-ms-summary": "Task ID" + }, + "integration_ext_id": { + "type": "string", + "description": "External ID of the linked entity in the external system.", + "x-ms-summary": "Integration External ID" + }, + "integration_ext_type": { + "type": "string", + "description": "External type of the linked entity in the external system.", + "x-ms-summary": "Integration External Type" + }, + "integration_provider": { + "type": "object", + "description": "Provider that has an entity linked to this Toggl Track entity.", + "x-ms-summary": "Integration Provider" + }, + "name": { + "type": "string", + "description": "Task name.", + "x-ms-summary": "Task Name" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Task permissions.", + "x-ms-summary": "Permissions" + }, + "project_billable": { + "type": "boolean", + "description": "Whether the project is billable.", + "x-ms-summary": "Project Billable" + }, + "project_color": { + "type": "string", + "description": "Project color metadata.", + "x-ms-summary": "Project Color" + }, + "project_id": { + "type": "integer", + "format": "int32", + "description": "Project ID.", + "x-ms-summary": "Project ID" + }, + "project_is_private": { + "type": "boolean", + "description": "Whether the project is private.", + "x-ms-summary": "Project Is Private" + }, + "project_name": { + "type": "string", + "description": "Project name.", + "x-ms-summary": "Project Name" + }, + "rate": { + "type": "number", + "format": "double", + "description": "Rate for this task.", + "x-ms-summary": "Rate" + }, + "rate_last_updated": { + "type": "string", + "description": "When rate was last updated.", + "x-ms-summary": "Rate Last Updated" + }, + "recurring": { + "type": "boolean", + "description": "Whether this is a recurring task.", + "x-ms-summary": "Recurring" + }, + "toggl_accounts_id": { + "type": "string", + "description": "Toggl accounts ID.", + "x-ms-summary": "Toggl Accounts ID" + }, + "tracked_seconds": { + "type": "integer", + "format": "int32", + "description": "The value tracked_seconds is in milliseconds, not in seconds.", + "x-ms-summary": "Tracked Seconds" + }, + "user_id": { + "type": "integer", + "format": "int32", + "description": "User ID.", + "x-ms-summary": "User ID" + }, + "user_name": { + "type": "string", + "description": "User name.", + "x-ms-summary": "User Name" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "TasksResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Task" + }, + "description": "List of tasks.", + "x-ms-summary": "Tasks" + } + } + }, + "TimeEntry": { + "type": "object", + "properties": { + "at": { + "type": "string", + "description": "When was last updated, follows ISO 8601 format.", + "x-ms-summary": "Last Updated" + }, + "billable": { + "type": "boolean", + "description": "Whether the time entry is marked as billable.", + "x-ms-summary": "Billable" + }, + "client_name": { + "type": "string", + "description": "Related entities meta fields.", + "x-ms-summary": "Client Name" + }, + "description": { + "type": "string", + "description": "Time entry description.", + "x-ms-summary": "Description" + }, + "duration": { + "type": "integer", + "format": "int32", + "description": "Time entry duration. For running entries should be negative, preferable -1.", + "x-ms-summary": "Duration" + }, + "duronly": { + "type": "boolean", + "description": "Used to create a TE with a duration but without a stop time.", + "x-ms-summary": "Duration Only" + }, + "expense_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Work expenses.", + "x-ms-summary": "Expense IDs" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Time Entry ID.", + "x-ms-summary": "Time Entry ID" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Permission list.", + "x-ms-summary": "Permissions" + }, + "pid": { + "type": "integer", + "format": "int32", + "description": "Project ID, legacy field.", + "x-ms-summary": "Project ID (Legacy)" + }, + "project_active": { + "type": "boolean", + "description": "Whether the project is active.", + "x-ms-summary": "Project Active" + }, + "project_billable": { + "type": "boolean", + "description": "Whether the project is billable.", + "x-ms-summary": "Project Billable" + }, + "project_color": { + "type": "string", + "description": "Project color.", + "x-ms-summary": "Project Color" + }, + "project_id": { + "type": "integer", + "format": "int32", + "description": "Project ID.", + "x-ms-summary": "Project ID" + }, + "project_name": { + "type": "string", + "description": "Project name.", + "x-ms-summary": "Project Name" + }, + "shared_with": { + "type": "array", + "items": { + "$ref": "#/definitions/SharedWith" + }, + "description": "Indicates who the time entry has been shared with.", + "x-ms-summary": "Shared With" + }, + "start": { + "type": "string", + "description": "Start time in UTC.", + "x-ms-summary": "Start Time" + }, + "stop": { + "type": "string", + "description": "Stop time in UTC, can be null if it's still running.", + "x-ms-summary": "Stop Time" + }, + "tag_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "Tag IDs, null if tags were not provided or were later deleted.", + "x-ms-summary": "Tag IDs" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Tag names, null if tags were not provided or were later deleted.", + "x-ms-summary": "Tags" + }, + "task_id": { + "type": "integer", + "format": "int32", + "description": "Task ID.", + "x-ms-summary": "Task ID" + }, + "task_name": { + "type": "string", + "description": "Task name.", + "x-ms-summary": "Task Name" + }, + "tid": { + "type": "integer", + "format": "int32", + "description": "Task ID, legacy field.", + "x-ms-summary": "Task ID (Legacy)" + }, + "uid": { + "type": "integer", + "format": "int32", + "description": "Time Entry creator ID, legacy field.", + "x-ms-summary": "User ID (Legacy)" + }, + "user_avatar_url": { + "type": "string", + "description": "User avatar URL.", + "x-ms-summary": "User Avatar URL" + }, + "user_id": { + "type": "integer", + "format": "int32", + "description": "Time Entry creator ID.", + "x-ms-summary": "User ID" + }, + "user_name": { + "type": "string", + "description": "User name.", + "x-ms-summary": "User Name" + }, + "wid": { + "type": "integer", + "format": "int32", + "description": "Workspace ID, legacy field.", + "x-ms-summary": "Workspace ID (Legacy)" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "SharedWith": { + "type": "object", + "properties": { + "accepted": { + "type": "boolean", + "description": "Whether the share was accepted.", + "x-ms-summary": "Accepted" + }, + "user_id": { + "type": "integer", + "format": "int32", + "description": "User ID of person shared with.", + "x-ms-summary": "User ID" + }, + "user_name": { + "type": "string", + "description": "User name of person shared with.", + "x-ms-summary": "User Name" + } + } + }, + "Workspace": { + "type": "object", + "properties": { + "active_project_count": { + "type": "integer", + "format": "int32", + "description": "Number of active projects.", + "x-ms-summary": "Active Project Count" + }, + "admin": { + "type": "boolean", + "description": "Current user is workspace admin (Deprecated).", + "x-ms-summary": "Admin" + }, + "api_token": { + "type": "string", + "description": "API token (deprecated).", + "x-ms-summary": "API Token" + }, + "at": { + "type": "string", + "description": "Timestamp of last workspace change.", + "x-ms-summary": "Last Changed" + }, + "business_ws": { + "type": "boolean", + "description": "Workspace on Premium subscription.", + "x-ms-summary": "Business Workspace" + }, + "csv_upload": { + "type": "object", + "description": "CSV upload data.", + "x-ms-summary": "CSV Upload" + }, + "default_currency": { + "type": "string", + "description": "Default currency, premium feature.", + "x-ms-summary": "Default Currency" + }, + "default_hourly_rate": { + "type": "number", + "format": "double", + "description": "The default hourly rate, premium feature.", + "x-ms-summary": "Default Hourly Rate" + }, + "disable_approvals": { + "type": "boolean", + "description": "Disable approvals in the workspace.", + "x-ms-summary": "Disable Approvals" + }, + "disable_timesheet_view": { + "type": "boolean", + "description": "Disable timesheet view in the workspace.", + "x-ms-summary": "Disable Timesheet View" + }, + "hide_start_end_times": { + "type": "boolean", + "description": "Hide start and end times.", + "x-ms-summary": "Hide Start End Times" + }, + "ical_enabled": { + "type": "boolean", + "description": "Calendar integration enabled.", + "x-ms-summary": "iCal Enabled" + }, + "ical_url": { + "type": "string", + "description": "URL of calendar.", + "x-ms-summary": "iCal URL" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Identifier of the workspace.", + "x-ms-summary": "Workspace ID" + }, + "last_modified": { + "type": "string", + "description": "Last modification of data in the workspace.", + "x-ms-summary": "Last Modified" + }, + "limit_public_project_data": { + "type": "boolean", + "description": "Limit public projects data in reports to admins.", + "x-ms-summary": "Limit Public Project Data" + }, + "logo_url": { + "type": "string", + "description": "URL of workspace logo.", + "x-ms-summary": "Logo URL" + }, + "max_data_retention_days": { + "type": "object", + "description": "How far back free workspaces can access data.", + "x-ms-summary": "Max Data Retention Days" + }, + "name": { + "type": "string", + "description": "Name of the workspace.", + "x-ms-summary": "Workspace Name" + }, + "only_admins_may_create_projects": { + "type": "boolean", + "description": "Only admins will be able to create projects.", + "x-ms-summary": "Only Admins May Create Projects" + }, + "only_admins_may_create_tags": { + "type": "boolean", + "description": "Only admins will be able to create tags.", + "x-ms-summary": "Only Admins May Create Tags" + }, + "only_admins_see_team_dashboard": { + "type": "boolean", + "description": "Only admins will be able to see the team dashboard.", + "x-ms-summary": "Only Admins See Team Dashboard" + }, + "organization_id": { + "type": "integer", + "format": "int32", + "description": "Identifier of the organization.", + "x-ms-summary": "Organization ID" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Permissions list.", + "x-ms-summary": "Permissions" + }, + "premium": { + "type": "boolean", + "description": "Workspace on Starter subscription.", + "x-ms-summary": "Premium" + }, + "projects_billable_by_default": { + "type": "boolean", + "description": "New projects billable by default.", + "x-ms-summary": "Projects Billable By Default" + }, + "projects_enforce_billable": { + "type": "boolean", + "description": "Whether tracking time to projects will enforce billable setting to be respected.", + "x-ms-summary": "Projects Enforce Billable" + }, + "projects_private_by_default": { + "type": "boolean", + "description": "Workspace setting for default project visibility.", + "x-ms-summary": "Projects Private By Default" + }, + "rate_last_updated": { + "type": "string", + "description": "Timestamp of last workspace rate update.", + "x-ms-summary": "Rate Last Updated" + }, + "reports_collapse": { + "type": "boolean", + "description": "Whether reports should be collapsed by default.", + "x-ms-summary": "Reports Collapse" + }, + "role": { + "type": "string", + "description": "Role of the current user in the workspace.", + "x-ms-summary": "Role" + }, + "rounding": { + "type": "integer", + "format": "int32", + "description": "Default rounding, premium feature. 0 - nearest, 1 - round up, -1 - round down.", + "x-ms-summary": "Rounding" + }, + "rounding_minutes": { + "type": "integer", + "format": "int32", + "description": "Default rounding in minutes, premium feature.", + "x-ms-summary": "Rounding Minutes" + }, + "subscription": { + "type": "object", + "description": "Subscription details (deprecated).", + "x-ms-summary": "Subscription" + }, + "suspended_at": { + "type": "string", + "description": "Timestamp of suspension.", + "x-ms-summary": "Suspended At" + }, + "te_constraints": { + "type": "object", + "description": "Time entry constraints setting.", + "x-ms-summary": "Time Entry Constraints" + }, + "working_hours_in_minutes": { + "type": "integer", + "format": "int32", + "description": "Working hours in minutes.", + "x-ms-summary": "Working Hours In Minutes" + } + } + }, + "WorkspacesResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Workspace" + }, + "description": "List of workspaces.", + "x-ms-summary": "Workspaces" + } + } + }, + "Feature": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether the feature is enabled.", + "x-ms-summary": "Enabled" + }, + "feature_id": { + "type": "integer", + "format": "int32", + "description": "Feature ID.", + "x-ms-summary": "Feature ID" + }, + "name": { + "type": "string", + "description": "Feature name.", + "x-ms-summary": "Feature Name" + } + } + }, + "WorkspaceFeatures": { + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "$ref": "#/definitions/Feature" + }, + "description": "List of features.", + "x-ms-summary": "Features" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "LocationResponse": { + "type": "object", + "properties": { + "city": { + "type": "string", + "description": "City name.", + "x-ms-summary": "City" + }, + "city_lat_long": { + "type": "string", + "description": "City latitude and longitude.", + "x-ms-summary": "City Coordinates" + }, + "country_code": { + "type": "string", + "description": "Country code.", + "x-ms-summary": "Country Code" + }, + "country_name": { + "type": "string", + "description": "Country name.", + "x-ms-summary": "Country Name" + }, + "state": { + "type": "string", + "description": "State or region.", + "x-ms-summary": "State" + } + } + }, + "Organization": { + "type": "object", + "properties": { + "admin": { + "type": "boolean", + "description": "Whether the requester is an admin of the organization.", + "x-ms-summary": "Admin" + }, + "at": { + "type": "string", + "description": "Organization's last modification date.", + "x-ms-summary": "Last Modified" + }, + "created_at": { + "type": "string", + "description": "Organization's creation date.", + "x-ms-summary": "Created At" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Organization ID.", + "x-ms-summary": "Organization ID" + }, + "is_multi_workspace_enabled": { + "type": "boolean", + "description": "Is true when the organization option is_multi_workspace_enabled is set.", + "x-ms-summary": "Multi Workspace Enabled" + }, + "is_unified": { + "type": "boolean", + "description": "Is unified organization.", + "x-ms-summary": "Is Unified" + }, + "max_data_retention_days": { + "type": "object", + "description": "How far back free workspaces in this org can access data.", + "x-ms-summary": "Max Data Retention Days" + }, + "max_workspaces": { + "type": "integer", + "format": "int32", + "description": "Maximum number of workspaces allowed for the organization.", + "x-ms-summary": "Max Workspaces" + }, + "name": { + "type": "string", + "description": "Organization Name.", + "x-ms-summary": "Organization Name" + }, + "owner": { + "type": "boolean", + "description": "Whether the requester is a the owner of the organization.", + "x-ms-summary": "Owner" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Organization permissions.", + "x-ms-summary": "Permissions" + }, + "pricing_plan_enterprise": { + "type": "boolean", + "description": "The subscription plan is an enterprise plan.", + "x-ms-summary": "Pricing Plan Enterprise" + }, + "pricing_plan_id": { + "type": "integer", + "format": "int32", + "description": "Organization plan ID.", + "x-ms-summary": "Pricing Plan ID" + }, + "pricing_plan_name": { + "type": "string", + "description": "The subscription plan name the org is currently on.", + "x-ms-summary": "Pricing Plan Name" + }, + "suspended_at": { + "type": "string", + "description": "Whether the organization is currently suspended.", + "x-ms-summary": "Suspended At" + }, + "trial_info": { + "$ref": "#/definitions/TrialInfo" + }, + "user_count": { + "type": "integer", + "format": "int32", + "description": "Number of organization users.", + "x-ms-summary": "User Count" + } + } + }, + "TrialInfo": { + "type": "object", + "properties": { + "can_have_trial": { + "type": "boolean", + "description": "Is true if neither the organization nor the owner has never had a trial before.", + "x-ms-summary": "Can Have Trial" + }, + "last_pricing_plan_id": { + "type": "integer", + "format": "int32", + "description": "Last pricing plan ID.", + "x-ms-summary": "Last Pricing Plan ID" + }, + "next_payment_date": { + "type": "string", + "description": "Next payment date.", + "x-ms-summary": "Next Payment Date" + }, + "trial": { + "type": "boolean", + "description": "Whether the organization's subscription is currently on trial.", + "x-ms-summary": "Trial" + }, + "trial_available": { + "type": "boolean", + "description": "When a trial is available for this organization (Deprecated).", + "x-ms-summary": "Trial Available" + }, + "trial_end_date": { + "type": "string", + "description": "Trial end date.", + "x-ms-summary": "Trial End Date" + }, + "trial_plan_id": { + "type": "integer", + "format": "int32", + "description": "Trial plan ID.", + "x-ms-summary": "Trial Plan ID" + } + } + }, + "OrganizationsResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Organization" + }, + "description": "List of organizations.", + "x-ms-summary": "Organizations" + } + } + }, + "TrackReminder": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "description": "Reminder creation time.", + "x-ms-summary": "Created At" + }, + "frequency": { + "type": "integer", + "format": "int32", + "description": "Frequency of the reminder in days, should be either 1 or 7.", + "x-ms-summary": "Frequency" + }, + "group_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Groups IDs to send the reminder to.", + "x-ms-summary": "Group IDs" + }, + "reminder_id": { + "type": "integer", + "format": "int32", + "description": "Reminder ID.", + "x-ms-summary": "Reminder ID" + }, + "threshold": { + "type": "integer", + "format": "int32", + "description": "Threshold is the number of hours after which the reminder will be sent.", + "x-ms-summary": "Threshold" + }, + "user_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "User IDs to send the reminder to.", + "x-ms-summary": "User IDs" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "TrackRemindersResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/TrackReminder" + }, + "description": "Returns a list of track reminders.", + "x-ms-summary": "Track Reminders" + } + } + }, + "TimeEntriesResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/TimeEntry" + }, + "description": "List of time entries.", + "x-ms-summary": "Time Entries" + } + } + }, + "TimeEntryRequest": { + "type": "object", + "properties": { + "billable": { + "type": "boolean", + "description": "Whether the time entry is marked as billable, optional, default false.", + "x-ms-summary": "Billable" + }, + "created_with": { + "type": "string", + "description": "Must be provided when creating a time entry and should identify the service/application used to create it.", + "x-ms-summary": "Created With" + }, + "description": { + "type": "string", + "description": "Time entry description, optional.", + "x-ms-summary": "Description" + }, + "duration": { + "type": "integer", + "format": "int32", + "description": "Time entry duration. For running entries should be negative, preferable -1.", + "x-ms-summary": "Duration" + }, + "duronly": { + "type": "boolean", + "description": "Deprecated: Used to create a time entry with a duration but without a stop time. This parameter can be ignored.", + "x-ms-summary": "Duration Only" + }, + "event_metadata": { + "$ref": "#/definitions/EventMetadata" + }, + "expense_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Work Expenses associated with the Time Entry.", + "x-ms-summary": "Expense IDs" + }, + "pid": { + "type": "integer", + "format": "int32", + "description": "Project ID, legacy field.", + "x-ms-summary": "Project ID (Legacy)" + }, + "project_id": { + "type": "integer", + "format": "int32", + "description": "Project ID, optional.", + "x-ms-summary": "Project ID" + }, + "shared_with_user_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "List of user IDs to share this time entry with.", + "x-ms-summary": "Shared With User IDs" + }, + "start": { + "type": "string", + "description": "Start time in UTC, required for creation. Format: 2006-01-02T15:04:05Z.", + "x-ms-summary": "Start Time" + }, + "start_date": { + "type": "string", + "description": "If provided during creation, the date part will take precedence over the date part of 'start'. Format: 2006-11-07.", + "x-ms-summary": "Start Date" + }, + "stop": { + "type": "string", + "description": "Stop time in UTC, can be omitted if it's still running or created with 'duration'. If 'stop' and 'duration' are provided, values must be consistent (start + duration == stop).", + "x-ms-summary": "Stop Time" + }, + "tag_action": { + "type": "string", + "description": "Can be 'add' or 'delete'. Used when updating an existing time entry.", + "x-ms-summary": "Tag Action", + "enum": [ + "add", + "delete" + ] + }, + "tag_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "IDs of tags to add/remove.", + "x-ms-summary": "Tag IDs" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Names of tags to add/remove. If name does not exist as tag, one will be created automatically.", + "x-ms-summary": "Tags" + }, + "task_id": { + "type": "integer", + "format": "int32", + "description": "Task ID, optional.", + "x-ms-summary": "Task ID" + }, + "tid": { + "type": "integer", + "format": "int32", + "description": "Task ID, legacy field.", + "x-ms-summary": "Task ID (Legacy)" + }, + "uid": { + "type": "integer", + "format": "int32", + "description": "Time Entry creator ID, legacy field.", + "x-ms-summary": "User ID (Legacy)" + }, + "user_id": { + "type": "integer", + "format": "int32", + "description": "Time Entry creator ID, if omitted will use the requester user ID.", + "x-ms-summary": "User ID" + }, + "wid": { + "type": "integer", + "format": "int32", + "description": "Workspace ID, legacy field.", + "x-ms-summary": "Workspace ID (Legacy)" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID, required.", + "x-ms-summary": "Workspace ID" + } + } + }, + "EventMetadata": { + "type": "object", + "properties": { + "origin_feature": { + "type": "string", + "description": "Origin feature name.", + "x-ms-summary": "Origin Feature" + }, + "visible_goals_count": { + "type": "integer", + "format": "int32", + "description": "Number of visible goals.", + "x-ms-summary": "Visible Goals Count" + } + } + }, + "PatchOperations": { + "type": "array", + "items": { + "$ref": "#/definitions/PatchOperation" + }, + "description": "List of patch operations." + }, + "PatchOperation": { + "type": "object", + "properties": { + "op": { + "type": "string", + "description": "Operation (add/remove/replace).", + "x-ms-summary": "Operation", + "enum": [ + "add", + "remove", + "replace" + ] + }, + "path": { + "type": "string", + "description": "The path to the entity to patch (e.g. /description).", + "x-ms-summary": "Path" + }, + "value": { + "type": "object", + "description": "The new value for the entity in path.", + "x-ms-summary": "Value" + } + }, + "required": [ + "op", + "path" + ] + }, + "BulkEditResponse": { + "type": "object", + "properties": { + "failure": { + "type": "array", + "items": { + "$ref": "#/definitions/BulkEditFailure" + }, + "description": "List of failed operations.", + "x-ms-summary": "Failures" + }, + "success": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "The IDs for which the patch was successful.", + "x-ms-summary": "Success IDs" + } + } + }, + "BulkEditFailure": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The ID for which the patch operation failed.", + "x-ms-summary": "Failed ID" + }, + "message": { + "type": "string", + "description": "The operation failure reason.", + "x-ms-summary": "Error Message" + } + } + }, + "WorkspaceUsersResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkspaceUser" + }, + "description": "List of workspace users.", + "x-ms-summary": "Workspace Users" + } + } + }, + "WorkspaceUser": { + "type": "object", + "properties": { + "2fa_enabled": { + "type": "boolean", + "description": "Flag indicating whether use has 2FA enabled or not.", + "x-ms-summary": "2FA Enabled" + }, + "active": { + "type": "boolean", + "description": "Flag indicating if user accepted the invitation.", + "x-ms-summary": "Active" + }, + "admin": { + "type": "boolean", + "description": "Flag indicating if user is admin.", + "x-ms-summary": "Admin" + }, + "at": { + "type": "string", + "description": "Timestamp of the last update.", + "x-ms-summary": "Last Updated" + }, + "avatar_file_name": { + "type": "string", + "description": "URL of avatar.", + "x-ms-summary": "Avatar URL" + }, + "email": { + "type": "string", + "description": "Email of the user.", + "x-ms-summary": "Email" + }, + "group_ids": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "List of groups the user belongs to.", + "x-ms-summary": "Group IDs" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Identifier of the user workspace.", + "x-ms-summary": "User Workspace ID" + }, + "inactive": { + "type": "boolean", + "description": "Flag indicating if user was deactivated by admin of the workspace.", + "x-ms-summary": "Inactive" + }, + "invitation_code": { + "type": "string", + "description": "Internal invitation code.", + "x-ms-summary": "Invitation Code" + }, + "invite_url": { + "type": "string", + "description": "Internal invite URL.", + "x-ms-summary": "Invite URL" + }, + "is_direct": { + "type": "boolean", + "description": "Flag indicating if user is a direct member of the workspace (is not assigned to the workspace using the group).", + "x-ms-summary": "Is Direct Member" + }, + "labor_cost": { + "type": "number", + "format": "double", + "description": "Labor cost assigned to the user.", + "x-ms-summary": "Labor Cost" + }, + "labor_cost_last_updated": { + "type": "string", + "description": "Timestamp of the last labor cost update.", + "x-ms-summary": "Labor Cost Last Updated" + }, + "name": { + "type": "string", + "description": "Name of the user.", + "x-ms-summary": "Name" + }, + "organization_admin": { + "type": "boolean", + "description": "Flag indicating if user is admin inside organization.", + "x-ms-summary": "Organization Admin" + }, + "rate": { + "type": "number", + "format": "double", + "description": "Rate assigned to the user.", + "x-ms-summary": "Rate" + }, + "rate_last_updated": { + "type": "string", + "description": "Timestamp of the last rate update.", + "x-ms-summary": "Rate Last Updated" + }, + "role": { + "type": "string", + "description": "Role of the user.", + "x-ms-summary": "Role" + }, + "role_id": { + "type": "integer", + "format": "int32", + "description": "Role ID.", + "x-ms-summary": "Role ID" + }, + "timezone": { + "type": "string", + "description": "Timezone of the user.", + "x-ms-summary": "Timezone" + }, + "uid": { + "type": "integer", + "format": "int32", + "description": "Global user identifier.", + "x-ms-summary": "Global User ID" + }, + "user_id": { + "type": "integer", + "format": "int32", + "description": "UserID alternative JSON field, only used by get-organization-workspaces-workspaceusers.", + "x-ms-summary": "User ID" + }, + "view_edit_billable_rates": { + "type": "boolean", + "description": "Granular rate permission flags. Only takes effect on roles with conditional rate permissions.", + "x-ms-summary": "View Edit Billable Rates" + }, + "view_edit_labor_costs": { + "type": "boolean", + "description": "View edit labor costs permission.", + "x-ms-summary": "View Edit Labor Costs" + }, + "wid": { + "type": "integer", + "format": "int32", + "description": "Workspace identifier.", + "x-ms-summary": "Workspace ID" + }, + "working_hours_in_minutes": { + "type": "integer", + "format": "int32", + "description": "Working hours value in minutes.", + "x-ms-summary": "Working Hours in Minutes" + }, + "workspace_admin": { + "type": "boolean", + "description": "Flag indicating if user is admin inside workspace.", + "x-ms-summary": "Workspace Admin" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "UserID alternative JSON field, only used by get-organization-workspaces-workspaceusers.", + "x-ms-summary": "Workspace ID" + } + } + }, + "RatesResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Rate" + }, + "description": "List of rates.", + "x-ms-summary": "Rates" + } + } + }, + "Rate": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "format": "double", + "description": "Amount of the rate.", + "x-ms-summary": "Amount" + }, + "created_at": { + "type": "string", + "description": "Creation date of the rate.", + "x-ms-summary": "Created At" + }, + "creator_id": { + "type": "integer", + "format": "int32", + "description": "Creator ID.", + "x-ms-summary": "Creator ID" + }, + "deleted_at": { + "type": "string", + "description": "Deletion date of the rate, in case that is null it means the rates is active.", + "x-ms-summary": "Deleted At" + }, + "end": { + "type": "string", + "description": "End date time of the rate.", + "x-ms-summary": "End Date" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Identifier of the rate.", + "x-ms-summary": "Rate ID" + }, + "planned_task_id": { + "type": "integer", + "format": "int32", + "description": "Planned task ID which the rate is applied.", + "x-ms-summary": "Planned Task ID" + }, + "project_id": { + "type": "integer", + "format": "int32", + "description": "Project ID which the rate is applied.", + "x-ms-summary": "Project ID" + }, + "project_user_id": { + "type": "integer", + "format": "int32", + "description": "Project user ID which the rate is applied.", + "x-ms-summary": "Project User ID" + }, + "rate_change_mode": { + "type": "string", + "description": "Rate change mode.", + "x-ms-summary": "Rate Change Mode" + }, + "start": { + "type": "string", + "description": "Start date time of the rate.", + "x-ms-summary": "Start Date" + }, + "type": { + "type": "string", + "description": "Rate type.", + "x-ms-summary": "Type" + }, + "updated_at": { + "type": "string", + "description": "Last update date of the rate.", + "x-ms-summary": "Updated At" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID which the rate is applied.", + "x-ms-summary": "Workspace ID" + }, + "workspace_user_id": { + "type": "integer", + "format": "int32", + "description": "Workspace user ID which the rate is applied.", + "x-ms-summary": "Workspace User ID" + } + } + }, + "WorkspaceStatistics": { + "type": "object", + "properties": { + "admins": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkspaceAdmin" + }, + "description": "List of workspace admins.", + "x-ms-summary": "Admins" + }, + "groups_count": { + "type": "integer", + "format": "int32", + "description": "Number of groups in workspace.", + "x-ms-summary": "Groups Count" + }, + "members_count": { + "type": "integer", + "format": "int32", + "description": "Number of members in workspace.", + "x-ms-summary": "Members Count" + } + } + }, + "WorkspaceAdmin": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Admin name.", + "x-ms-summary": "Name" + }, + "user_id": { + "type": "integer", + "format": "int32", + "description": "Admin user ID.", + "x-ms-summary": "User ID" + } + } + }, + "TimeEntryConstraints": { + "type": "object", + "properties": { + "description_present": { + "type": "boolean", + "description": "Description is required for time entries.", + "x-ms-summary": "Description Required" + }, + "project_present": { + "type": "boolean", + "description": "Project is required for time entries.", + "x-ms-summary": "Project Required" + }, + "tag_present": { + "type": "boolean", + "description": "Tag is required for time entries.", + "x-ms-summary": "Tag Required" + }, + "task_present": { + "type": "boolean", + "description": "Task is required for time entries.", + "x-ms-summary": "Task Required" + }, + "time_entry_constraints_enabled": { + "type": "boolean", + "description": "Time entry constraints are enabled.", + "x-ms-summary": "Constraints Enabled" + } + } + }, + "WorkspaceUsersSimpleResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/WorkspaceUserSimple" + }, + "description": "List of workspace users.", + "x-ms-summary": "Users" + } + } + }, + "WorkspaceUserSimple": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the user.", + "x-ms-summary": "Email" + }, + "fullname": { + "type": "string", + "description": "Name of the user.", + "x-ms-summary": "Full Name" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Global user identifier.", + "x-ms-summary": "User ID" + }, + "inactive": { + "type": "boolean", + "description": "Inactive indicates if user is deactivated or not in the workspace.", + "x-ms-summary": "Inactive" + }, + "is_active": { + "type": "boolean", + "description": "IsActive indicates if user has joined the workspace.", + "x-ms-summary": "Is Active" + }, + "is_admin": { + "type": "boolean", + "description": "Flag indicating if user is admin (Deprecated).", + "x-ms-summary": "Is Admin (Deprecated)" + }, + "role": { + "type": "string", + "description": "Role of the user.", + "x-ms-summary": "Role" + } + } + }, + "ProjectUsersResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/ProjectUser" + }, + "description": "List of project users.", + "x-ms-summary": "Project Users" + } + } + }, + "ProjectUser": { + "type": "object", + "properties": { + "at": { + "type": "string", + "description": "When was last modified.", + "x-ms-summary": "Last Modified" + }, + "gid": { + "type": "integer", + "format": "int32", + "description": "Group ID, legacy field.", + "x-ms-summary": "Group ID (Legacy)" + }, + "group_id": { + "type": "integer", + "format": "int32", + "description": "Group ID.", + "x-ms-summary": "Group ID" + }, + "id": { + "type": "integer", + "format": "int32", + "description": "Project User ID.", + "x-ms-summary": "Project User ID" + }, + "labor_cost": { + "type": "number", + "format": "double", + "description": "Labor cost for this project user.", + "x-ms-summary": "Labor Cost" + }, + "labor_cost_last_updated": { + "type": "string", + "description": "Date for labor cost last updated.", + "x-ms-summary": "Labor Cost Last Updated" + }, + "manager": { + "type": "boolean", + "description": "Whether the user is manager of the project.", + "x-ms-summary": "Manager" + }, + "project_id": { + "type": "integer", + "format": "int32", + "description": "Project ID.", + "x-ms-summary": "Project ID" + }, + "rate": { + "type": "number", + "format": "double", + "description": "Rate for this project user.", + "x-ms-summary": "Rate" + }, + "rate_last_updated": { + "type": "string", + "description": "Date for rate last updated.", + "x-ms-summary": "Rate Last Updated" + }, + "user_id": { + "type": "integer", + "format": "int32", + "description": "User ID.", + "x-ms-summary": "User ID" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID.", + "x-ms-summary": "Workspace ID" + } + } + }, + "WebhookSubscriptionRequest": { + "type": "object", + "required": [ + "url_callback", + "description", + "enabled" + ], + "properties": { + "url_callback": { + "type": "string", + "description": "URL endpoint where events will be notified.", + "x-ms-summary": "Callback URL", + "x-ms-notification-url": true, + "x-ms-visibility": "internal" + }, + "description": { + "type": "string", + "description": "Description for this subscription.", + "x-ms-summary": "Description", + "x-ms-visibility": "internal", + "default": "Power Automate Time Tracking Trigger" + }, + "enabled": { + "type": "boolean", + "description": "Whether the subscription is enabled.", + "x-ms-summary": "Enabled", + "x-ms-visibility": "internal", + "default": true + }, + "event_filters": { + "type": "array", + "description": "List of filters to select events to notify.", + "x-ms-summary": "Event Filters", + "x-ms-visibility": "internal", + "items": { + "$ref": "#/definitions/EventFilter" + } + } + } + }, + "WebhookSubscription": { + "type": "object", + "properties": { + "subscription_id": { + "type": "integer", + "format": "int32", + "description": "ID of the webhook subscription.", + "x-ms-summary": "Subscription ID" + }, + "workspace_id": { + "type": "integer", + "format": "int32", + "description": "Workspace ID for the subscription.", + "x-ms-summary": "Workspace ID" + }, + "description": { + "type": "string", + "description": "Description of the subscription.", + "x-ms-summary": "Description" + }, + "url_callback": { + "type": "string", + "description": "URL endpoint where events are notified.", + "x-ms-summary": "Callback URL" + }, + "enabled": { + "type": "boolean", + "description": "Whether the subscription is enabled.", + "x-ms-summary": "Enabled" + }, + "validated_at": { + "type": "string", + "description": "When the subscription was validated.", + "x-ms-summary": "Validated At" + }, + "created_at": { + "type": "string", + "description": "When the subscription was created.", + "x-ms-summary": "Created At" + }, + "event_filters": { + "type": "array", + "description": "Event filters for the subscription.", + "x-ms-summary": "Event Filters", + "items": { + "$ref": "#/definitions/EventFilter" + } + } + } + }, + "EventFilter": { + "type": "object", + "properties": { + "entity": { + "type": "string", + "description": "Toggl Track business entity to filter.", + "x-ms-summary": "Entity" + }, + "action": { + "type": "string", + "description": "Type of modification applied to the entity.", + "x-ms-summary": "Action" + } + } + }, + "TimeEntryWebhookEvent": { + "type": "object", + "properties": { + "event_id": { + "type": "integer", + "format": "int32", + "description": "Unique identifier for the webhook event.", + "x-ms-summary": "Event ID" + }, + "subscription_id": { + "type": "integer", + "format": "int32", + "description": "ID of the webhook subscription that triggered this event.", + "x-ms-summary": "Subscription ID" + }, + "created_at": { + "type": "string", + "description": "When the event was created.", + "x-ms-summary": "Event Created At" + }, + "timestamp": { + "type": "string", + "description": "When the event was sent.", + "x-ms-summary": "Event Timestamp" + }, + "creator_id": { + "type": "integer", + "format": "int32", + "description": "ID of the user who triggered the event.", + "x-ms-summary": "Creator ID" + }, + "url_callback": { + "type": "string", + "description": "The callback URL for this event.", + "x-ms-summary": "Callback URL" + }, + "metadata": { + "type": "object", + "description": "Additional metadata about the event.", + "x-ms-summary": "Event Metadata", + "properties": { + "request_type": { + "type": "string", + "description": "Type of request that triggered the event.", + "x-ms-summary": "Request Type" + }, + "event_user_id": { + "type": "integer", + "format": "int32", + "description": "ID of the user associated with the event.", + "x-ms-summary": "Event User ID" + }, + "action": { + "type": "string", + "description": "Action that was performed (created, updated, deleted, started, stopped).", + "x-ms-summary": "Action" + } + } + }, + "payload": { + "$ref": "#/definitions/TimeEntry" + } + } + } + }, + "parameters": { + "WorkspaceIdInPath": { + "name": "workspace_id", + "in": "path", + "description": "Numeric ID of the workspace.", + "required": true, + "x-ms-summary": "Workspace ID", + "x-ms-url-encoding": "single", + "type": "integer", + "format": "int32" + }, + "WithRelatedDataQuery": { + "name": "with_related_data", + "in": "query", + "description": "Retrieve user related data (clients, projects, tasks, tags, workspaces, time entries, etc.).", + "required": false, + "x-ms-summary": "Include Related Data", + "type": "boolean", + "default": false + }, + "SinceQuery": { + "name": "since", + "in": "query", + "description": "Retrieve items created/modified/deleted since this date using UNIX timestamp.", + "required": false, + "x-ms-summary": "Since Date", + "type": "integer", + "format": "int32" + }, + "IncludeArchivedQuery": { + "name": "include_archived", + "in": "query", + "description": "Include archived projects.", + "required": false, + "x-ms-summary": "Include Archived", + "type": "string" + }, + "StartProjectIdQuery": { + "name": "start_project_id", + "in": "query", + "description": "Project ID to resume the next pagination from.", + "required": false, + "x-ms-summary": "Start Project ID", + "type": "integer", + "format": "int32" + }, + "PerPageQuery": { + "name": "per_page", + "in": "query", + "description": "Number of items per page, default 201.", + "required": false, + "x-ms-summary": "Items Per Page", + "type": "integer", + "format": "int32", + "default": 201 + }, + "MetaQuery": { + "name": "meta", + "in": "query", + "description": "Should the response contain data for meta entities.", + "required": false, + "x-ms-summary": "Include Meta Data", + "type": "boolean", + "default": false + }, + "IncludeNotActiveQuery": { + "name": "include_not_active", + "in": "query", + "description": "Include tasks marked as done.", + "required": false, + "x-ms-summary": "Include Inactive Tasks", + "type": "string" + }, + "OffsetQuery": { + "name": "offset", + "in": "query", + "description": "Offset to resume the next pagination from.", + "required": false, + "x-ms-summary": "Pagination Offset", + "type": "integer", + "format": "int32" + }, + "IncludeSharingQuery": { + "name": "include_sharing", + "in": "query", + "description": "Include sharing details in the response.", + "required": false, + "x-ms-summary": "Include Sharing", + "type": "boolean", + "default": false + }, + "BeforeQuery": { + "name": "before", + "in": "query", + "description": "Get entries with start time, before given date (YYYY-MM-DD) or with time in RFC3339 format.", + "required": false, + "x-ms-summary": "Before Date", + "type": "string" + }, + "StartDateQuery": { + "name": "start_date", + "in": "query", + "description": "Get entries with start time, from start_date YYYY-MM-DD or with time in RFC3339 format. To be used with end_date.", + "required": false, + "x-ms-summary": "Start Date", + "type": "string" + }, + "EndDateQuery": { + "name": "end_date", + "in": "query", + "description": "Get entries with start time, until end_date YYYY-MM-DD or with time in RFC3339 format. To be used with start_date.", + "required": false, + "x-ms-summary": "End Date", + "type": "string" + }, + "TimeEntryIdInPath": { + "name": "time_entry_id", + "in": "path", + "description": "TimeEntry ID.", + "required": true, + "x-ms-summary": "Time Entry ID", + "x-ms-url-encoding": "single", + "type": "integer", + "format": "int32" + }, + "TimeEntryIdsInPath": { + "name": "time_entry_ids", + "in": "path", + "description": "Numeric IDs of time_entries, separated by comma. E.g.: 204301830,202700150,202687559. The limit is 100 IDs per request.", + "required": true, + "x-ms-summary": "Time Entry IDs", + "x-ms-url-encoding": "single", + "type": "string" + }, + "OrganizationIdInPath": { + "name": "organization_id", + "in": "path", + "description": "Numeric ID of the organization.", + "required": true, + "x-ms-summary": "Organization ID", + "x-ms-url-encoding": "single", + "type": "integer", + "format": "int32" + }, + "LevelInPath": { + "name": "level", + "in": "path", + "description": "Rates level: workspace, project, task or user.", + "required": true, + "x-ms-summary": "Level", + "x-ms-url-encoding": "single", + "type": "string", + "enum": [ + "workspace", + "project", + "task", + "user" + ] + }, + "LevelIdInPath": { + "name": "level_id", + "in": "path", + "description": "Numeric ID of the entity level.", + "required": true, + "x-ms-summary": "Level ID", + "x-ms-url-encoding": "single", + "type": "integer", + "format": "int32" + }, + "PageQuery": { + "name": "page", + "in": "query", + "description": "Page number.", + "required": false, + "x-ms-summary": "Page Number", + "type": "integer", + "format": "int32" + }, + "CustomRatesQuery": { + "name": "custom_rates", + "in": "query", + "description": "Returns only users with or without a custom hourly rate respectively.", + "required": false, + "x-ms-summary": "Custom Rates Filter", + "type": "boolean" + }, + "ActiveQuery": { + "name": "active", + "in": "query", + "description": "Returns only active users.", + "required": false, + "x-ms-summary": "Active Users Only", + "type": "boolean" + }, + "NameQuery": { + "name": "name", + "in": "query", + "description": "Workspace user name to filter by.", + "required": false, + "x-ms-summary": "Name Filter", + "type": "string" + }, + "SearchQuery": { + "name": "search", + "in": "query", + "description": "Workspace filter by name or email.", + "required": false, + "x-ms-summary": "Search Filter", + "type": "string" + }, + "RateTypeQuery": { + "name": "type", + "in": "query", + "description": "Type of rate values to be returned: billable_rates or labor_costs. Default is billable_rates.", + "required": false, + "x-ms-summary": "Rate Type", + "type": "string", + "enum": [ + "billable_rates", + "labor_costs" + ], + "default": "billable_rates" + }, + "ExcludeDeletedQuery": { + "name": "exclude_deleted", + "in": "query", + "description": "Exclude deleted records in the response.", + "required": false, + "x-ms-summary": "Exclude Deleted", + "type": "boolean", + "default": false + }, + "ProjectIdsQuery": { + "name": "project_ids", + "in": "query", + "description": "Numeric IDs of projects, comma-separated.", + "required": false, + "x-ms-summary": "Project IDs", + "type": "string" + }, + "UserIdQuery": { + "name": "user_id", + "in": "query", + "description": "Numeric ID of user, if passed returns only project users for this user's projects.", + "required": false, + "x-ms-summary": "User ID", + "type": "string" + }, + "WithGroupMembersQuery": { + "name": "with_group_members", + "in": "query", + "description": "Include group members.", + "required": false, + "x-ms-summary": "Include Group Members", + "type": "boolean", + "default": false + }, + "SortPinnedQuery": { + "name": "sort_pinned", + "in": "query", + "description": "Place pinned projects at top of response.", + "required": true, + "x-ms-summary": "Sort Pinned", + "type": "boolean" + }, + "BillableQuery": { + "name": "billable", + "in": "query", + "description": "Filter by billable status.", + "required": false, + "x-ms-summary": "Billable", + "type": "boolean" + }, + "UserIdsQuery": { + "name": "user_ids", + "in": "query", + "description": "User IDs to filter by.", + "required": false, + "x-ms-summary": "User IDs", + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "ClientIdsQuery": { + "name": "client_ids", + "in": "query", + "description": "Client IDs to filter by.", + "required": false, + "x-ms-summary": "Client IDs", + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "GroupIdsQuery": { + "name": "group_ids", + "in": "query", + "description": "Group IDs to filter by.", + "required": false, + "x-ms-summary": "Group IDs", + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "StatusesQuery": { + "name": "statuses", + "in": "query", + "description": "Project statuses to filter by.", + "required": false, + "x-ms-summary": "Statuses", + "type": "array", + "items": { + "type": "string" + } + }, + "SortFieldQuery": { + "name": "sort_field", + "in": "query", + "description": "Field to sort by.", + "required": true, + "x-ms-summary": "Sort Field", + "type": "string" + }, + "SortOrderQuery": { + "name": "sort_order", + "in": "query", + "description": "Sort order (asc/desc).", + "required": true, + "x-ms-summary": "Sort Order", + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "OnlyTemplatesQuery": { + "name": "only_templates", + "in": "query", + "description": "Return only project templates.", + "required": true, + "x-ms-summary": "Only Templates", + "type": "boolean" + }, + "OnlyMeQuery": { + "name": "only_me", + "in": "query", + "description": "Get only projects assigned to the current user.", + "required": false, + "x-ms-summary": "Only My Projects", + "type": "boolean", + "default": false + }, + "ProjectIdInPath": { + "name": "project_id", + "in": "path", + "description": "Numeric ID of the project.", + "required": true, + "x-ms-summary": "Project ID", + "x-ms-url-encoding": "single", + "type": "integer", + "format": "int32" + } + }, + "responses": {}, + "securityDefinitions": { + "basic-auth": { + "type": "basic" + } + }, + "security": [], + "tags": [ + { + "name": "Users", + "description": "Operations related to user management and profile." + }, + { + "name": "Clients", + "description": "Operations related to client management." + }, + { + "name": "Projects", + "description": "Operations related to project management." + }, + { + "name": "Tasks", + "description": "Operations related to task management." + }, + { + "name": "Tags", + "description": "Operations related to tag management." + }, + { + "name": "Time Entries", + "description": "Operations related to time tracking entries." + }, + { + "name": "Workspaces", + "description": "Operations related to workspace management." + }, + { + "name": "Organizations", + "description": "Operations related to organization management." + }, + { + "name": "Rates", + "description": "Operations related to rate management." + }, + { + "name": "Triggers", + "description": "Webhook triggers for real-time notifications." + } + ], + "x-ms-connector-metadata": [ + { + "propertyName": "Website", + "propertyValue": "https://toggl.com/track/automated-time-tracker/" + }, + { + "propertyName": "Privacy policy", + "propertyValue": "https://toggl.com/legal/track/privacy/" + }, + { + "propertyName": "Categories", + "propertyValue": "Productivity" + } + ] +} \ No newline at end of file diff --git a/independent-publisher-connectors/Toggl Track/apiProperties.json b/independent-publisher-connectors/Toggl Track/apiProperties.json new file mode 100644 index 0000000000..4b48488a27 --- /dev/null +++ b/independent-publisher-connectors/Toggl Track/apiProperties.json @@ -0,0 +1,38 @@ +{ + "properties": { + "connectionParameters": { + "username": { + "type": "securestring", + "uiDefinition": { + "displayName": "Username", + "description": "The Username for this api", + "tooltip": "Provide the Username", + "constraints": { + "tabIndex": 2, + "clearText": true, + "required": "true" + } + } + }, + "password": { + "type": "securestring", + "uiDefinition": { + "displayName": "Password", + "description": "The Password for this api", + "tooltip": "Provide the Password", + "constraints": { + "tabIndex": 3, + "clearText": false, + "required": "true" + } + } + } + }, + "iconBrandColor": "#da3b01", + "scriptOperations": [], + "capabilities": [], + "policyTemplateInstances": [], + "publisher": "Troy Taylor", + "stackOwner": "Toggl" + } +} \ No newline at end of file diff --git a/independent-publisher-connectors/Toggl Track/metadata.json b/independent-publisher-connectors/Toggl Track/metadata.json new file mode 100644 index 0000000000..5b5a970e0a --- /dev/null +++ b/independent-publisher-connectors/Toggl Track/metadata.json @@ -0,0 +1 @@ +{"ApplicationProductId":"60fe77f3-0017-4bef-884b-b87c32db74a1","AzurePublisherId":"44444967"} diff --git a/independent-publisher-connectors/Toggl Track/readme.md b/independent-publisher-connectors/Toggl Track/readme.md new file mode 100644 index 0000000000..e854005859 --- /dev/null +++ b/independent-publisher-connectors/Toggl Track/readme.md @@ -0,0 +1,123 @@ +# Toggl Track +The only time tracking software that builds custom reports from your team's time data to maximize productivity and revenue. Our time tracking solution records a calendar timeline of all your work activities throughout the day. + +## Publisher: Troy Taylor, Hitachi Solutions + +## Prerequisites +You must sign up for an account with [Toggl](https://toggl.com/). + +## Obtaining Credentials +This connector uses basic authentication with your email address and password. + +## Supported Operations +### Get current user +Returns details for the current user. +### Update current user +Updates details for the current user. +### Get user clients +Get clients for the current user. +### Get user features +Get features available to the current user. +### Get user location +Returns the client's IP-based location. If no data is present, empty response will be yielded. +### Check authentication +Used to check if authentication works. +### Get user organizations +Get all organizations a given user is part of. +### Get user projects +Get projects for the current user. +### Get user projects paginated +Get paginated projects for the current user. +### Get user tags +Returns tags for the current user. +### Get user tasks +Returns tasks from projects in which the user is participating. +### Get track reminders +Returns a list of track reminders. +### Get web timer +Get web timer configuration. +### Get user workspaces +Lists workspaces for given user. +### Get time entries +Lists latest time entries. +### Get current time entry +Load running time entry for user ID. +### Get time entry by ID +Load time entry by ID that is accessible by the current user. +### Get workspace users (organization level) +Returns any users who belong to the workspace directly or through at least one group. +### Get workspace users +List all users for a given workspace. +### Get workspace project users +List all projects users for a given workspace. +### Get user clients +Get clients for the current user. +### Get user organizations +Get all organizations a given user is part of. +### Get workspace users (organization level) +Returns any users who belong to the workspace directly or through at least one group. +### Get user projects +Get projects for the current user. +### Get user projects paginated +Get paginated projects for the current user. +### Get workspace project users +List all projects users for a given workspace. +### Get workspace projects +Get projects for given workspace. +### Get workspace project +Get project for given workspace. +### Get user tags +Returns tags for the current user. +### Get user tasks +Returns tasks from projects in which the user is participating. +### Get user workspaces +Lists workspaces for given user. +### Create time entry +Creates a new workspace time entry. +### Delete time entry +Deletes a workspace time entry. +### Update time entry +Updates a workspace time entry. +### Bulk edit time entries +Bulk editing time entries. Patch will be executed partially when there are errors with some records. No transaction, no rollback. +### Stop time entry +Stops a workspace time entry. +### Get workspace users (organization level) +Returns any users who belong to the workspace directly or through at least one group. +### Get single workspace +Get information of single workspace. +### Get rates list +Get rates by level (workspace\|project\|task\|user). +### Get workspace statistics +Returns workspace admins list, members count and groups count. +### Get workspace time entry constraints +Get the time entry constraints for a given workspace. +### Get workspace track reminders +Returns a list of track reminders. +### Get workspace users +List all users for a given workspace. +### Get workspace project users +List all projects users for a given workspace. +### Get workspace projects +Get projects for given workspace. +### Get workspace project +Get project for given workspace. +### Get time entries +Lists latest time entries. +### Get current time entry +Load running time entry for user ID. +### Get time entry by ID +Load time entry by ID that is accessible by the current user. +### When a time entry is created +Triggers when a new time entry is created in the workspace. +### When a time entry is updated +Triggers when an existing time entry is modified in the workspace. +### When a time entry is deleted +Triggers when a time entry is deleted from the workspace. +### When a time entry is started +Triggers when a time entry is started (timer begins) in the workspace. +### When a time entry is stopped +Triggers when a running time entry is stopped in the workspace. + +## Known Issues and Limitations +There are no known issues at this time. diff --git a/independent-publisher-connectors/Toggl Track/script.csx b/independent-publisher-connectors/Toggl Track/script.csx new file mode 100644 index 0000000000..ad91a883d4 --- /dev/null +++ b/independent-publisher-connectors/Toggl Track/script.csx @@ -0,0 +1,207 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +public class Script : ScriptBase +{ + public override async Task ExecuteAsync() + { + var response = await this.Context.SendAsync(this.Context.Request, this.CancellationToken).ConfigureAwait(false); + + if (response.IsSuccessStatusCode) + { + var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + + if (!string.IsNullOrEmpty(responseString)) + { + var transformedJson = ConvertNullsToEmptyStrings(responseString); + response.Content = CreateJsonContent(transformedJson); + } + } + + return response; + } + private string ConvertNullsToEmptyStrings(string jsonString) + { + if (string.IsNullOrEmpty(jsonString)) + return jsonString; + try + { + var token = JToken.Parse(jsonString); + var typeCache = new Dictionary(); + + BuildTypeCache(token, typeCache); + ProcessToken(token, typeCache); + return token.ToString(Newtonsoft.Json.Formatting.None); + } + catch (JsonReaderException) + { + return jsonString; + } + } + private void ProcessToken(JToken token, Dictionary typeCache) + { + switch (token.Type) + { + case JTokenType.Object: + foreach (var property in token.Children().ToList()) + { + if (property.Value.Type == JTokenType.Null) + { + if (property.Name.EndsWith("_id")) + { + property.Remove(); + } + else if (typeCache.TryGetValue(property.Name, out var cachedType)) + { + if (cachedType == JTokenType.Boolean) + { + property.Remove(); + } + else + { + property.Value = GetDefaultForType(cachedType); + } + } + else + { + var inferredType = InferTypeFromPropertyName(property.Name); + if (inferredType == JTokenType.Boolean) + { + property.Remove(); + } + else + { + property.Value = GetDefaultForType(inferredType); + } + } + } + else + { + ProcessToken(property.Value, typeCache); + } + } + break; + + case JTokenType.Array: + foreach (var item in token.Children().ToList()) + { + if (item.Type == JTokenType.Null) + { + item.Replace(""); + } + else + { + ProcessToken(item, typeCache); + } + } + break; + } + } + private void BuildTypeCache(JToken token, Dictionary typeCache) + { + if (token.Type == JTokenType.Array) + { + foreach (var item in token.Children()) + { + if (item.Type == JTokenType.Object) + { + foreach (var prop in item.Children()) + { + if (prop.Value.Type != JTokenType.Null && !typeCache.ContainsKey(prop.Name)) + { + typeCache[prop.Name] = prop.Value.Type; + } + } + } + } + } + else if (token.Type == JTokenType.Object) + { + foreach (var prop in token.Children()) + { + if (prop.Value.Type != JTokenType.Null && !typeCache.ContainsKey(prop.Name)) + { + typeCache[prop.Name] = prop.Value.Type; + } + } + } + } + private JToken GetDefaultForType(JTokenType tokenType) + { + switch (tokenType) + { + case JTokenType.Integer: + case JTokenType.Float: + return 0; + case JTokenType.String: + return ""; + case JTokenType.Array: + return new JArray(); + case JTokenType.Object: + return new JObject(); + default: + return ""; + } + } + + // Add specific property name checks to infer types + private JTokenType InferTypeFromPropertyName(string propertyName) + { + var lowerName = propertyName.ToLower(); + + // Date/time fields should be strings (highest priority) + if (lowerName.EndsWith("_at") || + lowerName.EndsWith("_updated") || + lowerName.EndsWith("_date") || + lowerName.EndsWith("_time") || + lowerName.Contains("created") || + lowerName.Contains("updated") || + lowerName.Contains("deleted") || + lowerName.Equals("at")) + { + return JTokenType.String; + } + + if (lowerName.Contains("hours") || + lowerName.Contains("seconds") || + lowerName.Contains("count") || + lowerName.EndsWith("_count") || + lowerName.Equals("total_count")) + { + return JTokenType.Integer; + } + + if (lowerName.Contains("rate") || + lowerName.Contains("fee") || + lowerName.Contains("cost") || + lowerName.Contains("amount") || + lowerName.Contains("price")) + { + return JTokenType.Float; + } + if (lowerName.Contains("parameters") && + (lowerName.Contains("recurring") || lowerName.EndsWith("_parameters"))) + { + return JTokenType.Array; + } + + if (lowerName.Contains("metadata") || + lowerName.Contains("_config") || + lowerName.Contains("settings") || + lowerName.Contains("_object") || + lowerName.EndsWith("_data")) + { + return JTokenType.Object; + } + + return JTokenType.String; + } +}