> For the complete documentation index, see [llms.txt](https://docs.api.intratool.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.intratool.de/introduction/assignment-and-targeting.md).

# Assignment and Targeting

Assignment and targeting define the shared request fields and resolution rules for a resource's [Targetables capability](/introduction/resource-capabilities/targetables.md). Targetables select [Users](/api-reference/users.md) or [Departments](/api-reference/departments.md) for participation, responsibility, notifications, or resource-specific visibility.

A resource's Model Definition states whether it supports Targetables directly or inherits them from a parent. The resource and endpoint documentation define the accepted assignment modes, request fields, defaults, and effects.

Targetables do not create permission-key grants. [Entity Permissions](/introduction/entity-permissions.md) remain a separate resource-access contract.

## Static Assignment

Static assignment stores an assignment mode and, for explicit selection modes, associations to users or departments.

### Request Fields

| Key              | Type               | Description                                      |
| ---------------- | ------------------ | ------------------------------------------------ |
| `assign_mode`    | `string` \| `null` | Determines how Targetables are resolved.         |
| `user_ids`       | `array`            | User IDs used by explicit selection modes.       |
| `department_ids` | `array`            | Department IDs used by explicit selection modes. |

Only send these fields where the affected endpoint documents them.

### Assignment Modes

* `null` - No users or departments are targeted.
* `all` - All users and departments are targeted.
* `all_users` - All regular user accounts are targeted.
* `all_group_accounts` - All group accounts are targeted.
* `any_of` - Explicit users and departments use resource-specific any-of behavior.
* `one_of` - One of the explicit users or departments can satisfy the resource-specific action.
* `any_of_user` - Explicit users and users resolved from explicit departments use resource-specific any-of behavior.
* `one_of_user` - One resolved user can satisfy the resource-specific action.

For `null`, `all`, `all_users`, and `all_group_accounts`, `user_ids` and `department_ids` must be empty. The explicit selection modes require at least one user or department. Individual resources can support only a subset of these modes.

### Static Assignment Example

```json
{
  "assign_mode": "any_of",
  "user_ids": [3, 4, 5],
  "department_ids": [4, 5]
}
```

## Dynamic Assignment

Dynamic assignment resolves Targetables when an automation action runs. The `computed_targetable_type` selects the resolution source; the action documentation defines its accepted subset and any required configuration fields.

### Execution Context

* `for_executing_department`: Uses the department of the user who is executing the action as the target.
* `for_executing_real_department`: Uses the real department of the executing user, ignoring any proxy or delegation.
* `for_executing_user`: Uses the user who is executing the action as the target.
* `for_executing_real_user`: Uses the real user (not a proxy or delegate) who is executing the action.

### Related Assignments and Workflow Nodes

* `from_task_assignment`: Uses the assignment from the related [TaskAssignment](/api-reference/tasks-2/task-assignments.md) as the target.
* `from_workflow_node`: Uses the related workflow node as the target.
* `for_workflow_node_department`: Uses the department associated with the workflow node as the target.
* `for_workflow_node_executed_user_department`: Uses the department of the user who executed the workflow node as the target.
* `for_workflow_node_user`: Uses the user associated with the workflow node as the target.
* `for_workflow_node_executed_user`: Uses the user who executed the workflow node as the target.

A workflow node is one executed step in a chain of automation actions. Workflow-node resolution can select a previous step by its zero-based index through `computed_targetables_workflow_node_index`.

```json
{
  "computed_targetables_workflow_node_index": 0
}
```

### Entity-Select Fields

* `from_entity_select_fields_users`: Uses users selected in entity select fields as the target.
* `from_entity_select_fields_departments`: Uses departments selected in entity select fields as the target.

These types require the relevant field IDs in `computed_targetables_entity_select_field_ids`.

```json
{
  "computed_targetables_entity_select_field_ids": [123, 456]
}
```

### System Variables

* `for_system_variable_users`: Uses users resolved from System Variables as the target.
* `for_system_variable_departments`: Uses departments resolved from System Variables as the target.

These types require a [key-only System Variable](/introduction/system-variables.md#key-only-values) in `computed_targetables_system_variable`. The variable must resolve to a user, department, or corresponding list that matches the selected type.

```json
{
  "computed_targetables_system_variable": "system.user"
}
```
