**Source URL:** https://general.veevavault.dev/regulatory/vault-api/api-reference/17.3/vault-objects/create-object-records.md

# Create Object Records



Create Object Records in bulk.

You can use this endpoint to create User Tasks. Learn more about [User Tasks in Vault Help](https://platform.veevavault.help/en/gr/40757).

* The maximum input file size is 1GB.

* The values in the input must be UTF-8 encoded.

* CSVs must follow the [standard format.](http://tools.ietf.org/html/rfc4180)

* The maximum batch size is 500.

Note that you can only add relationships on object fields using ID values or based on a unique field on the target object. This API does not support [object lookup fields](https://developer.veevavault.com/vql/#Object_Lookup_Fields).

<Endpoint path="/api/{version}/vobjects/{object_name}" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Content-Type` | `text/csv` or `application/json` |
| `Accept` | `application/json` (default) or `text/csv` |
</FieldTable>

## URI Path Parameters {#uri-path-parameters}

<FieldTable>
| Name | Description |
| --- | --- |
| `{object_name}` | The name of the object, for example, `product__v`. |
</FieldTable>

## Body Parameters {#body-parameters}

Upload parameters as a JSON or CSV file.

<FieldTable>
| Name | Description |
| --- | --- |
| `name__v` | This field is required unless it is set to system-managed. To find out if an object uses system-managed naming, retrieve its `name__v` field and look for the `system_managed_name` property set to `true` or `false`. Learn more about system-managed naming in [Vault Help](https://platform.veevavault.help/en/gr/30986). |
| `object_type__v` | Optional: To create objects of a specific object type, add this field with the `id` of the object type. |
| `object_type__v.api_name__v` | Optional: To create objects of a specific object type, add this field with the `name` of the object type. |
| `source_record_id` | Optional: To copy an existing object record, add this field with the `id` of the existing object record. Any values specified for other fields will override the copied values. If you want to make a deep copy of a record, see the Deep Copy endpoint. |
</FieldTable>
Note that if `object_type__v` and `object_type__v.api_name__v` are both included, Vault creates the object with the type specified in `object_type__v`.

## Query Parameters: Upsert Object Records {#query-parameters-upsert-object-records}

Upsert is a combination of create and update. With `idParam`, you can identify an object record by any unique object field. This allows you to use one input file to create new object records and update existing records at the same time. If a matching record exists, Vault updates the record with the unique field values specified in the input. If no matching object record exists, Vault creates a new record using the values in the input.

Upsert expects unique `idParam` field values in the request and providing duplicate values will result in a `FAILURE` for the entire batch.

<FieldTable>
| Name | Description |
| --- | --- |
| `idParam` | To upsert object records, add `idParam={field_name}` to the request endpoint. For example, `idParam=external_id__v`. Note that the specified object field must have `unique` set to `true` in the object metadata. |
</FieldTable>
Admin may set other standard or custom object fields to required. Use the Object Metadata API to retrieve all fields configured on objects. You can add any object field with `editable: true`.

## Request {#request}

<CodeExample title="">
```
curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: text/csv" \
-H "Accept: text/csv" \
--data-binary @"C:\Vault\Object Records\create_object_records.csv" \
https://myvault.veevavault.com/api/v8.0/vobjects/product__v

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
    "responseStatus": "SUCCESS",
    "data": [
        {
            "responseStatus": "SUCCESS",
            "data": {
                "id": "0PR0771",
                "url": "api/v8.0/vobjects/product__v/0PR0771"
            }
        },
        {
            "responseStatus": "SUCCESS",
            "data": {
                "id": "0PR0772",
                "url": "api/v8.0/vobjects/product__v/0PR0772"
            }
        },
        {
            "responseStatus": "SUCCESS",
            "data": {
                "id": "0PR0773",
                "url": "api/v8.0/vobjects/product__v/0PR0773"
            }
        },
        {
            "responseStatus": "FAILURE",
            "errors": [
                {
                    "type": "INVALID_DATA",
                    "message": "Error message describing why this object record was not created."
                }
            ]
        }
    ]
}

```
</CodeExample>

## Response Details {#response-details}

On SUCCESS, Vault returns the `id` and `url` of each new record.

Note that if an object has a field default configured, the value you use for that field overrides the default.

Note that in CTMS Vaults, if you do not specify a milestone record ID when creating a new *Monitoring Event* record, this call will automatically create a new *Milestone* record. However, the `id` of the new *Milestone* record is not returned in this response. Learn more about automated CTMS object creation in [Vault Help](https://clinical.veevavault.help/en/gr/40009).

<DownloadButton href="/sample-files/vault-create-object-records-sample-csv-input.csv" label="Download Input File"></DownloadButton>

---

**Previous:** [Retrieve Object Record](/regulatory/vault-api/api-reference/17.3/vault-objects/retrieve-object-record)  
**Next:** [Update Object Records](/regulatory/vault-api/api-reference/17.3/vault-objects/update-object-records)