---
schema_version: "1"
id: 1efb89abfb12e903f485854683d1abe7705ddda51a34bba3f40e3f3d2254090f
title: Update Records Using sObject Relationships
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/api-rest/guides/resources/resources-sobject-relationships-patch.md
canonical_url: https://developer.salesforce.com/docs/platform/api-rest/guide/resources-sobject-relationships-patch.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 557f04f7a75d69d57e55b1c0b5b906ee252596124ebd230ccf2a6fc0c0e4e907
products:
  - REST API Developer Guide
  - Platform Developer Content
---

# Update Records Using sObject Relationships

Updates a parent record based on the specified object, record ID, and relationship field name. Field values provided in the request body replace the existing values in the record. Only a child-to-parent relationship can be traversed when you update records.

If the `fields` parameter is used with fields that don’t exist or aren’t visible to the consumer by field-level security, a 400 error response is returned. For other error messages, see [Status Codes and Error Responses](https://developer.salesforce.com/docs/platform/api-rest/guide/errorcodes.md).

## Syntax

**URI:** `/services/data/vXX.X/sobjects/sObject/id/relationshipFieldName`

**Formats:** JSON, XML

**HTTP Method:** PATCH

**Authentication:** `Authorization: Bearer token`

**Parameters**

|Parameter|Description|
|---------|-----------|
|`sObject`|The name of the object. For example, `Contact`.|
|`id`|The identifier of the record. For example, `003R0000005hDFYIA2`, the contact ID.|
|`relationshipFieldName`|The name of the field that contains the relationship. For example, `Account`. Account is the name of the relationship on the child Contact object.|

## Example

For an example of updating a record using PATCH, see

[Update a Record](https://developer.salesforce.com/docs/platform/api-rest/do-me/dome-update-fields.md).

**See Also**  


-   [Object Reference for the Salesforce Platform](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/)

