Create Object
1 min
POST
https://api.nue.io/api/objects/{objectName}
Path Parameters
- objectNamestringrequiredDescriptionAllowedCustomer
Body Parameters
- bodyCustomerCreateRequestrequiredExamplesCreate Customer (Minimal):
{ "name": "Acme Corporation", "recordType": "Business" }Create Customer (Full):{ "name": "Acme Corporation", "recordType": "Business", "accountNumber": "ACC-12345", "email": "[email protected]", "phone": "+1-555-1234", "industry": "Technology", "billingStreet": "123 Main St", "billingCity": "San Francisco", "billingState": "CA", "billingCountry": "USA", "billingPostalCode": "94102", "billCycleDay": "15", "paymentTerm": "NET30" }Description- namestringrequiredExampleDescription
- recordTypestringExampleDescription
- accountNumberstringDescription
- emailstringDescription
- phonestringDescription
- industrystringDescription
- billingStreetstringDescription
- billingCitystringDescription
- billingStatestringDescription
- billingPostalCodestringDescription
- billingCountrystringDescription
- shippingStreetstringDescription
- shippingCitystringDescription
- shippingStatestringDescription
- shippingPostalCodestringDescription
- shippingCountrystringDescription
- billCycleDaystringDescription
- paymentTermstringDescription
- paymentMethodstringDescription
- descriptionstringDescription
Responses
201
- CreateObjectResponseDescription
- idstringExampleDescription
400
- ErrorResponseDescription
- codeintegerExampleDescription
- messagestringExampleDescription
- detailsstringExampleDescription
401
403
404
curl
curl --request POST \
--url https://api.nue.io/api/objects/{objectName} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"name": "Acme Corporation"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"name": "Acme Corporation"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.nue.io/api/objects/{objectName}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.nue.io/api/objects/{objectName}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"name": "Acme Corporation"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.nue.io/api/objects/{objectName}"
payload = json.dumps({
"name": "Acme Corporation"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
201
// Object created successfully
{
"id": "001D000000IRFmaIAH"
}400
// Bad Request - Invalid data or missing required fields
{
"code": 400,
"message": "Bad Request",
"details": "Required field 'name' is missing"
}401
// Unauthorized - Invalid or missing API key
403
// Forbidden - Insufficient permissions
404
// Not Found - Object type not found in metadata