Lead Action

Manage your leads using the invocable action.

Leads must be enabled in your org. The user must have read and edit permissions for leads.

Supported REST HTTP Methods

URIs
Apply Lead Assignment Rules:
/services/data/vXX.X/actions/standard/invocableApplyLeadAssignmentRules
Formats
JSON, XML
HTTP Methods
GET, HEAD, POST
Authentication
Authorization: Bearer token
Other Information
Error Response Types

Apply Lead Assignment Rules

Run lead assignment rules on a collection of leads.

Available in API version 54.0.

URI: /services/data/vXX.X/actions/standard/invocableApplyLeadAssignmentRules

Table 1. Inputs
Input Details
LeadIds
Type
String Collection
Description
Required. A collection of lead IDs to run lead assignment rules for.
Sample Input

The following code runs lead assignment rules for two leads:

{"inputs": [ {
      "leadId" : "00QR00000006LE8OAM"
    },
    {
        "leadId" : "00QR00000006LEDOA2"
    }]
}
Sample Output

The following code sample illustrates a response when the action succeeds.

[ {
         "actionName" : "invocableApplyLeadAssignmentRules",
         "isSuccess" : true
         } ]

Error Response Types

Sales Engagement actions can respond with success or errors.

If any type of error occurs with an action, the isSuccess field is false.

This example illustrates an error caused when the user has insufficient access to leads when calling the Apply Lead Assignment Rules action.

[ {
  "actionName" : "invocableApplyLeadAssignmentRules",
  "errors" : [ {
    "statusCode" : "INSUFFICIENT_ACCESS_OR_READONLY",
    "message" : "Looks like you don't have access to this record. Your Salesforce admin can help with that.",
    "fields" : [ ]
  } ],
  "isSuccess" : false,
  "outputValues" : null
} ]

This example illustrates an error caused when the lead IDs passed to the Apply Lead Assignment Rules action are invalid.

[ {
  "actionName" : "invocableApplyLeadAssignmentRules",
  "errors" : [ {
    "statusCode" : "UNKNOWN_EXCEPTION",
    "message" : "Something's not right with one or more the specified LeadIds. Check the IDs and try again.",
    "fields" : [ ]
  } ],
  "isSuccess" : false,
  "outputValues" : null
} ]

This example illustrates an error caused when one of the leads passed to the Apply Lead Assignment Rules action has been deleted.

[ {
  "actionName" : "invocableApplyLeadAssignmentRules",
  "errors" : [ {
    "statusCode" : "ENTITY_IS_DELETED",
    "message" : "One or more of the specified LeadIds were deleted. Check the IDs and try again.",
    "fields" : [ ]
  } ],
  "isSuccess" : false,
  "outputValues" : null
} ]