---
title: "🔒🛡️ Изменение пользовательской схемы привилегий."
method: POST
path: "/company/allows/scheme-update"
tags: ["Company: Access"]
---

# 🔒🛡️ Изменение пользовательской схемы привилегий.

`POST /company/allows/scheme-update`

## Request

- Base URL: `http://localhost`
- URL: `http://localhost/company/allows/scheme-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:privileges` (все обязательны; ресурс — `<тип>ID` / `ID` из запроса, `user:*` — `userID` или сам пользователь)

### TypeScript (copy-paste)

**`POST /company/allows/scheme-update`**

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

```typescript
export interface CompanyAllowsSchemeUpdateParams {
  ID: string
}
```

</details>

<details open><summary><b>Body</b></summary>

```typescript
export interface CompanyAllowsSchemeUpdateBody {
  title?: string | null
  desc?: string | null
  allows?: Record<string, any> | null
}
```

</details>

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

```typescript
export type CompanyAllowsSchemeUpdateResponse = IServerResponse<Privileges_Scheme>

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

- `ID` string, uuid, required

## Headers

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

## Request body

- CompanyAllowsSchemeUpdateBody: JSON body for `company/allows/scheme-update`
  - `title` string, nullable
  - `desc` string, nullable
  - `allows` object, nullable

## Response `200`

OK — `IServerResponse<Privileges_Scheme>`

- object
  - `code` integer, required
  - `data` PrivilegesScheme, required: Schema Privileges_Scheme (inferred from ResponseData AST)
  - `srvTS` integer, required: Server timestamp (ms)
  - `rkey` string, required: Request key

## Other responses

- `400`: BadRequest: Title is empty or too long, description is too long, unknown privilege or relation
- `401`: Unauthorized: Active user session required
- `403`: AccessNotAllowed: Privilege user:privileges required
- `404`: NotFound: Scheme not found
- `406`: TimeResync — расхождение rts с сервером
- `422`: UnprocessableContent: Title is taken in the company or privilege is available only to administrator

---

[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)
