Database Queries

Insert data into database (REST API)

Changed on

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

post/databases/{databaseName}/query/insert

Request

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

Path parameters

databaseNamestring required

Database name (unique within project, lowercase letters, numbers, and underscores only)

Request body

tablestring required

Table name

valuesobject 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}".

Example request

{
  "table": "posts",
  "values": {
    "title": "My New Post",
    "content": "This is the content",
    "status": "draft"
  }
}

Response

Insert successful

dataobject[]

Result rows

countinteger

Number of rows returned

Changes

    • ▲

      added the new path request parameter databaseName

    • ▲

      added the new required request property

    • ▲

      added the new required request property

    • ▲

      the request's body type changed from no type to object

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ▲

      the response's body type changed from no type to object for status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the optional property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ○

      added the required property to the response with the status

    • ▲

      the request's body type changed from object to no type

    • ▲

      the response's body type changed from object to no type for status

    • ▲

      the response's body type changed from object to no type for status

    • ▲

      the response's body type changed from object to no type for status

    • ▲

      the response's body type changed from object to no type for status

    • ▲

      the response's body type changed from object to no type for status

    • ▲

      the response's body type changed from object to no type for status

    • ▲

      removed the required property from the response with the status

    • ▲

      removed the required property from the response with the status

    • ▲

      removed the required property from the response with the status

    • ▲

      removed the required property from the response with the status

    • ▲

      removed the required property from the response with the status

    • ●

      deleted the path request parameter databaseName

    • ●

      removed the request property

    • ●

      removed the request property

    • ●

      removed the optional property from the response with the status

    • ●

      removed the optional property from the response with the status

    • ●

      removed the optional property from the response with the status

    • ●

      removed the optional property from the response with the status

    • ●

      removed the optional property from the response with the status

    • ●

      removed the optional property from the response with the status

    • ●

      removed the optional property from the response with the status