---
title: "Insert data into database (REST API)"
method: POST
path: "/databases/{databaseName}/query/insert"
tags: ["Database Queries"]
---

# Insert data into database (REST API)

`POST /databases/{databaseName}/query/insert`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/databases/{databaseName}/query/insert`
- Auth: HTTP bearer

Insert new rows into your database using REST API.

**Authentication:** Requires auth user access token

**Auto-set user_id:** If your table has a trigger using `auth.uid()`,
user_id will be automatically set to the authenticated user

**Security:** Row-Level Security policies are enforced

## Path parameters

- `databaseName` string, required

## Request body

- DatabaseInsertRequest
  - `table` string, required: Table name
  - `values` object, required: Column values to insert. JSON objects and arrays are stored as JSON, so send them to `json` or `jsonb` columns. For a Postgres array column, send an array literal string such as `"{a,b}"`.

## Response `200`

Insert successful

- DatabaseQueryResult: Rows returned by a data API request. RLS-filtered unless the request was made with a service key.
  - `data` object[]: Result rows
  - `count` integer: Number of rows returned

## Other responses

- `400`: Invalid request
- `401`: Not authenticated
- `403`: Access denied
- `404`: Database not found
- `429`: The query was rejected by a billing-cycle allowance: either the owning platform user's bandwidth allowance (aggregate ingress + egress across owned projects) or their database-request allowance. Enforcement is eventual: queries are rejected until the allowance increases or the next anniversary cycle begins. The error message identifies the resource.

## Changes

- **2026-09-19** `3a6f365f3f35`: 10 breaking, 12 info
  - added the new path request parameter `databaseName`
  - added the new required request property `table`
  - added the new required request property `values`
  - the request's body type changed from no type to `object`
  - …18 more
- **2026-08-27** `bb44e98aba2e`: 12 breaking, 10 warning
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `200`
  - the response's body type changed from `object` to no type for status `400`
  - the response's body type changed from `object` to no type for status `401`
  - …18 more
- **2026-07-27** `bb52784e098a`: 5 info
  - added the optional property `code` to the response with the `400` status
  - added the optional property `code` to the response with the `401` status
  - added the optional property `code` to the response with the `403` status
  - added the optional property `code` to the response with the `404` status
  - …1 more

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/databases/:databaseName/query/insert/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
