Newer Version Available
sObject Rows
Accesses records based on the specified object ID. Retrieves, updates, or deletes records. This resource can also be used to retrieve field values. Use the GET method to retrieve records or fields, the DELETE method to delete records, and the PATCH method to update records.
To create new records, use the sObject Basic Information resource.
- URI
- /services/data/vXX.X/sobjects/sObject/id/
- Formats
- JSON, XML
- HTTP Method
- GET, PATCH, DELETE
- Authentication
- Authorization: Bearer token
- Parameters
-
Parameter Description Content-Type An optional header, which can only be used with PATCH, specifying the format for the request and response. Possible choices are:- Content-Type: application/json
- Content-Type: application/xml
sObject The name of the object. For example, Account.
A required path parameter for all methods (GET, PATCH, and DELETE).
id The identifier of the object. For example, 001R0000005hDFYIA2.
A required path parameter for all methods (GET, PATCH, and DELETE).
fields A comma-delimited list of fields to get values for. For example, ?fields=name,description,numberofemployees,industry.
An optional query parameter that can only be used with GET.
If-Match An optional header specifying a comma-delimited list of one or more ETags. This only has an effect when used with Account objects. The request is only processed if the Account’s ETag matches one of the ETags in the list. For example: If-Match: "94C83JSreaVMGpL+lUzv8Dr3inI0kCvuKATVJcTuApA=--gzip", "ddpAdaTHz+GcV35e7NLJ9iKD3XXVqAzXT1Sl2ykkP7g=--gzip".
If-None-Match An optional header specifying a comma-delimited list of one or more ETags. This only has an effect when used with Account objects. The request is only processed if the Account’s ETag does not match one of the ETags in the list. For example: If-None-Match: "94C83JSreaVMGpL+lUzv8Dr3inI0kCvuKATVJcTuApA=--gzip", "ddpAdaTHz+GcV35e7NLJ9iKD3XXVqAzXT1Sl2ykkP7g=--gzip".
If-Modified-Since An optional header specifying a date and time. The request returns records that have been modified after that date and time.
The format is EEE, dd MMM yyyy HH:mm:ss z
For example: If-Modified-Since: Mon, 30 Nov 2020 08:34:54 MST.
If-Unmodified-Since An optional header specifying a date and time. The request returns records that have not been modified after that date and time.
The format is EEE, dd MMM yyyy HH:mm:ss z
For example: If-Unmodified-Since: Mon, 30 Nov 2020 08:34:54 MST.
- Usage
- This resource can be used with external objects in API version 32.0 and
later.
External objects that are associated with non-high-data-volume external data sources use the 18-character Salesforce ID for the id. Otherwise, external objects use the External ID standard field of the external object for the id.
For information about the items in the response body, see DescribeSObjectResult in the SOAP API Developer’s Guide.
If the object is an Account object, the response also contains an ETag header. For example: ETag: "ddpAdaTHz+GcV35e7NLJ9iKD3XXVqAzXT1Sl2ykkP7g=--gzip" This ETag can be used with the If-Match and If-None-Match headers. For more information, see Using Conditional Requests.
- Examples
-
- For examples of retrieving field values using GET, see:
- For an example of updating a record using PATCH, see Update a Record.
- For an example of deleting a record using DELETE, see Delete a Record.
- For an example of updating the blob data for an object, see Insert or Update Blob Data.