I'm trying to execute the following compositeRequest but I'm getting the error.

  "allOrNone": true,
  "compositeRequest": [
      "method": "GET",
      "url": "/services/data/v46.0/query/?q=SELECT+id,Name+FROM+Contact+WHERE+Email+=+'test@gmail.com'",
      "referenceId": "refContactData"
      "method": "PATCH",
      "url": "/services/data/v46.0/sobjects/Case/5005O000000s7XXXX",
      "referenceId": "refCase",
      "body": {
        "ContactId": "@{refContactData.records[0].id}"

Second is getting failed and it is throwing an error.


            "body": [
                    "errorCode": "PROCESSING_HALTED",
                    "message": "Invalid reference specified. No value for refContactData.records[0].id found in refContactData"
            "httpHeaders": {},
            "httpStatusCode": 400,
            "referenceId": "refCase"

Kindly please let me know If I have missed any componet.

  • Based on the email I have verified that contact is available in my org. – Ramesh S Sep 17 at 12:32

You have a capitalization error:


In the response body to a Query REST call, each record contains a field called Id, not id:

  "records" : [ {
    "attributes" : {
      "type" : "Contact",
      "url" : "/services/data/v46.0/sobjects/Contact/0031R000025XXXXQAA"
    "Id" : "0031R000025XXXXQAA"

I was able to execute a composite request analogous to yours simply by using

  • David Reed, It is working fine. Thank you. – Ramesh S Sep 18 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.