---
title: "Replace a dataset log"
method: PUT
path: "/api/datasets/{dataset_id}/logs/{unique_id}/"
tags: ["datasets"]
---

# Replace a dataset log

`PUT /api/datasets/{dataset_id}/logs/{unique_id}/`

Replace a dataset log with a new payload. Fields omitted from the body are removed.

## Path parameters

- `dataset_id` string, required
- `unique_id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `input` unknown
  - `output` unknown
  - `expected_output` unknown
  - `prompt` string
  - `completion` string
  - `metadata` ApiDatasetsDatasetIdLogsUniqueIdPutRequestBodyContentApplicationJsonSchemaMetadata
  - `error_code` string
  - `error_message` string

## Response `200`

Updated dataset log.

- DatasetsReplaceDatasetLogResponse200
  - `id` string — Log ID.
  - `unique_id` string — Unique log ID.
  - `organization_id` string
  - `environment` string
  - `timestamp` string, date-time
  - `start_time` string, date-time
  - `prompt_tokens` integer
  - `completion_tokens` integer
  - `total_request_tokens` integer
  - `cost` number, double
  - `model` string
  - `latency` number, double
  - `status_code` integer
  - `status` string
  - `metadata` ApiDatasetsDatasetIdLogsUniqueIdPutResponsesContentApplicationJsonSchemaMetadata
  - `prompt` string
  - `completion` string
  - `messages` ApiDatasetsDatasetIdLogsUniqueIdPutResponsesContentApplicationJsonSchemaMessagesItems[]
  - `input` unknown
  - `output` unknown
  - `expected_output` unknown
  - `dataset_id` string
  - `scores` ApiDatasetsDatasetIdLogsUniqueIdPutResponsesContentApplicationJsonSchemaScoresItems[]
  - `error_code` string
  - `error_message` string

## Other responses

- `400` — Invalid dataset-log update.
- `401` — Unauthorized - Missing/invalid authentication
- `404` — Dataset log not found.

## Changes

> 6 revisions in range; 2 could not be searched.

- **2026-08-13** `4e064cf81dae` — 24 breaking, 167 warning, 12 info
  - the `expected_output` request property type/format changed from `string`/`` to ``/``
  - the `input` request property type/format changed from `string`/`` to ``/``
  - the `output` request property type/format changed from `string`/`` to ``/``
  - the response property `id` became optional for the status `200`
  - …199 more
- **2026-07-31** `c26d550029f8` — 9 breaking, 7 warning, 185 info
  - added the new required request property `id`
  - added the new required request property `organization_id`
  - the `expected_output` request property type/format changed from ``/`` to `string`/``
  - the `input` request property type/format changed from ``/`` to `string`/``
  - …197 more

[Change history](https://skmtc.dev/keywordsai/apis/api-reference/changes/api/datasets/:dataset_id/logs/:unique_id/put.md)

---

[API](https://skmtc.dev/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.dev/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/c61efaf24756/schema)
