---
title: "Upsert rows"
method: POST
path: "/api/v2/reference-tables/tables/{id}/rows"
tags: ["Reference Tables"]
---

# Upsert rows

`POST /api/v2/reference-tables/tables/{id}/rows`

Create or update rows in a Reference Table by their primary key values. If a row with the specified primary key exists, it is updated; otherwise, a new row is created.

## Path parameters

- `id` string, required

## Request body

- BatchUpsertRowsRequestArray — The request body for creating or updating multiple rows into a reference table.
  - `data` BatchUpsertRowsRequestData[], required — List of row resources to create or update in the reference table.
    - `attributes` BatchUpsertRowsRequestDataAttributes — Attributes containing row data values for row creation or update operations.
      - `values` object, required — Key-value pairs representing row data, where keys are schema field names and values match the corresponding column types.
    - `id` string, required — The primary key value that uniquely identifies the row to create or update.
    - `type` 'row', required — Row resource type.

## Response `200`

Rows created or updated successfully

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `429` — Too many requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
