Post Operation
Create individuals one at a time or in batches. Use the POST method to create
individuals in your org. You can create more than one individual at a time, but it’s an
all-or-none operation. If an error occurs while creating any individual’s record, no individuals
are created.
Individuals are created using a map of field names and field values. You include only the fields that must have values in your org. Here’s an example that creates two individuals with minimal information, using an org with the namespace clinic01.
Here’s the request body that defines the individuals to add. lastname is required here because it’s required by the Salesforce Contact object. Contact
is the parent object of an
individual.
It’s
a good practice to always include the individualtype__c
value Individual even though it’s the only type currently available.
If more types are created later, setting the type now saves you from having to modify your
code.
The complete response contains all the individual’s fields, including the ones we didn’t
set. The unset fields are omitted in this response for
brevity.
The
status code of 2 tells us that the create
operation was successful, and the message confirms it.