---
title: "Create a dataset log"
method: POST
path: "/api/datasets/{dataset_id}/logs/"
tags: ["datasets"]
---

# Create a dataset log

`POST /api/datasets/{dataset_id}/logs/`

Create a single dataset log from unified-format input/output data.

## Path parameters

- `dataset_id` string, required

## Headers

- `Authorization` string, required

## Request body

- DatasetLogCreateRequest — A dataset log object. The same shape is accepted by the single-create and bulk-create endpoints.
  - `input` union, required — Model or application input. Provide a string, structured object, or message/value array.
    - string
    - unknown[]
      - unknown
    - object
  - `output` union — Observed model or application output. Provide a string, structured object, or message/value array.
    - string
    - object
    - unknown[]
      - unknown
  - `expected_output` union — Optional ground-truth or target output used for evaluation.
    - string
    - object
    - unknown[]
      - unknown
  - `metadata` object — Additional context for this log, such as category, model, or log type.
  - `metrics` object — Numeric or structured measurements, such as token counts, cost, or latency.

## Response `201`

Dataset log created.

- DatasetsCreateDatasetLogResponse201
  - `message` string, required
  - `unique_id` string, required

## Other responses

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

## Changes

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

- **2026-07-31** `c26d550029f8` — 4 breaking, 1 warning, 1 info
  - removed `subschema #1, subschema #2, subschema #3` from the `input` request property `oneOf` list
  - removed `subschema #1, subschema #2, subschema #3` from the `output` request property `oneOf` list
  - the `metadata` request property type/format changed from `object`/`` to ``/``
  - the `metrics` request property type/format changed from `object`/`` to ``/``
  - …2 more
- **2026-07-26** `77d94e49bc7a` — 3 info
  - added the new optional request property `expected_output`
  - added `subschema #1, subschema #2, subschema #3` to the `input` request property `oneOf` list
  - added `subschema #1, subschema #2, subschema #3` to the `output` request property `oneOf` list

[Change history](https://skmtc.dev/keywordsai/apis/api-reference/changes/api/datasets/:dataset_id/logs/post.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)
