> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefini.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign to agents

> Add or remove agent assignments for attributes.

Adds or removes assignments between agents and attributes. Send a batch of junction changes in one request. An attribute only runs in conversations for agents it is assigned to.

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `write` scope.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Body parameters

<ParamField body="junctions" type="Junction[]" required>
  Array of junction changes to apply.
</ParamField>

<ParamField body="junctions[].botId" type="string" required>
  Agent ID.
</ParamField>

<ParamField body="junctions[].toolId" type="string" required>
  Attribute ID.
</ParamField>

<ParamField body="junctions[].action" type="string" required>
  `ADD` to create the assignment, `DELETE` to remove it.
</ParamField>

<ParamField body="junctions[].channels" type="string[]">
  Optional channels the assignment applies to, for example `chat` and `email`.
</ParamField>

## Response

Returns `{ "success": true }` when the changes are applied.

## Errors

<AccordionGroup>
  <Accordion title="400 Bad Request" icon="circle-exclamation">
    The body is malformed, or a junction is missing `botId`, `toolId`, or a valid `action`.
  </Accordion>

  <Accordion title="401 Unauthorized" icon="lock">
    The API key is missing, malformed, revoked, or invalid.
  </Accordion>

  <Accordion title="403 Forbidden" icon="shield-halved">
    The API key does not include the `write` scope required for this route.
  </Accordion>
</AccordionGroup>
