---
title: "Bulk create dataset logs"
method: POST
path: "/api/datasets/{dataset_id}/logs/bulk/"
tags: ["datasets"]
---

# Bulk create dataset logs

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

Submit 1 to 500 dataset logs for ingestion in one request. Each log uses the same object as the single-create endpoint, and partial success is allowed. A `201` response can therefore contain item-level errors; if every item fails, the endpoint returns `400`. Rate limit: 30 requests per minute per organization for API-key calls (shared across API keys) and per user for JWT calls.

## Path parameters

- `dataset_id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `logs` DatasetLogCreateRequest[], required — Dataset log objects to create. Items are processed independently and errors use their zero-based array index.
    - `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`

At least one dataset log was accepted for ingestion. Inspect `error_count` and `errors` for partial failures.

- BulkOperationResponse — Canonical result envelope for a bulk operation.
  - `success_count` integer, required — Number of items successfully processed.
  - `error_count` integer, required — Number of items that failed.
  - `errors` BulkItemError[], required — Item-level failures, keyed by zero-based input index.
    - `index` integer, required — Zero-based index of the failed item in the submitted array.
    - `error` string, required — Error message for the failed item.

## Other responses

- `400` — The request is invalid, or every submitted log failed.
- `401` — Unauthorized - Missing or invalid authentication
- `403` — Forbidden - The caller cannot add logs to this dataset
- `404` — The requested dataset does not exist.
- `422` — The request contains more than 500 logs.
- `429` — Rate limit exceeded.

---

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