---
title: "Insert or update activities of a task"
method: POST
path: "/v1/task-activities/batch"
tags: ["TaskActivity"]
---

# Insert or update activities of a task

`POST /v1/task-activities/batch`

Stores up to 200 activities by their client generated id. Sending an id again updates that activity, so the request is safe to repeat and the still growing last activity can be re-sent while a timer runs. An activity that reaches outside the task's time range is clipped to it. The response holds the activities that were stored.

## Request body

- TaskActivityBatchDto
  - `taskId` string
  - `activities` TaskActivityUpsertDto[]
    - `id` string
    - `appName` string
    - `appExecutable` string
    - `titles` TaskActivityTitleDto[]
      - `title` string
      - `seconds` integer
    - `startDateTime` string
    - `endDateTime` string
    - `source` string

## Response `200`

Stored activities

- TaskActivityDto[]
  - `id` string
  - `user` string
  - `taskId` string
  - `appName` string
  - `appExecutable` string
  - `titles` TaskActivityTitleDto[]
    - `title` string
    - `seconds` integer
  - `startDateTime` string
  - `endDateTime` string
  - `source` string
  - `images` TaskActivityImageDto[]
    - `id` string
    - `taskActivityId` string
    - `taskId` string
    - `dateTime` string
    - `fileSize` integer
    - `width` integer
    - `height` integer
    - `lastUpdate` integer
    - `created` integer
  - `lastUpdate` integer
  - `created` integer

## Other responses

- `400` — Bad request - invalid data or task not found
- `401` — Not authorized
- `403` — Invalid permission - the task belongs to someone else

## Changes

> 8 revisions in range; 1 not diffed.

- **2026-09-21** `4f2bf90abf25` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/timesheet/apis/timesheet-api/changes/v1/task-activities/batch/post.md)

---

[API](https://skmtc.dev/timesheet/apis/timesheet-api.md) · [All operations](https://skmtc.dev/timesheet/apis/timesheet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/timesheet/apis/timesheet-api/revisions/a3d2f44e7345?raw)
