Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Add a row

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}
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:data:write
Path parameters
tenantstringrequired

The tenant, by its name.

typestringrequired

The luna type, by its name.

tablestringrequired

The table, by its name.

Request body
requiredapplication/json
keyanyrequired

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.

valuesobject | null

The row's value for each column you set, by the column's name. A column you leave out takes its default.

Responses
200

The row as it was stored.

rowidinteger<int64>required

The row's id within its table.

valuesobjectrequired

The row's value for each column, by the column's name. Bytes are shown as {"$bytes": length} and a vector as {"$vector": dimensions}.

default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://luna.example.com/_luna/tenants/string/data/string/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "key": null,
  "values": {}
}'
Response
{
  "rowid": 0,
  "values": {}
}

Was this page helpful?