---
title: "Upsert a record"
method: PUT
path: "/v2/objects/{object}/records"
tags: ["Records"]
---

# Upsert a record

`PUT /v2/objects/{object}/records`

Use this endpoint to create or update people, companies and other records. A matching attribute is used to search for existing records. If a record is found with the same value for the matching attribute, that record will be updated. If no record with the same value for the matching attribute is found, a new record will be created instead. If you would like to avoid matching, please use the [Create record endpoint](/rest-api/endpoint-reference/records/create-a-record).

If the matching attribute is a multiselect attribute, new values will be added and existing values will not be deleted. For any other multiselect attribute, all values will be either created or deleted as necessary to match the list of supplied values.

Required scopes: `record_permission:read-write`, `object_configuration:read`.

## Path parameters

- `object` string, required — A UUID or slug to identify the object the record should belong to.

## Query parameters

- `matching_attribute` string, required — The ID or slug of the attribute to use to check if a record already exists. The attribute must be unique.

## Request body

- object
  - `data` object, required
    - `values` object, required — An object with an attribute `api_slug` or `attribute_id` as the key, and a single value (for single-select attributes), or an array of values (for single or multi-select attributes) as the values. For complete documentation on values for all attribute types, please see our [attribute type docs](/docs/attribute-types).

## Response `200`

Success

- object — Success
  - `data` object, required
    - `id` object, required
      - `workspace_id` string, uuid, required — A UUID identifying the workspace this record belongs to.
      - `object_id` string, uuid, required — A UUID identifying the object this record belongs to.
      - `record_id` string, uuid, required — A UUID identifying this record.
    - `created_at` string, required — When this record was created.
    - `web_url` string, uri, required — A URL that links directly to the record page in the Attio web application.
    - `values` object, required — A record type with an attribute `api_slug` as the key, and an array of value objects as the values.

## Other responses

- `400` — Bad Request
- `404` — Not Found

---

[API](https://skmtc.net/attio/apis/attio-api.md) · [All operations](https://skmtc.net/attio/apis/attio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/attio/attio-api/versions/40a8e41d06a2/schema)
