---
search:
  tags:
    - Data
    - POST
seo:
  description: >-
    Adds a row to one table of one luna and returns it. The table… Reference for
    the POST /_luna/tenants/{tenant}/data/{type}/{table} endpoint in the Luna
    API.
sidebar:
  label: Add a row
  badge: POST
title: Add a row
type: openapi-operation
---
Adds a row to one table of one luna and returns it. The table exists once the luna has written to it for the first time. You cannot add a row to an index.

`POST /_luna/tenants/{tenant}/data/{type}/{table}`

**Request body** (`application/json`, required)

- `key` (any, required) — The luna's key as JSON, such as \`{"id":"a"}\`. For a type keyed by one field, the value of that field alone also works.
- `values` (object | null) — The row's value for each column you set, by the column's name. A column you leave out takes its default.

Request body example:

```json
{
  "key": null,
  "values": {}
}
```

**Responses**

- `200` — The row as it was stored.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "rowid": 0,
  "values": {}
}
```
