Salesforce

Update Salesforce Case Status

Changes the status of an existing case.

Unverified

Add this first. This tool needs an access token, so add Get Salesforce Access Token to the same bot. The bot calls it first and passes the token in.

What the model is told

Get a Salesforce access token first if you do not already have one. Change the status of a case, for example to Closed when the customer says the problem is solved. You need the case record ID, so use Get Salesforce Case by Number first. Confirm the change with the customer. A successful update returns no content.

Request

PATCHhttps://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/sobjects/Case/{{caseId}}

Headers

  • Content-Typeapplication/json
  • AuthorizationBearer {{accessToken}}

Body

{
  "Status": "{{status}}"
}

Parameters

  • caseId stringThe Salesforce record ID of the case, from Get Salesforce Case by Number.
  • status stringThe new status. It must match a value in your org, such as Working, Escalated or Closed.
  • accessToken stringThe access_token value returned by Get Salesforce Access Token. Reuse it for the rest of the conversation.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "e54d3991-9100-4dde-b55a-198ea6218711",
    "type": "HTTP_REQUEST",
    "label": "Update Salesforce Case Status",
    "name": "update_salesforce_case_status",
    "customName": false,
    "description": "Get a Salesforce access token first if you do not already have one. Change the status of a case, for example to Closed when the customer says the problem is solved. You need the case record ID, so use Get Salesforce Case by Number first. Confirm the change with the customer. A successful update returns no content.",
    "parameters": [
      {
        "name": "caseId",
        "type": "string",
        "description": "The Salesforce record ID of the case, from Get Salesforce Case by Number."
      },
      {
        "name": "status",
        "type": "string",
        "description": "The new status. It must match a value in your org, such as Working, Escalated or Closed."
      },
      {
        "name": "accessToken",
        "type": "string",
        "description": "The access_token value returned by Get Salesforce Access Token. Reuse it for the rest of the conversation."
      }
    ],
    "config": {
      "endpoint": {
        "method": "PATCH",
        "url": "https://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/sobjects/Case/{{caseId}}"
      },
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{accessToken}}"
        }
      ],
      "body": "{\n  \"Status\": \"{{status}}\"\n}",
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.