---
title: "Link Employee to User"
method: POST
path: "/v1/employees/link-user"
tags: ["Employees"]
---

# Link Employee to User

`POST /v1/employees/link-user`

## Request

- Base URL: `https://api.bluehive.com`
- URL: `https://api.bluehive.com/v1/employees/link-user`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/bluehive-health/apis/bluehive-api/docs/v1/employees/link-user/post.ts> (a function with typed inputs; its response is checked against the schema)

Link an employee to a user account with specified roles

## Request body

- object
  - `employeeId` string, required
  - `userId` string, required
  - `role` string[]

## Response `201`

Employee linked successfully

- object: Employee linked successfully
  - `success` boolean, required
  - `linkId` string, required: ID of the created link
  - `message` string, required

## Other responses

- `400`: Validation error
- `401`: Authentication error
- `404`: Employee or user not found
- `500`: Server error

## Changes

- **2025-10-03** `2e0dd34abf24`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bluehive-health/apis/bluehive-api/changes/v1/employees/link-user/post.md)

---

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