--- title: lead API description: 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.Retrieves all leads and associated lead line items based on the filter criteria passed in the query parameters.Returns the lead record and all associated lead line items for the specified sys\_id.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.Creates a lead record and its associated lead line items using the specified parameters. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/rest-apis/lead-api.html release: australia product: REST APIs classification: rest-apis topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 64 breadcrumb: [REST API reference, API reference, API implementation and reference] --- # 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. Use this API to integrate your instance with external websites and systems such as automated lead capture systems, or to provide lead information to external reporting systems. 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://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/order-management/lead-management-using.md). ## Extending the Lead API You can extend the lead API by overriding the methods in its associated script includes. The default API functionality is located in script includes ending in "OOB", such as LeadAPIProcessUtilOOB. To override this functionality, create methods with identical names and parameters in the script include that has the same file name, but doesn't end in "OOB", such as LeadAPIProcessUtil. The following is a list of the script includes that you can override to change the behavior of the lead API: - [LeadAPIProcessUtilOOB](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadAPIProcessUtilOOBAPI.md): Contains methods that handle the retrieval and creation of lead and lead line item records. - [LeadApiValidationUtilOOB](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadAPIValidationUtilOOBAPI.md): Contains methods that validate the JSON request object for the POST and PATCH endpoints. - [LeadAPIHelperOOB](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadAPIHelperOOBAPI.md): Contains API helper methods that: - Return an array of leads and related lead line items. - Return a JSON object from the associated GlideRecord. - Remove all ignored fields from a JSON object and perform other transformations. - LeadAPIConstantsOOB: Contains constants, status codes, and messages for all API operations. It also includes the list of fields that are ignored by the POST and PATCH endpoints. **Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md) ## lead - GET /sn\_lead\_mgmt\_core/lead Retrieves all leads and associated lead line items based on the filter criteria passed in the query parameters. This endpoint returns a paginated response as per the specified limit and offset. It retrieves information from the following tables: - Lead \[sn\_lead\_mgmt\_core\_lead\] - Lead Line Item \[sn\_lead\_mgmt\_core\_lead\_line\_item\] ### URL format Versioned URL: `/api/sn_lead_mgmt_core/{api_version}/lead` Default URL: `/api/sn_lead_mgmt_core/{api_version}/lead` **Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md). ### Supported request parameters
Name Description
api\_version Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name Description
sysparm\_fields Comma-separated list of fields to return in the response. Invalid fields are ignored.Data type: String Default: Return all fields.
sysparm\_limit Maximum number of records to return. For requests that exceed this number of records, use the **sysparm\_offset** parameter to paginate record retrieval. This limit is applied before ACL evaluation. If no records return, including records you have access to, rearrange the record order so records you have access to return first. **Note:** Unusually large **sysparm\_limit** values can impact system performance. Data type: Number Default: 10000
sysparm\_offset Starting record index for which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks. For example, the first time you call this endpoint, **sysparm\_offset** is set to "0". To simply page through all available records, use `sysparm_offset=sysparm_offset+sysparm_limit`, until you reach the end of all records. Don't pass a negative number in the **sysparm\_offset** parameter.Data type: Number Default: 0
sysparm\_query Encoded query used to filter the result set.For example: `(sysparm_query=caller_id=javascript:gs.getUserID()^active=true)` The encoded query supports order by. To sort responses based on certain fields, use the ORDERBY and ORDERBYDESC clauses in **sysparm\_query**. For example, `sysparm_query=active=true^ORDERBYnumber^ORDERBYDESCcategory` filters all active records and orders the results in ascending order by number first, and then in descending order by category. If part of the query is invalid, such as by specifying an invalid field name, the instance ignores the invalid part. It then returns rows using only the valid portion of the query. You can control this behavior using the property **glide.invalid\_query.returns\_no\_rows**. Set this property to true to return no rows on an invalid query. **Note:** The **glide.invalid\_query.returns\_no\_rows** property controls the behavior of all queries across the instance, such as in lists, scripts \(GlideRecord.query\(\)\), and web service APIs. Data type: String
|Name|Description| |----|-----------| |None| | ### Headers The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md). |Header|Description| |------|-----------| |Content-Type|Data format of the request body. Only supports **application/json**.|
Header Description
Accept Data format of the response body. Only supports **application/json**.
Content-Range Range of content returned in a paginated call. For example, if offset=2 and limit=3, the value of the Content-Range header is items 3-5.
Links Links through which to navigate the query results: - first - last - next - previous - self
Total-Count Total number of filtered records.
### Status codes The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).
Status code Description
200 Request was successfully processed. All responses returned \(no pagination\).
206 Request successfully processed. Partial resource returned in response \(with pagination\).
400 Error. Possible reasons:- Invalid limit/limit greater than maximum allowed. - Invalid offset.
403 Record denied access. Insufficient permission to query the record.
404 Not found. The requested item wasn't found.
500 Internal server error. An unexpected error occurred while processing the request.
### Response body parameters
Name Description
account Account linked to the lead.Data type: Object ``` "account": { "name": "String", "sys_id": "String" } ```
account.name Name of the account.Data type: String
account.sys\_id Sys\_id of the associated account record. Data type: String Table: Account \[customer\_account\]
business\_phone Lead's business phone number.Data type: String
city City in which the lead resides.Data type: String
closed\_date Date and time when the lead was closed.Data type: Object ``` "closed_date": { "display_value": "String", "value": "String" } ```
closed\_date.​display\_value Date and time as displayed in the UI. Data type: String Format: User's format and time zone.
closed\_date.value Date and time that the lead closed as defined in the associated record.Data type: String Format: UTC
company Lead's company name.Data type: String
consumer Consumer associated with the lead.Data type: Object ``` "consumer": { "name": "String", "sys_id": "String" } ```
consumer.name Name of the associated consumer.Data type: String
consumer.sys\_id Sys\_id of the associated consumer record. Data type: String Table: Consumer \[csm\_consumer\]
contact Contact associated with the lead account.Data type: Object ``` "contact": { "name": "String", "sys_id": "String" } ```
contact.name Contact's name.Data type: String
contact.sys\_id Sys\_id of the associated contact record. Data type: String Table: Contact \[customer\_contact\]
country Country in which the lead resides.Data type: String
do\_not\_call Flag that indicates whether the mode of communication is by phone. Valid values: - true: Can call contact. - false: Don't call contact. Data type: Boolean
do\_not\_email Flag that indicates whether the mode of communication is by email. Valid values: - true: Can email contact. - false: Don't email contact. Data type: Boolean
do\_not\_share Flag that indicates whether the lead details can be shared. Valid values: - true: Lead details can be shared. - false: Lead details can't be shared. Data type: Boolean
email Lead's email address.Data type: String
external\_id ID used by the system that generated the lead to identify the lead in the associated system.Data type: String
external\_system Name of the external system associated with the lead, such as HubSpot or pipedrive.Data type: String
first\_name First name of the contact associated with the lead.Data type: String
industry Industry to which the lead belongs.Data type: String Table: Located in the **industry** field of the Account \[customer\_account\] table.
last\_name Last name of the contact associated with the lead. Data type: String
lead\_group Group to which the lead belongs. Data type: Object ``` "lead_group": { "name: "String", "sys_id": "String" } ```
lead\_group.name Lead group's name.Data type: String
lead\_group.sys\_id Sys\_id of the lead group record.Data type: String Table: Group \[sys\_user\_group\]
lead\_line\_items Details of the lead line items associated with the lead.Data type: Array of Objects ``` "lead_line_items": [ { "external_id": "String", "external_system": "String", "lead": {Object}, "number": "String", "product_offering": {Object}, "quantity": Number, "sys_created_by”: "String", "sys_created_on {Object}, "sys_domain": "String", "sys_domain_path": "String", "sys_id": "String", "sys_mod_count": Number, "sys_tags": [Array], "sys_updated_by: "String", "sys_updated_on: {Object}, "unit_of_measurement": {Object}, "work_notes": [Array] } ] ```
lead\_line\_items.​external\_id ID used by the system that generated the lead line item to identify the line item in the associated system.Data type: String
lead\_line\_items.​external\_system Name of the external system associated with the lead line item, such as HubSpot or pipedrive.Data type: String
lead\_line\_items.​lead Details about the lead associated with the line item.Data type: Object ``` "lead: { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​lead.name Associated lead's name.Data type: String
lead\_line\_items.​lead.sys\_id Sys\_id of the associated lead record.Data type: String
lead\_line\_items.​number Unique system-generated number of the lead line item record.Data type: String
lead\_line\_items.​product\_offering Information about the product offering associated with the lead line item.Data type: Object ``` "product_offering": { "code": " String", "name": "String", "sys_id": "String" } ```
lead\_line\_items.​product\_offering.code Code linked to the product offering. **Note:** This is a system-generated alphanumeric number based on the product name. Although system generated, you can edit the code to represent a SKU or any other industry specific product codes. Data type: String
lead\_line\_items.​product\_offering.name Product offering's name.Data type: String
lead\_line\_items.​product\_offering.sys\_id Sys\_id of the product offering record associated with the lead line item. Data type: String Table: Product Offering \[sn\_prd\_pm\_product\_offering\]
lead\_line\_items.​quantity Quantity of items the lead wants to purchase of the associated product offering. Data type: Number \(Integer\)
lead\_line\_items.​sys\_created\_by User name of the person that created the lead line item.Data type: String
lead\_line\_items.​sys\_created\_on System-generated date and time that the lead line item was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_created\_on.display\_value Date and time that the lead line item was created.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_created\_on.value Date and time that the lead line item was created.Data type: String Format: UTC
lead\_line\_items.​sys\_domain Sys\_id of the domain record to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.sys\_domain\_path Path of the domain to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.​sys\_id Sys\_id of the lead line item record.Data type: String
lead\_line\_items.​sys\_mod\_count Number of times the associated lead line item record has been modified.Data type: Number \(Integer\)
lead\_line\_items.​sys\_tags List of system tags associated with the lead line item.Data type: Array
lead\_line\_items.​sys\_updated\_by User name of the person that last updated the associated lead line item.Data type: String
lead\_line\_items.​sys\_updated\_on System-generated date and time when the lead line item was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_updated\_on.​display\_value Date and time that the lead line item was last updated.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_updated\_on.​value Date and time that the lead line item was last updated.Data type: String Format: UTC
lead\_line\_items.​unit\_of\_measurement Details of the measuring unit of lead line item. Data type: Object ``` "unit_of_measurement": { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​unit\_of\_measurement.​name Name of the measuring unit such as, each or cubic foot.Data type: String
lead\_line\_items.​unit\_of\_measurement.​sys\_id Sys\_id of the record that describes the measuring unit.Data type: String Table: Unit of Measure \[sn\_prd\_pm\_uom\]
lead\_line\_items.​work\_notes List that describes the work notes created for the lead line item. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
lead\_line\_items.​work\_notes.​author User name of the person that authored the associated work note.Data type: String
lead\_line\_items.​work\_notes.​date Date that the note was created.Data type: String
lead\_line\_items.​work\_notes.​text Text of the note made by the author.Data type: String
lead\_rating Rating for the lead such as, 100\_cold, 200\_warm, 300\_hot, or 400\_super\_hot.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_rating field of the Leads table. Data type: String
lead\_score Score for the lead.Data type: Decimal Range: 1 to 100
lead\_source Originator of the lead.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_source field of the Leads table. Data type: String
lead\_type Type of lead, such as New Business or Existing Business. **Note:** This is a choice field. It must contain one of the choice items defined in the lead\_type field of the Leads table. Data type: String
middle\_name Middle name of the contact for the lead.Data type: String
mobile\_phone Phone number of the contact for the lead.Data type: String
number Unique system-generated number of the lead record.Data type: String
other\_reason Additional reason for the lead disqualification.Data type: String Max length: 160 characters
owner Details of the person associated with the lead. Data type: Object ``` "owner": { "name": "String", "sys_id": "String" } ```
owner.name Name of the person that owns the lead.Data type: String
owner.sys\_id Sys\_id of the user record of the person that owns the lead.Data type: String Table: User \[sys\_user\]
reason Reason for the lead disqualification such as, Disqualify.Data type: String Max length: 40 characters
short\_description Short description of the lead.Data type: String Max length: 160 characters
similar\_lead Details on any similar lead. Use this for possible lead disqualification. Data type: Object ``` "similar_lead": { "name": "String", "sys_id": "String" } ```
similar\_lead.name Name of the duplicate lead.Data type: String
similar\_lead.sys\_id Sys\_id of the lead record that is a possible duplicate lead.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
stage Stage of the lead such as, 100\_new. **Note:** This is a choice field. It must contain one of the choice items defined in the stage field of the Leads table. Data type: String
state State in which the lead resides.Data type: String
street Street on which the lead resides.Data type: String
sys\_class\_name System-generated class name of the Lead table.Data type: String
sys\_created\_by User name of the person that created the lead.Data type: String
sys\_created\_on System-generated date and time that the lead was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_created\_on.​display\_value Date and time when the lead was created.Data type: String Format: Default instance format and time zone
sys\_created\_on.​value Date and time when the lead was created.Data type: String Format: UTC
sys\_domain Sys\_id of the domain record to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_domain\_path Path of the domain to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_id Sys\_id of the lead record.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
sys\_mod\_count Number of times the associated lead record has been modified.Data type: Number \(Integer\)
sys\_tags List of system tags associated with the lead. You can use these tags to categorize leads.Data type: Array
sys\_updated\_by User name of the person that last updated the lead record.Data type: String
sys\_updated\_on System-generated date and time when the lead was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_updated\_on.​display\_value Date and time that the lead was last updated.Data type: String Format: Instance's default format and time zone
sys\_updated\_on.​value Date and time that the lead was last updated.Data type: String Format: UTC
title Lead's title.Data type: String
website Lead's website URL.Data type: String
work\_notes List of work notes created for the lead. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
work\_notes.​author User name of the person that authored the associated work note.Data type: String
work\_notes.​date Date that the note was created.Data type: String
work\_notes.​text Text of the note made by the author.Data type: String
zip Zip code of the associated lead.Data type: String
### cURL request The following code example shows how to pass query parameters to specify the leads to return. ``` curl "https://instance.service-now.com/api/sn_lead_mgmt_core/lead?sysparm_query=stage%3D400_closed_won&sysparm_fields=sys_id%2Cfirst_name%2Clast_name%2Cshort_description%2Cstage%2Clead_line_items&sysparm_offset=2" \ --request GET \ --header "Accept:application/json" \ --user "username":"password" ``` Leads are return in an array of objects: ``` [ { "short_description": "Looking for a quote on preventative maintenance plans for their corporate office building elevators.", "reason": null, "country": "USA", "closed_date": null, "city": "San Francisco", "lead_source": "inbound_phone", "external_id": null, "industry": "manufacturing", "sys_updated_on": { "value": "2024-05-31 11:01:55", "display_value": "2024-05-31 04:01:55" }, "title": "Director of Building operations", "sys_class_name": "Lead", "number": "LEAD0000001", "sys_id": "856b6a95ffde8210b85dffffffffffd7", "business_phone": "+1 (555) 123-4567", "similar_lead": null, "sys_updated_by": "admin", "mobile_phone": null, "street": "789, Industrial drive", "sys_created_on": { "value": "2024-05-20 10:32:41", "display_value": "2024-05-20 03:32:41" }, "contact": null, "company": "Lee Manufacturing Inc", "state": "CA", "first_name": "James", "email": "james.wilson@email.com", "consumer": null, "sys_created_by": "admin", "zip": "94016", "owner": { "sys_id": "60058fe943fe3110d6c6cd60afb8f203", "name": "Max Blaze" }, "website": null, "lead_group": null, "sys_mod_count": 1, "last_name": "Wilson", "other_reason": null, "middle_name": null, "sys_tags": null, "do_not_share": false, "lead_score": 92, "stage": "300_nurturing", "do_not_email": false, "lead_type": null, "work_notes": [ { "author": "Abel Tuter", "date": "2024-12-04 06:52:07", "text": "Work notes for lead" } ], "do_not_call": false, "lead_rating": "400_super_hot", "account": null, "external_system": null, "lead_line_items": [ { "quantity": 6, "product_offering": { "sys_id": "32619d9fd0a63110f8770dbf976be1f9", "name": "Safety Test Coverage", "code": "SAFETSTCVG1" }, "sys_mod_count": 0, "external_id": null, "sys_updated_on": { "value": "2024-05-20 10:38:41", "display_value": "2024-05-20 03:38:41" }, "sys_tags": null, "lead": { "sys_id": "856b6a95ffde8210b85dffffffffffd7", "name": "LEAD0000001" }, "number": "LEADL0000003", "sys_id": "013daa19ffde8210b85dffffffffff82", "unit_of_measurement": { "sys_id": "cb2795d553020110286eddeeff7b12ff", "name": "Each" }, "sys_updated_by": "admin", "sys_created_on": { "value": "2024-05-20 10:38:41", "display_value": "2024-05-20 03:38:41" }, "work_notes": null, "sys_created_by": "admin", "external_system": null } ] }, { "short_description": "Partner referral for a company interested in a reliable internet bundle with strong security features for their office.", "reason": null, "country": "USA", "closed_date": null, "city": "San Francisco", "lead_source": "partner_referral", "external_id": null, "industry": "technology_services", "sys_updated_on": { "value": "2024-05-20 10:53:59", "display_value": "2024-05-20 03:53:59" }, "title": "IT Director", "sys_class_name": "Lead", "number": "LEAD0000002", "sys_id": "e71fa6d9ffde8210b85dffffffffff51", "business_phone": "(626) 722-6969", "similar_lead": null, "sys_updated_by": "admin", "mobile_phone": null, "street": "747 Howard St", "sys_created_on": { "value": "2024-05-20 10:49:12", "display_value": "2024-05-20 03:49:12" }, "contact": { "sys_id": "4d147a386f0331003b3c498f5d3ee437", "name": "" }, "company": "Boxeo", "state": "CA", "first_name": "Julie", "email": "julie.lewis@example.com", "consumer": null, "sys_created_by": "admin", "zip": "94013", "owner": { "sys_id": "60058fe943fe3110d6c6cd60afb8f203", "name": "Max Blaze" }, "website": null, "lead_group": null, "sys_mod_count": 0, "last_name": "Lewis", "other_reason": null, "middle_name": null, "sys_tags": null, "do_not_share": false, "lead_score": 78, "stage": "400_closed_won", "do_not_email": false, "lead_type": null, "work_notes": [ { "author": "Abel Tuter", "date": "2024-12-03 03:52:51", "text": "Work noted for LEAD0000002" } ], "do_not_call": false, "lead_rating": "200_warm", "account": { "sys_id": "86837a386f0331003b3c498f5d3ee4ca", "name": "" }, "external_system": null, "lead_line_items": [ { "quantity": 50, "product_offering": { "sys_id": "0b61dd9fd0a63110f8770dbf976be171", "name": "Solana Modem M Series", "code": "SOLANAMODE2" }, "sys_mod_count": 0, "external_id": null, "sys_updated_on": { "value": "2024-05-20 10:51:57", "display_value": "2024-05-20 03:51:57" }, "sys_tags": null, "lead": { "sys_id": "e71fa6d9ffde8210b85dffffffffff51", "name": "LEAD0000002" }, "number": "LEADL0000009", "sys_id": "2130fa1dffde8210b85dffffffffffff", "unit_of_measurement": { "sys_id": "cb2795d553020110286eddeeff7b12ff", "name": "Each" }, "sys_updated_by": "admin", "sys_created_on": { "value": "2024-05-20 10:51:25", "display_value": "2024-05-20 03:51:25" }, "work_notes": null, "sys_created_by": "admin", "external_system": null } ] } ] ``` ## lead - GET /sn\_lead\_mgmt\_core/lead/\{sys\_id\} Returns the lead record and all associated lead line items for the specified sys\_id. This endpoint retrieves information from the following tables: - Lead \[sn\_lead\_mgmt\_core\_lead\] - Lead Line Item \[sn\_lead\_mgmt\_core\_lead\_line\_item\] ### URL format Versioned URL: `/api/sn_lead_mgmt_core/{api_version}/lead/{sys_id}` Default URL: `/api/sn_lead_mgmt_core/{api_version}/lead/{sys_id}` **Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md). ### Supported request parameters
Name Description
api\_version Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
sys\_id Sys\_id of the lead to retrieve.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
|Name|Description| |----|-----------| |None| | |Name|Description| |----|-----------| |None| | ### Headers The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md). |Header|Description| |------|-----------| |Accept|Data format of the response body. Only supports **application/json**.| |Header|Description| |------|-----------| |None| | ### Status codes The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md). |Status code|Description| |-----------|-----------| |200|Successful. The request was successfully processed.| |403|Forbidden. The user doesn't have access rights to the specified record.| |404|Not found. The requested item wasn't found.| |500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.| ### Response body parameters
Name Description
account Account linked to the lead.Data type: Object ``` "account": { "name": "String", "sys_id": "String" } ```
account.name Name of the account.Data type: String
account.sys\_id Sys\_id of the associated account record. Data type: String Table: Account \[customer\_account\]
business\_phone Lead's business phone number.Data type: String
city City in which the lead resides.Data type: String
closed\_date Date and time when the lead was closed.Data type: Object ``` "closed_date": { "display_value": "String", "value": "String" } ```
closed\_date.​display\_value Date and time as displayed in the UI. Data type: String Format: User's format and time zone.
closed\_date.value Date and time that the lead closed as defined in the associated record.Data type: String Format: UTC
company Lead's company name.Data type: String
consumer Consumer associated with the lead.Data type: Object ``` "consumer": { "name": "String", "sys_id": "String" } ```
consumer.name Name of the associated consumer.Data type: String
consumer.sys\_id Sys\_id of the associated consumer record. Data type: String Table: Consumer \[csm\_consumer\]
contact Contact associated with the lead account.Data type: Object ``` "contact": { "name": "String", "sys_id": "String" } ```
contact.name Contact's name.Data type: String
contact.sys\_id Sys\_id of the associated contact record. Data type: String Table: Contact \[customer\_contact\]
country Country in which the lead resides.Data type: String
do\_not\_call Flag that indicates whether the mode of communication is by phone. Valid values: - true: Can call contact. - false: Don't call contact. Data type: Boolean
do\_not\_email Flag that indicates whether the mode of communication is by email. Valid values: - true: Can email contact. - false: Don't email contact. Data type: Boolean
do\_not\_share Flag that indicates whether the lead details can be shared. Valid values: - true: Lead details can be shared. - false: Lead details can't be shared. Data type: Boolean
email Lead's email address.Data type: String
external\_id ID used by the system that generated the lead to identify the lead in the associated system.Data type: String
external\_system Name of the external system associated with the lead, such as HubSpot or pipedrive.Data type: String
first\_name First name of the contact associated with the lead.Data type: String
industry Industry to which the lead belongs.Data type: String Table: Located in the **industry** field of the Account \[customer\_account\] table.
last\_name Last name of the contact associated with the lead. Data type: String
lead\_group Group to which the lead belongs. Data type: Object ``` "lead_group": { "name: "String", "sys_id": "String" } ```
lead\_group.name Lead group's name.Data type: String
lead\_group.sys\_id Sys\_id of the lead group record.Data type: String Table: Group \[sys\_user\_group\]
lead\_line\_items Details of the lead line items associated with the lead.Data type: Array of Objects ``` "lead_line_items": [ { "external_id": "String", "external_system": "String", "lead": {Object}, "number": "String", "product_offering": {Object}, "quantity": Number, "sys_created_by”: "String", "sys_created_on {Object}, "sys_domain": "String", "sys_domain_path": "String", "sys_id": "String", "sys_mod_count": Number, "sys_tags": [Array], "sys_updated_by: "String", "sys_updated_on: {Object}, "unit_of_measurement": {Object}, "work_notes": [Array] } ] ```
lead\_line\_items.​external\_id ID used by the system that generated the lead line item to identify the line item in the associated system.Data type: String
lead\_line\_items.​external\_system Name of the external system associated with the lead line item, such as HubSpot or pipedrive.Data type: String
lead\_line\_items.​lead Details about the lead associated with the line item.Data type: Object ``` "lead: { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​lead.name Associated lead's name.Data type: String
lead\_line\_items.​lead.sys\_id Sys\_id of the associated lead record.Data type: String
lead\_line\_items.​number Unique system-generated number of the lead line item record.Data type: String
lead\_line\_items.​product\_offering Information about the product offering associated with the lead line item.Data type: Object ``` "product_offering": { "code": " String", "name": "String", "sys_id": "String" } ```
lead\_line\_items.​product\_offering.code Code linked to the product offering. **Note:** This is a system-generated alphanumeric number based on the product name. Although system generated, you can edit the code to represent a SKU or any other industry specific product codes. Data type: String
lead\_line\_items.​product\_offering.name Product offering's name.Data type: String
lead\_line\_items.​product\_offering.sys\_id Sys\_id of the product offering record associated with the lead line item. Data type: String Table: Product Offering \[sn\_prd\_pm\_product\_offering\]
lead\_line\_items.​quantity Quantity of items the lead wants to purchase of the associated product offering. Data type: Number \(Integer\)
lead\_line\_items.​sys\_created\_by User name of the person that created the lead line item.Data type: String
lead\_line\_items.​sys\_created\_on System-generated date and time that the lead line item was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_created\_on.display\_value Date and time that the lead line item was created.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_created\_on.value Date and time that the lead line item was created.Data type: String Format: UTC
lead\_line\_items.​sys\_domain Sys\_id of the domain record to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.sys\_domain\_path Path of the domain to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.​sys\_id Sys\_id of the lead line item record.Data type: String
lead\_line\_items.​sys\_mod\_count Number of times the associated lead line item record has been modified.Data type: Number \(Integer\)
lead\_line\_items.​sys\_tags List of system tags associated with the lead line item.Data type: Array
lead\_line\_items.​sys\_updated\_by User name of the person that last updated the associated lead line item.Data type: String
lead\_line\_items.​sys\_updated\_on System-generated date and time when the lead line item was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_updated\_on.​display\_value Date and time that the lead line item was last updated.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_updated\_on.​value Date and time that the lead line item was last updated.Data type: String Format: UTC
lead\_line\_items.​unit\_of\_measurement Details of the measuring unit of lead line item. Data type: Object ``` "unit_of_measurement": { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​unit\_of\_measurement.​name Name of the measuring unit such as, each or cubic foot.Data type: String
lead\_line\_items.​unit\_of\_measurement.​sys\_id Sys\_id of the record that describes the measuring unit.Data type: String Table: Unit of Measure \[sn\_prd\_pm\_uom\]
lead\_line\_items.​work\_notes List that describes the work notes created for the lead line item. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
lead\_line\_items.​work\_notes.​author User name of the person that authored the associated work note.Data type: String
lead\_line\_items.​work\_notes.​date Date that the note was created.Data type: String
lead\_line\_items.​work\_notes.​text Text of the note made by the author.Data type: String
lead\_rating Rating for the lead such as, 100\_cold, 200\_warm, 300\_hot, or 400\_super\_hot.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_rating field of the Leads table. Data type: String
lead\_score Score for the lead.Data type: Decimal Range: 1 to 100
lead\_source Originator of the lead.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_source field of the Leads table. Data type: String
lead\_type Type of lead, such as New Business or Existing Business. **Note:** This is a choice field. It must contain one of the choice items defined in the lead\_type field of the Leads table. Data type: String
middle\_name Middle name of the contact for the lead.Data type: String
mobile\_phone Phone number of the contact for the lead.Data type: String
number Unique system-generated number of the lead record.Data type: String
other\_reason Additional reason for the lead disqualification.Data type: String Max length: 160 characters
owner Details of the person associated with the lead. Data type: Object ``` "owner": { "name": "String", "sys_id": "String" } ```
owner.name Name of the person that owns the lead.Data type: String
owner.sys\_id Sys\_id of the user record of the person that owns the lead.Data type: String Table: User \[sys\_user\]
reason Reason for the lead disqualification such as, Disqualify.Data type: String Max length: 40 characters
short\_description Short description of the lead.Data type: String Max length: 160 characters
similar\_lead Details on any similar lead. Use this for possible lead disqualification. Data type: Object ``` "similar_lead": { "name": "String", "sys_id": "String" } ```
similar\_lead.name Name of the duplicate lead.Data type: String
similar\_lead.sys\_id Sys\_id of the lead record that is a possible duplicate lead.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
stage Stage of the lead such as, 100\_new. **Note:** This is a choice field. It must contain one of the choice items defined in the stage field of the Leads table. Data type: String
state State in which the lead resides.Data type: String
street Street on which the lead resides.Data type: String
sys\_class\_name System-generated class name of the Lead table.Data type: String
sys\_created\_by User name of the person that created the lead.Data type: String
sys\_created\_on System-generated date and time that the lead was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_created\_on.​display\_value Date and time when the lead was created.Data type: String Format: Default instance format and time zone
sys\_created\_on.​value Date and time when the lead was created.Data type: String Format: UTC
sys\_domain Sys\_id of the domain record to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_domain\_path Path of the domain to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_id Sys\_id of the lead record.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
sys\_mod\_count Number of times the associated lead record has been modified.Data type: Number \(Integer\)
sys\_tags List of system tags associated with the lead. You can use these tags to categorize leads.Data type: Array
sys\_updated\_by User name of the person that last updated the lead record.Data type: String
sys\_updated\_on System-generated date and time when the lead was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_updated\_on.​display\_value Date and time that the lead was last updated.Data type: String Format: Instance's default format and time zone
sys\_updated\_on.​value Date and time that the lead was last updated.Data type: String Format: UTC
title Lead's title.Data type: String
website Lead's website URL.Data type: String
work\_notes List of work notes created for the lead. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
work\_notes.​author User name of the person that authored the associated work note.Data type: String
work\_notes.​date Date that the note was created.Data type: String
work\_notes.​text Text of the note made by the author.Data type: String
zip Zip code of the associated lead.Data type: String
### cURL request The following code example shows how to retrieve the lead record with the sys\_id of 856b6a95ffde8210b85dffffffffffd7. ``` curl "https://instance.service-now.com /api/sn_lead_mgmt_core/lead/856b6a95ffde8210b85dffffffffffd7" \ --request GET \ --header "Accept:application/json" \ --user "username":"password" ``` The following are the return results: ``` { "short_description": "Looking for a quote on preventative maintenance plans for their corporate office building elevators.", "reason": null, "country": "USA", "closed_date": null, "city": "San Francisco", "lead_source": "inbound_phone", "external_id": null, "industry": "manufacturing", "sys_updated_on": { "value": "2024-05-31 11:01:55", "display_value": "2024-05-31 04:01:55" }, "title": "Director of Building operations", "sys_class_name": "Lead", "number": "LEAD0000001", "sys_id": "856b6a95ffde8210b85dffffffffffd7", "business_phone": "+1 (555) 123-4567", "similar_lead": null, "sys_updated_by": "abel.tuter", "mobile_phone": null, "street": "789, Industrial drive", "sys_created_on": { "value": "2024-05-20 10:32:41", "display_value": "2024-05-20 03:32:41" }, "contact": null, "company": "Lee Manufacturing Inc", "state": "CA", "first_name": "James", "email": "james.wilson@email.com", "consumer": null, "sys_created_by": "abel.tuter", "zip": "94016", "owner": { "sys_id": "60058fe943fe3110d6c6cd60afb8f203", "name": "Max Blaze" }, "website": null, "lead_group": null, "sys_mod_count": 1, "last_name": "Wilson", "other_reason": null, "middle_name": null, "sys_tags": null, "do_not_share": false, "lead_score": 92, "stage": "300_nurturing", "do_not_email": false, "lead_type": null, "work_notes": [ { "author": "Abel Tuter", "date": "2024-12-04 06:52:07", "text": "Work notes for lead" } ], "do_not_call": false, "lead_rating": "400_super_hot", "account": null, "external_system": null, "lead_line_items": [ { "quantity": 6, "product_offering": { "sys_id": "32619d9fd0a63110f8770dbf976be1f9", "name": "Safety Test Coverage", "code": "SAFETSTCVG1" }, "sys_mod_count": 0, "external_id": null, "sys_updated_on": { "value": "2024-05-20 10:38:41", "display_value": "2024-05-20 03:38:41" }, "sys_tags": null, "lead": { "sys_id": "856b6a95ffde8210b85dffffffffffd7", "name": "LEAD0000001" }, "number": "LEADL0000003", "sys_id": "013daa19ffde8210b85dffffffffff82", "unit_of_measurement": { "sys_id": "cb2795d553020110286eddeeff7b12ff", "name": "Each" }, "sys_updated_by": "abel.tuter", "sys_created_on": { "value": "2024-05-20 10:38:41", "display_value": "2024-05-20 03:38:41" }, "work_notes": null, "sys_created_by": "abel.tuter", "external_system": null } ] } ``` ## lead - PATCH /sn\_lead\_mgmt\_core/lead/\{sys\_id\} 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. This endpoint updates information in the following tables: - Lead \[sn\_lead\_mgmt\_core\_lead\] - Lead Line Item \[sn\_lead\_mgmt\_core\_lead\_line\_item\] Rules for passed-in parameters: - Invalid parameter names are ignored. - Invalid values for non-mandatory choice and reference fields are ignored. - If field WRITE access is denied for one or more fields, the restricted fields are ignored. - You can't insert system field values using this API. Any provided values are ignored. System fields are a part of the ignored fields list, which is configurable. - The values of the parameters **account**, **contact**, and **consumer** are ignored if both the **account** and **consumer** parameters are non-empty. - Unless otherwise specified, the default value for all non-passed parameters is 'null'. **Note:** This endpoint only modifies the specified parameters. If a parameter that exists in the current lead or lead line item record is not specified in the call, its contents remain unchanged. ### URL format Versioned URL: `/api/sn_lead_mgmt_core/{api_version}/lead/{sys_id}` Default URL: `/api/sn_lead_mgmt_core/{api_version}/lead/{sys_id}` **Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md). ### Supported request parameters
Name Description
api\_version Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
sys\_id Sys\_id of the lead record to update.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
|Name|Description| |----|-----------| |None| |
Name Description
account Details of the account associated with the lead.Data type: Object ``` "account": { "sys_id": "String" } ```
account.sys\_id Sys\_id of the associated account record. Data type: String Table: Account \[customer\_account\]
business\_phone Lead's business phone number.Data type: String
city City in which the lead resides.Data type: String
company Lead's company name.Data type: String
consumer Consumer associated with the lead.Data type: Object ``` "consumer": { "sys_id": "String" } ```
consumer.sys\_id Sys\_id of the associated consumer record. Data type: String Table: Consumer \[csm\_consumer\]
contact Contact associated with the lead account.Data type: Object ``` "contact": { "sys_id": "String" } ```
contact.sys\_id Sys\_id of the associated contact record. Data type: String Table: Contact \[customer\_contact\]
country Country in which the lead resides.Data type: String
do\_not\_call Flag that indicates whether the mode of communication is by phone. Valid values: - true: Can call contact. - false: Don't call contact. Data type: Boolean
do\_not\_email Flag that indicates whether the mode of communication is by email. Valid values: - true: Can email contact. - false: Don't email contact. Data type: Boolean
do\_not\_share Flag that indicates whether the lead details can be shared. Valid values: - true: Lead details can be shared. - false: Lead details can't be shared. Data type: Boolean
email Lead's email address.Data type: String
external\_id ID used by the system that generated the lead to identify the lead in the associated system.Data type: String
external\_system Name of the external system associated with the lead, such as HubSpot or pipedrive.Data type: String
first\_name First name of the contact associated with the lead.Data type: String
industry Industry to which the lead belongs.Data type: String Table: Located in the **industry** field of the Account \[customer\_account\] table.
last\_name Required. Last name of the contact associated with the lead. Data type: String
lead\_group Group to which the lead belongs. Data type: Object ``` "lead_group": { "sys_id": "String" } ```
lead\_group.sys\_id Sys\_id of the lead group record.Data type: String Table: Group \[sys\_user\_group\]
lead\_line\_items List of lead line items to associated with the lead.Group to which the lead belongs. Data type: Object ``` "lead_line_items": [ { "external_id": "String", "external_system": "String", "product_offering": {Object}, "quantity": Number, "work_notes": [Array], "unit_of_measurement": {Object} } ] ``` Maximum line items: 100 - any over that are ignored
lead\_line\_items.​external\_id ID used by the system that generated the lead line item to identify the line item in the associated system.Data type: String
lead\_line\_items.​external\_system Name of the external system associated with the lead line item, such as HubSpot or pipedrive.Data type: String
lead\_line\_items.product\_offering Required. Information about the product offering associated with the lead line item.Data type: Object ``` "product_offering": { "sys_id": "String" } ```
lead\_line\_items.product\_offering.sys\_id Required. Sys\_id of the product offering record associated with the lead line item. Data type: String Table: Product Offering \[sn\_prd\_pm\_product\_offering\]
lead\_line\_items.quantity Quantity of items the lead wants to purchase of the associated product offering. Data type: Number \(Integer\)
lead\_line\_items.​unit\_of\_measurement Details of the measuring unit of lead line item. Data type: Object ``` "unit_of_measurement": { "sys_id": "String" } ```
lead\_line\_items.​unit\_of\_measurement​.sys\_id Sys\_id of the record that describes the measuring unit.Data type: String Table: Unit of Measure \[sn\_prd\_pm\_uom\]
lead\_line\_items.work\_notes List that describes the work notes created for the lead line item. Data type: Array of Objects ``` "work_notes": [ "text": "String" } ] ```
lead\_line\_items.​work\_notes.​text Text of the note made by the author.Data type: String
lead\_rating Rating for the lead such as, 100\_cold, 200\_warm, 300\_hot, or 400\_super\_hot.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_rating field of the Leads table. Data type: String
lead\_score Score for the lead.Data type: Decimal Range: 1 to 100
lead\_source Originator of the lead.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_source field of the Leads table. Data type: String
lead\_type Type of lead, such as New Business or Existing Business. **Note:** This is a choice field. It must contain one of the choice items defined in the lead\_type field of the Leads table. Data type: String
middle\_name Middle name of the contact for the lead.Data type: String
mobile\_phone Phone number of the contact for the lead.Data type: String
other\_reason Additional reason for the lead disqualification.Data type: String Max length: 160 characters
owner Details of the person associated with the lead. Data type: Object ``` "owner": { "sys_id": "String" } ```
owner.sys\_id Sys\_id of the user record of the person that owns the lead.Data type: String Table: User \[sys\_user\]
reason Reason for the lead disqualification such as, Disqualify.Data type: String Max length: 40 characters
short\_description Short description of the lead.Data type: String Max length: 160 characters
similar\_lead Details on any similar lead. Use this for possible lead disqualification. Data type: Object ``` "similar_lead": { "sys_id": "String" } ```
similar\_lead.sys\_id Sys\_id of the lead record that is a possible duplicate lead.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
stage Stage of the lead such as, 100\_new. **Note:** This is a choice field. It must contain one of the choice items defined in the stage field of the Leads table. Data type: String
state State in which the lead resides.Data type: String
street Street on which the lead resides.Data type: String
title Lead's title.Data type: String
website Lead's website URL.Data type: String
work\_notes List of work notes created for the lead. Data type: Array of Objects ``` "work_notes": [ { "text": "String" } ] ``` **Note:** An array of work notes in the request is inserted as a single text. This text is generated by combining the content from all work note objects in the request, with each entry separated by a comma \(,\).
work\_notes.​text Text of the note made by the author.Data type: String
zip Zip code of the associated lead.Data type: String
### Headers The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md). |Header|Description| |------|-----------| |Accept|Data format of the response body. Only supports **application/json**.| |Content-Type|Data format of the request body. Only supports **application/json**.| |Header|Description| |------|-----------| |None| | ### Status codes The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).
Status code Description
200 Successful. Lead and lead line items records were successfully updated.
400 Error. Possible reasons: - Invalid payload: Invalid/empty request body. - Invalid payload: Invalid field value for email/phone number fields. - Invalid payload: Mandatory field is absent, or its value is empty. - Invalid payload: Stage is ‘400\_closed\_won’. Qualifying lead is not supported using the API. - If the stage of the lead to be updated is already in the closed state and you are trying to update it.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
### Response body parameters
Name Description
account Account linked to the lead.Data type: Object ``` "account": { "name": "String", "sys_id": "String" } ```
account.name Name of the account.Data type: String
account.sys\_id Sys\_id of the associated account record. Data type: String Table: Account \[customer\_account\]
business\_phone Lead's business phone number.Data type: String
city City in which the lead resides.Data type: String
closed\_date Date and time when the lead was closed.Data type: Object ``` "closed_date": { "display_value": "String", "value": "String" } ```
closed\_date.​display\_value Date and time as displayed in the UI. Data type: String Format: User's format and time zone.
closed\_date.value Date and time that the lead closed as defined in the associated record.Data type: String Format: UTC
company Lead's company name.Data type: String
consumer Consumer associated with the lead.Data type: Object ``` "consumer": { "name": "String", "sys_id": "String" } ```
consumer.name Name of the associated consumer.Data type: String
consumer.sys\_id Sys\_id of the associated consumer record. Data type: String Table: Consumer \[csm\_consumer\]
contact Contact associated with the lead account.Data type: Object ``` "contact": { "name": "String", "sys_id": "String" } ```
contact.name Contact's name.Data type: String
contact.sys\_id Sys\_id of the associated contact record. Data type: String Table: Contact \[customer\_contact\]
country Country in which the lead resides.Data type: String
do\_not\_call Flag that indicates whether the mode of communication is by phone. Valid values: - true: Can call contact. - false: Don't call contact. Data type: Boolean
do\_not\_email Flag that indicates whether the mode of communication is by email. Valid values: - true: Can email contact. - false: Don't email contact. Data type: Boolean
do\_not\_share Flag that indicates whether the lead details can be shared. Valid values: - true: Lead details can be shared. - false: Lead details can't be shared. Data type: Boolean
email Lead's email address.Data type: String
external\_id ID used by the system that generated the lead to identify the lead in the associated system.Data type: String
external\_system Name of the external system associated with the lead, such as HubSpot or pipedrive.Data type: String
first\_name First name of the contact associated with the lead.Data type: String
industry Industry to which the lead belongs.Data type: String Table: Located in the **industry** field of the Account \[customer\_account\] table.
last\_name Last name of the contact associated with the lead. Data type: String
lead\_group Group to which the lead belongs. Data type: Object ``` "lead_group": { "name: "String", "sys_id": "String" } ```
lead\_group.name Lead group's name.Data type: String
lead\_group.sys\_id Sys\_id of the lead group record.Data type: String Table: Group \[sys\_user\_group\]
lead\_line\_items Details of the lead line items associated with the lead.Data type: Array of Objects ``` "lead_line_items": [ { "external_id": "String", "external_system": "String", "lead": {Object}, "number": "String", "product_offering": {Object}, "quantity": Number, "sys_created_by”: "String", "sys_created_on {Object}, "sys_domain": "String", "sys_domain_path": "String", "sys_id": "String", "sys_mod_count": Number, "sys_tags": [Array], "sys_updated_by: "String", "sys_updated_on: {Object}, "unit_of_measurement": {Object}, "work_notes": [Array] } ] ```
lead\_line\_items.​external\_id ID used by the system that generated the lead line item to identify the line item in the associated system.Data type: String
lead\_line\_items.​external\_system Name of the external system associated with the lead line item, such as HubSpot or pipedrive.Data type: String
lead\_line\_items.​lead Details about the lead associated with the line item.Data type: Object ``` "lead: { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​lead.name Associated lead's name.Data type: String
lead\_line\_items.​lead.sys\_id Sys\_id of the associated lead record.Data type: String
lead\_line\_items.​number Unique system-generated number of the lead line item record.Data type: String
lead\_line\_items.​product\_offering Information about the product offering associated with the lead line item.Data type: Object ``` "product_offering": { "code": " String", "name": "String", "sys_id": "String" } ```
lead\_line\_items.​product\_offering.code Code linked to the product offering. **Note:** This is a system-generated alphanumeric number based on the product name. Although system generated, you can edit the code to represent a SKU or any other industry specific product codes. Data type: String
lead\_line\_items.​product\_offering.name Product offering's name.Data type: String
lead\_line\_items.​product\_offering.sys\_id Sys\_id of the product offering record associated with the lead line item. Data type: String Table: Product Offering \[sn\_prd\_pm\_product\_offering\]
lead\_line\_items.​quantity Quantity of items the lead wants to purchase of the associated product offering. Data type: Number \(Integer\)
lead\_line\_items.​sys\_created\_by User name of the person that created the lead line item.Data type: String
lead\_line\_items.​sys\_created\_on System-generated date and time that the lead line item was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_created\_on.display\_value Date and time that the lead line item was created.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_created\_on.value Date and time that the lead line item was created.Data type: String Format: UTC
lead\_line\_items.​sys\_domain Sys\_id of the domain record to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.sys\_domain\_path Path of the domain to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.​sys\_id Sys\_id of the lead line item record.Data type: String
lead\_line\_items.​sys\_mod\_count Number of times the associated lead line item record has been modified.Data type: Number \(Integer\)
lead\_line\_items.​sys\_tags List of system tags associated with the lead line item.Data type: Array
lead\_line\_items.​sys\_updated\_by User name of the person that last updated the associated lead line item.Data type: String
lead\_line\_items.​sys\_updated\_on System-generated date and time when the lead line item was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_updated\_on.​display\_value Date and time that the lead line item was last updated.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_updated\_on.​value Date and time that the lead line item was last updated.Data type: String Format: UTC
lead\_line\_items.​unit\_of\_measurement Details of the measuring unit of lead line item. Data type: Object ``` "unit_of_measurement": { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​unit\_of\_measurement.​name Name of the measuring unit such as, each or cubic foot.Data type: String
lead\_line\_items.​unit\_of\_measurement.​sys\_id Sys\_id of the record that describes the measuring unit.Data type: String Table: Unit of Measure \[sn\_prd\_pm\_uom\]
lead\_line\_items.​work\_notes List that describes the work notes created for the lead line item. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
lead\_line\_items.​work\_notes.​author User name of the person that authored the associated work note.Data type: String
lead\_line\_items.​work\_notes.​date Date that the note was created.Data type: String
lead\_line\_items.​work\_notes.​text Text of the note made by the author.Data type: String
lead\_rating Rating for the lead such as, 100\_cold, 200\_warm, 300\_hot, or 400\_super\_hot.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_rating field of the Leads table. Data type: String
lead\_score Score for the lead.Data type: Decimal Range: 1 to 100
lead\_source Originator of the lead.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_source field of the Leads table. Data type: String
lead\_type Type of lead, such as New Business or Existing Business. **Note:** This is a choice field. It must contain one of the choice items defined in the lead\_type field of the Leads table. Data type: String
middle\_name Middle name of the contact for the lead.Data type: String
mobile\_phone Phone number of the contact for the lead.Data type: String
number Unique system-generated number of the lead record.Data type: String
other\_reason Additional reason for the lead disqualification.Data type: String Max length: 160 characters
owner Details of the person associated with the lead. Data type: Object ``` "owner": { "name": "String", "sys_id": "String" } ```
owner.name Name of the person that owns the lead.Data type: String
owner.sys\_id Sys\_id of the user record of the person that owns the lead.Data type: String Table: User \[sys\_user\]
reason Reason for the lead disqualification such as, Disqualify.Data type: String Max length: 40 characters
short\_description Short description of the lead.Data type: String Max length: 160 characters
similar\_lead Details on any similar lead. Use this for possible lead disqualification. Data type: Object ``` "similar_lead": { "name": "String", "sys_id": "String" } ```
similar\_lead.name Name of the duplicate lead.Data type: String
similar\_lead.sys\_id Sys\_id of the lead record that is a possible duplicate lead.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
stage Stage of the lead such as, 100\_new. **Note:** This is a choice field. It must contain one of the choice items defined in the stage field of the Leads table. Data type: String
state State in which the lead resides.Data type: String
street Street on which the lead resides.Data type: String
sys\_class\_name System-generated class name of the Lead table.Data type: String
sys\_created\_by User name of the person that created the lead.Data type: String
sys\_created\_on System-generated date and time that the lead was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_created\_on.​display\_value Date and time when the lead was created.Data type: String Format: Default instance format and time zone
sys\_created\_on.​value Date and time when the lead was created.Data type: String Format: UTC
sys\_domain Sys\_id of the domain record to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_domain\_path Path of the domain to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_id Sys\_id of the lead record.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
sys\_mod\_count Number of times the associated lead record has been modified.Data type: Number \(Integer\)
sys\_tags List of system tags associated with the lead. You can use these tags to categorize leads.Data type: Array
sys\_updated\_by User name of the person that last updated the lead record.Data type: String
sys\_updated\_on System-generated date and time when the lead was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_updated\_on.​display\_value Date and time that the lead was last updated.Data type: String Format: Instance's default format and time zone
sys\_updated\_on.​value Date and time that the lead was last updated.Data type: String Format: UTC
title Lead's title.Data type: String
website Lead's website URL.Data type: String
work\_notes List of work notes created for the lead. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
work\_notes.​author User name of the person that authored the associated work note.Data type: String
work\_notes.​date Date that the note was created.Data type: String
work\_notes.​text Text of the note made by the author.Data type: String
zip Zip code of the associated lead.Data type: String
### cURL request The following code example shows how to update the lead record with the sys\_id 856b6a95ffde8210b85dffffffffffd7. ``` curl " https://instance.service-now.com/api/sn_lead_mgmt_core/v1/lead/856b6a95ffde8210b85dffffffffffd7" \ --request PATCH \ --header "Accept:application/json" \ --header "Content-Type:application/json" \ --data " { "lead_source": "inbount_web", "business_phone": "+1 (555) 123-4567", "do_not_share": true, "lead_score": 40, "stage": "300_nurturning", "do_not_email": false, "lead_type": "new_business", "work_notes": [ { "text": "Work notes for lead" } ], "lead_rating": "200_warm", "lead_line_items": [ { "sys_id" : "013daa19ffde8210b85dffffffffff82", "quantity": 10 }, { "product_offering": { "sys_id": "0b61dd9fd0a63110f8770dbf976be171" } } ] }" ``` The response contains all lead record fields. ``` { "short_description": "Looking for a quote on preventative maintenance plans for their corporate office building elevators.", "reason": null, "country": "USA", "closed_date": null, "city": "San Francisco", "lead_source": "inbount_web", "external_id": null, "industry": "manufacturing", "sys_updated_on": { "value": "2024-12-11 08:45:52", "display_value": "2024-12-11 00:45:52" }, "title": "Director of Building operations", "sys_class_name": "Lead", "number": "LEAD0000001", "sys_id": "856b6a95ffde8210b85dffffffffffd7", "business_phone": "+1 (555) 123-4567", "similar_lead": null, "sys_updated_by": "abel.tuter", "mobile_phone": null, "street": "789, Industrial drive", "sys_created_on": { "value": "2024-05-20 10:32:41", "display_value": "2024-05-20 03:32:41" }, "contact": null, "company": "Lee Manufacturing Inc", "state": "CA", "first_name": "James", "email": "james.wilson@email.com", "consumer": null, "sys_created_by": "abel.tuter", "zip": "94016", "owner": { "sys_id": "60058fe943fe3110d6c6cd60afb8f203", "name": "Max Blaze" }, "website": null, "lead_group": null, "sys_mod_count": 4, "last_name": "Wilson", "other_reason": null, "middle_name": null, "sys_tags": null, "do_not_share": true, "lead_score": 40, "stage": "300_nurturing", "do_not_email": false, "lead_type": "new_business", "work_notes": [ { "author": "Abel Tuter", "date": "2024-12-11 00:45:52", "text": "Lead Line Item [code]LEADL0000003[/code] has been updated [code] Quantity [/code] 10 [code] was [/code] 6" }, { "author": "Abel Tuter", "date": "2024-12-11 00:45:52", "text": "Lead Line Item [code]LEADL0001002[/code] has been created [code] Product Offering [/code] Solana Modem M Series [code] Quantity [/code] 1" }, { "author": "Abel Tuter", "date": "2024-12-11 00:45:51", "text": "Work notes for lead" } ], "do_not_call": false, "lead_rating": "200_warm", "account": null, "external_system": null, "lead_line_items": [ { "quantity": 10, "product_offering": { "sys_id": "32619d9fd0a63110f8770dbf976be1f9", "name": "Safety Test Coverage", "code": "SAFETSTCVG1" }, "sys_mod_count": 1, "external_id": null, "sys_updated_on": { "value": "2024-12-11 08:45:52", "display_value": "2024-12-11 00:45:52" }, "sys_tags": null, "lead": { "sys_id": "856b6a95ffde8210b85dffffffffffd7", "name": "LEAD0000001" }, "number": "LEADL0000003", "sys_id": "013daa19ffde8210b85dffffffffff82", "unit_of_measurement": { "sys_id": "cb2795d553020110286eddeeff7b12ff", "name": "Each" }, "sys_updated_by": "abel.tuter", "sys_created_on": { "value": "2024-05-20 10:38:41", "display_value": "2024-05-20 03:38:41" }, "work_notes": null, "sys_created_by": "abel.tuter", "external_system": null }, { "quantity": 1, "product_offering": { "sys_id": "0b61dd9fd0a63110f8770dbf976be171", "name": "Solana Modem M Series", "code": "SOLANAMODE2" }, "sys_mod_count": 0, "external_id": null, "sys_updated_on": { "value": "2024-12-11 08:45:52", "display_value": "2024-12-11 00:45:52" }, "sys_tags": null, "lead": { "sys_id": "856b6a95ffde8210b85dffffffffffd7", "name": "LEAD0000001" }, "number": "LEADL0001002", "sys_id": "37610e1780925210f877983fa0be6725", "unit_of_measurement": null, "sys_updated_by": "abel.tuter", "sys_created_on": { "value": "2024-12-11 08:45:52", "display_value": "2024-12-11 00:45:52" }, "work_notes": null, "sys_created_by": "abel.tuter", "external_system": null } ] } ``` ## lead - POST /sn\_lead\_mgmt\_core/lead Creates a lead record and its associated lead line items using the specified parameters. Once processed, records are created in the following tables: - Lead \[sn\_lead\_mgmt\_core\_lead\] - Lead Line Item \[sn\_lead\_mgmt\_core\_lead\_line\_item\] Rules for passed-in parameters: - Invalid parameter names are ignored. - Invalid values for non-mandatory choice and reference fields are ignored. - If field WRITE access is denied for one or more fields, the restricted fields are ignored. - You can't insert system field values using this API. Any provided values are ignored. System fields are a part of the ignored fields list, which is configurable. - The values of the parameters **account**, **contact**, and **consumer** are ignored if both the **account** and **consumer** parameters are non-empty. - Unless otherwise specified, the default value for all non-passed parameters is 'null'. ### URL format Versioned URL: `/api/sn_lead_mgmt_core/{api_version}/lead` Default URL: `/api/sn_lead_mgmt_core/{api_version}/lead` **Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md). ### Supported request parameters
Name Description
api\_version Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
|Name|Description| |----|-----------| |None| |
Name Description
account Details on the account associated with the lead.Data type: Object ``` "account": { "sys_id": "String" } ```
account.sys\_id Sys\_id of the associated account record. Data type: String Table: Account \[customer\_account\]
business\_phone Lead's business phone number.Data type: String
city City in which the lead resides.Data type: String
company Lead's company name.Data type: String
consumer Consumer associated with the lead.Data type: Object ``` "consumer": { "sys_id": "String" } ```
consumer.sys\_id Sys\_id of the associated consumer record. Data type: String Table: Consumer \[csm\_consumer\]
contact Contact associated with the lead account.Data type: Object ``` "contact": { "sys_id": "String" } ```
contact.sys\_id Sys\_id of the associated contact record. Data type: String Table: Contact \[customer\_contact\]
country Country in which the lead resides.Data type: String
do\_not\_call Flag that indicates whether the mode of communication is by phone. Valid values: - true: Can call contact. - false: Don't call contact. Data type: Boolean Default: false
do\_not\_email Flag that indicates whether the mode of communication is by email. Valid values: - true: Can email contact. - false: Don't email contact. Data type: Boolean Default: false
do\_not\_share Flag that indicates whether the lead details can be shared. Valid values: - true: Lead details can be shared. - false: Lead details can't be shared. Data type: Boolean Default: false
email Lead's email address.Data type: String
external\_id ID used by the system that generated the lead to identify the lead in the associated system.Data type: String
external\_system Name of the external system associated with the lead, such as HubSpot or pipedrive.Data type: String
first\_name First name of the contact associated with the lead.Data type: String
industry Industry to which the lead belongs.Data type: String Table: Located in the **industry** field of the Account \[customer\_account\] table.
last\_name Required. Last name of the contact associated with the lead. Data type: String
lead\_group Group to which the lead belongs. Data type: Object ``` "lead_group": { "sys_id": "String" } ```
lead\_group.sys\_id Sys\_id of the lead group record.Data type: String Table: Group \[sys\_user\_group\]
lead\_line\_items List of lead line items to associated with the lead.Group to which the lead belongs. Data type: Object ``` "lead_line_items": [ { "external_id": "String", "external_system": "String", "product_offering": {Object}, "quantity": Number, "work_notes": [Array], "unit_of_measurement": {Object} } ] ``` Maximum line items: 100 - any over that are ignored
lead\_line\_items.​external\_id ID used by the system that generated the lead line item to identify the line item in the associated system.Data type: String
lead\_line\_items.​external\_system Name of the external system associated with the lead line item, such as HubSpot or pipedrive.Data type: String
lead\_line\_items.product\_offering Required. Information about the product offering associated with the lead line item.Data type: Object ``` "product_offering": { "sys_id": "String" } ```
lead\_line\_items.product\_offering.sys\_id Required. Sys\_id of the product offering record associated with the lead line item. Data type: String Table: Product Offering \[sn\_prd\_pm\_product\_offering\]
lead\_line\_items.quantity Quantity of items the lead wants to purchase of the associated product offering. Data type: Number \(Integer\) Default: 1
lead\_line\_items.unit\_of\_measurement Details of the measuring unit of lead line item. Data type: Object ``` "unit_of_measurement": { "sys_id": "String" } ```
lead\_line\_items.​unit\_of\_measurement.​sys\_id Sys\_id of the record that describes the measuring unit.Data type: String Table: Unit of Measure \[sn\_prd\_pm\_uom\]
lead\_line\_items.work\_notes List that describes the work notes created for the lead line item. Data type: Array of Objects ``` "work_notes": [ "text": "String" } ] ``` Default: Empty array
lead\_line\_items.​work\_notes.​text Text of the note made by the author.Data type: String
lead\_rating Rating for the lead such as, 100\_cold, 200\_warm, 300\_hot, or 400\_super\_hot.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_rating field of the Leads table. Data type: String
lead\_score Score for the lead.Data type: Decimal Range: 1 to 100
lead\_source Originator of the lead.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_source field of the Leads table. Data type: String
lead\_type Type of lead, such as New Business or Existing Business. **Note:** This is a choice field. It must contain one of the choice items defined in the lead\_type field of the Leads table. Data type: String
middle\_name Middle name of the contact for the lead.Data type: String
mobile\_phone Phone number of the contact for the lead.Data type: String
other\_reason Additional reason for the lead disqualification.Data type: String Max length: 160 characters
owner Details of the person associated with the lead. Data type: Object ``` "owner": { "sys_id": "String" } ```
owner.sys\_id Sys\_id of the user record of the person that owns the lead.Data type: String Table: User \[sys\_user\]
reason Reason for the lead disqualification such as, Disqualify.Data type: String Max length: 40 characters
short\_description Short description of the lead.Data type: String Max length: 160 characters
similar\_lead Details on any similar lead. Use this for possible lead disqualification. Data type: Object ``` "similar_lead": { "sys_id": "String" } ```
similar\_lead.sys\_id Sys\_id of the lead record that is a possible duplicate lead.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
stage Stage of the lead such as, 100\_new. **Note:** This is a choice field. It must contain one of the choice items defined in the stage field of the Leads table. Data type: String Default: 100\_new
state State in which the lead resides.Data type: String
street Street on which the lead resides.Data type: String
title Lead's title.Data type: String
website Lead's website URL.Data type: String
work\_notes List of work notes created for the lead. Data type: Array of Objects ``` "work_notes": [ { "text": "String" } ] ``` **Note:** An array of work notes in the request is inserted as a single text. This text is generated by combining the content from all work note objects in the request, with each entry separated by a comma \(,\). Default: Empty array
work\_notes.​text Text of the note made by the author.Data type: String
zip Zip code of the associated lead.Data type: String
### Headers The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md). |Header|Description| |------|-----------| |Accept|Data format of the response body. Only supports **application/json**.| |Header|Description| |------|-----------| |None| | ### Status codes The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).
Status code Description
201 Successful. Lead and its associated line items are inserted successfully.
400 Error. Possible reasons: - Invalid payload: Invalid/empty request body. - Invalid payload: Invalid field value for email/phone number fields. - Invalid payload: Mandatory field is absent, or its value is empty. - Business rule/data policy violation.
403 Forbidden. The user doesn't have access rights to the specified record.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
### Response body parameters
Name Description
account Account linked to the lead.Data type: Object ``` "account": { "name": "String", "sys_id": "String" } ```
account.name Name of the account.Data type: String
account.sys\_id Sys\_id of the associated account record. Data type: String Table: Account \[customer\_account\]
business\_phone Lead's business phone number.Data type: String
city City in which the lead resides.Data type: String
closed\_date Date and time when the lead was closed.Data type: Object ``` "closed_date": { "display_value": "String", "value": "String" } ```
closed\_date.​display\_value Date and time as displayed in the UI. Data type: String Format: User's format and time zone.
closed\_date.value Date and time that the lead closed as defined in the associated record.Data type: String Format: UTC
company Lead's company name.Data type: String
consumer Consumer associated with the lead.Data type: Object ``` "consumer": { "name": "String", "sys_id": "String" } ```
consumer.name Name of the associated consumer.Data type: String
consumer.sys\_id Sys\_id of the associated consumer record. Data type: String Table: Consumer \[csm\_consumer\]
contact Contact associated with the lead account.Data type: Object ``` "contact": { "name": "String", "sys_id": "String" } ```
contact.name Contact's name.Data type: String
contact.sys\_id Sys\_id of the associated contact record. Data type: String Table: Contact \[customer\_contact\]
country Country in which the lead resides.Data type: String
do\_not\_call Flag that indicates whether the mode of communication is by phone. Valid values: - true: Can call contact. - false: Don't call contact. Data type: Boolean
do\_not\_email Flag that indicates whether the mode of communication is by email. Valid values: - true: Can email contact. - false: Don't email contact. Data type: Boolean
do\_not\_share Flag that indicates whether the lead details can be shared. Valid values: - true: Lead details can be shared. - false: Lead details can't be shared. Data type: Boolean
email Lead's email address.Data type: String
external\_id ID used by the system that generated the lead to identify the lead in the associated system.Data type: String
external\_system Name of the external system associated with the lead, such as HubSpot or pipedrive.Data type: String
first\_name First name of the contact associated with the lead.Data type: String
industry Industry to which the lead belongs.Data type: String Table: Located in the **industry** field of the Account \[customer\_account\] table.
last\_name Last name of the contact associated with the lead. Data type: String
lead\_group Group to which the lead belongs. Data type: Object ``` "lead_group": { "name: "String", "sys_id": "String" } ```
lead\_group.name Lead group's name.Data type: String
lead\_group.sys\_id Sys\_id of the lead group record.Data type: String Table: Group \[sys\_user\_group\]
lead\_line\_items Details of the lead line items associated with the lead.Data type: Array of Objects ``` "lead_line_items": [ { "external_id": "String", "external_system": "String", "lead": {Object}, "number": "String", "product_offering": {Object}, "quantity": Number, "sys_created_by”: "String", "sys_created_on {Object}, "sys_domain": "String", "sys_domain_path": "String", "sys_id": "String", "sys_mod_count": Number, "sys_tags": [Array], "sys_updated_by: "String", "sys_updated_on: {Object}, "unit_of_measurement": {Object}, "work_notes": [Array] } ] ```
lead\_line\_items.​external\_id ID used by the system that generated the lead line item to identify the line item in the associated system.Data type: String
lead\_line\_items.​external\_system Name of the external system associated with the lead line item, such as HubSpot or pipedrive.Data type: String
lead\_line\_items.​lead Details about the lead associated with the line item.Data type: Object ``` "lead: { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​lead.name Associated lead's name.Data type: String
lead\_line\_items.​lead.sys\_id Sys\_id of the associated lead record.Data type: String
lead\_line\_items.​number Unique system-generated number of the lead line item record.Data type: String
lead\_line\_items.​product\_offering Information about the product offering associated with the lead line item.Data type: Object ``` "product_offering": { "code": " String", "name": "String", "sys_id": "String" } ```
lead\_line\_items.​product\_offering.code Code linked to the product offering. **Note:** This is a system-generated alphanumeric number based on the product name. Although system generated, you can edit the code to represent a SKU or any other industry specific product codes. Data type: String
lead\_line\_items.​product\_offering.name Product offering's name.Data type: String
lead\_line\_items.​product\_offering.sys\_id Sys\_id of the product offering record associated with the lead line item. Data type: String Table: Product Offering \[sn\_prd\_pm\_product\_offering\]
lead\_line\_items.​quantity Quantity of items the lead wants to purchase of the associated product offering. Data type: Number \(Integer\)
lead\_line\_items.​sys\_created\_by User name of the person that created the lead line item.Data type: String
lead\_line\_items.​sys\_created\_on System-generated date and time that the lead line item was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_created\_on.display\_value Date and time that the lead line item was created.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_created\_on.value Date and time that the lead line item was created.Data type: String Format: UTC
lead\_line\_items.​sys\_domain Sys\_id of the domain record to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.sys\_domain\_path Path of the domain to which the lead line item belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
lead\_line\_items.​sys\_id Sys\_id of the lead line item record.Data type: String
lead\_line\_items.​sys\_mod\_count Number of times the associated lead line item record has been modified.Data type: Number \(Integer\)
lead\_line\_items.​sys\_tags List of system tags associated with the lead line item.Data type: Array
lead\_line\_items.​sys\_updated\_by User name of the person that last updated the associated lead line item.Data type: String
lead\_line\_items.​sys\_updated\_on System-generated date and time when the lead line item was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
lead\_line\_items.​sys\_updated\_on.​display\_value Date and time that the lead line item was last updated.Data type: String Format: Default instance format and time zone
lead\_line\_items.​sys\_updated\_on.​value Date and time that the lead line item was last updated.Data type: String Format: UTC
lead\_line\_items.​unit\_of\_measurement Details of the measuring unit of lead line item. Data type: Object ``` "unit_of_measurement": { "name": "String", "sys_id": "String" } ```
lead\_line\_items.​unit\_of\_measurement.​name Name of the measuring unit such as, each or cubic foot.Data type: String
lead\_line\_items.​unit\_of\_measurement.​sys\_id Sys\_id of the record that describes the measuring unit.Data type: String Table: Unit of Measure \[sn\_prd\_pm\_uom\]
lead\_line\_items.​work\_notes List that describes the work notes created for the lead line item. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
lead\_line\_items.​work\_notes.​author User name of the person that authored the associated work note.Data type: String
lead\_line\_items.​work\_notes.​date Date that the note was created.Data type: String
lead\_line\_items.​work\_notes.​text Text of the note made by the author.Data type: String
lead\_rating Rating for the lead such as, 100\_cold, 200\_warm, 300\_hot, or 400\_super\_hot.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_rating field of the Leads table. Data type: String
lead\_score Score for the lead.Data type: Decimal Range: 1 to 100
lead\_source Originator of the lead.**Note:** This is a choice field. It must contain one of the choice items defined in the lead\_source field of the Leads table. Data type: String
lead\_type Type of lead, such as New Business or Existing Business. **Note:** This is a choice field. It must contain one of the choice items defined in the lead\_type field of the Leads table. Data type: String
middle\_name Middle name of the contact for the lead.Data type: String
mobile\_phone Phone number of the contact for the lead.Data type: String
number Unique system-generated number of the lead record.Data type: String
other\_reason Additional reason for the lead disqualification.Data type: String Max length: 160 characters
owner Details of the person associated with the lead. Data type: Object ``` "owner": { "name": "String", "sys_id": "String" } ```
owner.name Name of the person that owns the lead.Data type: String
owner.sys\_id Sys\_id of the user record of the person that owns the lead.Data type: String Table: User \[sys\_user\]
reason Reason for the lead disqualification such as, Disqualify.Data type: String Max length: 40 characters
short\_description Short description of the lead.Data type: String Max length: 160 characters
similar\_lead Details on any similar lead. Use this for possible lead disqualification. Data type: Object ``` "similar_lead": { "name": "String", "sys_id": "String" } ```
similar\_lead.name Name of the duplicate lead.Data type: String
similar\_lead.sys\_id Sys\_id of the lead record that is a possible duplicate lead.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
stage Stage of the lead such as, 100\_new. **Note:** This is a choice field. It must contain one of the choice items defined in the stage field of the Leads table. Data type: String
state State in which the lead resides.Data type: String
street Street on which the lead resides.Data type: String
sys\_class\_name System-generated class name of the Lead table.Data type: String
sys\_created\_by User name of the person that created the lead.Data type: String
sys\_created\_on System-generated date and time that the lead was created.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_created\_on.​display\_value Date and time when the lead was created.Data type: String Format: Default instance format and time zone
sys\_created\_on.​value Date and time when the lead was created.Data type: String Format: UTC
sys\_domain Sys\_id of the domain record to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_domain\_path Path of the domain to which the lead belongs. **Note:** This parameter is only returned in the response if domain separation is enabled. Data type: String
sys\_id Sys\_id of the lead record.Data type: String Table: Lead \[sn\_lead\_mgmt\_core\_lead\]
sys\_mod\_count Number of times the associated lead record has been modified.Data type: Number \(Integer\)
sys\_tags List of system tags associated with the lead. You can use these tags to categorize leads.Data type: Array
sys\_updated\_by User name of the person that last updated the lead record.Data type: String
sys\_updated\_on System-generated date and time when the lead was last updated.Data type: Object ``` "sys_created_on": { "display_value": "String", "value": "String" } ```
sys\_updated\_on.​display\_value Date and time that the lead was last updated.Data type: String Format: Instance's default format and time zone
sys\_updated\_on.​value Date and time that the lead was last updated.Data type: String Format: UTC
title Lead's title.Data type: String
website Lead's website URL.Data type: String
work\_notes List of work notes created for the lead. Data type: Array of Objects ``` "work_notes": [ { "author": "String", "date": "String", "text": "String" } ] ```
work\_notes.​author User name of the person that authored the associated work note.Data type: String
work\_notes.​date Date that the note was created.Data type: String
work\_notes.​text Text of the note made by the author.Data type: String
zip Zip code of the associated lead.Data type: String
### cURL request The following code example shows how to create a new lead record with one lead line item. ``` curl " https://instance.service-now.com/api/sn_lead_mgmt_core/v1/lead" \ --request POST \ --header "Accept:application/json" \ --header "Content-Type:application/json" \ --data " { "short_description": "Looking for a quote on preventative maintenance plans for their corporate office building elevators.", "country": "USA", "city": "San Francisco", "lead_source": "inbound_phone", "industry": "manufacturing", "title": "Director of Building operations", "business_phone": "+1 (555) 123-4567", "street": "789, Industrial drive", "company": "Lee Manufacturing Inc", "state": "CA", "first_name": "James", "email": "james.wilson@email.com", "consumer": { "sys_id": "46ce64ef99ca5210f8779c3cc41bb03c" }, "zip": "94016", "website": "example.com", "last_name": "Wilson", "middle_name": null, "do_not_share": false, "lead_score": 92, "stage": "100_new", "do_not_email": false, "lead_type": "existing_business", "work_notes": [ { "text": "Work notes for lead" } ], "do_not_call": true, "lead_rating": "200_warm", "lead_line_items": [ { "quantity": 1, "product_offering": { "sys_id": "32619d9fd0a63110f8770dbf976be1f9" }, "unit_of_measurement": { "sys_id": "cb2795d553020110286eddeeff7b12ff" } } ] } ``` The response contains the fields in the lead and lead line items records. ``` { "short_description": "Looking for a quote on preventative maintenance plans for their corporate office building elevators.", "reason": null, "country": "USA", "closed_date": null, "city": "San Francisco", "lead_source": "inbound_phone", "external_id": null, "industry": "manufacturing", "sys_updated_on": { "value": "2024-12-11 08:35:26", "display_value": "2024-12-11 00:35:26" }, "title": "Director of Building operations", "sys_class_name": "Lead", "number": "LEAD0001001", "sys_id": "030f795380925210f877983fa0be67c0", "business_phone": "+1 (555) 123-4567", "similar_lead": null, "sys_updated_by": "abel.tuter", "mobile_phone": null, "street": "789, Industrial drive", "sys_created_on": { "value": "2024-12-11 08:35:26", "display_value": "2024-12-11 00:35:26" }, "contact": null, "company": "Lee Manufacturing Inc", "state": "CA", "first_name": "James", "email": "james.wilson@email.com", "consumer": { "sys_id": "46ce64ef99ca5210f8779c3cc41bb03c", "name": "test" }, "sys_created_by": "abel.tuter", "zip": "94016", "owner": { "sys_id": "62826bf03710200044e0bfc8bcbe5df1", "name": "Abel Tuter" }, "website": "example.com", "lead_group": null, "sys_mod_count": 1, "last_name": "Wilson", "other_reason": null, "middle_name": null, "sys_tags": null, "do_not_share": false, "lead_score": 92, "stage": "100_new", "do_not_email": false, "lead_type": "existing_business", "work_notes": [ { "author": "Abel Tuter", "date": "2024-12-11 00:35:26", "text": "Work notes for lead" }, { "author": "Abel Tuter", "date": "2024-12-11 00:35:26", "text": "Lead Line Item [code]LEADL0001001[/code] has been created [code] Product Offering [/code] Safety Test Coverage [code] Quantity [/code] 1 [code] Unit of Measure [/code] Each" } ], "do_not_call": true, "lead_rating": "200_warm", "account": null, "external_system": null, "lead_line_items": [ { "quantity": 1, "product_offering": { "sys_id": "32619d9fd0a63110f8770dbf976be1f9", "name": "Safety Test Coverage", "code": "SAFETSTCVG1" }, "sys_mod_count": 0, "external_id": null, "sys_updated_on": { "value": "2024-12-11 08:35:26", "display_value": "2024-12-11 00:35:26" }, "sys_tags": null, "lead": { "sys_id": "030f795380925210f877983fa0be67c0", "name": "LEAD0001001" }, "number": "LEADL0001001", "sys_id": "830f795380925210f877983fa0be67c5", "unit_of_measurement": { "sys_id": "cb2795d553020110286eddeeff7b12ff", "name": "Each" }, "sys_updated_by": "abel.tuter", "sys_created_on": { "value": "2024-12-11 08:35:26", "display_value": "2024-12-11 00:35:26" }, "work_notes": null, "sys_created_by": "abel.tuter", "external_system": null } ] } ```