# Read and write rows (/en/docs/api/native/database/rest)



[Guide →](/en/docs/developers/services/database/quickstart)

`/database/v1/databases/{database_id}/rest/{table}`

Reads and writes the same rows as the other entry point for this database. Errors use PostgREST codes.

[Support matrix and client setup](/en/docs/api/compatible/supabase)

[Full parameters, response headers and status codes](/en/docs/api/compatible/supabase/tables)

One batch POST inserts at most **500 rows**. Each request is atomic: a failure in any row rolls back the entire batch. There are no transactions across requests. Put rows that must succeed together in one batch POST. For links, query first, then insert, and handle link errors caused by concurrent changes.

Rows in a batch are filled to the union of their keys with `null` (PostgREST behavior). Send `Prefer: missing=default` to use field defaults instead. Explicit `null` remains null; required fields without defaults must still be provided. The default `return=minimal` returns 201 with an empty body; send `Prefer: return=representation` to return rows.

## Select rows [#select-rows]

`GET /database/v1/databases/{database_id}/rest/{table}`

```bash
curl -X GET "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/rest/tasks?select=*&order=title.asc&limit=10" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
```

### Response [#response]

#### HTTP 200 [#http-200]

Success; write bodies require Prefer: return=representation

**application/json**

| Name | Type | Description |
| --- | --- | --- |
| [].id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

**application/vnd.pgrst.object+json**

| Name | Type | Description |
| --- | --- | --- |
| id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

#### HTTP 206 [#http-206]

Partial range with requested count

**application/json**

| Name | Type | Description |
| --- | --- | --- |
| [].id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

**application/vnd.pgrst.object+json**

| Name | Type | Description |
| --- | --- | --- |
| id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

Response example — HTTP 200

| Header | Value |
| --- | --- |
| content-range | 0-0/* |
| etag | W/"5.1" |
| range-unit | items |

```json
[
  {
    "id": "rec_3e85a292099340e3",
    "version": 1,
    "created_at": "2026-10-11T17:41:47.896Z",
    "updated_at": "2026-10-11T17:41:47.896Z",
    "title": "Write a summary",
    "done": false
  }
]
```

## Count rows [#count-rows]

`HEAD /database/v1/databases/{database_id}/rest/{table}`

```bash
curl --head "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/rest/tasks?select=*" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'prefer: count=exact'
```

### Response [#response-1]

#### HTTP 200 [#http-200-1]

Success; write bodies require Prefer: return=representation

No response body is declared.

#### HTTP 206 [#http-206-1]

Partial range with requested count

No response body is declared.

Response example — HTTP 200

| Header | Value |
| --- | --- |
| content-range | 0-0/1 |
| preference-applied | count=exact |
| etag | W/"5.1" |
| range-unit | items |

No response body.

## Insert rows [#insert-rows]

`POST /database/v1/databases/{database_id}/rest/{table}`

```bash
curl -X POST "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/rest/tasks" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'prefer: return=representation' \
  -H "Content-Type: application/json" \
  -d '{"title":"Write a summary","done":false}'
```

### Response [#response-2]

#### HTTP 201 [#http-201]

Success (201). With the default return=minimal the body is empty; Prefer: return=representation returns rows.

**application/json**

| Name | Type | Description |
| --- | --- | --- |
| [].id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

**application/vnd.pgrst.object+json**

| Name | Type | Description |
| --- | --- | --- |
| id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

Response example — HTTP 201

| Header | Value |
| --- | --- |
| content-range | 0-0/* |
| preference-applied | return=representation |
| range-unit | items |

```json
[
  {
    "id": "rec_3e85a292099340e3",
    "version": 1,
    "created_at": "2026-10-11T17:41:47.896Z",
    "updated_at": "2026-10-11T17:41:47.896Z",
    "title": "Write a summary",
    "done": false
  }
]
```

## Update rows [#update-rows]

`PATCH /database/v1/databases/{database_id}/rest/{table}`

```bash
curl -X PATCH "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/rest/tasks?title=eq.Write%20a%20summary" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'prefer: return=representation' \
  -H "Content-Type: application/json" \
  -d '{"done":true}'
```

### Response [#response-3]

#### HTTP 200 [#http-200-2]

Success; write bodies require Prefer: return=representation

**application/json**

| Name | Type | Description |
| --- | --- | --- |
| [].id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

**application/vnd.pgrst.object+json**

| Name | Type | Description |
| --- | --- | --- |
| id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

#### HTTP 204 [#http-204]

Success without a body

No response body is declared.

Response example — HTTP 200

| Header | Value |
| --- | --- |
| content-range | 0-0/* |
| preference-applied | return=representation |
| range-unit | items |

```json
[
  {
    "id": "rec_3e85a292099340e3",
    "version": 2,
    "created_at": "2026-10-11T17:41:47.896Z",
    "updated_at": "2026-10-11T17:41:48.802Z",
    "title": "Write a summary",
    "done": true
  }
]
```

## Upsert rows [#upsert-rows]

`POST /database/v1/databases/{database_id}/rest/{table}`

```bash
curl -X POST "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/rest/tasks?on_conflict=title" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'prefer: resolution=merge-duplicates,return=representation' \
  -H "Content-Type: application/json" \
  -d '{"title":"Write a summary","done":true}'
```

### Response [#response-4]

#### HTTP 201 [#http-201-1]

Success (201). With the default return=minimal the body is empty; Prefer: return=representation returns rows.

**application/json**

| Name | Type | Description |
| --- | --- | --- |
| [].id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

**application/vnd.pgrst.object+json**

| Name | Type | Description |
| --- | --- | --- |
| id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

Response example — HTTP 201

| Header | Value |
| --- | --- |
| content-range | 0-0/* |
| preference-applied | resolution=merge-duplicates, return=representation |
| range-unit | items |

```json
[
  {
    "id": "rec_3e85a292099340e3",
    "version": 3,
    "created_at": "2026-10-11T17:41:47.896Z",
    "updated_at": "2026-10-11T17:41:49.076Z",
    "title": "Write a summary",
    "done": true
  }
]
```

## Delete rows [#delete-rows]

`DELETE /database/v1/databases/{database_id}/rest/{table}`

```bash
curl -X DELETE "https://api.deepraxis.ai/database/v1/databases/${DATABASE_ID}/rest/tasks?title=eq.Write%20a%20summary" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H 'prefer: return=representation'
```

### Response [#response-5]

#### HTTP 200 [#http-200-3]

Success; write bodies require Prefer: return=representation

**application/json**

| Name | Type | Description |
| --- | --- | --- |
| [].id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

**application/vnd.pgrst.object+json**

| Name | Type | Description |
| --- | --- | --- |
| id | string | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates. |

#### HTTP 204 [#http-204-1]

Success without a body

No response body is declared.

Response example — HTTP 200

| Header | Value |
| --- | --- |
| content-range | 0-0/* |
| preference-applied | return=representation |
| range-unit | items |

```json
[
  {
    "id": "rec_3e85a292099340e3",
    "version": 3,
    "created_at": "2026-10-11T17:41:47.896Z",
    "updated_at": "2026-10-11T17:41:49.076Z",
    "title": "Write a summary",
    "done": true
  }
]
```

## Row [#row]

Default projections, select=&#x2A;, return=representation and RPC row objects return only id and user fields. Explicitly request metadata with select=*,\_version,\_created\_at,\_updated\_at; star does not expand it. Filter with \_version=eq.3 or sort with order=\_created\_at.desc. Metadata is read-only. Default order remains internal creation time then id. Old filter/order names created\_at/updated\_at/version without same-named user fields return 400, details use \_created\_at (or the corresponding name), and hint system metadata moved to underscore columns. Existing underscore user fields take precedence; their same-named system metadata is inaccessible in that table. Historical response examples above were captured before this change and may still contain old metadata columns; this section defines the current row shape.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| id | string | yes | Row identifier of 1–64 characters from A-Z a-z 0-9 _ -. Generated by the service unless the insert supplied one; it cannot be changed by updates.; ^[A-Za-z0-9_-]&#123;1,64&#125;$ |
