Lead Action

Manage your leads by 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.

The Apply Lead Assignment Rules action can process up to 20 lead records at a time.

Available in API version 54.0.

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

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

Sample Input

This code runs lead assignment rules for two leads:

1{"inputs": [ {
2      "leadId" : "00QR00000006LE8OAM"
3    },
4    {
5        "leadId" : "00QR00000006LEDOA2"
6    }]
7}

Sample Output

This code sample illustrates a response when the action succeeds.

1[ {
2         "actionName" : "invocableApplyLeadAssignmentRules",
3         "isSuccess" : true
4         } ]

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.

1[ {
2  "actionName" : "invocableApplyLeadAssignmentRules",
3  "errors" : [ {
4    "statusCode" : "INSUFFICIENT_ACCESS_OR_READONLY",
5    "message" : "Looks like you don't have access to this record. Your Salesforce admin can help with that.",
6    "fields" : [ ]
7  } ],
8  "isSuccess" : false,
9  "outputValues" : null
10} ]

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

1[ {
2  "actionName" : "invocableApplyLeadAssignmentRules",
3  "errors" : [ {
4    "statusCode" : "UNKNOWN_EXCEPTION",
5    "message" : "Something's not right with one or more the specified LeadIds. Check the IDs and try again.",
6    "fields" : [ ]
7  } ],
8  "isSuccess" : false,
9  "outputValues" : null
10} ]

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

1[ {
2  "actionName" : "invocableApplyLeadAssignmentRules",
3  "errors" : [ {
4    "statusCode" : "ENTITY_IS_DELETED",
5    "message" : "One or more of the specified LeadIds were deleted. Check the IDs and try again.",
6    "fields" : [ ]
7  } ],
8  "isSuccess" : false,
9  "outputValues" : null
10} ]