> This page is for Developers.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Update an object definition

POST https://rest.test.zuora.com/objects/migrations
Content-Type: application/json

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 Custom fields and legacy custom fields.

### 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.

Reference: https://zuora.ferndocs.com/developers/api-reference/zuora-api/custom-objects/custom-object-definitions/update-object-definition

## Authentication

- `Authorization` header (bearer token, required) — Use `Bearer {{token}}` in the `Authorization` header for authentication.

## Servers

- `https://rest.test.zuora.com` (US Developer & Central Sandbox (incl. Test Drive), default)
- `https://rest.sandbox.na.zuora.com` (US API Sandbox Cloud 1)
- `https://rest.apisandbox.zuora.com` (US API Sandbox Cloud 2)
- `https://rest.na.zuora.com` (US Production Cloud 1)
- `https://rest.zuora.com` (US Production Cloud 2)
- `https://rest.test.eu.zuora.com` (EU Developer & Central Sandbox)
- `https://rest.sandbox.eu.zuora.com` (EU API Sandbox)
- `https://rest.eu.zuora.com` (EU Production)
- `https://rest.test.ap.zuora.com` (APAC Developer & Central Sandbox)
- `https://rest.ap.zuora.com` (APAC Production)

## Request

### Headers

- `Accept-Encoding` (string, optional) — Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it.
- `Content-Encoding` (string, optional) — Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.
- `Zuora-Track-Id` (string, optional) — A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`"`), and quote (`'`).
- `Zuora-Entity-Ids` (string, optional) — An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.
- `Zuora-Org-Ids` (string, optional) — Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. This header is important in Multi-Org (MO) setups because it defines the organization context under which the API should operate—mainly used for read access or data visibility filtering. If the header is not set, the operation is performed in scope of the user's accessible orgs.
- `Zuora-Version` (date, optional) — API version that determines the response schema. The default version is used if this parameter is not included. Specify `Zuora-Version` in the request header if you expect a specific response schema.

### Body (application/json)

This endpoint expects a MigrationUpdateCustomObjectDefinitionsRequest.

- `actions` (list of 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.

## Response

### 200

OK

- `actions` (list of CustomObjectDefinitionUpdateActionResponse, optional) — The actions of updating custom object definitions, to be performed as parts of the migration. Currently only one action per migration is supported.
- `jobId` (string, optional) — 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.

## Types

### CustomObjectDefinitionUpdateActionRequest

- `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
- `type` (enum, required) — The type of the updating action on a custom object definition
  - Allowed values: `addField`, `deleteField`, `updateField`, `updateObject`, `renameField`, `addRelationship`, `deleteRelationship`
- `description` (string, optional) — Optional property for `updateObject` action
- `enableCreateRecordAuditing` (boolean, optional) — 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 Manage audit trail settings.
- `enableDeleteRecordAuditing` (boolean, optional) — 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 Manage audit trail settings.
- `field` (UpdateCustomObjectCusotmField, optional) — A reference to a field.
- `label` (string, optional) — Optional property for `updateObject` action
- `relationship` (CustomObjectDefinitionUpdateActionRequestRelationship, optional)

### CustomObjectDefinitionUpdateActionResponse

- `description` (string, optional) — Optional property for `updateObject` action
- `enableCreateRecordAuditing` (boolean, optional) — Indicates whether to audit the creation of custom object records of this custom object definition.
- `enableDeleteRecordAuditing` (boolean, optional) — Indicates whether to audit the deletion of custom object records of this custom object definition.
- `field` (UpdateCustomObjectCusotmField, optional) — A reference to a field.
- `label` (string, optional) — Optional property for `updateObject` action
- `namespace` (string, optional) — The namespace of the custom object definition to be updated
- `object` (string, optional) — The API name of the custom object definition to be updated
- `relationship` (CustomObjectDefinitionUpdateActionResponseRelationship, optional)
- `type` (enum, optional) — The type of the updating action on a custom object definition
  - Allowed values: `addField`, `deleteField`, `updateField`, `updateObject`, `renameField`, `addRelationship`, `deleteRelationship`

### UpdateCustomObjectCusotmField

A reference to a field.

- `auditable` (boolean, optional) — 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, optional) — The custom field definition in the custom object
- `filterable` (boolean, optional) — 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, optional) — The name of the custom field to be updated
- `required` (boolean, optional) — 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, optional) — Required if the `type` of the action is `renameField`
- `unique` (boolean, optional) — 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.

### CustomObjectDefinitionUpdateActionRequestRelationship

- `fields` (map from string to string, 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
- `cardinality` (enum, optional) — 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.
  - Allowed values: `manyToOne`
- `recordConstraints` (CustomObjectDefinitionUpdateActionRequestRelationshipRecordConstraints, optional) — Specifies contraints to apply to custom object records.

### CustomObjectDefinitionUpdateActionResponseRelationship

- `cardinality` (enum, optional, default: manyToOne) — 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.
  - Allowed values: `manyToOne`, `oneToMany`
- `fields` (map from string to string, optional) — Field mappings in the form of `<this-object-field-name>`: `<other-object-field-name>`.
- `namespace` (string, optional) — The namespace where the related object is located
- `object` (string, optional) — The API name of the related object
- `recordConstraints` (CustomObjectDefinitionUpdateActionResponseRelationshipRecordConstraints, optional) — Specifies contraints to apply to custom object records.

### CustomObjectCustomFieldDefinitionUpdate

The custom field definition in the custom object

- `default` (string, optional) — Applicable if the `type` of the action is `updateField`
- `description` (string, optional) — Applicable if the `type` of the action is `updateField`
- `displayName` (boolean, optional) — 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, optional) — The data format of the custom field
- `label` (string, optional) — The UI label of the custom field
- `maxLength` (integer, optional) — 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, optional) — 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` (enum, optional) — Specifies that this is a custom field
  - Allowed values: `custom`
- `type` (string, optional) — The data type of the custom field

### CustomObjectDefinitionUpdateActionRequestRelationshipRecordConstraints

Specifies contraints to apply to custom object records.

- `create` (CustomObjectDefinitionUpdateActionRequestRelationshipRecordConstraintsCreate, optional)

### CustomObjectDefinitionUpdateActionResponseRelationshipRecordConstraints

Specifies contraints to apply to custom object records.

- `create` (CustomObjectDefinitionUpdateActionResponseRelationshipRecordConstraintsCreate, optional)

### CustomObjectDefinitionUpdateActionRequestRelationshipRecordConstraintsCreate

- `enforceValidMapping` (boolean, optional, default: true) — 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.

### CustomObjectDefinitionUpdateActionResponseRelationshipRecordConstraintsCreate

- `enforceValidMapping` (boolean, optional, default: true) — Specifies whether Zuora validates the values of mapped fields in custom object records.

## Examples

### Add a custom field to a standard object

**Request**

```json
{
  "actions": [
    {
      "namespace": "com_zuora",
      "object": "Account",
      "type": "addField",
      "field": {
        "definition": {
          "label": "AccountGroup",
          "maxLength": 50,
          "type": "string"
        },
        "name": "AccountGroup__c"
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Add a custom field to a standard object
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "com_zuora",
            "object": "Account",
            "type": "addField",
            "field": {
                "definition": {
                    "label": "AccountGroup",
                    "maxLength": 50,
                    "type": "string"
                },
                "name": "AccountGroup__c"
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Add a custom field to a standard object
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"com_zuora","object":"Account","type":"addField","field":{"definition":{"label":"AccountGroup","maxLength":50,"type":"string"},"name":"AccountGroup__c"}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Add a custom field to a standard object
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"AccountGroup\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"AccountGroup__c\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Add a custom field to a standard object
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"AccountGroup\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"AccountGroup__c\"\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Add a custom field to a standard object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"AccountGroup\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"AccountGroup__c\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Add a custom field to a standard object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "com_zuora",
      "object": "Account",
      "type": "addField",
      "field": {
        "definition": {
          "label": "AccountGroup",
          "maxLength": 50,
          "type": "string"
        },
        "name": "AccountGroup__c"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Add a custom field to a standard object
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"AccountGroup\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"AccountGroup__c\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add a custom field to a standard object
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "com_zuora",
      "object": "Account",
      "type": "addField",
      "field": [
        "definition": [
          "label": "AccountGroup",
          "maxLength": 50,
          "type": "string"
        ],
        "name": "AccountGroup__c"
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update a custom field on a standard object

**Request**

```json
{
  "actions": [
    {
      "namespace": "com_zuora",
      "object": "Account",
      "type": "updateField",
      "field": {
        "definition": {
          "description": "The account group number"
        },
        "name": "AccountGroup__c",
        "required": true
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Update a custom field on a standard object
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "com_zuora",
            "object": "Account",
            "type": "updateField",
            "field": {
                "definition": { "description": "The account group number" },
                "name": "AccountGroup__c",
                "required": True
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update a custom field on a standard object
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"com_zuora","object":"Account","type":"updateField","field":{"definition":{"description":"The account group number"},"name":"AccountGroup__c","required":true}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update a custom field on a standard object
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"The account group number\"\n        },\n        \"name\": \"AccountGroup__c\",\n        \"required\": true\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update a custom field on a standard object
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"The account group number\"\n        },\n        \"name\": \"AccountGroup__c\",\n        \"required\": true\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Update a custom field on a standard object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"The account group number\"\n        },\n        \"name\": \"AccountGroup__c\",\n        \"required\": true\n      }\n    }\n  ]\n}")
  .asString();
```

```php Update a custom field on a standard object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "com_zuora",
      "object": "Account",
      "type": "updateField",
      "field": {
        "definition": {
          "description": "The account group number"
        },
        "name": "AccountGroup__c",
        "required": true
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update a custom field on a standard object
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"com_zuora\",\n      \"object\": \"Account\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"The account group number\"\n        },\n        \"name\": \"AccountGroup__c\",\n        \"required\": true\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update a custom field on a standard object
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "com_zuora",
      "object": "Account",
      "type": "updateField",
      "field": [
        "definition": ["description": "The account group number"],
        "name": "AccountGroup__c",
        "required": true
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update a custom object

**Request**

```json
{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "updateObject",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "label": "Vehicle"
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Update a custom object
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "default",
            "object": "Vehicle",
            "type": "updateObject",
            "enableCreateRecordAuditing": True,
            "enableDeleteRecordAuditing": True,
            "label": "Vehicle"
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update a custom object
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"default","object":"Vehicle","type":"updateObject","enableCreateRecordAuditing":true,"enableDeleteRecordAuditing":true,"label":"Vehicle"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update a custom object
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateObject\",\n      \"enableCreateRecordAuditing\": true,\n      \"enableDeleteRecordAuditing\": true,\n      \"label\": \"Vehicle\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update a custom object
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateObject\",\n      \"enableCreateRecordAuditing\": true,\n      \"enableDeleteRecordAuditing\": true,\n      \"label\": \"Vehicle\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Update a custom object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateObject\",\n      \"enableCreateRecordAuditing\": true,\n      \"enableDeleteRecordAuditing\": true,\n      \"label\": \"Vehicle\"\n    }\n  ]\n}")
  .asString();
```

```php Update a custom object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "updateObject",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "label": "Vehicle"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update a custom object
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateObject\",\n      \"enableCreateRecordAuditing\": true,\n      \"enableDeleteRecordAuditing\": true,\n      \"label\": \"Vehicle\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update a custom object
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "default",
      "object": "Vehicle",
      "type": "updateObject",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "label": "Vehicle"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Add a custom field to a custom object

**Request**

```json
{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "addField",
      "field": {
        "definition": {
          "label": "DeviceId",
          "maxLength": 50,
          "type": "string"
        },
        "name": "DeviceId__c"
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Add a custom field to a custom object
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "default",
            "object": "Vehicle",
            "type": "addField",
            "field": {
                "definition": {
                    "label": "DeviceId",
                    "maxLength": 50,
                    "type": "string"
                },
                "name": "DeviceId__c"
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Add a custom field to a custom object
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"default","object":"Vehicle","type":"addField","field":{"definition":{"label":"DeviceId","maxLength":50,"type":"string"},"name":"DeviceId__c"}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Add a custom field to a custom object
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"DeviceId\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"DeviceId__c\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Add a custom field to a custom object
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"DeviceId\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"DeviceId__c\"\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Add a custom field to a custom object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"DeviceId\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"DeviceId__c\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Add a custom field to a custom object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "addField",
      "field": {
        "definition": {
          "label": "DeviceId",
          "maxLength": 50,
          "type": "string"
        },
        "name": "DeviceId__c"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Add a custom field to a custom object
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addField\",\n      \"field\": {\n        \"definition\": {\n          \"label\": \"DeviceId\",\n          \"maxLength\": 50,\n          \"type\": \"string\"\n        },\n        \"name\": \"DeviceId__c\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add a custom field to a custom object
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "default",
      "object": "Vehicle",
      "type": "addField",
      "field": [
        "definition": [
          "label": "DeviceId",
          "maxLength": 50,
          "type": "string"
        ],
        "name": "DeviceId__c"
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update a custom field on a custom object

**Request**

```json
{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "updateField",
      "field": {
        "definition": {
          "description": "Linking to the Order object"
        },
        "name": "OrderId__c",
        "required": true
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Update a custom field on a custom object
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "default",
            "object": "Vehicle",
            "type": "updateField",
            "field": {
                "definition": { "description": "Linking to the Order object" },
                "name": "OrderId__c",
                "required": True
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update a custom field on a custom object
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"default","object":"Vehicle","type":"updateField","field":{"definition":{"description":"Linking to the Order object"},"name":"OrderId__c","required":true}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update a custom field on a custom object
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"Linking to the Order object\"\n        },\n        \"name\": \"OrderId__c\",\n        \"required\": true\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update a custom field on a custom object
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"Linking to the Order object\"\n        },\n        \"name\": \"OrderId__c\",\n        \"required\": true\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Update a custom field on a custom object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"Linking to the Order object\"\n        },\n        \"name\": \"OrderId__c\",\n        \"required\": true\n      }\n    }\n  ]\n}")
  .asString();
```

```php Update a custom field on a custom object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "updateField",
      "field": {
        "definition": {
          "description": "Linking to the Order object"
        },
        "name": "OrderId__c",
        "required": true
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Update a custom field on a custom object
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"updateField\",\n      \"field\": {\n        \"definition\": {\n          \"description\": \"Linking to the Order object\"\n        },\n        \"name\": \"OrderId__c\",\n        \"required\": true\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update a custom field on a custom object
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "default",
      "object": "Vehicle",
      "type": "updateField",
      "field": [
        "definition": ["description": "Linking to the Order object"],
        "name": "OrderId__c",
        "required": true
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete a custom field from a custom object

**Request**

```json
{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "deleteField",
      "field": {
        "name": "OrderId__c"
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Delete a custom field from a custom object
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "default",
            "object": "Vehicle",
            "type": "deleteField",
            "field": { "name": "OrderId__c" }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete a custom field from a custom object
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"default","object":"Vehicle","type":"deleteField","field":{"name":"OrderId__c"}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete a custom field from a custom object
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteField\",\n      \"field\": {\n        \"name\": \"OrderId__c\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete a custom field from a custom object
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteField\",\n      \"field\": {\n        \"name\": \"OrderId__c\"\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Delete a custom field from a custom object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteField\",\n      \"field\": {\n        \"name\": \"OrderId__c\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Delete a custom field from a custom object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "deleteField",
      "field": {
        "name": "OrderId__c"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete a custom field from a custom object
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteField\",\n      \"field\": {\n        \"name\": \"OrderId__c\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete a custom field from a custom object
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "default",
      "object": "Vehicle",
      "type": "deleteField",
      "field": ["name": "OrderId__c"]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Rename a custom field on a custom object

**Request**

```json
{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "renameField",
      "field": {
        "name": "Color__c",
        "targetName": "CarColor__c"
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Rename a custom field on a custom object
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "default",
            "object": "Vehicle",
            "type": "renameField",
            "field": {
                "name": "Color__c",
                "targetName": "CarColor__c"
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Rename a custom field on a custom object
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"default","object":"Vehicle","type":"renameField","field":{"name":"Color__c","targetName":"CarColor__c"}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Rename a custom field on a custom object
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"renameField\",\n      \"field\": {\n        \"name\": \"Color__c\",\n        \"targetName\": \"CarColor__c\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Rename a custom field on a custom object
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"renameField\",\n      \"field\": {\n        \"name\": \"Color__c\",\n        \"targetName\": \"CarColor__c\"\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Rename a custom field on a custom object
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"renameField\",\n      \"field\": {\n        \"name\": \"Color__c\",\n        \"targetName\": \"CarColor__c\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Rename a custom field on a custom object
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "renameField",
      "field": {
        "name": "Color__c",
        "targetName": "CarColor__c"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Rename a custom field on a custom object
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"renameField\",\n      \"field\": {\n        \"name\": \"Color__c\",\n        \"targetName\": \"CarColor__c\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rename a custom field on a custom object
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "default",
      "object": "Vehicle",
      "type": "renameField",
      "field": [
        "name": "Color__c",
        "targetName": "CarColor__c"
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Add a relationship for a custom field

**Request**

```json
{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "addRelationship",
      "relationship": {
        "fields": {
          "OrderId__c": "Id"
        },
        "namespace": "com_zuora",
        "object": "orders"
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Add a relationship for a custom field
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "default",
            "object": "Vehicle",
            "type": "addRelationship",
            "relationship": {
                "fields": { "OrderId__c": "Id" },
                "namespace": "com_zuora",
                "object": "orders"
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Add a relationship for a custom field
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"default","object":"Vehicle","type":"addRelationship","relationship":{"fields":{"OrderId__c":"Id"},"namespace":"com_zuora","object":"orders"}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Add a relationship for a custom field
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Add a relationship for a custom field
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Add a relationship for a custom field
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Add a relationship for a custom field
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "addRelationship",
      "relationship": {
        "fields": {
          "OrderId__c": "Id"
        },
        "namespace": "com_zuora",
        "object": "orders"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Add a relationship for a custom field
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"addRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add a relationship for a custom field
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "default",
      "object": "Vehicle",
      "type": "addRelationship",
      "relationship": [
        "fields": ["OrderId__c": "Id"],
        "namespace": "com_zuora",
        "object": "orders"
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete a relationship for a custom field

**Request**

```json
{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "deleteRelationship",
      "relationship": {
        "fields": {
          "OrderId__c": "Id"
        },
        "namespace": "com_zuora",
        "object": "orders"
      }
    }
  ]
}
```

**Response**

```json
{
  "actions": [
    {
      "description": "string",
      "enableCreateRecordAuditing": true,
      "enableDeleteRecordAuditing": true,
      "field": {
        "auditable": true,
        "definition": {
          "default": "string",
          "description": "string",
          "displayName": true,
          "format": "string",
          "label": "string",
          "maxLength": 1,
          "multiselect": true,
          "origin": "custom",
          "type": "string"
        },
        "filterable": true,
        "name": "string",
        "required": true,
        "targetName": "string",
        "unique": true
      },
      "label": "string",
      "namespace": "string",
      "object": "string",
      "relationship": {
        "cardinality": "manyToOne",
        "fields": {},
        "namespace": "string",
        "object": "string",
        "recordConstraints": {
          "create": {
            "enforceValidMapping": true
          }
        }
      },
      "type": "addField"
    }
  ],
  "jobId": "string"
}
```

**SDK Code**

```python Delete a relationship for a custom field
import requests

url = "https://rest.test.zuora.com/objects/migrations"

payload = { "actions": [
        {
            "namespace": "default",
            "object": "Vehicle",
            "type": "deleteRelationship",
            "relationship": {
                "fields": { "OrderId__c": "Id" },
                "namespace": "com_zuora",
                "object": "orders"
            }
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete a relationship for a custom field
const url = 'https://rest.test.zuora.com/objects/migrations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"actions":[{"namespace":"default","object":"Vehicle","type":"deleteRelationship","relationship":{"fields":{"OrderId__c":"Id"},"namespace":"com_zuora","object":"orders"}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete a relationship for a custom field
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://rest.test.zuora.com/objects/migrations"

	payload := strings.NewReader("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete a relationship for a custom field
require 'uri'
require 'net/http'

url = URI("https://rest.test.zuora.com/objects/migrations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Delete a relationship for a custom field
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://rest.test.zuora.com/objects/migrations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Delete a relationship for a custom field
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://rest.test.zuora.com/objects/migrations', [
  'body' => '{
  "actions": [
    {
      "namespace": "default",
      "object": "Vehicle",
      "type": "deleteRelationship",
      "relationship": {
        "fields": {
          "OrderId__c": "Id"
        },
        "namespace": "com_zuora",
        "object": "orders"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Delete a relationship for a custom field
using RestSharp;

var client = new RestClient("https://rest.test.zuora.com/objects/migrations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"actions\": [\n    {\n      \"namespace\": \"default\",\n      \"object\": \"Vehicle\",\n      \"type\": \"deleteRelationship\",\n      \"relationship\": {\n        \"fields\": {\n          \"OrderId__c\": \"Id\"\n        },\n        \"namespace\": \"com_zuora\",\n        \"object\": \"orders\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete a relationship for a custom field
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["actions": [
    [
      "namespace": "default",
      "object": "Vehicle",
      "type": "deleteRelationship",
      "relationship": [
        "fields": ["OrderId__c": "Id"],
        "namespace": "com_zuora",
        "object": "orders"
      ]
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://rest.test.zuora.com/objects/migrations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```