REST API Developer Guide
Summer '26 (API version 67.0)
Spring '26 (API version 66.0)
Winter '26 (API version 65.0)
Summer '25 (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Spring '21 (API version 51.0)
Winter '21 (API version 50.0)
Summer '20 (API version 49.0)
Spring '20 (API version 48.0)
Winter '20 (API version 47.0)
Summer '19 (API version 46.0)
Spring '19 (API version 45.0)
Winter '19 (API version 44.0)
Summer '18 (API version 43.0)
Spring '18 (API version 42.0)
Winter '18 (API version 41.0)
Summer '17 (API version 40.0)
Spring '17 (API version 39.0)
Winter '17 (API version 38.0)
Summer '16 (API version 37.0)
Spring '16 (API version 36.0)
Winter '16 (API version 35.0)
Summer '15 (API version 34.0)
Spring '15 (API version 33.0)
Winter '15 (API version 32.0)
Spring '14 (API version 30.0)
Create a Record
Update a Record
Delete a Record
Get Field Values from a Standard Object Record
Get Field Values from an External Object Record by Using the Salesforce ID
Get Field Values from an External Object Record by Using the External ID Standard Field
Retrieve a Record Using an External ID
Insert or Update (Upsert) a Record Using an External ID
Traverse Relationships with Friendly URLs
Get Attachment Content from a Record
Get a List of Deleted Records Within a Given Timeframe
Get a List of Updated Records Within a Given Timeframe
Delete Lightning Experience Event Series
Insert or Update Blob Data
Newer Version Available
Working with Records
The examples in this section use REST API resources to create, retrieve, update, and
delete records, along with other record-related operations.
-
Create a Record
Use the SObject Basic Information resource to create new records. You supply the required field values in the request data, and then use the POST method of the resource. The response body will contain the ID of the created record if the call is successful. -
Update a Record
You use the *** resource to update records. Provide the updated record information in your request data and use the PATCH method of the resource with a specific record ID to update that record. Records in a single file must be of the same object type. -
Delete a Record
Use the SObject Rows resource to delete records. Specify the record ID and use the DELETE method of the resource to delete a record. -
Get Field Values from a Standard Object Record
You use the SObject Rows resource to retrieve field values from a record. Specify the fields you want to retrieve in the fields parameter and use the GET method of the resource. -
Get Field Values from an External Object Record by Using the Salesforce ID
You use the SObject Rows resource to retrieve field values from a record. Specify the fields you want to retrieve in the fields parameter and use the GET method of the resource. -
Get Field Values from an External Object Record by Using the External ID Standard Field
You use the SObject Rows resource to retrieve field values from a record. Specify the fields you want to retrieve in the fields parameter and use the GET method of the resource. -
Retrieve a Record Using an External ID
You can use the GET method of the SObject Rows by External ID resource to retrieve records with a specific external ID. -
Insert or Update (Upsert) a Record Using an External ID
You can use the *** resource to create records or update existing records (upsert) based on the value of a specified external ID field. -
Traverse Relationships with Friendly URLs
You can traverse relationship fields in objects by constructing friendly URLs via the SObject Relationship resource. This approach allows you to directly access records associated with relationships. Using friendly URLs is easier than accessing records by obtaining object IDs from relationship fields and then inspecting the associated object ID record. -
Get Attachment Content from a Record
Use the SObject Blob Retrieve resource to retrieve blob data for a given record. -
Get a List of Deleted Records Within a Given Timeframe
Use the SObject Get Deleted resource to get a list of deleted records for the specified object. Specify the date and time range within which the records for the given object were deleted. Deleted records are written to a delete log (that is periodically purged), and will be filtered out of most operations, such as SObject Rows or Query (although QueryAll will include deleted records in results). -
Get a List of Updated Records Within a Given Timeframe
Use the SObject Get Updated resource to get a list of updated (modified or added) records for the specified object. Specify the date and time range within which the records for the given object were updated.