---
title: "Import data rows"
method: POST
path: "/v1/projects/{project_id}/tables/{id}/import_rows"
tags: ["DataTable"]
---

# Import data rows

`POST /v1/projects/{project_id}/tables/{id}/import_rows`

## Request

- Base URL: `https://api.telerivet.com`
- URL: `https://api.telerivet.com/v1/projects/{project_id}/tables/{id}/import_rows`
- Auth: one of:
  - HTTP basic
  - OAuth 2 (authorization code, authorization URL `https://telerivet.com/oauth/authorize`, token URL `https://api.telerivet.com/oauth/token`)

Creates and/or updates up to 200 rows in a single API call. When creating or updating a large number of rows, this method is significantly faster than sending a separate API request for each row.

 By default, a new row will be created for each item. To update existing rows, set the `lookup_key` parameter to match rows by ID, contact, or the value of a custom variable.

## Path parameters

- `project_id` string, required
- `id` string, required

## Request body

- object
  - `rows` object[], required: Array of up to 200 objects which may contain the properties `vars` (object), `contact_id` (string), `from_number` (string), and `id` (string). All properties are optional, unless used as a lookup key.
    - `vars` object: Custom variables and values for this data row. Variable names may be up to 32 characters in length and can contain the characters a-z, A-Z, 0-9, and _. Values may be strings, numbers, or boolean (true/false). String values may be up to 4096 bytes in length when encoded as UTF-8. Up to 100 variables are supported per object. Setting a variable to null will delete the variable.
    - `contact_id` string: ID of the contact associated with this row
    - `from_number` string: Phone number associated with this row
    - `id` string: ID of an existing row (only used if `lookup_key` is 'id')
  - `lookup_key` 'none' | 'id' | 'contact_id' | 'vars.variable_name': The field used to search for a matching row, or 'none' to always create a new row. To search by a custom variable, precede the variable name with 'vars.'.

## Response `200`

Successful response

- object
  - `rows` object[]: List of objects representing each row, in the same order as provided in the `rows` parameter in the API request.
    - `id` string, required: ID of the row
    - `time_created` integer: Time the row was created (UNIX timestamp)
    - `time_updated` integer: Time the row was last updated (UNIX timestamp)
    - `contact_id` string: ID of the associated contact (if any)
    - `from_number` string: Phone number associated with this row (if any)
    - `vars` object: Custom variables stored for this row

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key or Bearer token
- `404`: Resource not found

---

[API](https://skmtc.dev/telerivet/apis/telerivet-api.md) · [All operations](https://skmtc.dev/telerivet/apis/telerivet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/telerivet/apis/telerivet-api/revisions/4e14b1c8d917?raw)
