{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":496,"path":"api-reference/rest-apis/consumer-api.md","title":"Consumer API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Consumer API\n\nThe Consumer API provides endpoints to retrieve and update Customer Service Management \\(CSM\\) consumer records.\n\nIn addition, you can generate new social media profile records when creating a consumer.\n\nThe Consumer API requires the Customer Service plugin \\(com.sn\\_customerservice\\) and is provided within the `now` namespace.\n\nUsers require the csm\\_ws\\_integration role for full API access.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Consumer - GET /now/consumer\n\nRetrieves a specified set of Customer Service Management \\(CSM\\) consumer records.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/consumer`\n\nDefault URL: `/api/now/consumer`\n\n**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).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table><table class=\"rest_api_query_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nsysparm\\_limit\n\n</td><td id=\"sysparm-limit-entry\">\n\nMaximum number of records to return. For requests that exceed this number of records, use the **sysparm\\_offset** parameter to paginate record retrieval.\n\nIn the response, the boolean parameter **hasMore** is returned. It indicates whether there are more records to return that meet the filter criteria.\n\nData type: Number\n\nDefault: 10\n\n</td></tr><tr><td>\n\nsysparm\\_offset\n\n</td><td id=\"sysparm-offset-entry\">\n\nStarting 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.\n\nFor 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.\n\nDo not pass a negative number in the **sysparm\\_offset** parameter.\n\nData type: Number\n\nDefault: 0\n\n</td></tr><tr><td>\n\nsysparm\\_query\n\n</td><td id=\"sysparm-query-entry\">\n\nEncoded query used to filter the result set.For example:\n\n`sysparm_query=caller_id=javascript:gs.getUserID()^active=true`\n\nThe 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.\n\nIf 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.\n\n**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.\n\nData type: String\n\n</td></tr></tbody>\n</table>|Element|Description|\n|-------|-----------|\n|None| |\n\n### Headers\n\nThe 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).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|404|Not found. The requested item wasn't found.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\nThe endpoint may return the following JSON or XML elements in the response body. In addition to the list of elements defined below \\(which define the elements in a base system\\), the endpoint also returns any custom fields added to the Consumer \\[csm\\_consumer\\] table. For additional information on these elements, refer to your specific table definition \\[**System Definition** &gt; **Tables**\\].\n\n<table><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nactive\n\n</td><td id=\"consumertable-active-entry\">\n\nFlag that indicates whether the consumer is active.Possible values:\n\n-   true: Consumer active\n-   false: Consumer de-activated\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nbusiness\\_phone\n\n</td><td id=\"consumertable-business_phone-entry\">\n\nBusiness phone number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ncity\n\n</td><td id=\"consumertable-city-entry\">\n\nCity in which the consumer resides.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\ncountry\n\n</td><td id=\"consumertable-country-entry\">\n\nCountry in which the consumer resides.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ndate\\_format\n\n</td><td id=\"consumertable-date_format-entry\">\n\nFormat in which to display dates.Valid values:\n\n-   dd-mm-yyyy\n-   dd/mm/yyyy\n-   dd.mm.yyyy\n-   mm-dd-yyyy\n-   yyyy-mm-dd\n\nData type: String\n\nMaximum length: 40\n\nDefault: blank \\(system date format\\)\n\n</td></tr><tr><td>\n\nemail\n\n</td><td id=\"consumertable-email-entry\">\n\nEmail address of the consumer.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\nfax\n\n</td><td id=\"consumertable-fax-entry\">\n\nFax number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nfirst\\_name\n\n</td><td id=\"consumertable-first_name-entry\">\n\nConsumer first name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\ngender\n\n</td><td id=\"consumertable-gender-entry\">\n\nGender of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nhome\\_phone\n\n</td><td id=\"consumertable-home_phone-entry\">\n\nHome phone number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nhousehold\n\n</td><td id=\"consumertable-household-entry\">\n\nSys\\_id of the record that describes the household characteristics.Data type: String\n\nTable: Household \\[csm\\_household\\]\n\n</td></tr><tr><td>\n\nlast\\_name\n\n</td><td id=\"consumertable-last_name-entry\">\n\nConsumer last name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\nmiddle\\_name\n\n</td><td id=\"consumertable-middle_name-entry\">\n\nConsumer middle name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\nmobile\\_phone\n\n</td><td id=\"consumertable-mobile_phone-entry\">\n\nConsumer mobile phone number.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nname\n\n</td><td id=\"consumertable-name-entry\">\n\nConsumer full name; first\\_name+middle\\_name+last\\_name.Data type: String\n\nMaximum length: 152\n\n</td></tr><tr><td>\n\nnotes\n\n</td><td id=\"consumertable-notes-entry\">\n\nNotes on consumer.Data type: String\n\nMaximum length: 4,000\n\n</td></tr><tr><td>\n\nnotification\n\n</td><td id=\"consumertable-notification-entry\">\n\nIndicates whether the consumer should receive notifications.Valid values:\n\n-   1: Disabled\n-   2: Enabled\n\nData type: Number \\(Integer\\)\n\nMaximum length: 40\n\nDefault: 2\n\n</td></tr><tr><td>\n\nnumber\n\n</td><td id=\"consumertable-number-entry\">\n\nUnique number associated with the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nphoto\n\n</td><td id=\"consumertable-photo-entry\">\n\nPhoto of the consumer.Data type: Image\n\n</td></tr><tr><td>\n\npreferred\\_language\n\n</td><td id=\"consumertable-preferred_language-entry\">\n\nConsumer primary language.Data type: String\n\nMaximum length: 3\n\n</td></tr><tr><td>\n\nprefix\n\n</td><td id=\"consumertable-prefix-entry\">\n\nConsumer name prefix such as, Dr., Mr., Mrs., or Ms.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nprimary\n\n</td><td id=\"consumertable-primary-entry\">\n\nFlag that indicates whether this is the primary consumer.Possible values:\n\n-   true: Primary consumer\n-   false: Not primary consumer\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nstate\n\n</td><td id=\"consumertable-state-entry\">\n\nState in which the consumer resides.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\nstreet\n\n</td><td id=\"consumertable-street-entry\">\n\nConsumer street address.Data type: String\n\nMaximum length: 255\n\n</td></tr><tr><td>\n\nsuffix\n\n</td><td id=\"consumertable-suffix-entry\">\n\nConsumer name suffix such as Jr., Sr., or II.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_created\\_by\n\n</td><td id=\"consumertable-sys_created_by-entry\">\n\nUser that created the consumer record.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nsys\\_created\\_on\n\n</td><td id=\"consumertable-sys_created_on-entry\">\n\nDate and time the consumer record was originally created.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_domain\n\n</td><td id=\"consumertable-sys_domain-entry\">\n\nServiceNow domain in which the consumer information resides.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td id=\"consumertable-sys_id-entry\">\n\nUnique identifier for the consumer.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_mod\\_count\n\n</td><td id=\"consumertable-sys_mod_count-entry\">\n\nNumber of times that the associated consumer information has been modified.Data type: Number \\(Integer\\)\n\n</td></tr><tr><td>\n\nsys\\_tags\n\n</td><td>\n\nSystem tags.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_updated\\_by\n\n</td><td id=\"consumertable-sys_updated_by-entry\">\n\nUser that last updated the consumer information.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nsys\\_updated\\_on\n\n</td><td id=\"consumertable-sys_updated_on-entry\">\n\nDate and time when the consumer information was last updated.Data type: String\n\n</td></tr><tr><td>\n\ntime\\_format\n\n</td><td id=\"consumertable-time_format-entry\">\n\nFormat in which to display time.Valid values:\n\n-   hh.mm.ss a: hh.mm.ss \\(12 hour\\)\n-   hh:mm:ss a: hh:mm:ss \\(12 hour\\)\n-   HH.mm.ss: hh.mm.ss \\(24 hour\\)\n-   HH:mm:ss: hh:mm:ss \\(24 hour\\)\n\nData type: String\n\nMaximum length: 40\n\nDefault: blank \\(system time format\\)\n\n</td></tr><tr><td>\n\ntime\\_zone\n\n</td><td id=\"consumertable-time_zone-entry\">\n\nConsumer time zone, such as Canada/Central or US/Eastern.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ntitle\n\n</td><td id=\"consumertable-title-entry\">\n\nConsumer business title such as Manager, Software Developer, or Contractor.Data type: String\n\nMaximum length: 60\n\n</td></tr><tr><td>\n\nuser\n\n</td><td id=\"consumertable-user-entry\">\n\nSys\\_id of the consumer user. Data type: String\n\nTable: Consumer User \\[csm\\_consumer\\_user\\]\n\n</td></tr><tr><td>\n\nzip\n\n</td><td id=\"consumertable-zip-entry\">\n\nConsumer zip code. Data type: String\n\nMaximum length: 40\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.servicenow.com/api/now/consumer?sysparm_query=account=86837a386f0331003b3c498f5d3ee4ca&sysparm_limit=2&sysparm_offset=2>;rel=\"next\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user \"username\":\"password\"\n```\n\n```\n{\n  \"result\": [\n    {\n      \"country\": \"USA\",\n      \"notes\": \"\",\n      \"gender\": \"Male\",\n      \"city\": \"Plano\",\n      \"prefix\": \"\",\n      \"sys_updated_on\": \"2016-08-12 00:19:12\",\n      \"suffix\": \"\",\n      \"title\": \"\",\n      \"number\": \"CSMR0000004\",\n      \"notification\": \"2\",\n      \"sys_id\": \"01d8403fdb1b1200b6075200cf961941\",\n      \"business_phone\": \"\",\n      \"sys_updated_by\": \"prithvi\",\n      \"mobile_phone\": \"\",\n      \"street\": \"6900 Dallas Pkwy\",\n      \"sys_created_on\": \"2016-06-16 19:20:13\",\n      \"sys_domain\": \"global\",\n      \"state\": \"TX\",\n      \"fax\": \"\",\n      \"first_name\": \"Harding\",\n      \"email\": \"harding.asher@mailinator.com\",\n      \"preferred_language\": \"\",\n      \"sys_created_by\": \"guest\",\n      \"zip\": \"75024\",\n      \"home_phone\": \"\",\n      \"time_format\": \"\",\n      \"sys_mod_count\": \"8\",\n      \"last_name\": \"Asher\",\n      \"photo\": \"\",\n      \"active\": \"true\",\n      \"middle_name\": \"\",\n      \"time_zone\": \"\",\n      \"sys_tags\": \"\",\n      \"name\": \"Harding Asher\",\n      \"household\": \"\",\n      \"date_format\": \"\",\n      \"user\": \"c3d35d82c37122005871d44d81d3ae91\",\n      \"primary\": \"false\"\n    },\n    {\n      \"country\": \"USA\",\n      \"notes\": \"\",\n      \"gender\": \"Male\",\n      \"city\": \"San Francisco\",\n      \"prefix\": \"\",\n      \"sys_updated_on\": \"2016-08-12 00:20:27\",\n      \"suffix\": \"\",\n      \"title\": \"\",\n      \"number\": \"CSMR0000002\",\n      \"notification\": \"2\",\n      \"sys_id\": \"a0488cfbdb1b1200b6075200cf9619db\",\n      \"business_phone\": \"\",\n      \"sys_updated_by\": \"prithvi\",\n      \"mobile_phone\": \"\",\n      \"street\": \"144 2nd St\",\n      \"sys_created_on\": \"2016-06-16 19:17:44\",\n      \"sys_domain\": \"global\",\n      \"state\": \"CA\",\n      \"fax\": \"\",\n      \"first_name\": \"Sam\",\n      \"email\": \"sam.collins@mailinator.com\",\n      \"preferred_language\": \"\",\n      \"sys_created_by\": \"guest\",\n      \"zip\": \"94105\",\n      \"home_phone\": \"\",\n      \"time_format\": \"\",\n      \"sys_mod_count\": \"13\",\n      \"last_name\": \"Collins\",\n      \"photo\": \"\",\n      \"active\": \"true\",\n      \"middle_name\": \"\",\n      \"time_zone\": \"\",\n      \"sys_tags\": \"\",\n      \"name\": \"Sam Collins\",\n      \"household\": \"\",\n      \"date_format\": \"\",\n      \"user\": \"64488cfbdb1b1200b6075200cf9619db\",\n      \"primary\": \"false\"\n    }\n  ]\n}\n\n```\n\n## Consumer - GET /now/consumer/\\{id\\}\n\nRetrieves the specified Customer Service Management \\(CSM\\) consumer record.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/consumer/{id}`\n\nDefault URL: `/api/now/consumer/{id}`\n\n**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).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr><tr><td>\n\nid\n\n</td><td>\n\nSys\\_id of the consumer record to return.Data type: String\n\nTable: Consumer \\[csm\\_consumer\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n|Name|Description|\n|----|-----------|\n|None| |\n\n### Headers\n\nThe 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).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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).\n\n<table><thead><tr><th>\n\nStatus code\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n200\n\n</td><td id=\"entry-200-status-code\">\n\nSuccessful. The request was successfully processed.\n\n</td></tr><tr><td>\n\n401\n\n</td><td id=\"entry-401-status-code\">\n\nUnauthorized. The user credentials are incorrect or have not been passed.\n\n</td></tr><tr><td>\n\n404\n\n</td><td>\n\nIndicates that the request is invalid. Could be due to one of the following reasons:-   Requested case doesn't exist.\n-   User doesn't have access to the consumer record.\n\n</td></tr><tr><td>\n\n500\n\n</td><td id=\"entry-500-status-code\">\n\nInternal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.\n\n</td></tr></tbody>\n</table>### Response body parameters \\(JSON or XML\\)\n\nThe endpoint may return the following JSON or XML elements in the response body. In addition to the list of elements defined below \\(which define the elements in a base system\\), the endpoint also returns any custom fields added to the Consumer \\[csm\\_consumer\\] table. For additional information on these elements, refer to your specific table definition \\[**System Definition** &gt; **Tables**\\].\n\n<table><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nactive\n\n</td><td id=\"consumertable-active-entry\">\n\nFlag that indicates whether the consumer is active.Possible values:\n\n-   true: Consumer active\n-   false: Consumer de-activated\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nbusiness\\_phone\n\n</td><td id=\"consumertable-business_phone-entry\">\n\nBusiness phone number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ncity\n\n</td><td id=\"consumertable-city-entry\">\n\nCity in which the consumer resides.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\ncountry\n\n</td><td id=\"consumertable-country-entry\">\n\nCountry in which the consumer resides.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ndate\\_format\n\n</td><td id=\"consumertable-date_format-entry\">\n\nFormat in which to display dates.Valid values:\n\n-   dd-mm-yyyy\n-   dd/mm/yyyy\n-   dd.mm.yyyy\n-   mm-dd-yyyy\n-   yyyy-mm-dd\n\nData type: String\n\nMaximum length: 40\n\nDefault: blank \\(system date format\\)\n\n</td></tr><tr><td>\n\nemail\n\n</td><td id=\"consumertable-email-entry\">\n\nEmail address of the consumer.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\nfax\n\n</td><td id=\"consumertable-fax-entry\">\n\nFax number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nfirst\\_name\n\n</td><td id=\"consumertable-first_name-entry\">\n\nConsumer first name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\ngender\n\n</td><td id=\"consumertable-gender-entry\">\n\nGender of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nhome\\_phone\n\n</td><td id=\"consumertable-home_phone-entry\">\n\nHome phone number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nhousehold\n\n</td><td id=\"consumertable-household-entry\">\n\nSys\\_id of the record that describes the household characteristics.Data type: String\n\nTable: Household \\[csm\\_household\\]\n\n</td></tr><tr><td>\n\nlast\\_name\n\n</td><td id=\"consumertable-last_name-entry\">\n\nConsumer last name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\nmiddle\\_name\n\n</td><td id=\"consumertable-middle_name-entry\">\n\nConsumer middle name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\nmobile\\_phone\n\n</td><td id=\"consumertable-mobile_phone-entry\">\n\nConsumer mobile phone number.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nname\n\n</td><td id=\"consumertable-name-entry\">\n\nConsumer full name; first\\_name+middle\\_name+last\\_name.Data type: String\n\nMaximum length: 152\n\n</td></tr><tr><td>\n\nnotes\n\n</td><td id=\"consumertable-notes-entry\">\n\nNotes on consumer.Data type: String\n\nMaximum length: 4,000\n\n</td></tr><tr><td>\n\nnotification\n\n</td><td id=\"consumertable-notification-entry\">\n\nIndicates whether the consumer should receive notifications.Valid values:\n\n-   1: Disabled\n-   2: Enabled\n\nData type: Number \\(Integer\\)\n\nMaximum length: 40\n\nDefault: 2\n\n</td></tr><tr><td>\n\nnumber\n\n</td><td id=\"consumertable-number-entry\">\n\nUnique number associated with the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nphoto\n\n</td><td id=\"consumertable-photo-entry\">\n\nPhoto of the consumer.Data type: Image\n\n</td></tr><tr><td>\n\npreferred\\_language\n\n</td><td id=\"consumertable-preferred_language-entry\">\n\nConsumer primary language.Data type: String\n\nMaximum length: 3\n\n</td></tr><tr><td>\n\nprefix\n\n</td><td id=\"consumertable-prefix-entry\">\n\nConsumer name prefix such as, Dr., Mr., Mrs., or Ms.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nprimary\n\n</td><td id=\"consumertable-primary-entry\">\n\nFlag that indicates whether this is the primary consumer.Possible values:\n\n-   true: Primary consumer\n-   false: Not primary consumer\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nstate\n\n</td><td id=\"consumertable-state-entry\">\n\nState in which the consumer resides.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\nstreet\n\n</td><td id=\"consumertable-street-entry\">\n\nConsumer street address.Data type: String\n\nMaximum length: 255\n\n</td></tr><tr><td>\n\nsuffix\n\n</td><td id=\"consumertable-suffix-entry\">\n\nConsumer name suffix such as Jr., Sr., or II.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_created\\_by\n\n</td><td id=\"consumertable-sys_created_by-entry\">\n\nUser that created the consumer record.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nsys\\_created\\_on\n\n</td><td id=\"consumertable-sys_created_on-entry\">\n\nDate and time the consumer record was originally created.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_domain\n\n</td><td id=\"consumertable-sys_domain-entry\">\n\nServiceNow domain in which the consumer information resides.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td id=\"consumertable-sys_id-entry\">\n\nUnique identifier for the consumer.Data type: String\n\n</td></tr><tr><td>\n\nsys\\_mod\\_count\n\n</td><td id=\"consumertable-sys_mod_count-entry\">\n\nNumber of times that the associated consumer information has been modified.Data type: Number \\(Integer\\)\n\n</td></tr><tr><td>\n\nsys\\_updated\\_by\n\n</td><td id=\"consumertable-sys_updated_by-entry\">\n\nUser that last updated the consumer information.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nsys\\_updated\\_on\n\n</td><td id=\"consumertable-sys_updated_on-entry\">\n\nDate and time when the consumer information was last updated.Data type: String\n\n</td></tr><tr><td>\n\ntime\\_format\n\n</td><td id=\"consumertable-time_format-entry\">\n\nFormat in which to display time.Valid values:\n\n-   hh.mm.ss a: hh.mm.ss \\(12 hour\\)\n-   hh:mm:ss a: hh:mm:ss \\(12 hour\\)\n-   HH.mm.ss: hh.mm.ss \\(24 hour\\)\n-   HH:mm:ss: hh:mm:ss \\(24 hour\\)\n\nData type: String\n\nMaximum length: 40\n\nDefault: blank \\(system time format\\)\n\n</td></tr><tr><td>\n\ntime\\_zone\n\n</td><td id=\"consumertable-time_zone-entry\">\n\nConsumer time zone, such as Canada/Central or US/Eastern.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ntitle\n\n</td><td id=\"consumertable-title-entry\">\n\nConsumer business title such as Manager, Software Developer, or Contractor.Data type: String\n\nMaximum length: 60\n\n</td></tr><tr><td>\n\nuser\n\n</td><td id=\"consumertable-user-entry\">\n\nSys\\_id of the consumer user. Data type: String\n\nTable: Consumer User \\[csm\\_consumer\\_user\\]\n\n</td></tr><tr><td>\n\nzip\n\n</td><td id=\"consumertable-zip-entry\">\n\nConsumer zip code. Data type: String\n\nMaximum length: 40\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl \"https://instance.servicenow.com/api/now/consumer/01d8403fdb1b1200b6075200cf961941 \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user \"username\":\"password\"\n\n```\n\n```\n{\n  \"result\": {\n    \"country\": \"USA\",\n    \"notes\": \"\",\n    \"gender\": \"Male\",\n    \"city\": \"Plano\",\n    \"prefix\": \"\",\n    \"sys_updated_on\": \"2016-08-12 00:19:12\",\n    \"suffix\": \"\",\n    \"title\": \"\",\n    \"number\": \"CSMR0000004\",\n    \"notification\": \"2\",\n    \"sys_id\": \"01d8403fdb1b1200b6075200cf961941\",\n    \"business_phone\": \"\",\n    \"sys_updated_by\": \"prithvi\",\n    \"mobile_phone\": \"\",\n    \"street\": \"6900 Dallas Pkwy\",\n    \"sys_created_on\": \"2016-06-16 19:20:13\",\n    \"sys_domain\": \"global\",\n    \"state\": \"TX\",\n    \"fax\": \"\",\n    \"first_name\": \"Harding\",\n    \"email\": \"harding.asher@mailinator.com\",\n    \"preferred_language\": \"\",\n    \"sys_created_by\": \"guest\",\n    \"zip\": \"75024\",\n    \"home_phone\": \"\",\n    \"time_format\": \"\",\n    \"sys_mod_count\": \"8\",\n    \"last_name\": \"Asher\",\n    \"photo\": \"\",\n    \"active\": \"true\",\n    \"middle_name\": \"\",\n    \"time_zone\": \"\",\n    \"sys_tags\": \"\",\n    \"name\": \"Harding Asher\",\n    \"household\": \"\",\n    \"date_format\": \"\",\n    \"user\": \"c3d35d82c37122005871d44d81d3ae91\",\n    \"primary\": \"false\"\n  }\n}\n\n```\n\n## Consumer - POST /now/consumer\n\nCreates a new Customer Service Management \\(CSM\\) consumer.\n\nIn addition, you can create a social media profile for the consumer using this endpoint. To create the profile, you must specify the following parameters in the request body:\n\n-   **social\\_channel**\n-   **social\\_handle**\n-   **social\\_handle\\_url**\n\n**Warning:** This endpoint does not perform parameter validation as doing so can create excessive overhead. If a request parameter is misspelled, is not valid, or is not supported by the endpoint, it is ignored without warning.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/consumer`\n\nDefault URL: `/api/now/consumer`\n\n**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).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. 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\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nactive\n\n</td><td id=\"consumertable-active-entry\">\n\nFlag that indicates whether the consumer is active.Possible values:\n\n-   true: Consumer active\n-   false: Consumer de-activated\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nbusiness\\_phone\n\n</td><td id=\"consumertable-business_phone-entry\">\n\nBusiness phone number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ncity\n\n</td><td id=\"consumertable-city-entry\">\n\nCity in which the consumer resides.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\ncountry\n\n</td><td id=\"consumertable-country-entry\">\n\nCountry in which the consumer resides.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ndate\\_format\n\n</td><td id=\"consumertable-date_format-entry\">\n\nFormat in which to display dates.Valid values:\n\n-   dd-mm-yyyy\n-   dd/mm/yyyy\n-   dd.mm.yyyy\n-   mm-dd-yyyy\n-   yyyy-mm-dd\n\nData type: String\n\nMaximum length: 40\n\nDefault: blank \\(system date format\\)\n\n</td></tr><tr><td>\n\nemail\n\n</td><td id=\"consumertable-email-entry\">\n\nEmail address of the consumer.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\nfax\n\n</td><td id=\"consumertable-fax-entry\">\n\nFax number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nfirst\\_name\n\n</td><td id=\"consumertable-first_name-entry\">\n\nConsumer first name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\ngender\n\n</td><td id=\"consumertable-gender-entry\">\n\nGender of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nhome\\_phone\n\n</td><td id=\"consumertable-home_phone-entry\">\n\nHome phone number of the consumer.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nhousehold\n\n</td><td id=\"consumertable-household-entry\">\n\nSys\\_id of the record that describes the household characteristics.Data type: String\n\nTable: Household \\[csm\\_household\\]\n\n</td></tr><tr><td>\n\nlast\\_name\n\n</td><td id=\"consumertable-last_name-entry\">\n\nConsumer last name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\nmiddle\\_name\n\n</td><td id=\"consumertable-middle_name-entry\">\n\nConsumer middle name.Data type: String\n\nMaximum length: 50\n\n</td></tr><tr><td>\n\nmobile\\_phone\n\n</td><td id=\"consumertable-mobile_phone-entry\">\n\nConsumer mobile phone number.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nname\n\n</td><td id=\"consumertable-name-entry\">\n\nConsumer full name; first\\_name+middle\\_name+last\\_name.Data type: String\n\nMaximum length: 152\n\n</td></tr><tr><td>\n\nnotes\n\n</td><td id=\"consumertable-notes-entry\">\n\nNotes on consumer.Data type: String\n\nMaximum length: 4,000\n\n</td></tr><tr><td>\n\nnotification\n\n</td><td id=\"consumertable-notification-entry\">\n\nIndicates whether the consumer should receive notifications.Valid values:\n\n-   1: Disabled\n-   2: Enabled\n\nData type: Number \\(Integer\\)\n\nMaximum length: 40\n\nDefault: 2\n\n</td></tr><tr><td>\n\nphoto\n\n</td><td id=\"consumertable-photo-entry\">\n\nPhoto of the consumer.Data type: Image\n\n</td></tr><tr><td>\n\npreferred\\_language\n\n</td><td id=\"consumertable-preferred_language-entry\">\n\nConsumer primary language.Data type: String\n\nMaximum length: 3\n\n</td></tr><tr><td>\n\nprefix\n\n</td><td id=\"consumertable-prefix-entry\">\n\nConsumer name prefix such as, Dr., Mr., Mrs., or Ms.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\nprimary\n\n</td><td id=\"consumertable-primary-entry\">\n\nFlag that indicates whether this is the primary consumer.Possible values:\n\n-   true: Primary consumer\n-   false: Not primary consumer\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsocial\\_channel\n\n</td><td>\n\nSocial media channel to which the consumer is associated such as Twitter, Facebook, or Instagram.Data type: String\n\n</td></tr><tr><td>\n\nsocial\\_handle\n\n</td><td>\n\nUser handle on the social media channel.Data type: String\n\n</td></tr><tr><td>\n\nsocial\\_handle\\_url\n\n</td><td>\n\nURL to the consumer's social channel handle.Data type: String\n\n</td></tr><tr><td>\n\nstate\n\n</td><td id=\"consumertable-state-entry\">\n\nState in which the consumer resides.Data type: String\n\nMaximum length: 100\n\n</td></tr><tr><td>\n\nstreet\n\n</td><td id=\"consumertable-street-entry\">\n\nConsumer street address.Data type: String\n\nMaximum length: 255\n\n</td></tr><tr><td>\n\nsuffix\n\n</td><td id=\"consumertable-suffix-entry\">\n\nConsumer name suffix such as Jr., Sr., or II.Data type: String\n\n</td></tr><tr><td>\n\ntime\\_format\n\n</td><td id=\"consumertable-time_format-entry\">\n\nFormat in which to display time.Valid values:\n\n-   hh.mm.ss a: hh.mm.ss \\(12 hour\\)\n-   hh:mm:ss a: hh:mm:ss \\(12 hour\\)\n-   HH.mm.ss: hh.mm.ss \\(24 hour\\)\n-   HH:mm:ss: hh:mm:ss \\(24 hour\\)\n\nData type: String\n\nMaximum length: 40\n\nDefault: blank \\(system time format\\)\n\n</td></tr><tr><td>\n\ntime\\_zone\n\n</td><td id=\"consumertable-time_zone-entry\">\n\nConsumer time zone, such as Canada/Central or US/Eastern.Data type: String\n\nMaximum length: 40\n\n</td></tr><tr><td>\n\ntitle\n\n</td><td id=\"consumertable-title-entry\">\n\nConsumer business title such as Manager, Software Developer, or Contractor.Data type: String\n\nMaximum length: 60\n\n</td></tr><tr><td>\n\nuser\n\n</td><td id=\"consumertable-user-entry\">\n\nSys\\_id of the consumer user. Data type: String\n\nTable: Consumer User \\[csm\\_consumer\\_user\\]\n\n</td></tr><tr><td>\n\nzip\n\n</td><td id=\"consumertable-zip-entry\">\n\nConsumer zip code. Data type: String\n\nMaximum length: 40\n\n</td></tr></tbody>\n</table>### Headers\n\nThe 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).\n\n|Header|Description|\n|------|-----------|\n|Accept|Data format of the response body. Only supports **application/json**.|\n|Content-Type|Data format of the request body. Only supports **application/json**.|\n\n|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe 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).\n\n|Status code|Description|\n|-----------|-----------|\n|201|New consumer record was successfully created.|\n|400|Bad Request. A bad request type or malformed request was detected.|\n|401|Unauthorized. The user credentials are incorrect or have not been passed.|\n|500|Internal Server Error. A logic error on the server-side code occurred.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nElement\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nSys\\_id of the newly created consumer record.Data type: String\n\n</td></tr></tbody>\n</table>### cURL request\n\n```\ncurl -X POST \"https://instance.servicenow.com/api/now/consumer\" \\\n-H \"Accept: application/json\" \\\n-H \"Content-Type: application/json\" \\\n-d \" { \\\n  \"country\": \"USA\", \\\n  \"notes\": \"Never comes in before 10am\", \\\n  \"gender\": \"Female\", \\\n  \"city\": \"San Marcos\", \\\n  \"prefix\": \"Ms\", \\\n  \"title\": \"Director\", \\\n  \"notification\": \"1\", \\\n  \"business_phone\": \"(555)555-1234\", \\\n  \"mobile_phone\": \"(555)555-1235\", \\\n  \"street\": \"123 Sesame St\", \\\n  \"state\": \"CA\", \\\n  \"fax\": \"(555)555-1236\", \\\n  \"first_name\": \"Jane\", \\\n  \"zip\": \"92001\", \\\n  \"home_phone\": \"(555)555-1234\", \\\n  \"last_name\": \"Brown\", \\\n  \"active\": \"true\", \\\n  \"middle_name\": \"Dell\", \\\n  \"time_zone\": \"PST\", \\\n  \"name\": \"Jane Brown\", \\\n  \"household\": \"4\", \\\n  \"user\": \"c3d35d82c37122005871d44d81d3ae91\", \\\n  \"primary\": \"false\" \\\n}\"\n--user \"username\":\"password\"\n```\n\n```\n{\n    \"result\": \"0f5c13addb93230057c3fd441d9619b8\"\n}\n```\n\n"}}