> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add datapoints to a dataset



## OpenAPI

````yaml post /datasets/{dataset_id}/datapoints
openapi: 3.0.3
info:
  title: HoneyHive API
  version: 1.0.1
servers:
  - url: https://api.honeyhive.ai
security:
  - BearerAuth: []
paths:
  /datasets/{dataset_id}/datapoints:
    post:
      tags:
        - Datasets
      summary: Add datapoints to a dataset
      operationId: addDatapoints
      parameters:
        - in: path
          name: dataset_id
          required: true
          schema:
            type: string
          description: >-
            The unique identifier of the dataset to add datapoints to like 
            `663876ec4611c47f4970f0c3`
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project:
                  type: string
                  description: >-
                    Name of the project associated with this dataset like `New
                    Project`
                data:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                  description: List of JSON objects to be added as datapoints
                mapping:
                  description: >-
                    Mapping of keys in the data object to be used as inputs,
                    ground truth, and history, everything else goes into
                    metadata
                  type: object
                  properties:
                    inputs:
                      type: array
                      items:
                        type: string
                      description: List of keys in the data object to be used as inputs
                    ground_truth:
                      type: array
                      items:
                        type: string
                      description: >-
                        List of keys in the data object to be used as ground
                        truth
                    history:
                      type: array
                      items:
                        type: string
                      description: >-
                        List of keys in the data object to be used as chat
                        history, can be empty list if not needed
                  required:
                    - inputs
                    - ground_truth
                    - history
              required:
                - project
                - data
                - mapping
      responses:
        '200':
          description: Successful addition
          content:
            application/json:
              schema:
                type: object
                properties:
                  inserted:
                    type: boolean
                  datapoint_ids:
                    type: array
                    items:
                      type: string
                    description: List of unique datapoint ids added to the dataset
      x-codeSamples:
        - lang: python
          label: addDatapoints
          source: >-
            import honeyhive

            from honeyhive.models import operations


            s = honeyhive.HoneyHive(
                bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
            )



            res = s.datasets.add_datapoints(dataset_id='<value>',
            request_body=operations.AddDatapointsRequestBody(
                project='<value>',
                data=[
                    {
                        'key': '<value>',
                    },
                ],
                mapping=operations.Mapping(
                    inputs=[
                        '<value>',
                    ],
                    ground_truth=[
                        '<value>',
                    ],
                    history=[
                        '<value>',
                    ],
                ),
            ))


            if res.object is not None:
                # handle response
                pass
        - lang: typescript
          label: addDatapoints
          source: >-
            import { HoneyHive } from "honeyhive";

            import { AddDatapointsRequest, AddDatapointsRequestBody, Mapping }
            from "honeyhive/dist/models/operations";


            async function run() {
              const sdk = new HoneyHive({
                bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
              });
            const datasetId: string = "<value>";

            const requestBody: AddDatapointsRequestBody = {
              project: "<value>",
              data: [
                {
                  "key": "<value>",
                },
              ],
              mapping: {
                inputs: [
                  "<value>",
                ],
                groundTruth: [
                  "<value>",
                ],
                history: [
                  "<value>",
                ],
              },
            };

              const res = await sdk.datasets.addDatapoints(datasetId, requestBody);

              if (res.statusCode == 200) {
                // handle response
              }
            }


            run();
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````