---
title: "Create or update a record"
method: PUT
path: "/v1/objects/{slug}"
tags: ["Records"]
---

# Create or update a record

`PUT /v1/objects/{slug}`

## Request

- Base URL: `https://app.nex.ai/api/developers`
- URL: `https://app.nex.ai/api/developers/v1/objects/{slug}`
- Auth: API key in header `Authorization`

Creates a new record or updates an existing one based on a matching attribute

## Path parameters

- `slug` string, required

## Request body

- DeveloperUpsertRecordRequest
  - `attributes` object, required
    - `name` union, required: Required when creating a new record, but optional when updating an existing record that already has a name. Can be a string (e.g., 'John Doe') or an object (e.g., {'first_name': 'John', 'last_name': 'Doe'} for Person objects).
      - string
      - object
  - `matching_attribute` string, required: ID or slug of the attribute to match on

## Response `200`

Created or updated record with all attributes

- DeveloperUpsertRecordResponse
  - `attributes` object
  - `created_at` string
  - `id` string
  - `object_id` string
  - `type` string
  - `updated_at` string
  - `workspace_id` string

## Other responses

- `400`: Bad request - Invalid data
- `401`: Unauthorized - Invalid or missing API key
- `404`: Object type not found
- `500`: Internal server error

## Changes

- **2026-02-17** `b05d8cb8cf43`: 1 info
  - api operation id `upsertRecord` was added
- **2025-08-20** `15b859d2ef86`: 3 breaking
  - added the new required request property `attributes/name`
  - the request property `attributes` became required
  - the request property `matching_attribute` became required
- **2025-08-19** `c7b3e291a84e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nex/apis/nex-developer-api/changes/v1/objects/:slug/put.md)

---

[API](https://skmtc.dev/nex/apis/nex-developer-api.md) - [All operations](https://skmtc.dev/nex/apis/nex-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nex/apis/nex-developer-api/revisions/51003af13108?raw)
