---
title: "🔒 #26668 Страница «ИИ-функции»: включить или выключить функцию в компании; #26682 режим запуска (auto - по событию и из меню, manual - только из меню)."
method: POST
path: "/llm/functions/update"
tags: ["LLM Functions"]
---

# 🔒 #26668 Страница «ИИ-функции»: включить или выключить функцию в компании; #26682 режим запуска (auto - по событию и из меню, manual - только из меню).

`POST /llm/functions/update`

## Request

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

#26668 Страница «ИИ-функции»: включить или выключить функцию в компании; #26682 режим запуска (auto - по событию и из меню, manual - только из меню).

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

**Allows:** `company:llm` (все обязательны; без ресурса)

### TypeScript (copy-paste)

**`POST /llm/functions/update`**

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

```typescript
export interface LlmFunctionsUpdateBody {
  key: string
  enabled?: boolean | null
  launch?: LLMFunctionConnection_launch | null
}
```

</details>

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

```typescript
export type LlmFunctionsUpdateResponse = IServerResponse<LLMFunctionConnection>

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)

## Headers

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

## Request body

- LlmFunctionsUpdateBody: JSON body for `llm/functions/update`
  - `key` string, required
  - `enabled` boolean, nullable
  - `launch` 'auto' | 'manual': `auto` = "auto", `manual` = "manual"

## Response `200`

OK — `IServerResponse<LLMFunctionConnection>`

- object
  - `code` integer, required
  - `data` LLMFunctionConnection, required: Entity `LLMFunctionConnection` (table: LLMFunctionConnection )
    - `ID` string, uuid, required
    - `key` string, required
    - `cID` string, uuid, required
    - `enabled` boolean
    - `costFactor` number, nullable
    - `launch` 'auto' | 'manual': `auto` = "auto", `manual` = "manual"
    - `lastUsedTs` integer, nullable: Unix timestamp in milliseconds
    - `createdDT` string, date-time, 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`: Authorize — сессия отсутствует, истекла или невалидна
- `403`: AccessNotAllowed: Privilege company:llm required
- `404`: NotFound: unknown function key
- `406`: TimeResync — расхождение rts с сервером
- `422`: UnprocessableContent: the function has no launch mode (reason: launch)

---

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