> ## Documentation Index
> Fetch the complete documentation index at: https://plain-mattvagni-patch-1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Assignment

Threads can be assigned to users or machine users. The latter is useful if you want a bot to handle or are building a complex automation of some kind.

### Assigning a thread

To assign threads you need an API key with the following permissions:

* `thread:assign`
* `thread:read`

<Tabs>
  <Tab title="Typescript SDK">
    <Snippet file="typescript-sdk/assign-thread.mdx" />

    Where `res.data` is the full thread:

    <Snippet file="typescript-sdk/assign-thread-response.mdx" />
  </Tab>

  <Tab title="GraphQL">
    <Snippet file="graphql/assign-thread.mdx" />
  </Tab>
</Tabs>

## Unassigning threads

To unassign threads you need an API key with the following permissions:

* `thread:unassign`
* `thread:read`

<Tabs>
  <Tab title="Typescript SDK">
    <Snippet file="typescript-sdk/unassign-thread.mdx" />

    Where `res.data` is the full thread like with assignment.
  </Tab>

  <Tab title="GraphQL">
    <Snippet file="graphql/unassign-thread.mdx" />
  </Tab>
</Tabs>
