---
title: "Give a person their manager"
method: PUT
path: "/organization/members/{userId}/manager"
tags: ["Organization"]
---

# Give a person their manager

`PUT /organization/members/{userId}/manager`

## Request

- Base URL: `https://api.atako.ai`
- URL: `https://api.atako.ai/organization/members/{userId}/manager`
- Auth: HTTP bearer

A USER id, never an OrgRef: the typing carries half the cardinal rule — a person answers to a person, or to nobody. `managerUserId: null` makes them a root of the chart.

## Path parameters

- `userId` string, uuid, required

## Request body

- object
  - `managerUserId` string, uuid, nullable, required

## Response `200`

The recomputed chart — identical shape to GET /organization/chart.

- OrgChart: The whole chart, and the single payload of every /organization operation — reads AND writes. A hierarchy change moves people who were not named in the request, so a write answers with the recomputed chart rather than an acknowledgement: the client never has to make a second call, nor guess. It carries both the derived SHAPE (`tree`) and the raw CHOICES (`teams`/`agents`/`humans`, with their explicit `lead`/`manager`), which is what an editor needs to show what was decided instead of what was inferred from it.
  - `rootHumanId` string, uuid, nullable, required: DERIVED, never stored: the oldest `admin` member. Null when the company has no admin at all — the only case where the chart has nothing to hang on.
  - `tree` object, required: The chart as a forest. `roots` are the people nobody stands above (normally one). `loose` collects what the structure left dangling — a team whose lead is gone stays on the chart, to be repaired rather than to vanish quietly.
    - `roots` OrgNode[], required
      - `key` string, required: Stable key: `human:<id>`, `agent:<id>` or `team:<id>`.
      - `kind` 'human' | 'agent' | 'team', required
      - `id` string, required
      - `name` string, required
      - `role` string, nullable, required
      - `teamId` string, uuid, nullable: On a member node: the team it stands in. On a team node: its own id, or null for the virtual `unassigned` group.
      - `memberCount` integer: Team nodes only — agents plus humans attached to the team.
      - `children` OrgNode[], required
    - `loose` OrgNode[], required
      - `key` string, required: Stable key: `human:<id>`, `agent:<id>` or `team:<id>`.
      - `kind` 'human' | 'agent' | 'team', required
      - `id` string, required
      - `name` string, required
      - `role` string, nullable, required
      - `teamId` string, uuid, nullable: On a member node: the team it stands in. On a team node: its own id, or null for the virtual `unassigned` group.
      - `memberCount` integer: Team nodes only — agents plus humans attached to the team.
      - `children` OrgNode[], required
  - `issues` OrgIssue[], required
    - `kind` 'team-lead' | 'agent-manager' | 'agent-human', required
    - `id` string, required
  - `teams` OrgTeam[], required
    - `id` string, uuid, required
    - `name` string, required
    - `parentId` string, uuid, nullable, required
    - `lead` OrgRef, required: A reference to a member of the organisation, whatever its nature. Humans and agents are the same kind of node in this chart.
      - `kind` 'human' | 'agent', required
      - `id` string, uuid, required
  - `agents` OrgAgentNode[], required
    - `id` string, uuid, required
    - `name` string, required
    - `role` string, nullable, required: The title of the org-chart position held, when there is one.
    - `teamId` string, uuid, nullable, required
    - `manager` OrgRef, required: A reference to a member of the organisation, whatever its nature. Humans and agents are the same kind of node in this chart.
      - `kind` 'human' | 'agent', required
      - `id` string, uuid, required
  - `humans` OrgHuman[], required
    - `id` string, uuid, required: User id.
    - `name` string, required
    - `title` string, nullable, required
    - `teamId` string, uuid, nullable, required
    - `managerUserId` string, uuid, nullable, required: A person answers to a person, or to nobody — never to an agent. Null on the root of the chart.
  - `canEdit` boolean, required: True when the caller is a company admin, i.e. when the write operations below are open to them. Told here so the client never has to deduce a permission from a 403 it provoked.

## Other responses

- `400`: Validation error, or a refused hierarchy: `ORG_CYCLE` (the link would close a loop) / `ORG_NO_HUMAN_MANAGER` (somebody would end up with no person responsible for them). The body carries the bare CODE so the client can say which.
- `401`: Missing, malformed, or invalid bearer token / API key, or revoked session (SESSION_REVOKED).
- `403`: Admin only — every organisation write is reserved to a company admin.
- `404`: No company, an unknown id, or one belonging to another company (`TEAM_NOT_FOUND` / `ORG_REF_NOT_FOUND`).

---

[API](https://skmtc.dev/atako/apis/atako-api.md) · [All operations](https://skmtc.dev/atako/apis/atako-api/llms.txt) · [OpenAPI document](https://skmtc.dev/atako/apis/atako-api/revisions/aa555c56fbd7?raw)
