> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://developers.awork.com/apiv1/time-tracking/post-stop-time-tracking-by-user-id/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.awork.com/_mcp/server. # Stops the currently running time tracking of the specified user. POST https://api.awork.com/api/v1/users/{userId}/timetracking/stop Content-Type: application/json The request body is optional. You can provide a stopReason to indicate how the tracking was stopped. For external API clients, the stopReason is automatically set to "external-api" regardless of what is provided. For this operation to work there must be a running time tracking for the user.The user must be an admin or the creator. Reference: https://developers.awork.com/apiv1/time-tracking/post-stop-my-time-tracking ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `userId` (string, required) — The id of the user. ## Response ### 200 OK - `timezone` (string, required) — The original timezone of the time tracking. The format of the timezone is the IANA standard. - `typeOfWorkId` (string, required) — The id of the type of work. - `isBillable` (boolean, optional) — Whether the time tracking is billable or not. - `isBilled` (boolean, optional) — Whether the time tracking is billed or not. - `taskId` (string, optional, nullable) — The id of the task. - `projectId` (string, optional, nullable) — The id of the project. - `note` (string, optional, nullable) — The note of the time tracking. - `startDateUtc` (string, optional, nullable) — The date (in UTC) when the time tracking was started. - `startTimeUtc` (string, optional, nullable) — The time (in UTC) when the time tracking was started. - `endDateUtc` (string, optional, nullable) — The date (in UTC) when the time tracking was stopped. - `endTimeUtc` (string, optional, nullable) — The time (in UTC) when the time tracking was stopped. Required when the time tracking has already been completed and Duration has not been set. - `startDateLocal` (string, optional, nullable) — The date (in Local) when the time tracking was started. - `startTimeLocal` (string, optional, nullable) — The time (in Local) when the time tracking was started. - `endDateLocal` (string, optional, nullable) — The date (in Local) when the time tracking was stopped. - `endTimeLocal` (string, optional, nullable) — The time (in Local) when the time tracking was stopped. Required when the time tracking has already been completed and Duration has not been set. - `duration` (integer, optional, nullable) — The duration of the time tracking in seconds. Required when the time tracking has already been completed and EndTime has not been set. - `breakDuration` (integer, optional, nullable) — The duration of the break in seconds. Cannot be set via API. - `userId` (string, optional, nullable) — The id of the user. Can be null if the user was deleted. - `id` (string, optional) — The id of the time tracking. - `createdBy` (string, optional) — The id of the user who created this time tracking. - `createdOn` (string, optional) — The date this time tracking was created. - `updatedBy` (string, optional) — The id of the user who last updated this time tracking. - `updatedOn` (string, optional) — The date this time tracking was last modified. - `typeOfWork` (NestedTypeModel, optional) - `user` (UserModelForTimeTrackings, optional) - `task` (TaskModelForTimeTrackings, optional) - `project` (ProjectModelForTimeTrackings, optional) - `breaks` (list of Break, optional, nullable) — The breaks of the time tracking. - `resourceVersion` (long, optional) — The version of the entity, updated on every modification, to the ticks in UTC. Not identical to UpdatedOn. - `isExternal` (boolean, optional) — True if this entity is coming from an external workspace (awork Connect). ## Types ### NestedTypeModel - `id` (string, optional) — The identifier of the nested model. - `name` (string, optional, nullable) — The name of the entity. - `icon` (string, optional, nullable) — The icon of the type. - `isArchived` (boolean, optional) — Whether the type is archived. ### UserModelForTimeTrackings - `id` (string, optional) — The identifier of the nested model. - `firstName` (string, optional, nullable) — The first name of the user. - `lastName` (string, optional, nullable) — The last name of the user. - `hasImage` (boolean, optional, nullable) — Whether this user has a profile image. - `isExternal` (boolean, optional) — Whether the user is external. ### TaskModelForTimeTrackings - `id` (string, optional) — The identifier of the nested model. - `name` (string, optional, nullable) — The name of the entity. - `baseType` (string, optional, nullable) — The base type of the task. Can be 'private' for a private task or 'projecttask' for a project task. - `taskIdentifier` (string, optional, nullable) — The full task identifier combining project key and task number (e.g., "NIKE-42"). Maintained by the service layer, updated when project key changes. - `taskStatusId` (string, optional) — The id of the status for this task. - `typeOfWorkId` (string, optional) — The id of the type of work of this task. - `project` (ProjectModelForTimeTrackings, optional) - `projectId` (string, optional, nullable) — The id of the project this task is assigned to. Only set if this is a project task. In this case, it is equal to the EntityId. - `plannedDuration` (integer, optional, nullable) — The expected planned workload of the task, in seconds. - `closedOn` (string, optional, nullable) — The date the task was set to closed. - `taskStatus` (NestedTaskStatusModel, optional) - `createdBy` (string, optional) — The id of the user who created this task. - `correlationId` (string, optional) — The correlation id between parent and subtasks, meaning it's either the ParentId or its own Id. - `parentId` (string, optional, nullable) — The id of the parent task this of this subtask. Only set if this is a subtask. - `parentTask` (NestedModel, optional) ### ProjectModelForTimeTrackings - `id` (string, optional) — The identifier of the nested model. - `name` (string, optional, nullable) — The name of the entity. - `projectStatus` (NestedStatusModel, optional) - `company` (NestedCompanyModel, optional) - `projectType` (NestedTypeModel, optional) - `projectKey` (string, optional, nullable) — The unique project key within the workspace (e.g., "NIKE"). Maximum 32 characters, uppercase letters, numbers, and dashes only. - `isPrivate` (boolean, optional) — Whether the project is private. - `hasImage` (boolean, optional) — Whether the project has an image. - `isExternal` (boolean, optional) — Whether the project is external. - `isBillableByDefault` (boolean, optional, nullable) — Whether project times should be billable by default. - `createdBy` (string, optional) — The id of the user who created the project. ### Break The break model. Shows when a time tracking was paused. - `startDate` (string, optional) — The start date and time of the break in UTC. Required. - `duration` (integer, optional, nullable) — The duration of the break in seconds. Required when the end date is set. When a time tracking is paused, it has at least one break with a start date and no duration or end date. - `endDate` (string, optional, nullable) — The end date and time of the break in UTC. Required when the duration is set and the break is finished. ### NestedTaskStatusModel - `id` (string, optional) — The identifier of the nested model. - `name` (string, optional, nullable) — The name of the entity. - `description` (string, optional, nullable) — The description of the type. - `type` (string, optional, nullable) — The type of the status. - `order` (double, optional, nullable) — The order of the task status in a task. - `icon` (string, optional, nullable) — The icon of the task status in a task. ### NestedModel - `id` (string, optional) — The identifier of the nested model. - `name` (string, optional, nullable) — The name of the entity. ### NestedStatusModel - `id` (string, optional) — The identifier of the nested model. - `name` (string, optional, nullable) — The name of the entity. - `description` (string, optional, nullable) — The description of the type. - `type` (string, optional, nullable) — The type of the status. - `isArchived` (boolean, optional) — Whether the type is archived. ### NestedCompanyModel - `id` (string, optional) — The identifier of the nested model. - `name` (string, optional, nullable) — The name of the entity. - `hasImage` (boolean, optional) — Whether the company has a profile image. - `description` (string, optional, nullable) — The description of the company. ## Examples **Request** ```json {} ``` **Response** ```json { "timezone": "Europe/Berlin", "typeOfWorkId": "123e4567-e89b-12d3-a456-426614174000", "isBillable": true, "isBilled": false, "taskId": "123e4567-e89b-12d3-a456-426614174000", "projectId": "123e4567-e89b-12d3-a456-426614174000", "note": "I created a first draft for the new sitemap", "startDateUtc": "2022-03-01T00:00:00Z", "startTimeUtc": "09:21:00", "endDateUtc": "2022-03-01T18:21:05Z", "endTimeUtc": "11:45:00", "startDateLocal": "2022-03-01T00:00:00", "startTimeLocal": "10:21:00", "endDateLocal": "2022-03-01T17:21:05", "endTimeLocal": "12:45:00", "duration": 8635, "breakDuration": 1, "userId": "123e4567-e89b-12d3-a456-426614174000", "id": "123e4567-e89b-12d3-a456-426614174000", "createdBy": "123e4567-e89b-12d3-a456-426614174000", "createdOn": "2024-01-15T09:30:00Z", "updatedBy": "123e4567-e89b-12d3-a456-426614174000", "updatedOn": "2024-01-15T09:30:00Z", "typeOfWork": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "icon": "thumb_up", "isArchived": false }, "user": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "firstName": "Carla", "lastName": "Creative", "hasImage": true, "isExternal": true }, "task": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "baseType": "projecttask", "taskIdentifier": "string", "taskStatusId": "123e4567-e89b-12d3-a456-426614174000", "typeOfWorkId": "123e4567-e89b-12d3-a456-426614174000", "project": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "projectStatus": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "description": "Work in progress", "type": "todo", "isArchived": false }, "company": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "hasImage": true, "description": "One of our customers" }, "projectType": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "icon": "thumb_up", "isArchived": false }, "projectKey": "string", "isPrivate": false, "hasImage": true, "isExternal": true, "isBillableByDefault": true, "createdBy": "123e4567-e89b-12d3-a456-426614174000" }, "projectId": "123e4567-e89b-12d3-a456-426614174000", "plannedDuration": 21600, "closedOn": "2024-01-15T09:30:00Z", "taskStatus": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "description": "Work in progress", "type": "todo", "order": 1, "icon": "arrow_forward" }, "createdBy": "123e4567-e89b-12d3-a456-426614174000", "correlationId": "123e4567-e89b-12d3-a456-426614174000", "parentId": "123e4567-e89b-12d3-a456-426614174000", "parentTask": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design" } }, "project": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "projectStatus": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "description": "Work in progress", "type": "todo", "isArchived": false }, "company": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "hasImage": true, "description": "One of our customers" }, "projectType": { "id": "80a2b26b-9fb3-42b5-b6dc-126c437cad5d", "name": "Design", "icon": "thumb_up", "isArchived": false }, "projectKey": "string", "isPrivate": false, "hasImage": true, "isExternal": true, "isBillableByDefault": true, "createdBy": "123e4567-e89b-12d3-a456-426614174000" }, "breaks": [ { "startDate": "2022-01-01T12:00:00Z", "duration": 3600, "endDate": "2022-01-01T13:00:00Z" } ], "resourceVersion": 637825154598057900, "isExternal": true } ``` **SDK Code** ```python import requests url = "https://api.awork.com/api/v1/users/userId/timetracking/stop" payload = {} headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.awork.com/api/v1/users/userId/timetracking/stop'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.awork.com/api/v1/users/userId/timetracking/stop" payload := strings.NewReader("{}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.awork.com/api/v1/users/userId/timetracking/stop") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.awork.com/api/v1/users/userId/timetracking/stop") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('POST', 'https://api.awork.com/api/v1/users/userId/timetracking/stop', [ 'body' => '{}', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.awork.com/api/v1/users/userId/timetracking/stop"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.awork.com/api/v1/users/userId/timetracking/stop")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```