> For the complete documentation index, see [llms.txt](https://docs.redivis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.redivis.com/api/client-libraries/redivis-r/reference/upload/uploadusdinsert_rows.md).

# Upload$insert\_rows

### Upload$<mark style="color:purple;">insert\_rows</mark>(*rows, update\_schema=FALSE*) → ***list***[\<insertRows response>](/api/rest-api/uploads/insertrows.md#response-body)

Insert rows into the upload. Can only be called on unreleased uploads of type `"stream".` Should be called at most once per second, per upload; for increased performance try batching multiple rows into a single request, up to a limit of 10MB per request.

### **Parameters:**

**`rows` :&#x20;*****data.frame | character***\
The rows to insert. Either a data.frame (or something that inherits from data.frame; e.g., a tibble), or a character vector that is a valid JSON string for an [insertRows payload](/api/rest-api/uploads/insertrows.md).

### **Returns:**&#x20;

**List**[**\<insertRows response>**](/api/rest-api/uploads/insertrows.md#response-body)

### Examples

```r
library(redivis)

dataset <- redivis$user("user_name")$dataset("dataset_name", version="next")
table <- dataset$table("table_name")

# Providing a schema with the initial request is optional (but recommended).
# If not set, schema will be inferred based on the first batch of rows.
schema <- list(
  list(name = "var1", type = "string"),
  list(name = "var2", type = "integer"),
  list(name = "var3", type = "dateTime")
)

# Construct a data.frame to send (or alternatively, a stringified JSON array of objects)
rows <- data.frame(
  var1 = c("hello", "world"),
  var2 = c(1, 2),
  var3 = c(NA, "2020-01-01T00:00:00.123")
)

upload <- table$upload(name="my_stream")

# Create, or get a reference to an exisiting upload named "my_stream"
upload.create(type="stream", schema=schema, if_not_exists=True) 

insert_response = upload.insert_rows(rows)

# See REST API / uploads / insertRows
print(insert_response)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.redivis.com/api/client-libraries/redivis-r/reference/upload/uploadusdinsert_rows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
