---
title: "🔒 Обновление настроек контроля и условий найма сотрудника в компании."
method: POST
path: "/company/control/update"
tags: ["Company"]
---

# 🔒 Обновление настроек контроля и условий найма сотрудника в компании.

`POST /company/control/update`

## Request

- Base URL: `http://localhost`
- URL: `http://localhost/company/control/update`
- Auth: one of:
  - API key in header `sid` and API key in header `rts` and API key in header `sig`
  - HTTP bearer

Обновление настроек контроля и условий найма сотрудника в компании.

**Access:** `authorized` (10 ) · **Scope:** `write`

**Allows:** `user:employment` (все обязательны; проверка в команде по ресурсу из запроса)

### TypeScript (copy-paste)

**`POST /company/control/update`**

<details open><summary><b>Params</b></summary>

```typescript
export interface CompanyControlUpdateParams {
  userID: string
}
```

</details>

<details open><summary><b>Body (Partial)</b></summary>

```typescript
// Patch-body: все поля опциональны (Valid.Patch)
export type CompanyControlUpdateBody = Partial<UserDto>

export interface CompanyControlUpdateBodyFields {
  ID?: string
  cID?: string
  userID?: string
  accessType?: AccessType
  status?: string
  statusDT?: string
  statusUID?: string
  hasActiveRole?: boolean | null
  allProductAccess?: boolean | null
  /** Day key (YYYYMMDD or internal day index) */
  rolesStartDK?: number | null
  employment?: Record<string, any> | null
  isOwner?: boolean
  note?: Record<string, any> | null
  params?: Record<string, any> | null
  productAccess?: Record<string, any> | null
  marginPercent?: number | null
  roles?: Array<any> | null
  department?: Record<string, any> | null
  allowsSchemes?: Record<string, any> | null
  allows?: Record<string, any> | null
  /** Unix timestamp in milliseconds */
  allowsTS?: number | null
  /** Unix timestamp in milliseconds */
  updTS?: number
  updUID?: string
}
```

</details>

<details open><summary><b>Response</b></summary>

```typescript
export type CompanyControlUpdateResponse = IServerResponse<UserDto>

export interface IServerResponse<T = any> {
  code: number
  data: T
  srvTS: number
  rkey: string
}
```

</details>

> Полный файл типов: [`/docs/types`](/docs/types) · raw: [`/docs/api-types.ts`](/docs/api-types.ts)

## Query parameters

- `userID` string, uuid, required

## Headers

- `devID` string, uuid, required
- `tz` string, required
- `app` string, required
- `appVer` string, required
- `rKey` string

## Request body

- CompanyControlUpdateBody: Partial body (Valid.Patch) for `company/control/update` — все поля опциональны
  - `ID` string, uuid
  - `cID` string, uuid
  - `userID` string, uuid
  - `accessType` 0 | 10 | 100: `unauthorized` = 0, `authorized` = 10, `administrator` = 100
  - `status` string
  - `statusDT` string, date-time
  - `statusUID` string
  - `hasActiveRole` boolean, nullable
  - `allProductAccess` boolean, nullable
  - `rolesStartDK` integer, nullable: Day key (YYYYMMDD or internal day index)
  - `employment` object, nullable
  - `isOwner` boolean
  - `note` object, nullable
  - `params` object, nullable
  - `productAccess` object, nullable
  - `marginPercent` integer, nullable
  - `roles` unknown[], nullable
    - unknown
  - `department` object, nullable
  - `allowsSchemes` object, nullable
  - `allows` object, nullable
  - `allowsTS` integer, nullable: Unix timestamp in milliseconds
  - `updTS` integer: Unix timestamp in milliseconds
  - `updUID` string

## Response `200`

OK — `IServerResponse<UserDto>`

- object
  - `code` integer, required
  - `data` UserDto, required: Entity `User` (table: User )
    - `ID` string, uuid, required
    - `phone` string, nullable: Phone number
    - `email` string, nullable
    - `auth` object, nullable
    - `avatarFID` string, uuid, required
    - `firstName` string, required
    - `lastName` string, required
    - `patronymic` string, nullable
    - `gender` 'male' | 'female': `male` = "male", `female` = "female"
    - `contactInfo` string, nullable
    - `dateOfBirth` string, date-time, nullable
    - `address` object, nullable
      - `country` string, nullable
      - `city` string, nullable
      - `streetAddress` string, nullable
    - `timeZone` string, nullable
    - `meetingInfo` object, nullable
      - `zoomEmail` string, nullable
    - `position` string, nullable
    - `hourCost` number, required
    - `docsEmployment` object, nullable
    - `docsLibrary` object, nullable
    - `isDraft` boolean, required
    - `createDT` string, date-time, required
    - `createdUID` string, required
    - `updTS` integer, required: Unix timestamp in milliseconds
    - `updUID` string, required
  - `srvTS` integer, required: Server timestamp (ms)
  - `rkey` string, required: Request key

## Other responses

- `400`: BadRequest / Validation — неверные params/body/headers
- `401`: Unauthorized: Active user session required
- `403`: AccessNotAllowed: Privilege user:employment (common) required
- `404`: NotFound: Target user does not have access record for current company
- `406`: TimeResync — расхождение rts с сервером

---

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