---
title: "Create or update a registered custom entity"
method: PATCH
path: "/custom-entities/{entity_registry_id}:upsert"
tags: ["customEntities"]
---

# Create or update a registered custom entity

`PATCH /custom-entities/{entity_registry_id}:upsert`

## Request

- Base URL: `https://{tenant_name}.benchling.com/api/v2`
- URL: `https://{tenant_name}.benchling.com/api/v2/custom-entities/{entity_registry_id}:upsert`
- Auth: HTTP bearer

Create or update a registered custom entity.

Schema field links can be populated using entity registry IDs or API IDs. In the `value` field of the `Field` resource, the object `{"entityRegistryId": ENTITY_REGISTRY_ID}` may be provided instead of the API ID if desired (see example value).

## Path parameters

- `entity_registry_id` string, required

## Request body

- CustomEntityUpsertRequest
  - `archiveRecord` ArchiveRecordSet: Currently, we only support setting a null value for archiveRecord, which unarchives the item
  - `fields` FieldsWithResolution
  - `name` string, required
  - `registryId` string, required
  - `schemaId` string, required
  - `aliases` string[]: Aliases to add to the custom entity
  - `authorIds` string[]: IDs of users to set as the custom entity's authors.
  - `customFields` CustomFields
  - `folderId` string: ID of the folder that the entity is moved into

## Response `200`

Updated

- CustomEntity
  - `aliases` string[]
  - `apiURL` string, uri: The canonical url of the Custom Entity in the API.
  - `archiveRecord` ArchiveRecord
    - `reason` string
  - `authors` UserSummary[]
    - `handle` string
    - `id` string
    - `name` string
  - `createdAt` string, date-time
  - `creator` CustomEntityCreator
    - `handle` string
    - `id` string
    - `name` string
  - `customFields` CustomFields
  - `entityRegistryId` string, nullable
  - `fields` Fields
  - `folderId` string, nullable
  - `id` string
  - `modifiedAt` string, date-time
  - `name` string
  - `registrationOrigin` RegistrationOrigin
    - `originEntryId` string, nullable
    - `registeredAt` string, date-time
  - `registryId` string, nullable
  - `schema` SchemaSummary
    - `id` string
    - `name` string
  - `url` string: The path of the web URL, omitting the tenant domain
  - `webURL` string

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/benchling/apis/benchling-api-2.md) - [All operations](https://skmtc.dev/benchling/apis/benchling-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/benchling/apis/benchling-api-2/revisions/01d2fa8523cd?raw)
