---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# AWA Manual Assignment API

# AWA Manual Assignment API {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 6 minutes to read

The AWA Manual Assignment API provides an endpoint to manually assign available work items to available Advanced Work Assignment (AWA) agents.
A work item is a single piece of work handled by an AWA agent from start to finish. For example, one chat or one case is an object that can be routed and assigned to agents. For more information, refer to [Advanced Work Assignment](https://www.servicenow.com/docs/access?context=awa-overview&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US).

This API requires the Advanced Work Assignment (com.glide.awa) plugin. To call this API, you must have either the awa_manager or awa_integration_user role.

## AWA Manual Assignment -- POST /now/awa/workitems/{work_item_sys_id}/assignments {#ariaid-title2}

Assigns an available work item to an available Advanced Work Assignment (AWA) agent.
The primary use case for this endpoint is to enable external routing systems to route work items. If Advanced Work Assignment is configured to use external routing, work items in the queue are assigned using external routing and not AWA. You can assign the work item task by calling this endpoint. For more information, refer to [Use external routing](https://www.servicenow.com/docs/access?context=awa-external-routing-overview&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US).

### URL format

Versioned URL:
/now/{api_version}/awa/workitems/{sys_id}/assignments

Default URL:
/now/awa/workitems/{sys_id}/assignments

### Supported request parameters

{#awa_ma-POST-workitems-assignments__entry__2}{#awa_ma-POST-workitems-assignments__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| work_item_sys_id | The sys_id of the work item to assign to an available agent. Located in the Work Items \[awa_work_item\] table. The work item must be unassigned and in the Pending Accept or Queued state. For more information, refer to [Check unassigned task work items](https://www.servicenow.com/docs/access?context=awa-unassigned-task-work-items&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US). Type: String |
[Table 1. Path parameters]

{#awa_ma-POST-workitems-assignments__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 2. Query parameters]

{#awa_ma-POST-workitems-assignments__entry__12}

| Name | Description |
|-|-|
| after_timeout_presence | Sys_id of the presence state that the agent switches to if the timeout parameter expires. Located in the AWA Presence State \[awa_presence_state\] table. If the timeout parameter isn't passed, this parameter is ignored. For additional information on presence states, see [Configure agent presence states](https://www.servicenow.com/docs/access?context=awa-configure-agent-presence&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US). Data type: String Default: "" (Empty string) |
| agent_sys_id | Required. Sys_id of the available agent to receive the work item. Agents are users with the awa_agent role in the User \[sys_user\] table. For information on how to determine if an agent is available, refer to [Agent Inbox controls](https://www.servicenow.com/docs/access?context=agent-experience&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US). Data type: String |
| allowed_to_decline | Flag that indicates whether agents are allowed to reject work items. If this parameter is `true`, the inbox card displays both the Accept and Reject buttons on the inbox card. Valid values (not case-sensitive): * true/yes/1: Agent can reject work items. * false/no/0: Agent can't reject work items. Data type: Boolean Default: true |
| display_option | Display option for the card and tab when a work item is automatically assigned. This parameter is only valid if the enable_auto_assign is passed as <kbd class="ph userinput">true</kbd>. Valid values: * card_only: Display only the card. * card_and_tab: Display both the card and tab. Data type: String Default: card_only |
| enable_auto_assign | Flag that indicates whether the work item should be automatically accepted or should allow the agent to manually accept or reject the work item. Valid values (not case-sensitive): * true/yes/1: Automatically accept. * false/no/0: Allow agent to manually accept or reject. Data type: Boolean Default: false |
| offered_on | Work item offer time. The offer time is used to calculate the remaining time the agent has left to accept the work item in the inbox. It helps account for the discrepancy between the time when the API request gets processed, and when the third-party routing system invokes the API request. This parameter allows external systems calling this endpoint to configure the offer time of the work item so that it stays in synchronization with the external system's internal tracking of the work item. For example, if the work item was offered on 11:30:30, the timeout is 30 seconds, and the current time is 11:30:45, the countdown timer displays 00:15 (as in 15 seconds remaining). This value is stored in the offered_on field on the work item. This parameter is ignored if the timeout parameter isn't passed. Data type: String Format: UTC timestamp (yyyy-MM-dd'T'HH:mm:ss.SSS) |
| timeout | Amount of time that the work item stays in the agent's inbox waiting for the agent to accept the work assignment. Data type: Number Unit: Seconds |
[Table 3. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#awa_ma-POST-workitems-assignments__entry__28}{#awa_ma-POST-workitems-assignments__accept-RESTAPI}{#awa_ma-POST-workitems-assignments__content_type-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
[Table 4. Request headers]

{#awa_ma-POST-workitems-assignments__entry__34}

| Header | Description |
|-|-|
| None |   |
[Table 5. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://servicenow-prod.fluidtopics.net/2vuQj3~2s_niNXyXhrbRZA "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#awa_ma-POST-workitems-assignments__entry__38}{#awa_ma-POST-workitems-assignments__entry-200-status-code}{#awa_ma-POST-workitems-assignments__entry-401-status-code}{#awa_ma-POST-workitems-assignments__entry-404-status-code}{#awa_ma-POST-workitems-assignments__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | Unauthorized. The user credentials are incorrect or have not been passed. |
| 404 | Not found. The requested item wasn't found. |
| 409 | Conflict. The request couldn't pass due to an error with the provided work item or agent sys_id. |
| 500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
[Table 6. Status codes]

### Response body parameters (JSON or XML)

{#awa_ma-POST-workitems-assignments__entry__50}

| Name | Description |
|-|-|
| success | Flag that indicates whether the manual work item assignment is successful. Possible values: * true: Work item assignment successful. * false: Work item assignment unsuccessful. Data type: Boolean |
| message | Response message acknowledging successful assignment or an exception. Success: "Manual assignment successfully requested." Exceptions: * "\<work_item_sys_id\> is not a valid work item" -- Provided work item sys_id does not exist. * "Caller \<API_caller_sys_id\> does not have the awa_manager or awa_integration_user role" -- The authenticated user making the API request must have either the awa_manager or awa_integration_user role. * "Work item \<work_item_sys_id\> cannot be assigned" -- Work item provided cannot be assigned because it is in Accepted or Canceled state. Refer to [Check work items and AWA events](https://www.servicenow.com/docs/access?context=awa-work-items-all&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US). * "\<agent_sys_id\> is not a valid agent" -- Agent does not have the awa_agent role. * "Work Item is already assigned to \<agent_sys_id\>" -- Provided work item is assigned to another agent. * "Agent is not available" -- Agent is not in the Available state in AWA. Refer to [Agent Inbox controls](https://www.servicenow.com/docs/access?context=agent-experience&version=xanadu&pubname=xanadu-servicenow-platform&ft:locale=en-US). * "Timeout value cannot be negative" -- Provided timeout value cannot be a negative value. * "\<presence_state_sys_id\> is not a valid presence state" -- Provided presence state sys_id does not exist in the AWA Presence State \[awa_presence_state\] table. * "Offered time (\<offered_on_timestamp\>) must be in the following format: yyyy-MM-dd'T'HH:mm:ss.SSS" -- Provided offered_on timestamp must be in the specified format. * "Offered time (\<offered_on_timestamp \>) must be before the current time, otherwise agent will have more time to accept the work item" -- Provided offered_on timestamp can't be before the time the request is made. * "Timestamp after timeout (\<offered_on_timestamp \>) must be after the current time, otherwise agent has no time to accept the work item" -- The timestamp after adding the timeout value to the provided offered_on timestamp must be after the time the request was made. * "\<display_option\> is not a valid display option" -- Provided display_option must be either of the following values: "card_only" or "card_and_tab" * "%s is not a valid boolean value" -- Provided Boolean-type value must be in one of the following Boolean formats: "yes"/"no", "true"/"false", "1"/"0" Data type: String |
[ ]

### cURL request

The following example shows how to assign a work item to an available AWA agent using only the required parameters.

    curl "https://instance.servicenow.com/api/now/awa/workitems/<work_item_sys_id>/assignments" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{\"agent_sys_id\":\"<agent_sys_id>\"}" \
    --user 'username':'password'

The result shows that the task has been successfully assigned to the agent. You can verify results in the Assigned to field of the Work Items \[awa_work_item\] table.

    {
      "result": {
        "success": true,
        "message": "Manual assignment successfully requested."
      }
    }

### cURL request {#awa_ma-POST-workitems-assignments__example_rgh_ct5_2bc}

The following example shows how to assign a work item to an available AWA agent including the optional parameters.

    curl "https://instance.servicenow.com/api/now/awa/workitems/<work_item_sys_id>/assignments" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data '{
        "agent_sys_id": "46d44a23a9fe19810012d100cca80666",
        "timeout":"10",
        "offered_on":"2024-04-03T23:09:31.000"
      }'
    --user 'username':'password'

The result shows that the task has been successfully assigned to the agent. You can verify results in the Assigned to field of the Work Items \[awa_work_item\] table.

    {
      "result": {
        "success": true,
        "message": "Manual assignment successfully requested."
      }
    }


