> For a complete page index, fetch https://developer.close.com/llms.txt # Create a new Custom Object instance POST https://api.close.com/api/v1/custom_object/ Content-Type: application/json Custom Field values can be set using the format: `custom.{custom_field_id}`. See [Custom Fields](https://developer.close.com/api/resources/custom-fields/custom-fields-custom-object). The following fields are required: * `custom_object_type_id`: The type of Custom Object you are creating determines the Custom Fields that can be used. * `lead_id`: The Lead that this Custom Object instance will belong to. * `name`: Each Custom Object has a name, used for display. Reference: https://developer.close.com/api/resources/custom-objects/create ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Body (application/json) This endpoint expects an any. - `any` ## Response ### 201 Successful response ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Examples **Request** ```json { "custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S": [ "Conference", "Meeting" ], "custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g": "Software", "custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf": "custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he", "custom_object_type_id": "cotype_1h5m6uHM9BZOpwVhyRJb4Y", "lead_id": "lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T", "name": "Resource" } ``` **Response** ```json { "created_by": "user_Ova4RGFG7pztSeJiiMFdN7O2MFl71nD0uGO3bIOo4Wk", "custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S": [ "Conference", "Meeting" ], "custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g": "Software", "custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf": "custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he", "custom_object_type_id": "cotype_1h5m6uHM9BZOpwVhyRJb4Y", "date_created": "2020-08-04T16:45:35.367000+00:00", "date_updated": "2020-08-04T17:37:56.439000+00:00", "id": "custobj_5J7mimiIKB1tQ3gVduP0c4UhXbNj5ptMLteAWRJu7Sf", "lead_id": "lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T", "name": "Resource", "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "updated_by": "user_Ova4RGFG7pztSeJiiMFdN7O2MFl71nD0uGO3bIOo4Wk" } ``` **SDK Code** ```python import requests url = "https://api.close.com/api/v1/custom_object/" payload = { "custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S": ["Conference", "Meeting"], "custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g": "Software", "custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf": "custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he", "custom_object_type_id": "cotype_1h5m6uHM9BZOpwVhyRJb4Y", "lead_id": "lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T", "name": "Resource" } headers = { "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://api.close.com/api/v1/custom_object/'; const credentials = btoa(":"); const options = { method: 'POST', headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'}, body: '{"custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S":["Conference","Meeting"],"custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g":"Software","custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf":"custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he","custom_object_type_id":"cotype_1h5m6uHM9BZOpwVhyRJb4Y","lead_id":"lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T","name":"Resource"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/custom_object/" payload := strings.NewReader("{\n \"custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S\": [\n \"Conference\",\n \"Meeting\"\n ],\n \"custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g\": \"Software\",\n \"custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf\": \"custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he\",\n \"custom_object_type_id\": \"cotype_1h5m6uHM9BZOpwVhyRJb4Y\",\n \"lead_id\": \"lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T\",\n \"name\": \"Resource\"\n}") req, _ := http.NewRequest("POST", url, payload) req.SetBasicAuth("", "") 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 require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/custom_object/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{\n \"custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S\": [\n \"Conference\",\n \"Meeting\"\n ],\n \"custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g\": \"Software\",\n \"custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf\": \"custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he\",\n \"custom_object_type_id\": \"cotype_1h5m6uHM9BZOpwVhyRJb4Y\",\n \"lead_id\": \"lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T\",\n \"name\": \"Resource\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.close.com/api/v1/custom_object/") .basicAuth("", "") .header("Content-Type", "application/json") .body("{\n \"custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S\": [\n \"Conference\",\n \"Meeting\"\n ],\n \"custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g\": \"Software\",\n \"custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf\": \"custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he\",\n \"custom_object_type_id\": \"cotype_1h5m6uHM9BZOpwVhyRJb4Y\",\n \"lead_id\": \"lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T\",\n \"name\": \"Resource\"\n}") .asString(); ``` ```php request('POST', 'https://api.close.com/api/v1/custom_object/', [ 'body' => '{ "custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S": [ "Conference", "Meeting" ], "custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g": "Software", "custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf": "custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he", "custom_object_type_id": "cotype_1h5m6uHM9BZOpwVhyRJb4Y", "lead_id": "lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T", "name": "Resource" }', 'headers' => [ 'Content-Type' => 'application/json', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/custom_object/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"custom.cf_UpyNBvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jg64S\": [\n \"Conference\",\n \"Meeting\"\n ],\n \"custom.cf_cSh3fWT3rEJ1BFSezme2YAG6bPrZV5wUWKKrW4iN19g\": \"Software\",\n \"custom.cf_jnxTQDKnSxCEBtD5dvZdNgTzC3CqeyWUyU349PBA9Wf\": \"custobj_v0VS1AZAg8LjnpBm1hZz83UZ3yWK0n9SdVV5i8yC6he\",\n \"custom_object_type_id\": \"cotype_1h5m6uHM9BZOpwVhyRJb4Y\",\n \"lead_id\": \"lead_hwnL36A2iEMSLIlmGhsdrcmOJzTUzqEHwr66wrA1K2T\",\n \"name\": \"Resource\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ```