# Assign user to jobs

Users can be assigned to fulfillmenttools jobs to designate responsibility for the work. This function helps distribute the workload in advance among different employees. The user must exist in the system before they can be assigned to a job.

{% hint style="warning" %}
Assigning a user to a job is for informational purposes only. fulfillmenttools doesn't restrict job interactions to the assigned user; any user with the appropriate permissions can interact with the job.
{% endhint %}

User assignment is available for the following job types:

* Pick jobs
* Pack jobs
* Handover jobs
* Service jobs
* Stow jobs

## Assignment during job creation

To assign one or more users when a job is created, include the `assignedUsers` array in the request body.

```http
POST https://{projectId}.api.fulfillmenttools.com/api/{JOB_ENTITY}
```

The `{JOB_ENTITY}` placeholder represents the specific job endpoint, such as `pickjobs` or `packjobs`. The body must include the `assignedUsers` array as shown in the following examples.

{% tabs %}
{% tab title="By `userId`" %}
This example assigns a user by their `userId`.

```json
{
  // Any job object
  ...
  "assignedUsers": [
    {
      "userId": "{USER_ID}"
    }
  ]
}
```

{% endtab %}

{% tab title="By `userName`" %}
This example assigns a user by their `userName`.

```json
{
  // Any job object
  ...
  "assignedUsers": [
    {
      "userName": "{USER_NAME}"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Updating assigned users

The `REPLACE_ASSIGNED_USERS` action updates the users assigned to a job. This action fully replaces the existing list of assigned users with the new list provided in the request body. If an empty array is provided, all current assignments are removed.

```http
POST https://{projectId}.api.fulfillmenttools.com/api/{JOB_ENTITY}/actions
```

The action body must conform to one of the following examples.

{% tabs %}
{% tab title="By `userId`" %}
This example replaces the assigned user list using a `userId`.

```json
{
  "name": "REPLACE_ASSIGNED_USERS",
  "assignedUsers": [
    {
      "userId": "{USER_ID}"
    }
  ],
  "version": 2
}
```

{% endtab %}

{% tab title="By `userName`" %}
This example replaces the assigned user list using a `userName`.

```json
{
  "name": "REPLACE_ASSIGNED_USERS",
  "assignedUsers": [
    {
      "userName": "{USER_NAME}"
    }
  ],
  "version": 2
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fulfillmenttools.com/documentation/by-pillar/store-operations/assign-user-to-jobs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
