With a few exceptions, most API Entities support a basic set of CRUD (create, read, update, delete) actions, along with some metadata actions to retrieve information about the structure of the entity.
The easiest way to see which actions are available for each entity is to browse the API Explorer, which shows all available entities, their actions, and the parameters for each action.
Most entities support the following actions:
Check if current user is authorized to perform a specified action on a given record.
Returns a list of actions avaiable for a given entity.
Search for records based on query parameters. For most entities,
getincludes advanced features such as joins.
Used to populate EntityReference autocomplete results, this action calls
SearchDisplay::runwhich in turn calls the
Available only for Managed Entity types, outputs code which can be used to package and distribute a record in an extension.
Insert a single new record into the database.
Update one or more existing records with new values. If an
idis not supplied, then query params are required to search for records to update.
Given an array of records, either
updateeach one. By default the presence of an
iddetermines whether an existing record will be updated. The
matchparam gives finer control over this, and lets you specify one or more fields; if a single existing record matches all of them, it will be updated instead of a new record created. For example you can
savean array of contacts and specify
matchparam, which will update contacts with matching
Delete one or more records based on query parameters. Some entities, including
Contact, implement "Soft Delete", in which case the
deleteaction's default behavior is to give records an intermediate "trashed" status. For these entities, set
useTrash = FALSEto delete records permanently.
Replace an existing set of records with a new or modified set of records. For example, replace a group of
Phonenumbers for a given
Replace includes an implicit delete action - use with care & test well before using in production.
Available only for Managed Entity types, resets a record to its original packaged state.