---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# LeadAPIProcessUtilOOB - Scoped

# LeadAPIProcessUtilOOB - Scoped {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 Minuten Lesedauer

The LeadAPIProcessUtilOOB script include provides methods that are called by the lead REST API to retrieve lead records and their associated lead line item records.

If you want to customize how lead records are retrieved when the [lead API](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-api "The lead API provides endpoints that enable you to create, update, and query/retrieve marketing leads and their associated lead line items from an instance.") methods are called, override the methods in this script include in the LeadAPIProcessUtil script include. The names of the methods that you are overriding in the
LeadAPIProcessUtil script include must be the same as those in the LeadAPIProcessUtilOOB script include file.

This API is provided within the `sn_lead_mgmt_core` namespace. To access the API, the Lead Management Data Model (sn_lead_mgmt_core) plugin must be activated on the instance, and the calling
user must have the sn_lead_mgmt_core.lead_integrator role.

For additional information on Lead Management, see [Using Lead Management](https://www.servicenow.com/docs/access?context=lead-management-using&version=australia&pubname=australia-order-management&ft:locale=en-US).

## LeadAPIProcessUtilOOB - processCreateLead (Object requestBody) {#ariaid-title2}

Processes the request body and creates a lead and all its associated line items, based on the passed parameters.
Records are inserted in the following tables:

* Lead \[sn_lead_mgmt_core_lead\]
* Lead Line Item \[sn_lead_mgmt_core_lead_line_item\]
{#LAPU-processCreateLead_O__table_sxx_crr_ydc__entry__3}

| Name | Type | Description |
|-|-|-|
| requestBody | Object | Request body of the lead and its related lead line items to create. For details on the contents of this object, see [lead - POST /sn_lead_mgmt_core/lead](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-POST-lead "Creates a lead record and its associated lead line items using the specified parameters."). |
[Tabelle : 1. Parameters]

{#LAPU-processCreateLead_O__table_sxx_crr_ydc} {#LAPU-processCreateLead_O__table_txx_crr_ydc__entry__2}

| Type | Description |
|-|-|
| JSON object | Details of the saved lead and lead line item records. Data type: Object { "body": {Object}, "status": "String" } |
| \<JSONobject\>.body | Response body. Successful response: All fields within the requested lead record and all fields in the associated lead line item records. For a description of the fields returned, refer to [lead - POST /sn_lead_mgmt_core/lead](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-POST-lead "Creates a lead record and its associated lead line items using the specified parameters."). Error response: List of errors detected when trying to process the request. These error messages are defined in the LeadAPIConstants script include. Data type: Object |
| \<JSONobject\>.status | Response status code. These status codes are defined in the LeadAPIConstants script include. Data type: String |
[Tabelle : 2. Returns]

{#LAPU-processCreateLead_O__table_txx_crr_ydc}  
The following code example shows where to add your custom code for the processCreateLead() method in the LeadAPIProcessUtil script include.

    var LeadAPIProcessUtil = Class.create(); 

    LeadAPIProcessUtil.prototype = Object.extendsObject(LeadAPIProcessUtilOOB, { 

    // Define overriding functions here 

    processCreateLead: function(requestBody) { 
    // Add your custom code 
    }, 

    type: 'LeadAPIProcessUtil' 

    }); 

## LeadAPIProcessUtilOOB - processGetAllLeads (Object queryParams, String requestUrl) {#ariaid-title3}

Retrieves all lead records and associated line item records based on the passed-in filter criteria. This method returns all fields within the associated records.
Record details are fetched from the following tables:

* Lead \[sn_lead_mgmt_core_lead\]
* Lead Line Item \[sn_lead_mgmt_core_lead_line_item\]
{#LAPU-processGetAllLeads_O_S__table_igt_klr_ydc__entry__3}

| Name | Type | Description |
|-|-|-|
| queryParams | Object | Object containing the query parameters to apply when retrieving the lead records. These are the query parameters passed in the [lead - GET /sn_lead_mgmt_core/lead](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-GET-lead "Retrieves all leads and associated lead line items based on the filter criteria passed in the query parameters.") endpoint. For example: { "sysparm_fields":["first_name,last_name,sys_id,lead_line_items"], "sysparm_query":["lead_type=new_business"], "sysparm_offset":["2"],"sysparm_limit":["25"] } |
| requestUrl | String | Request URL. Pass this URL when you are processing a paginated response so that the method has the links to all of the pages in the response. |
[Tabelle : 3. Parameters]

{#LAPU-processGetAllLeads_O_S__table_igt_klr_ydc} {#LAPU-processGetAllLeads_O_S__table_jgt_klr_ydc__entry__2}

| Type | Description |
|-|-|
| JSON object | Details of the requested lead and lead line item records. Data type: Object { "body": [Array], "contentRange": "String", "links": "String", "status": "String", "totalCount": "Number" } If an errors occur while processing the request, the JSON object only contains the `body` and `status` parameters. |
| \<JSONobject\>.body | Response body. Successful response: An array of objects with each object containing a lead record and all associated lead line item records. All fields within the requested lead record and all fields in the associated lead line item records are returned. For a description of the fields returned, refer to [lead - GET /sn_lead_mgmt_core/lead](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-GET-lead "Retrieves all leads and associated lead line items based on the filter criteria passed in the query parameters."). Error response: List of errors detected when trying to process the request. These error messages are defined in the LeadAPIConstants script include. Data type: Array of Objects |
| \<JSONobject\>.contentRange | Range of the content returned in a paginated call. For example: If offset=2 and limit=3, the value of this parameter is items 3-5. Data type: String |
| \<JSONobject\>.links | In the case of a paginated response, comma-separated links to each page contained in the response. For example: <https://servicenow-instance/api/sn_lead_mgmt_core/lead?sysparm_offset=0&sysparm_limit=20>;rel="self", <https://servicenow-instance/api/sn_lead_mgmt_core/lead?sysparm_offset=20&sysparm_limit=20>;rel="last", <https://servicenow-instance/api/sn_lead_mgmt_core/lead?sysparm_offset=20&sysparm_limit=20>;rel="next" Data type: String |
| \<JSONobject\>.status | Response status code. These status codes are defined in the LeadAPIConstants script include. Data type: String |
| \<JSONobject\>.totalCount | Total number of lead records returned by the method. Data type: Number (Integer) |
[Tabelle : 4. Returns]

{#LAPU-processGetAllLeads_O_S__table_jgt_klr_ydc}  
The following code example shows where to add your custom code for the processGetAllLeads() method in the LeadAPIProcessUtil script include.

    var LeadAPIProcessUtil = Class.create(); 

    LeadAPIProcessUtil.prototype = Object.extendsObject(LeadAPIProcessUtilOOB, { 

    // Define overriding functions here 

    processGetAllLeads: function(queryParams, requestUrl) { 
    // Add your custom code here 
    }, 

    type: 'LeadAPIProcessUtil' 
    }); 

## LeadAPIProcessUtilOOB - processGetLeadById (String id) {#ariaid-title4}

Retrieves the specified lead record and its associated line item records. This method returns all fields within the associated records.
Record details are fetched from the following tables:

* Lead \[sn_lead_mgmt_core_lead\]
* Lead Line Item \[sn_lead_mgmt_core_lead_line_item\]
{#LAPU-processGetLeadById_S__table_fvz_qcl_ydc__entry__3}

| Name | Type | Description |
|-|-|-|
| id | String | Sys_id of the lead record to retrieve. Table: Lead \[sn_lead_mgmt_core_lead\] |
[Tabelle : 5. Parameters]

{#LAPU-processGetLeadById_S__table_fvz_qcl_ydc} {#LAPU-processGetLeadById_S__table_gvz_qcl_ydc__entry__2}

| Type | Description |
|-|-|
| JSON object | Details of the requested lead and lead line item records. Data type: Object { "body": {Object}, "status": "String" } |
| \<JSONobject\>.body | Response body. Successful response: All fields within the requested lead record and all fields in the associated lead line item records. For a description of the fields returned, refer to [lead - GET /sn_lead_mgmt_core/lead/{sys_id}](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-GET-lead-sys_id "Returns the lead record and all associated lead line items for the specified sys_id."). Error response: List of errors detected when trying to process the request. These error messages are defined in the LeadAPIConstants script include. Data type: Object |
| \<JSONobject\>.status | Response status code. These status codes are defined in the LeadAPIConstants script include. Data type: String |
[Tabelle : 6. Returns]

{#LAPU-processGetLeadById_S__table_gvz_qcl_ydc}  
The following code example shows where to add your custom code for the processGetLeadById() method in the LeadAPIProcessUtil script include.

    var LeadAPIProcessUtil = Class.create(); 

    LeadAPIProcessUtil.prototype = Object.extendsObject(LeadAPIProcessUtilOOB, { 

    // Define overriding functions here

    processGetLeadById: function(id) { 
      // Add your custom code here
    }, 

    type: 'LeadAPIProcessUtil' 

    }); 

## LeadAPIProcessUtilOOB - processUpdateLead (Object requestBody, String id) {#ariaid-title5}

Processes the request body and updates the specified lead and all its associated line items, based on the passed parameters.
Records are updated in the following tables:

* Lead \[sn_lead_mgmt_core_lead\]
* Lead Line Item \[sn_lead_mgmt_core_lead_line_item\]
{#LAPU-processUpdateLead_O_S__table_n24_k5r_ydc__entry__3}

| Name | Type | Description |
|-|-|-|
| requestBody | Object | Request body of the lead and its related lead line item fields to update. For details on the contents of this object, see [lead - PATCH /sn_lead_mgmt_core/lead/{sys_id}](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-PATCH-lead "Updates the specified lead record and its associated lead line items. You can also use this endpoint to associate new lead line items to the specified lead."). |
| id | String | Sys_id of the lead record to update. Table: Lead \[sn_lead_mgmt_core_lead\] |
[Tabelle : 7. Parameters]

{#LAPU-processUpdateLead_O_S__table_n24_k5r_ydc} {#LAPU-processUpdateLead_O_S__table_o24_k5r_ydc__entry__2}

| Type | Description |
|-|-|
| JSON object | Details of the saved lead and lead line item records. Data type: Object { "body": {Object}, "status": "String" } |
| \<JSONobject\>.body | Response body. Successful response: All fields of the updated lead record and all fields in the associated lead line item records (updated or not). For a description of the fields returned, refer to [lead - PATCH /sn_lead_mgmt_core/lead/{sys_id}](https://servicenow-prod.fluidtopics.net/4bJYXCKwJzhif2R4nVedyg#lead-PATCH-lead "Updates the specified lead record and its associated lead line items. You can also use this endpoint to associate new lead line items to the specified lead."). Error response: List of errors detected when trying to process the request. These error messages are defined in the LeadAPIConstants script include. Data type: Object |
| \<JSONobject\>.status | Response status code. These status codes are defined in the LeadAPIConstants script include. Data type: String |
[Tabelle : 8. Returns]

{#LAPU-processUpdateLead_O_S__table_o24_k5r_ydc}  
The following code example shows where to add your custom code for the processUpdateLead() method in the LeadAPIProcessUtil script include.

    var LeadAPIProcessUtil = Class.create();

    LeadAPIProcessUtil.prototype = Object.extendsObject(LeadAPIProcessUtilOOB, {

    // Define overriding functions here 

    processUpdateLead: function(requestBody, id) { 
    // Add your custom code here
    },

    type: 'LeadAPIProcessUtil' 

    }); 


