{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":571,"path":"api-reference/rest-apis/wrap-up-api.md","title":"Wrap Up API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Wrap Up API\n\nProvides endpoints for managing wrap-up functionality for external Contact Center as a Service \\(CCaaS\\) systems or ServiceNow AI Platform workspaces.\n\nThis API requires the Interactions Management \\(com.glide.interaction.awa\\) plugin. To call this API, you must have the interaction\\_integration\\_user role.\n\nWhen agents close an interaction, the wrap-up feature enables them to enter closing details and wrap-up codes for future reference. For more information about wrap-up functionality, see [Wrap up overview](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/conversational-interfaces/wrap-up-overview.md).\n\nTo use this API for segmented wrap-up of interactions from external systems, you must implement the InteractionSegment scripted extension point to create and retrieve segment records in your chosen table. If you're using [OpenFrame](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/customer-service-management/c_OpenFrameOverview.md), the extension point has an existing implementation to create and retrieve segment records in the Phone Log \\[sn\\_openframe\\_phone\\_log\\] table.\n\n-   **AI wrap-up recommendations**\n\n    AI wrap-up recommendations can come from two sources:\n\n    -   Internal \\(Now Assist\\): When **use\\_third\\_party\\_ai** is false, a business rule triggers automatically after segment creation to call the CSM API and populate **ai\\_wrap\\_up\\_code** and **ai\\_notes**.\n    -   External \\(third-party / CCaaS\\): When **use\\_third\\_party\\_ai** is true, the external system pushes AI data via the new PUT `/api/now/wrapup/segment/update/ai` endpoint.\n-   **Use cases**\n    -   Reduce agent handle time by providing wrap-up codes and notes with AI suggestions.\n    -   Enable CCaaS platforms to push AI-generated content into ServiceNow AI Platform after an interaction ends.\n    -   Give supervisors cleaner, more consistent wrap-up data for reporting and analytics.\n-   **Endpoint call order for an AI-assisted wrap-up flow**\n    1.  POST `/api/now/wrapup/segment/create` — Open a segment or pass **ai\\_wrap\\_up\\_code** / **ai\\_notes** and AI config flags.\n    2.  PUT `/api/now/wrapup/segment/update/ai` — \\(External AI only\\) Push AI recommendations onto the open segment.\n    3.  PUT `/api/now/wrapup/segment/update` — Agent finalizes and closes the segment.\n    4.  GET `/api/now/wrapup/segment/{segment_id}` — Retrieve segment including stored AI fields.\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## Wrap Up - GET /now/wrapup/code/\\{code\\_id\\}\n\nRetrieves details for a specified wrap-up code.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/wrapup/code/{code_id}`\n\nDefault URL: `/api/now/wrapup/code/{code_id}`\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\ncode\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\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|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\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. 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\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nObject containing information about the API request and the wrap-up code.Data type: Object\n\n```\n\"result\": {\n   \"message\": \"String\",\n   \"resultMap\": {Object},\n   \"success\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nresult.message\n\n</td><td id=\"message\">\n\nMessage that describes the outcome of the API request.Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map\n\n</td><td>\n\nObject containing the wrap-up code.Data type: Object\n\n```\n\"result_map\": {\n   \"wrap_up_code\": {Object}\n}\n```\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code\n\n</td><td>\n\nObject with details about the wrap-up code.Data type: Object\n\n```\n\"wrap_up_code\": {\n   \"active\": Boolean,\n   \"code\": \"String\",\n   \"description\": \"String\",\n   \"external\": Boolean,\n   \"sys_id\": \"String\",\n   \"translated_code\": \"String\",\n   \"translated_description\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map.wrap\\_up\\_code.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nresult.success\n\n</td><td id=\"success\">\n\nFlag that indicates whether the API request was successfully processed.Valid values:\n\n-   true: The API request was successful.\n-   false: The API request failed.\n\nData type: Boolean\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example retrieves details for a specified wrap-up code.\n\n```\ncurl \"https://instance.service-now.com/api/now/v1/wrapup/code/49c27b679f201210c89656effa0a1cd7\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"result\": {\n    \"message\": \"Wrap up code found.\",\n    \"result_map\": {\n      \"wrap_up_code\": {\n        \"code\": \"Billing Issue\",\n        \"description\": \"A code for billing issues\",\n        \"active\": true,\n        \"external\": true,\n        \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n        \"translated_code\": \"Abrechnungsproblem\",\n        \"translated_description\": \"Ein code für Abrechnungsprobleme\"\n      }\n    },\n    \"success\": true\n  }\n}\n```\n\n## Wrap Up - GET /now/wrapup/segment/\\{segment\\_id\\}\n\nRetrieves details for a specified wrap-up segment.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/wrapup/segment/{segment_id}`\n\nDefault URL: `/api/now/wrapup/segment/{segment_id}`\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\nsegment\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment in the Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\] table, or identifier representing the interaction segment on the external system. Data type: String\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|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\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. 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\n<table id=\"table_xpr_b42_42c\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nMessage that describes the outcome of the API request.Data type: String\n\n</td></tr><tr><td>\n\nsegment\n\n</td><td>\n\nObject containing data about the interaction and wrap-up segment.Data type: Object\n\n```\n\"segment\": {\n  \"agent\": \"String\",\n  \"ai_code_defined_at\": \"String\",\n  \"ai_notes\": \"String\",\n  \"ai_notes_defined_at\": \"String\",\n  \"ai_wrap_up_code\": \"String\",\n  \"awaiting_confirmation\": Boolean,\n  \"confirmed_on\": \"String\",\n  \"external\": Boolean,\n  \"interaction\": \"String\",\n  \"opened_on\": \"String\",\n  \"segmented\": Boolean,\n  \"segment_id\": \"String\",\n  \"segment_table\": \"String\",\n  \"state\": \"String\",\n  \"submitted_on\": \"String\",\n  \"sys_id\": \"String\",\n  \"wrap_up_configuration\": {Object} \n}\n```\n\n</td></tr><tr><td>\n\nsegment.agent\n\n</td><td id=\"segment-agent\">\n\nSys\\_id of the agent assigned to the interaction.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nsegment.ai\\_code\\_defined\\_at\n\n</td><td>\n\nTimestamp when AI code was stored.Format: Unix epoch milliseconds \\(e.g., \"1752252703000\"\\)\n\nData type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_notes\n\n</td><td>\n\nAI-generated notes stored on the segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_notes\\_defined\\_at\n\n</td><td>\n\nTimestamp when AI notes were stored.Format: Unix epoch milliseconds\n\nData type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_wrap\\_up\\_code\n\n</td><td>\n\nAI-recommended code stored on the segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.awaiting\\_confirmation\n\n</td><td>\n\nFlag that indicates whether the wrap-up segment submitted by the agent is awaiting confirmation that it was processed by the external CCaaS system.Valid values:\n\n-   true: The wrap-up segment is awaiting confirmation.\n-   false: The wrap-up segment was processed by the external system.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.confirmed\\_on\n\n</td><td>\n\nDate and time the submitted wrap-up segment is processed in the external CCaaS system.Data type: String\n\n</td></tr><tr><td>\n\nsegment.external\n\n</td><td>\n\nFlag that indicates whether the interaction segment is from an external system.Valid values:\n\n-   true: The interaction segment is from an external system.\n-   false: The interaction segment is internal.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.interaction\n\n</td><td id=\"interaction-id\">\n\nSys\\_id of the interaction.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsegment.opened\\_on\n\n</td><td>\n\nThe start date and time of the wrap-up period according to the external system.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segmented\n\n</td><td>\n\nFlag that indicates whether the wrap-up is segmented.Valid values:\n\n-   true: The wrap-up is segmented into multiple parts.\n-   false: The wrap-up is one complete segment.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.segment\\_id\n\n</td><td>\n\nSys\\_id of the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segment\\_table\n\n</td><td>\n\nName of the table containing the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.state\n\n</td><td>\n\nState of the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.submitted\\_on\n\n</td><td>\n\nDate and time the agent submitted the wrap-up segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration\n\n</td><td>\n\nObject containing details about the wrap-up configuration used for the wrap-up segment.Data type: Object\n\n```\n\"wrap_up_configuration\": {  \n  \"allowed_codes\": [Array],\n  \"default_code\": {Object},\n  \"enable_ai_code\": Boolean,\n  \"enable_ai_notes\": Boolean,\n  \"enable_codes\": Boolean,\n  \"use_ai_as_default\": Boolean,\n  \"use_third_party_ai\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes\n\n</td><td>\n\nArray of objects each representing a wrap-up code the agent is allowed to use.Data type: Array\n\n```\n\"allowed_codes\": [\n  {\n    \"active\": Boolean, \n    \"code\": \"String\",\n    \"description\": \"String\",\n    \"external\": Boolean,\n    \"sys_id\": \"String\",\n    \"translated_code\": \"String\",\n    \"translated_description\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code\n\n</td><td>\n\nObject containing the wrap-up code to use as the default.Data type: Object\n\n```\n\"default_code\": {\n  \"active\": Boolean,\n  \"code\": \"String\",\n  \"description\": \"String\",\n  \"external\": Boolean,\n  \"sys_id\": \"String\",\n  \"translated_code\": \"String\",\n  \"translated_description\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_ai\\_code\n\n</td><td>\n\nFlag that indicates whether AI code generation is enabled for this configuration.Valid values:\n\n-   true: AI code generation is enabled for this configuration.\n-   false: AI code generation is not enabled for this configuration.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_ai\\_notes\n\n</td><td>\n\nFlag that indicates whether AI notes generation is enabled for this configuration.Valid values:\n\n-   true: AI notes generation is enabled for this configuration.\n-   false: AI notes generation is not enabled for this configuration.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_codes\n\n</td><td>\n\nFlag that indicates whether the agent must select a wrap-up code.Valid values:\n\n-   true: Agent must select a wrap-up code.\n-   false: Agent isn't required to select a wrap-up code.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.use\\_ai\\_as\\_default\n\n</td><td>\n\nFlag that indicates whether AI code is automatically set as the default wrap-up code for this configuration.Valid values:\n\n-   true: AI code is automatically set as the default wrap-up code.\n-   false: AI code is not automatically set as the default wrap-up code.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.use\\_third\\_party\\_ai\n\n</td><td>\n\nFlag that indicates if the AI content source is from a third-party external system.Valid values:\n\n-   true: AI content source is from a third-party external system.\n-   false: Now Assist is the AI content source.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr><tr><td>\n\nsuccess\n\n</td><td>\n\nFlag that indicates whether the API request was successfully processed.Valid values:\n\n-   true: The API request was successful.\n-   false: The API request failed.\n\nData type: Boolean\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example retrieves details for a specified wrap-up segment.\n\n```\ncurl \"https://instance.service-now.com/api/now/v1/wrapup/segment/dgajbcef12345678defdbxef123435678\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"message\": \"Wrap up segment retrieved successfully.\",\n  \"segment_id\": \"dgajbcef12345678defdbxef123435678\",\n  \"segment\": {\n    \"agent\": \"123412345678567890ab90abcdefcdef\",\n    \"segment_table\": \"sn_openframe_phone_log\",\n    \"segment_id\": \"dgajbcef12345678defdbxef123435678\",\n    \"external\": true,\n    \"interaction\": \"213412345678567890ab90abcdefcdef\",\n    \"state\": \"closed\",\n    \"wrap_up_configuration\": {\n      \"enable_codes\": true,\n      \"allowed_codes\": [\n        {\n          \"code\": \"Billing Issue\",\n          \"description\": \"\",\n          \"active\": true,\n          \"external\": true,\n          \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n          \"translated_code\": \"Abrechnungsproblem\",\n          \"translated_description\": \"\"\n        },\n        {\n          \"code\": \"Store Issue\",\n          \"description\": \"\",\n          \"active\": true,\n          \"external\": true,\n          \"sys_id\": \"54327b679f201210c89656effa0a1cd7\",\n          \"translated_code\": \" Einkaufsproblem\",\n          \"translated_description\": \"\"\n        }\n      ],\n      \"default_code\": {\n        \"code\": \"Billing Issue\",\n        \"description\": \"\",\n        \"active\": true,\n        \"external\": true,\n        \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n        \"translated_code\": \"Abrechnungsproblem\",\n        \"translated_description\": \"\"\n      }\n    },\n    \"segmented\": true,\n    \"sys_id\": \"dgajbcef12345678defdbxef123435678\",\n    \"opened_on\": \"2024-09-16 17:52:01\",\n    \"submitted_on\": \"2024-09-16 18:51:59\",\n    \"confirmed_on\": \"2024-09-16 18:52:01\",\n    \"awaiting_confirmation\": false\n  }\n}\n```\n\nThis example retrieves details for a specified wrap-up segment configured for AI recommendations.\n\n```\ncurl \"https://instance.service-now.com/api/now/v1/wrapup/segment/abcd1234abcd1234abcd1234abcd1234\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"message\": \"Segment retrieved.\",\n  \"segment_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n  \"segment\": {\n    \"agent\": \"123412345678567890ab90abcdefcdef\",\n    \"state\": \"closed\",\n    \"ai_wrap_up_code\": \"Billing Issue\",\n    \"ai_notes\": \"Customer called about an incorrect charge.\",\n    \"ai_code_defined_at\": \"1752252703000\",\n    \"ai_notes_defined_at\": \"1752252703000\",\n    \"wrap_up_configuration\": {\n      \"enable_ai_code\": true,\n      \"enable_ai_notes\": true,\n      \"use_ai_as_default\": true,\n      \"use_third_party_ai\": false\n    }\n  }\n}\n```\n\n## Wrap Up - GET /now/wrapup/segment/agent/\\{agent\\_id\\}/interaction/\\{interaction\\_id\\}\n\nRetrieves details for a wrap-up segment based on a specified agent and interaction.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/wrapup/segment/agent/{agent_id}/interaction/{interaction_id}`\n\nDefault URL: `/api/now/wrapup/segment/agent/{agent_id}/interaction/{interaction_id}`\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\nagent\\_id\n\n</td><td>\n\nSys\\_id of the agent assigned to the interaction.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\ninteraction\\_id\n\n</td><td>\n\nSys\\_id of the interaction.Data type: String\n\nTable: Interaction \\[interaction\\]\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|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\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. 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\n<table id=\"table_xpr_b42_42c\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nMessage that describes the outcome of the API request.Data type: String\n\n</td></tr><tr><td>\n\nsegment\n\n</td><td>\n\nObject containing data about the interaction and wrap-up segment.Data type: Object\n\n```\n\"segment\": {\n  \"agent\": \"String\",\n  \"ai_code_defined_at\": \"String\",\n  \"ai_notes\": \"String\",\n  \"ai_notes_defined_at\": \"String\",\n  \"ai_wrap_up_code\": \"String\",\n  \"awaiting_confirmation\": Boolean,\n  \"confirmed_on\": \"String\",\n  \"external\": Boolean,\n  \"interaction\": \"String\",\n  \"opened_on\": \"String\",\n  \"segmented\": Boolean,\n  \"segment_id\": \"String\",\n  \"segment_table\": \"String\",\n  \"state\": \"String\",\n  \"submitted_on\": \"String\",\n  \"sys_id\": \"String\",\n  \"wrap_up_configuration\": {Object} \n}\n```\n\n</td></tr><tr><td>\n\nsegment.agent\n\n</td><td id=\"segment-agent\">\n\nSys\\_id of the agent assigned to the interaction.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nsegment.agent\n\n</td><td id=\"d3836e468\">\n\nSys\\_id of the agent assigned to the interaction.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nsegment.ai\\_code\\_defined\\_at\n\n</td><td>\n\nTimestamp when AI code was stored.Format: Unix epoch milliseconds \\(e.g., \"1752252703000\"\\)\n\nData type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_notes\n\n</td><td>\n\nAI-generated notes stored on the segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_notes\\_defined\\_at\n\n</td><td>\n\nTimestamp when AI notes were stored.Format: Unix epoch milliseconds\n\nData type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_wrap\\_up\\_code\n\n</td><td>\n\nAI-recommended code stored on the segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.awaiting\\_confirmation\n\n</td><td>\n\nFlag that indicates whether the wrap-up segment submitted by the agent is awaiting confirmation that it was processed by the external CCaaS system.Valid values:\n\n-   true: The wrap-up segment is awaiting confirmation.\n-   false: The wrap-up segment was processed by the external system.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.confirmed\\_on\n\n</td><td>\n\nDate and time the submitted wrap-up segment is processed in the external CCaaS system.Data type: String\n\n</td></tr><tr><td>\n\nsegment.external\n\n</td><td>\n\nFlag that indicates whether the interaction segment is from an external system.Valid values:\n\n-   true: The interaction segment is from an external system.\n-   false: The interaction segment is internal.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.interaction\n\n</td><td id=\"interaction-id\">\n\nSys\\_id of the interaction.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsegment.opened\\_on\n\n</td><td>\n\nThe start date and time of the wrap-up period according to the external system.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segmented\n\n</td><td>\n\nFlag that indicates whether the wrap-up is segmented.Valid values:\n\n-   true: The wrap-up is segmented into multiple parts.\n-   false: The wrap-up is one complete segment.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.segment\\_id\n\n</td><td>\n\nSys\\_id of the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segment\\_table\n\n</td><td>\n\nName of the table containing the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.state\n\n</td><td>\n\nState of the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.submitted\\_on\n\n</td><td>\n\nDate and time the agent submitted the wrap-up segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration\n\n</td><td>\n\nObject containing details about the wrap-up configuration used for the wrap-up segment.Data type: Object\n\n```\n\"wrap_up_configuration\": {  \n  \"allowed_codes\": [Array],\n  \"default_code\": {Object},\n  \"enable_codes\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes\n\n</td><td>\n\nArray of objects each representing a wrap-up code the agent is allowed to use.Data type: Array\n\n```\n\"allowed_codes\": [\n  {\n    \"active\": Boolean, \n    \"code\": \"String\",\n    \"description\": \"String\",\n    \"external\": Boolean,\n    \"sys_id\": \"String\",\n    \"translated_code\": \"String\",\n    \"translated_description\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code\n\n</td><td>\n\nObject containing the wrap-up code to use as the default.Data type: Object\n\n```\n\"default_code\": {\n  \"active\": Boolean,\n  \"code\": \"String\",\n  \"description\": \"String\",\n  \"external\": Boolean,\n  \"sys_id\": \"String\",\n  \"translated_code\": \"String\",\n  \"translated_description\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_ai\\_code\n\n</td><td>\n\nFlag that indicates whether AI code generation is enabled for this configuration.Valid values:\n\n-   true: AI code generation is enabled for this configuration.\n-   false: AI code generation is not enabled for this configuration.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_ai\\_notes\n\n</td><td>\n\nFlag that indicates whether AI notes generation is enabled for this configuration.Valid values:\n\n-   true: AI notes generation is enabled for this configuration.\n-   false: AI notes generation is not enabled for this configuration.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_codes\n\n</td><td>\n\nFlag that indicates whether the agent must select a wrap-up code.Valid values:\n\n-   true: Agent must select a wrap-up code.\n-   false: Agent isn't required to select a wrap-up code.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.use\\_ai\\_as\\_default\n\n</td><td>\n\nFlag that indicates whether AI code is automatically set as the default wrap-up code for this configuration.Valid values:\n\n-   true: AI code is automatically set as the default wrap-up code.\n-   false: AI code is not automatically set as the default wrap-up code.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.use\\_third\\_party\\_ai\n\n</td><td>\n\nFlag that indicates if the AI content source is from a third-party external system.Valid values:\n\n-   true: AI content source is from a third-party external system.\n-   false: Now Assist is the AI content source.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr><tr><td>\n\nsuccess\n\n</td><td>\n\nFlag that indicates whether the API request was successfully processed.Valid values:\n\n-   true: The API request was successful.\n-   false: The API request failed.\n\nData type: Boolean\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example retrieves details for a wrap-up segment based on a specified agent and interaction.\n\n```\ncurl \"https://instance.service-now.com/api/now/v1/wrapup/segment/agent/123412345678567890ab90abcdefcdef/interaction/213412345678567890ab90abcdefcdef\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"message\": \"Wrap up segment retrieved successfully.\",\n  \"segment_id\": \"dgajbcef12345678defdbxef123435678\",\n  \"segment\": {\n    \"agent\": \"123412345678567890ab90abcdefcdef\",\n    \"segment_table\": \"sn_openframe_phone_log\",\n    \"segment_id\": \"dgajbcef12345678defdbxef123435678\",\n    \"external\": true,\n    \"interaction\": \"213412345678567890ab90abcdefcdef\",\n    \"state\": \"closed\",\n    \"wrap_up_configuration\": {\n      \"enable_codes\": true,\n      \"allowed_codes\": [\n        {\n          \"code\": \"Billing Issue\",\n          \"description\": \"\",\n          \"active\": true,\n          \"external\": true,\n          \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n          \"translated_code\": \"Abrechnungsproblem\",\n          \"translated_description\": \"\"\n        },\n        {\n          \"code\": \"Store Issue\",\n          \"description\": \"\",\n          \"active\": true,\n          \"external\": true,\n          \"sys_id\": \"54327b679f201210c89656effa0a1cd7\",\n          \"translated_code\": \" Einkaufsproblem\",\n          \"translated_description\": \"\"\n        }\n      ],\n      \"default_code\": {\n        \"code\": \"Billing Issue\",\n        \"description\": \"\",\n        \"active\": true,\n        \"external\": true,\n        \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n        \"translated_code\": \"Abrechnungsproblem\",\n        \"translated_description\": \"\"\n      }\n    },\n    \"segmented\": true,\n    \"sys_id\": \"dgajbcef12345678defdbxef123435678\",\n    \"opened_on\": \"2024-09-16 17:52:01\",\n    \"submitted_on\": \"2024-09-16 18:51:59\",\n    \"confirmed_on\": \"2024-09-16 18:52:01\",\n    \"awaiting_confirmation\": false\n  }\n}\n```\n\n### cURL request\n\nThis example retrieves details for a wrap-up segment configured for AI recommendations.\n\n```\ncurl \"https://instance.service-now.com/api/now/v1/wrapup/segment/agent/987698761234123456xy12ghijklmnoqrst/interaction/879065432198432109xy34mnopqrstuv\" \\\n--request GET \\\n--header \"Accept:application/json\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"segment\": {\n    \"ai_wrap_up_code\": \"Billing Issue\",\n    \"ai_notes\": \"Customer called about incorrect charge.\",\n    \"ai_code_defined_at\": \"1752252703000\",\n    \"ai_notes_defined_at\": \"1752252703000\",\n    \"wrap_up_configuration\": {\n      \"enable_ai_code\": true,\n      \"enable_ai_notes\": true,\n      \"use_ai_as_default\": true,\n      \"use_third_party_ai\": false\n    }\n  }\n}\n```\n\n## Wrap Up - POST /now/wrapup/code\n\nCreates or updates wrap-up codes.\n\nWrap-up codes are created in the Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\] table.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/wrapup/code`\n\nDefault URL: `/api/now/wrapup/code`\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\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ncodes\n\n</td><td>\n\nRequired. Array of objects each representing a wrap-up code.Data type: Array\n\n```\n\"codes\": [\n   {\n      \"active\": Boolean,\n      \"code\": \"String\",\n      \"description\": \"String\",\n      \"translations\": [Array]\n   }\n]\n```\n\n</td></tr><tr><td>\n\ncodes.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\ncodes.code\n\n</td><td>\n\nRequired. Label of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\ncodes.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\ncodes.translations\n\n</td><td>\n\nArray of objects each representing a translation of the wrap-up code.Data type: Array\n\n```\n\"translations\": [\n   {    \n      \"code\": \"Abrechnungsproblem\",\n      \"description\": \"Ein code für Abrechnungsprobleme\",\n      \"language\": \"de\"\n   }\n]\n```\n\n</td></tr><tr><td>\n\ncodes.translations.code\n\n</td><td>\n\nA translation of the wrap-up code label \\(**codes.code**\\). Required if using the **codes.translations** parameter.Data type: String\n\n</td></tr><tr><td>\n\ncodes.translations.description\n\n</td><td>\n\nA translation of the wrap-up code description \\(**codes.description**\\). Required if using the **codes.translations** parameter and a value was provided for **codes.description**.Data type: String\n\n</td></tr><tr><td>\n\ncodes.translations.language\n\n</td><td>\n\nTwo-letter code for the language used in the translation. Required if using the **codes.translations** parameter.Data type: String\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<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><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request 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|207|Successful. Some wrap-up codes created successfully. Validation errors occurred while creating others.|\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. 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\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nObject containing information about the API request and the created wrap-up codes.Data type: Object\n\n```\n\"result\": {\n   \"message\": \"String\",\n   \"resultMap\": {Object},\n   \"success\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nresult.message\n\n</td><td id=\"message\">\n\nMessage that describes the outcome of the API request.Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map\n\n</td><td>\n\nObject containing an array of created wrap-up codes.Data type: Object\n\n```\n\"result_map\": {\n   \"created_wrap_up_codes\": [Array]\n}\n```\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes\n\n</td><td>\n\nArray of objects each representing a created wrap-up code.Data type: Array\n\n```\n\"created_wrap_up_codes\": [\n   {\n      \"active\": Boolean,\n      \"code\": \"String\",\n      \"description\": \"String\",\n      \"external\": Boolean,\n      \"sys_id\": \"String\",\n      \"translated_code\": \"String\",\n      \"translated_description\": \"String\"\n   }\n]\n```\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nresult.result\\_map.created\\_wrap\\_up\\_codes.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nresult.success\n\n</td><td id=\"success\">\n\nFlag that indicates whether the API request was successfully processed.Valid values:\n\n-   true: The API request was successful.\n-   false: The API request failed.\n\nData type: Boolean\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example creates a wrap-up code for billing issues with a translation in German.\n\n```\ncurl \"https://instance.service-now.com/api/now/v1/wrapup/code\" \\\n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \\\"codes\\\": [\n    {\n      \\\"code\\\": \\\"Billing Issue\\\",\n      \\\"description\\\": \\\"A code for billing issues\\\",\n      \\\"translations\\\": [\n        {\n          \\\"language\\\": \\\"de\\\",\n          \\\"code\\\": \\\"Abrechnungsproblem\\\",\n          \\\"description\\\": \\\"Ein code für Abrechnungsprobleme\\\"\n        }\n      ]\n    }\n  ]\n}\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"result\": {\n    \"message\": \"All wrap up codes created successfully.\",\n    \"result_map\": {\n      \"created_wrap_up_codes\": [\n        {\n          \"code\": \"Billing Issue\",\n          \"description\": \"A code for billing issues\",\n          \"active\": true,\n          \"external\": true,\n          \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n          \"translated_code\": \"Abrechnungsproblem\",\n          \"translated_description\": \"Ein code für Abrechnungsprobleme\"\n        }\n      ]\n    },\n    \"success\": true\n  }\n}\n```\n\n## Wrap Up - POST /now/wrapup/segment/create\n\nOpens a wrap-up segment for an interaction.\n\nWrap-ups are created in the Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\] table. Call this endpoint at the start of the wrap‑up period.\n\nThis endpoint supports AI-generated wrap‑up codes and notes directly in the request payload, and it saves the AI configuration flags on the wrap‑up configuration. If **external** is set to `false` and AI codes or notes are enabled on the configuration, a synchronous business rule runs after the segment is created. This endpoint calls the internal CSM \\(NowAssist\\) API and automatically fills in the AI fields. No extra action is required from the caller.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/wrapup/segment/create`\n\nDefault URL: `/api/now/wrapup/segment/create`\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\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nagent\\_sys\\_id\n\n</td><td>\n\nRequired. Sys\\_id of the agent assigned to the interaction.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nai\\_wrap\\_up\\_code\n\n</td><td>\n\nAI-suggested wrap-up code label. Populated automatically by Now Assist if the value of **use\\_third\\_party\\_ai** is `false` or the field is absent from configuration.See also:\n\n-   [GET /now/wrapup/segment/\\{segment\\_id\\}](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/wrap-up-api.md)\n-   [PUT /api/now/wrapup/segment/update/ai](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/wrap-up-api.md)\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nai\\_notes\n\n</td><td>\n\nAI-generated notes.Maximum length: 4000 characters\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\nData type: String\n\n</td></tr><tr><td>\n\nconfiguration\n\n</td><td>\n\nObject containing the code and duration details for an external wrap-up. Required if **external** is `true`.Data type: Object\n\n```\n\"configuration\": {  \n   \"allowed_codes\": [Array], \n   \"default_code\": \"String\", \n   \"duration\": \"String\", \n   \"enable_codes\": Boolean,\n   \"enable_ai_code\": Boolean,\n   \"enable_ai_notes\": Boolean,\n   \"show_timer\": Boolean,\n   \"use_ai_as_default\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nconfiguration.allowed\\_codes\n\n</td><td>\n\nArray of objects each representing a wrap-up code the agent is allowed to use. Required if **external** and **configuration.enable\\_codes** are both `true`.Data type: Array\n\n```\n\"allowed_codes\": [ \n   { \n      \"code\": \"String\", \n      \"translation\": {Object}  \n   } \n]\n```\n\n</td></tr><tr><td>\n\nconfiguration.allowed\\_codes.code\n\n</td><td>\n\nLabel of the wrap-up code. Required if using the **configuration.allowed\\_codes** parameter.Data type: String\n\n</td></tr><tr><td>\n\nconfiguration.allowed\\_codes.translation\n\n</td><td>\n\nA translation of the wrap-up code.Data type: Object\n\n```\n\"translation\": {  \n   \"code\": \"String\",\n   \"language\": \"String\"  \n}\n```\n\n</td></tr><tr><td>\n\nconfiguration.allowed\\_codes.translation.code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nconfiguration.allowed\\_codes.translation.language\n\n</td><td>\n\nTwo-letter code for the language used in the translation.Data type: String\n\n</td></tr><tr><td>\n\nconfiguration.default\\_code\n\n</td><td>\n\nLabel of the wrap-up code to use as the default. Required if **external** and **configuration.enable\\_codes** are both `true`.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\nField: Code\n\n</td></tr><tr><td>\n\nconfiguration.duration\n\n</td><td>\n\nMaximum allowed wrap-up duration. Must be used with **show\\_timer**.Data type: String\n\nUnit: Seconds\n\nDefault: Empty string \\(No time limit\\).\n\n</td></tr><tr><td>\n\nconfiguration.enable\\_codes\n\n</td><td>\n\nFlag that indicates whether the agent must select a wrap-up code.Valid values:\n\n-   true: Agent must select a wrap-up code.\n-   false: Agent isn't required to select a wrap-up code.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nconfiguration.enable\\_ai\\_code\n\n</td><td>\n\nFlag that indicates whether AI code generation is enabled for this configuration.Valid values:\n\n-   true: AI code generation is enabled for this configuration.\n-   false: AI code generation is not enabled for this configuration.\n\nTable: Interaction Wrap Up Configuration \\[interaction\\_wrap\\_up\\_configuration\\]\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nconfiguration.enable\\_ai\\_notes\n\n</td><td>\n\nFlag that indicates whether AI notes generation is enabled for this configuration.Valid values:\n\n-   true: AI notes generation is enabled for this configuration.\n-   false: AI notes generation is not enabled for this configuration.\n\nTable: Interaction Wrap Up Configuration \\[interaction\\_wrap\\_up\\_configuration\\]\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nconfiguration.use\\_ai\\_as\\_default\n\n</td><td>\n\nFlag that indicates whether AI code is automatically set as the default wrap-up code for this configuration.Valid values:\n\n-   true: AI code is automatically set as the default wrap-up code.\n-   false: AI code is not automatically set as the default wrap-up code.\n\nTable: Interaction Wrap Up Configuration \\[interaction\\_wrap\\_up\\_configuration\\]\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nconfiguration.show\\_timer\n\n</td><td>\n\nRequired when using the duration property. Flag that indicates whether the timer displays.Valid values:\n\n-   true: Timer displays in the UI.\n-   false: Timer does not display in the UI.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nexternal\n\n</td><td id=\"external-seg\">\n\nFlag that indicates whether the interaction segment is from an external system.Valid values:\n\n-   true: The interaction segment is from an external system.\n-   false: The interaction segment is internal.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nexternal\\_segment\\_id\n\n</td><td>\n\nIdentifier representing the interaction segment on the external system. Required if **external** is `true`.Data type: String\n\n</td></tr><tr><td>\n\ninteraction\\_sys\\_id\n\n</td><td>\n\nRequired. Sys\\_id of the interaction.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nopened\\_on\n\n</td><td>\n\nThe start date and time of the wrap-up period according to the external system. Required if using the **configuration.duration** parameter.Data type: String\n\n</td></tr><tr><td>\n\nsegmented\n\n</td><td>\n\nFlag that indicates whether the wrap-up is segmented.Valid values:\n\n-   true: The wrap-up is segmented into multiple parts.\n-   false: The wrap-up is one complete segment.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment\\_id\n\n</td><td>\n\nSys\\_id of the interaction segment. Required if **external** and **segmented** are both `true`.**Note:** You must implement the InteractionSegment scripted extension point to create and retrieve segment records in your chosen table or use the [OpenFrame](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/customer-service-management/c_OpenFrameOverview.md) implementation to create and retrieve segment records in the Phone Log \\[sn\\_openframe\\_phone\\_log\\] table.\n\nData type: String\n\n</td></tr><tr><td>\n\nsegment\\_table\n\n</td><td>\n\nName of the table containing the interaction segment. Required if **external** and **segmented** are both `true`.Data type: String\n\n</td></tr><tr><td>\n\nwrap\\_up\\_configuration\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up configuration to use. Required if **external** is `false`.Data type: String\n\nTable: Interaction Wrap Up Configuration \\[interaction\\_wrap\\_up\\_configuration\\]\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<table id=\"table_r5j_h1f_42c\" 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><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request 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|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. 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\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nMessage that describes the outcome of the API request.Data type: String\n\n</td></tr><tr><td>\n\nsegment\n\n</td><td>\n\nObject containing data about the interaction and wrap-up segment.Data type: Object\n\n```\n\"segment\": {\n  \"agent\": \"String\",\n  \"external\": Boolean,\n  \"interaction\": \"String\",\n  \"opened_on\": \"String\",\n  \"segmented\": Boolean,\n  \"segment_id\": \"String\",\n  \"segment_table\": \"String\",\n  \"state\": \"String\",\n  \"sys_id\": \"String\",\n  \"wrap_up_configuration\": {Object} \n}\n```\n\n</td></tr><tr><td>\n\nsegment.agent\n\n</td><td>\n\nSys\\_id of the agent assigned to the interaction segment.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nsegment.external\n\n</td><td>\n\nFlag that indicates whether the interaction segment is from an external system.Valid values:\n\n-   true: The interaction segment is from an external system.\n-   false: The interaction segment is internal.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.interaction\n\n</td><td>\n\nSys\\_id of the interaction.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsegment.opened\\_on\n\n</td><td>\n\nThe start date and time of the wrap-up period according to the external system.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segmented\n\n</td><td>\n\nFlag that indicates whether the wrap-up is segmented.Valid values:\n\n-   true: The wrap-up is segmented into multiple parts.\n-   false: The wrap-up is one complete segment.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.segment\\_id\n\n</td><td>\n\nSys\\_id of the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segment\\_table\n\n</td><td>\n\nName of the table containing the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.state\n\n</td><td>\n\nState of the interaction segment. Interaction segments that the Wrap Up API creates successfully are in the open state.Data type: String\n\n</td></tr><tr><td>\n\nsegment.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration\n\n</td><td>\n\nObject containing details about the wrap-up configuration used for the wrap-up segment.Data type: Object\n\n```\n\"wrap_up_configuration\": {  \n  \"allowed_codes\": [Array],\n  \"default_code\": {Object},\n  \"enable_ai_code\": Boolean,\n  \"enable_ai_notes\": Boolean,\n  \"enable_codes\": Boolean,\n  \"use_ai_as_default\": Boolean,\n  \"use_third_party_ai\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes\n\n</td><td>\n\nArray of objects each representing a wrap-up code the agent is allowed to use.Data type: Array\n\n```\n\"allowed_codes\": [\n  {\n    \"active\": Boolean, \n    \"code\": \"String\",\n    \"description\": \"String\",\n    \"external\": Boolean,\n    \"sys_id\": \"String\",\n    \"translated_code\": \"String\",\n    \"translated_description\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code\n\n</td><td>\n\nObject containing the wrap-up code to use as the default.Data type: Object\n\n```\n\"default_code\": {\n  \"active\": Boolean,\n  \"code\": \"String\",\n  \"description\": \"String\",\n  \"external\": Boolean,\n  \"sys_id\": \"String\",\n  \"translated_code\": \"String\",\n  \"translated_description\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_ai\\_code\n\n</td><td>\n\nFlag that indicates whether AI code generation is enabled for this configuration.Valid values:\n\n-   true: AI code generation is enabled for this configuration.\n-   false: AI code generation is not enabled for this configuration.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_ai\\_notes\n\n</td><td>\n\nFlag that indicates whether AI notes generation is enabled for this configuration.Valid values:\n\n-   true: AI notes generation is enabled for this configuration.\n-   false: AI notes generation is not enabled for this configuration.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_codes\n\n</td><td>\n\nFlag that indicates whether the agent must select a wrap-up code.Valid values:\n\n-   true: Agent must select a wrap-up code.\n-   false: Agent isn't required to select a wrap-up code.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.use\\_ai\\_as\\_default\n\n</td><td>\n\nFlag that indicates whether AI code is automatically set as the default wrap-up code for this configuration.Valid values:\n\n-   true: AI code is automatically set as the default wrap-up code.\n-   false: AI code is not automatically set as the default wrap-up code.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.use\\_third\\_party\\_ai\n\n</td><td>\n\nFlag that indicates if the AI content source is from a third-party external system.Valid values:\n\n-   true: AI content source is from a third-party external system.\n-   false: Now Assist is the AI content source.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsuccess\n\n</td><td>\n\nFlag that indicates whether the API request was successfully processed.Valid values:\n\n-   true: The API request was successful.\n-   false: The API request failed.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example opens a wrap-up segment for an interaction.\n\n```\ncurl --request POST \\\n  --url 'https://instance.servicenow.com/api/now/wrapup/segment/create' \\\n  --header 'Accept: application/json' \\\n  --header 'Content-Type: application/json' \\\n  --user 'username:password' \\\n  --data '{\n    \"agent_sys_id\": \"123412345678567890ab90abcdefcdef\",\n    \"interaction_sys_id\": \"213412345678567890ab90abcdefcdef\",\n    \"external\": true,\n    \"external_segment_id\": \"EXT-SEG-001\",\n    \"ai_wrap_up_code\": \"Billing Issue\",\n    \"ai_notes\": \"Customer called about an incorrect charge on their invoice.\",\n    \"configuration\": {\n      \"enable_codes\": true,\n      \"enable_ai_code\": true,\n      \"enable_ai_notes\": true,\n      \"use_ai_as_default\": true,\n      \"allowed_codes\": [{\"code\": \"Billing Issue\"}, {\"code\": \"Store Issue\"}],\n      \"default_code\": \"Billing Issue\"\n    }\n  }'\n\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"message\": \"Wrap-up segment created successfully.\",\n  \"sys_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n  \"segment\": {\n    \"agent\": \"123412345678567890ab90abcdefcdef\",\n    \"external\": true,\n    \"interaction\": \"213412345678567890ab90abcdefcdef\",\n    \"state\": \"open\",\n    \"sys_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n    \"wrap_up_configuration\": {\n      \"enable_codes\": true,\n      \"enable_ai_code\": true,\n      \"enable_ai_notes\": true,\n      \"use_ai_as_default\": true,\n      \"allowed_codes\": [...],\n      \"default_code\": {...}\n    }\n  }\n}\n```\n\n### cURL request\n\nThis example opens a wrap-up segment configured for AI recommendations.\n\n```\ncurl --request POST \\\n  --url 'https://instance.servicenow.com/api/now/wrapup/segment/create' \\\n  --header 'Accept: application/json' \\\n  --header 'Content-Type: application/json' \\\n  --user 'username:password' \\\n  --data '{\n    \"agent_sys_id\": \"123412345678567890ab90abcdefcdef\",\n    \"interaction_sys_id\": \"213412345678567890ab90abcdefcdef\",\n    \"external\": true,\n    \"external_segment_id\": \"EXT-SEG-001\",\n    \"ai_wrap_up_code\": \"Billing Issue\",\n    \"ai_notes\": \"Customer called about an incorrect charge on their invoice.\",\n    \"configuration\": {\n      \"enable_codes\": true,\n      \"enable_ai_code\": true,\n      \"enable_ai_notes\": true,\n      \"use_ai_as_default\": true,\n      \"allowed_codes\": [{\"code\": \"Billing Issue\"}, {\"code\": \"Store Issue\"}],\n      \"default_code\": \"Billing Issue\"\n    }\n  }'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"message\": \"Wrap-up segment created successfully.\",\n  \"sys_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n  \"segment\": {\n    \"agent\": \"123412345678567890ab90abcdefcdef\",\n    \"external\": true,\n    \"interaction\": \"213412345678567890ab90abcdefcdef\",\n    \"state\": \"open\",\n    \"sys_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n    \"wrap_up_configuration\": {\n      \"enable_codes\": true,\n      \"enable_ai_code\": true,\n      \"enable_ai_notes\": true,\n      \"use_ai_as_default\": true,\n      \"allowed_codes\": [...],\n      \"default_code\": {...}\n    }\n  }\n}\n```\n\n## Wrap Up - PUT /now/wrapup/segment/update\n\nUpdates and closes a wrap-up segment for an interaction.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/wrapup/segment/update`\n\nDefault URL: `/api/now/wrapup/segment/update`\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\nagent\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the agent assigned to the interaction. Required along with **interaction\\_sys\\_id** if neither **segment\\_sys\\_id** nor **external\\_segment\\_id** are provided.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nexternal\\_segment\\_id\n\n</td><td>\n\nIdentifier representing the interaction segment on the external system. Used to identify the wrap-up segment to update if **segment\\_sys\\_id** isn't provided.\n\n</td></tr><tr><td>\n\ninteraction\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the interaction. Required along with **agent\\_sys\\_id** if neither **segment\\_sys\\_id** nor **external\\_segment\\_id** are provided.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsegment\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr></tbody>\n</table><table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nconfirmed\\_on\n\n</td><td>\n\nThe end date and time of the wrap-up period according to the external system.Data type: String\n\n</td></tr><tr><td>\n\nnotes\n\n</td><td>\n\nAdditional notes added to the wrap-up by the agent.Data type: String\n\n</td></tr><tr><td>\n\nwrap\\_up\\_code\n\n</td><td>\n\nLabel of the wrap-up code selected by the agent. If the agent doesn't select a code, the configured default code is used.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\nField: Code\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<table id=\"table_ubl_j1f_42c\" 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><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request 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|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. 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\n<table id=\"table_xpr_b42_42c\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nMessage that describes the outcome of the API request.Data type: String\n\n</td></tr><tr><td>\n\nsegment\n\n</td><td>\n\nObject containing data about the interaction and wrap-up segment.Data type: Object\n\n```\n\"segment\": {\n  \"agent\": \"String\",\n  \"awaiting_confirmation\": Boolean,\n  \"code\": {Object},\n  \"confirmed_on\": \"String\",\n  \"external\": Boolean,\n  \"interaction\": \"String\",\n  \"notes\": \"String\",\n  \"opened_on\": \"String\",\n  \"segmented\": Boolean,\n  \"segment_id\": \"String\",\n  \"segment_table\": \"String\",\n  \"state\": \"String\",\n  \"submitted_on\": \"String\",\n  \"sys_id\": \"String\",\n  \"wrap_up_configuration\": {Object} \n}\n```\n\n</td></tr><tr><td>\n\nsegment.agent\n\n</td><td id=\"segment-agent\">\n\nSys\\_id of the agent assigned to the interaction.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nsegment.awaiting\\_confirmation\n\n</td><td>\n\nFlag that indicates whether the wrap-up segment submitted by the agent is awaiting confirmation that it was processed by the external CCaaS system.Valid values:\n\n-   true: The wrap-up segment is awaiting confirmation.\n-   false: The wrap-up segment was processed by the external system.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.code\n\n</td><td>\n\nObject containing the wrap-up code selected by the agent.Data type: Object\n\n```\n\"code\": {\n  \"active\": Boolean,\n  \"code\": \"String\",\n  \"description\": \"String\",\n  \"external\": Boolean,\n  \"sys_id\": \"String\",\n  \"translated_code\": \"String\",\n  \"translated_description\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nsegment.code.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.code.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.code.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.code.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.code.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.code.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.code.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.confirmed\\_on\n\n</td><td>\n\nDate and time the submitted wrap-up segment is processed in the external CCaaS system.Data type: String\n\n</td></tr><tr><td>\n\nsegment.external\n\n</td><td>\n\nFlag that indicates whether the interaction segment is from an external system.Valid values:\n\n-   true: The interaction segment is from an external system.\n-   false: The interaction segment is internal.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.interaction\n\n</td><td id=\"interaction-id\">\n\nSys\\_id of the interaction.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsegment.notes\n\n</td><td>\n\nAdditional notes added to the wrap-up by the agent.Data type: String\n\n</td></tr><tr><td>\n\nsegment.opened\\_on\n\n</td><td>\n\nThe start date and time of the wrap-up period according to the external system.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segmented\n\n</td><td>\n\nFlag that indicates whether the wrap-up is segmented.Valid values:\n\n-   true: The wrap-up is segmented into multiple parts.\n-   false: The wrap-up is one complete segment.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsegment.segment\\_id\n\n</td><td>\n\nSys\\_id of the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.segment\\_table\n\n</td><td>\n\nName of the table containing the interaction segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.state\n\n</td><td>\n\nState of the interaction segment. Interaction segments that this endpoint updates successfully are in the closed state.Data type: String\n\n</td></tr><tr><td>\n\nsegment.submitted\\_on\n\n</td><td>\n\nDate and time the agent submitted the wrap-up segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration\n\n</td><td>\n\nObject containing details about the wrap-up configuration used for the wrap-up segment.Data type: Object\n\n```\n\"wrap_up_configuration\": {  \n  \"allowed_codes\": [Array],\n  \"default_code\": {Object},\n  \"enable_codes\": Boolean\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes\n\n</td><td>\n\nArray of objects each representing a wrap-up code the agent is allowed to use.Data type: Array\n\n```\n\"allowed_codes\": [\n  {\n    \"active\": Boolean, \n    \"code\": \"String\",\n    \"description\": \"String\",\n    \"external\": Boolean,\n    \"sys_id\": \"String\",\n    \"translated_code\": \"String\",\n    \"translated_description\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.allowed\\_codes.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code\n\n</td><td>\n\nObject containing the wrap-up code to use as the default.Data type: Object\n\n```\n\"default_code\": {\n  \"active\": Boolean,\n  \"code\": \"String\",\n  \"description\": \"String\",\n  \"external\": Boolean,\n  \"sys_id\": \"String\",\n  \"translated_code\": \"String\",\n  \"translated_description\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.active\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is active.Valid values:\n\n-   true: The wrap-up code is active.\n-   false: The wrap-up code isn't active.\n\nData type: Boolean\n\nDefault: true\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.code\n\n</td><td>\n\nLabel of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.description\n\n</td><td>\n\nDescription of the wrap-up code.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.external\n\n</td><td>\n\nFlag that indicates whether the wrap-up code is from an external system.Valid values:\n\n-   true: The wrap-up code is from an external system.\n-   false: The wrap-up code is internal.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up code.Data type: String\n\nTable: Interaction Wrap Up Code \\[interaction\\_wrap\\_up\\_code\\]\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_code\n\n</td><td>\n\nA translation of the wrap-up code label. Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.default\\_code.translated\\_description\n\n</td><td>\n\nA translation of the wrap-up code description.Data type: String\n\n</td></tr><tr><td>\n\nsegment.wrap\\_up\\_configuration.enable\\_codes\n\n</td><td>\n\nFlag that indicates whether the agent must select a wrap-up code.Valid values:\n\n-   true: Agent must select a wrap-up code.\n-   false: Agent isn't required to select a wrap-up code.\n\nData type: Boolean\n\nDefault: false\n\n</td></tr><tr><td>\n\nsuccess\n\n</td><td>\n\nFlag that indicates whether the API request was successfully processed.Valid values:\n\n-   true: The API request was successful.\n-   false: The API request failed.\n\nData type: Boolean\n\n</td></tr><tr><td>\n\nsys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example updates and closes a wrap-up segment for an interaction.\n\n```\ncurl \"https://instance.service-now.com/api/now/v1/wrapup/segment/update?segment_sys_id=98769876543254321fed1fedcba0cba0&agent_sys_id=123412345678567890ab90abcdefcdef&interaction_sys_id=213412345678567890ab90abcdefcde\" \\\n--request PUT \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type:application/json\" \\\n--data \"{\n  \\\"wrap_up_code\\\": \\\"Billing Issue\\\",\n  \\\"notes\\\": \\\"Customer's credit card expired. Had to switch to another one.\\\",\n  \\\"confirmed_on\\\": \\\"2024-09-16 18:52:01\\\"\n}\" \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"message\": \"Wrap-up segment updated successfully.\",\n  \"sys_id\": \"98769876543254321fed1fedcba0cba0\",\n  \"segment\": {\n    \"agent\": \"123412345678567890ab90abcdefcdef\",\n    \"segment_table\": \"sn_openframe_phone_log\",\n    \"segment_id\": \"dgajbcef12345678defdbxef123435678\",\n    \"external\": true,\n    \"interaction\": \"213412345678567890ab90abcdefcdef\",\n    \"state\": \"closed\",\n    \"wrap_up_configuration\": {\n      \"enable_codes\": true,\n      \"allowed_codes\": [\n        {\n          \"code\": \"Billing Issue\",\n          \"description\": \"\",\n          \"active\": true,\n          \"external\": true,\n          \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n          \"translated_code\": \"Abrechnungsproblem\",\n          \"translated_description\": \"\"\n        },\n        {\n          \"code\": \"Store Issue\",\n          \"description\": \"\",\n          \"active\": true,\n          \"external\": true,\n          \"sys_id\": \"54327b679f201210c89656effa0a1cd7\",\n          \"translated_code\": \" Einkaufsproblem\",\n          \"translated_description\": \"\"\n        }\n      ],\n      \"default_code\": {\n        \"code\": \"Billing Issue\",\n        \"description\": \"\",\n        \"active\": true,\n        \"external\": true,\n        \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n        \"translated_code\": \"Abrechnungsproblem\",\n        \"translated_description\": \"\"\n      }\n    },\n    \"code\": {\n      \"code\": \"Billing Issue\",\n      \"description\": \"\",\n      \"active\": true,\n      \"external\": true,\n      \"sys_id\": \"49c27b679f201210c89656effa0a1cd7\",\n      \"translated_code\": \"Abrechnungsproblem\",\n      \"translated_description\": \"\"\n    },\n    \"notes\": \"Customer's credit card expired. Had to switch to another one.\",\n    \"segmented\": true,\n    \"sys_id\": \"dgajbcef12345678defdbxef123435678\",\n    \"opened_on\": \"2024-09-16 17:52:01\",\n    \"submitted_on\": \"2024-09-16 18:51:59\",\n    \"confirmed_on\": \"2024-09-16 18:52:01\",\n    \"awaiting_confirmation\": false\n  }\n}\n```\n\n## Wrap Up - PUT /now/wrapup/segment/update/ai\n\nUpdates an existing open wrap-up segment with AI-recommended wrap-up codes and notes.\n\nThis endpoint is intended for external CCaaS systems that generate AI content independently and push it into the ServiceNow platform after segment creation. The **use\\_third\\_party\\_ai** property must be `true` on the wrap-up configuration.\n\nIf the **enable\\_ai\\_code** or **enable\\_ai\\_notes** is `false` in the configuration, the corresponding AI fields are saved, even if they’re included in the request payload. The **ai\\_code\\_defined\\_at** and **ai\\_notes\\_defined\\_at** timestamps are automatically set at the time of storage.\n\n-   **AI wrap-up recommendations**\n\n    AI wrap-up recommendations can come from two sources:\n\n    -   Internal \\(Now Assist\\): When **use\\_third\\_party\\_ai** is false, a business rule triggers automatically after segment creation to call the CSM API and populate **ai\\_wrap\\_up\\_code** and **ai\\_notes**.\n    -   External \\(third-party / CCaaS\\): When **use\\_third\\_party\\_ai** is true, the external system pushes AI data via the new PUT `/api/now/wrapup/segment/update/ai` endpoint.\n-   **Use cases**\n    -   Reduce agent handle time by providing wrap-up codes and notes with AI suggestions.\n    -   Enable CCaaS platforms to push AI-generated content into ServiceNow AI Platform after an interaction ends.\n    -   Give supervisors cleaner, more consistent wrap-up data for reporting and analytics.\n-   **Endpoint call order for an AI-assisted wrap-up flow**\n    1.  POST `/api/now/wrapup/segment/create` — Open a segment or pass **ai\\_wrap\\_up\\_code** / **ai\\_notes** and AI config flags.\n    2.  PUT `/api/now/wrapup/segment/update/ai` — \\(External AI only\\) Push AI recommendations onto the open segment.\n    3.  PUT `/api/now/wrapup/segment/update` — Agent finalizes and closes the segment.\n    4.  GET `/api/now/wrapup/segment/{segment_id}` — Retrieve segment including stored AI fields.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/wrapup/segment/update/ai`\n\nDefault URL: `/api/now/wrapup/segment/update/ai`\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\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nagent\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the agent assigned to the interaction. Required with **interaction\\_sys\\_id** if neither **segment\\_sys\\_id** nor **external\\_segment\\_id** are provided.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nai\\_wrap\\_up\\_code\n\n</td><td>\n\nAI-recommended wrap-up code label. Stored only if the **enable\\_ai\\_code** property is `true` in the configuration.[Wrap Up - POST /now/wrapup/segment/create](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/wrap-up-api.md)Data type: String\n\n</td></tr><tr><td>\n\nai\\_notes\n\n</td><td>\n\nAI-generated notes. . Stored only if enable\\_ai\\_notes is true on the configuration.[Wrap Up - POST /now/wrapup/segment/create](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/wrap-up-api.md)Max length: 4000 characters\n\nData type: String\n\n</td></tr><tr><td>\n\ninteraction\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the interaction. Required with **agent\\_sys\\_id** if neither **segment\\_sys\\_id** nor **external\\_segment\\_id** are provided.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsegment\\_sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\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<table id=\"table_ubl_j1f_42c\" 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><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request 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|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. 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\n<table id=\"table_xpr_b42_42c\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nmessage\n\n</td><td>\n\nMessage that describes the outcome of the API request.Data type: String\n\n</td></tr><tr><td>\n\nsegment\n\n</td><td>\n\nObject containing data about the interaction and wrap-up segment.Data type: Object\n\n```\n\"segment\": {\n  \"agent\": \"String\",\n  \"ai_code_defined_at\": \"String\",\n  \"ai_notes\": \"String\",\n  \"ai_notes_defined_at\": \"String\",\n  \"ai_wrap_up_code\": \"String\",\n  \"interaction\": \"String\",\n  \"sys_id\": \"String\"\n}\n```\n\n</td></tr><tr><td>\n\nsegment.agent\n\n</td><td id=\"segment-agent\">\n\nSys\\_id of the agent assigned to the interaction.Data type: String\n\nTable: User \\[sys\\_user\\]\n\n</td></tr><tr><td>\n\nsegment.ai\\_code\\_defined\\_at\n\n</td><td>\n\nTimestamp when AI code was stored.Format: Unix epoch milliseconds \\(e.g., \"1752252703000\"\\)\n\nData type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_notes\n\n</td><td>\n\nAI-generated notes stored on the segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_notes\\_defined\\_at\n\n</td><td>\n\nTimestamp when AI notes were stored.Format: Unix epoch milliseconds\n\nData type: String\n\n</td></tr><tr><td>\n\nsegment.ai\\_wrap\\_up\\_code\n\n</td><td>\n\nAI-recommended code stored on the segment.Data type: String\n\n</td></tr><tr><td>\n\nsegment.interaction\n\n</td><td id=\"interaction-id\">\n\nSys\\_id of the interaction.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsegment.sys\\_id\n\n</td><td>\n\nSys\\_id of the wrap-up segment.Data type: String\n\nTable: Interaction Wrap Up Segment \\[interaction\\_wrap\\_up\\_segment\\]\n\n</td></tr><tr><td>\n\nsuccess\n\n</td><td>\n\nFlag that indicates whether the API request was successfully processed.Valid values:\n\n-   true: The API request was successful.\n-   false: The API request failed.\n\nData type: Boolean\n\n</td></tr></tbody>\n</table>### cURL request\n\nThis example updates and closes a wrap-up segment for an interaction.\n\n```\ncurl --request PUT \\\n  --url 'https://instance.servicenow.com/api/now/wrapup/segment/update/ai' \\\n  --header 'Accept: application/json' \\\n  --header 'Content-Type: application/json' \\\n  --user 'username:password' \\\n  --data '{\n    \"segment_sys_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n    \"agent_sys_id\": \"123412345678567890ab90abcdefcdef\",\n    \"interaction_sys_id\": \"213412345678567890ab90abcdefcdef\",\n    \"ai_wrap_up_code\": \"Plan Update\",\n    \"ai_notes\": \"Customer requested an upgrade to the Premium plan.\"\n  }' \\\n--user 'username':'password'\n```\n\nResponse body.\n\n```\n{\n  \"success\": true,\n  \"message\": \"AI wrap-up data updated successfully.\",\n  \"segment\": {\n    \"sys_id\": \"abcd1234abcd1234abcd1234abcd1234\",\n    \"agent\": \"123412345678567890ab90abcdefcdef\",\n    \"interaction\": \"213412345678567890ab90abcdefcdef\",\n    \"ai_wrap_up_code\": \"Plan Update\",\n    \"ai_notes\": \"Customer requested an upgrade to the Premium plan.\",\n    \"ai_code_defined_at\": \"1752252703000\",\n    \"ai_notes_defined_at\": \"1752252703000\"\n  }\n}\n```\n\n"}}