---
title: "Update an object definition"
method: POST
path: "/objects/migrations"
tags: ["Custom Object Definitions"]
---

# Update an object definition

`POST /objects/migrations`

Updates custom object definitions or custom field definitions for standard and custom objects.

The system asynchronously processes requests to update custom object definitions or advanced custom field definitions and returns a `jobId` in the response. 
You can use the “Retrieve a custom object bulk job” operation to check whether the asynchronous job is completed. 
For more information about advanced custom fields, see <a href="https://docs.zuora.com/en/zuora-platform/extensibility/custom-fields/custom-fields-and-legacy-custom-fields" target="_blank">Custom fields and legacy custom fields</a>.

### Limitations

Updating custom field definition has the following limitations:
  
* You can only have one action per update request.
* You cannot delete fields from custom objects that contain records.
* You can only add required fields to custom objects with no records.
* You can change optional fields to required only on the custom objects with no records.

### Note

The bulk deletion of custom fields on standard and custom objects is temporarily unavailable as we refine the Custom Field feature.

You can still delete custom fields individually during this refinement process. If you want to delete multiple custom fields, ensure that you send each deletion request only after receiving the response for the previous request.

The bulk deletion capability will be restored once the refinement is complete.

## Headers

- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Track-Id` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Version` string, date

## Request body

- MigrationUpdateCustomObjectDefinitionsRequest
  - `actions` CustomObjectDefinitionUpdateActionRequest[], required — The actions of updating custom object definitions, to be performed as parts of the migration. Currently only one action per migration is supported.
    - `description` string — Optional property for `updateObject` action
    - `enableCreateRecordAuditing` boolean — Optional property for `updateObject` action. Indicates whether to audit the creation of custom object records of this custom object definition. Note that you must enable the **Custom Object Definition** audit trail setting in your Zuora tenant before auditing custom object record creation. For more information, see <a href="https://docs.zuora.com/en/zuora-platform/system-management/administrator-settings/manage-audit-trail-settings" target="_blank">Manage audit trail settings</a>.
    - `enableDeleteRecordAuditing` boolean — Optional property for `updateObject` action. Indicates whether to audit the deletion of custom object records of this custom object definition. Note that you must enable the **Custom Object Definition** audit trail setting in your Zuora tenant before auditing custom object record deletion. For more information, see <a href="https://docs.zuora.com/en/zuora-platform/system-management/administrator-settings/manage-audit-trail-settings" target="_blank">Manage audit trail settings</a>.
    - `field` UpdateCustomObjectCusotmField — A reference to a field.
      - `auditable` boolean — Indicates whether Audit Trail will record changes of this custom field. You can change auditable fields to non-auditable, and vice versa. One custom object can have a maximum of five auditable fields.
      - `definition` CustomObjectCustomFieldDefinitionUpdate — The custom field definition in the custom object
        - `default` string — Applicable if the `type` of the action is `updateField`
        - `description` string — Applicable if the `type` of the action is `updateField`
        - `displayName` boolean — Indicates whether to use this field as the display name of the custom object when being linked to another custom object. This field applies only to the Text custom field type: - The `type` field is `string`. - The `enum` field is not specified.
        - `format` string — The data format of the custom field
        - `label` string — The UI label of the custom field
        - `maxLength` integer — The maximum length of string that can be stored in the custom field. This field applies only to the following custom field types: - Text: - The `type` field is `string`. - The `format` field is not specified or is `url`. - The `enum` field is not specified. - Long Text: - The `type` field is `string`. - The `format` field is `long-text`. - Picklist: - The `type` field is `string`. - The `enum` field is specified. - The `multiselect` field is not specified or is `false`. - Multiselect: - The `type` field is `string`. - The `enum` field is specified. - The `multiselect` field is `true`.
        - `multiselect` boolean — Indicates whether this is a multiselect custom field. This field applies only to the creation of Picklist or Multiselect custom fields: - The action `type` field is `addField`. - The definition `type` field is `string`. - The `maxLength` field is specified. - The `enum` field is specified.
        - `origin` 'custom' — Specifies that this is a custom field
        - `type` string — The data type of the custom field
      - `filterable` boolean — Indicates whether the field is filterable or not. Applicable to `addField` and `updateField` actions. You can change a filterable field to non-filterable and vice versa. You can also add a filterable field. One custom object can have a maximum of 10 filterable fields. Note that changing filterable fields triggers reindexing. It will take 12-24 hours before all your data are reindexed and available to query.
      - `name` string — The name of the custom field to be updated
      - `required` boolean — Indicates whether the field is required or optional. You can update a required field to optional. On the other hand, you can only update an optional field to required on the custom object with no records. You can only add a required field to the custom object with no records.
      - `targetName` string — Required if the `type` of the action is `renameField`
      - `unique` boolean — Indicates whether to specify a unique constraint to the field. You can remove the unique constraint on the field. However, you can only add a unique constraint to a filterable field if the custom object contains no record. One custom object can have a maximum of five fields with unique constraints.
    - `label` string — Optional property for `updateObject` action
    - `namespace` string, required — The namespace of the custom object definition to be updated
    - `object` string, required — The API name of the custom object definition to be updated
    - `relationship` object
      - `cardinality` 'manyToOne' — The cardinality of the relationship from this object to another object. Only the `manyToOne` cardinality can be used when creating relationships. A relationship with `oneToMany` cardinality is created implicitly when a `manyToOne` relationship is created. A custom object definition can have a maximum of 2 `manyToOne` relationships.
      - `fields` FieldsAdditionalProperties, required — Field mappings in the form of `<this-object-field-name>`: `<other-object-field-name>`.
      - `namespace` string, required — The namespace where the related object is located
      - `object` string, required — The API name of the related object
      - `recordConstraints` object — Specifies contraints to apply to custom object records.
        - `create` object
          - `enforceValidMapping` boolean — Specifies whether Zuora validates the values of mapped fields in custom object records. By default, Zuora validates the values of mapped fields in custom object records. For example, if the custom object definition has a field called `AccountId__c` that is mapped to the `Id` field of the `account` object, Zuora verifies that the value of `AccountId__c` is a valid account ID when a custom object record is created. If the value of `AccountId__c` is not a valid account ID, the operation fails.
    - `type` 'addField' | 'deleteField' | 'updateField' | 'updateObject' | 'renameField' | 'addRelationship' | 'deleteRelationship', required — The type of the updating action on a custom object definition

## Response `200`

OK

- MigrationUpdateCustomObjectDefinitionsResponse
  - `actions` CustomObjectDefinitionUpdateActionResponse[] — The actions of updating custom object definitions, to be performed as parts of the migration. Currently only one action per migration is supported.
    - `description` string — Optional property for `updateObject` action
    - `enableCreateRecordAuditing` boolean — Indicates whether to audit the creation of custom object records of this custom object definition.
    - `enableDeleteRecordAuditing` boolean — Indicates whether to audit the deletion of custom object records of this custom object definition.
    - `field` UpdateCustomObjectCusotmField — A reference to a field.
      - `auditable` boolean — Indicates whether Audit Trail will record changes of this custom field. You can change auditable fields to non-auditable, and vice versa. One custom object can have a maximum of five auditable fields.
      - `definition` CustomObjectCustomFieldDefinitionUpdate — The custom field definition in the custom object
        - `default` string — Applicable if the `type` of the action is `updateField`
        - `description` string — Applicable if the `type` of the action is `updateField`
        - `displayName` boolean — Indicates whether to use this field as the display name of the custom object when being linked to another custom object. This field applies only to the Text custom field type: - The `type` field is `string`. - The `enum` field is not specified.
        - `format` string — The data format of the custom field
        - `label` string — The UI label of the custom field
        - `maxLength` integer — The maximum length of string that can be stored in the custom field. This field applies only to the following custom field types: - Text: - The `type` field is `string`. - The `format` field is not specified or is `url`. - The `enum` field is not specified. - Long Text: - The `type` field is `string`. - The `format` field is `long-text`. - Picklist: - The `type` field is `string`. - The `enum` field is specified. - The `multiselect` field is not specified or is `false`. - Multiselect: - The `type` field is `string`. - The `enum` field is specified. - The `multiselect` field is `true`.
        - `multiselect` boolean — Indicates whether this is a multiselect custom field. This field applies only to the creation of Picklist or Multiselect custom fields: - The action `type` field is `addField`. - The definition `type` field is `string`. - The `maxLength` field is specified. - The `enum` field is specified.
        - `origin` 'custom' — Specifies that this is a custom field
        - `type` string — The data type of the custom field
      - `filterable` boolean — Indicates whether the field is filterable or not. Applicable to `addField` and `updateField` actions. You can change a filterable field to non-filterable and vice versa. You can also add a filterable field. One custom object can have a maximum of 10 filterable fields. Note that changing filterable fields triggers reindexing. It will take 12-24 hours before all your data are reindexed and available to query.
      - `name` string — The name of the custom field to be updated
      - `required` boolean — Indicates whether the field is required or optional. You can update a required field to optional. On the other hand, you can only update an optional field to required on the custom object with no records. You can only add a required field to the custom object with no records.
      - `targetName` string — Required if the `type` of the action is `renameField`
      - `unique` boolean — Indicates whether to specify a unique constraint to the field. You can remove the unique constraint on the field. However, you can only add a unique constraint to a filterable field if the custom object contains no record. One custom object can have a maximum of five fields with unique constraints.
    - `label` string — Optional property for `updateObject` action
    - `namespace` string — The namespace of the custom object definition to be updated
    - `object` string — The API name of the custom object definition to be updated
    - `relationship` object
      - `cardinality` 'manyToOne' | 'oneToMany' — The cardinality of the relationship from this object to another object. A `manyToOne` relationship means this object is the child object (the "many" side), and the referenced object (the "one" side) is the parent. A `oneToMany` relationship means this object is the parent object (the "one" side), and the referenced object (the "many" side) is the child.
      - `fields` FieldsAdditionalProperties — Field mappings in the form of `<this-object-field-name>`: `<other-object-field-name>`.
      - `namespace` string — The namespace where the related object is located
      - `object` string — The API name of the related object
      - `recordConstraints` object — Specifies contraints to apply to custom object records.
        - `create` object
          - `enforceValidMapping` boolean — Specifies whether Zuora validates the values of mapped fields in custom object records.
    - `type` 'addField' | 'deleteField' | 'updateField' | 'updateObject' | 'renameField' | 'addRelationship' | 'deleteRelationship' — The type of the updating action on a custom object definition
  - `jobId` string, uuid — The ID of the asynchronous job. It is available only when updating custom object definitions or advanced custom field definitions. Use the “Retrieve a custom object bulk job” operation to check whether the asynchronous job is completed.

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
