Create a custom object record
client.object.create(stringentitySlug, ObjectCreateParams { fields, relationships } body, RequestOptionsoptions?): ObjectCreateResponse { id, createdAt, fields, 4 more }
POST/v1/objects/{entitySlug}/values
Creates a new record for the specified custom object type.
Create a custom object record
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const objectCreateResponse = await client.object.create('entitySlug', {
fields: { foo: 'string' },
});
console.log(objectCreateResponse.id);{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}