---
title: "Update a Genie"
method: PATCH
path: "/v1/workspaces/{workspace_id}/genies/{genie_id}"
tags: ["Genies"]
---

# Update a Genie

`PATCH /v1/workspaces/{workspace_id}/genies/{genie_id}`

## Request

- Base URL: `https://api.stacksync.com`
- URL: `https://api.stacksync.com/v1/workspaces/{workspace_id}/genies/{genie_id}`
- Auth: HTTP bearer

Changes a Genie: name, configuration (only the keys sent), knowledge bases, who may use it, active or not.

## Path parameters

- `workspace_id` integer, required
- `genie_id` string, uuid, required

## Query parameters

- `region` 'besg' | 'usnv', required

## Request body

- UpdateGenieBody
  - `name` string, nullable
  - `genie_config` GenieConfigChanges: A partial configuration: the keys sent replace the stored ones, the others are kept (tools merge key by key)
    - `master_prompt` string, nullable
    - `description` string, nullable
    - `model` string, nullable
    - `interfaces` GenieInterfaceDocument[], nullable
      - `id` string, required
      - `type` string, required: slack, teams or email
      - `details` string, required: For email: the address '<alias>@stacksync.email'
      - `connection_id` string: The Slack or Teams connection of the workspace; empty for email
      - `connection_resource_id` string: The resource id of that connection; empty for email
    - `skills` GenieSkillDocument[], nullable
      - `id` string, required: The module id
      - `name` string, required
      - `description` string
      - `type` 'Module'
      - `enabled` boolean
      - `connection` string, nullable: The connection id the action runs with
      - `connection_resource_id` string, nullable: The resource id of that connection
      - `approval_policy` 'always_allow' | 'approval_required': approval_required pauses the genie until a person approves the action
    - `app_descriptions` object, nullable
    - `resources` GenieResourceDocument[], nullable
      - `name` string, required
      - `type` 'connection' | 'variable' | 'secret', required
      - `value` string, required: The connection id or the variable id
      - `instructions` string
    - `teams` GenieTeamDocument[], nullable
      - `id` string, required
      - `name` string, required
    - `contacts` GenieContactDocument[], nullable
      - `id` string, required
      - `name` string, required
      - `email` string, required
    - `tools` object, nullable: Only the tools to switch, e.g. {"web_search": false}
    - `api_key` string, nullable: Your own LLM API key for the model; never returned
  - `knowledge_bases` GenieKnowledgeBaseDocument[], nullable: Replaces the list
    - `knowledge_base_id` string, uuid, required: As answered by the knowledge base routes
    - `instructions` string
  - `public_access_rights` 'allow_without_authorization' | 'allow_with_authorization' | 'allow_selected_users_and_groups', nullable: Who may use the genie
  - `status` 'active' | 'inactive', nullable: active or inactive
  - `validate_only` boolean: Run every check of the write and answer 204 without writing: a refused write answers the error the write would

## Response `200`

OK

- Genie: A genie, as a create or an update takes it back
  - `genie_id` string, required
  - `name` string, required
  - `region` 'besg' | 'usnv', required
  - `folder_id` string, nullable
  - `status` string, nullable
  - `public_access_rights` string, nullable
  - `is_shared_with_workspace` boolean, nullable
  - `has_api_key` boolean, required: Whether an LLM API key of yours is stored (the key itself is never returned)
  - `genie_config` GenieConfigDocument, required: What the genie does and how: its instructions, channels, skills, resources and tools
    - `master_prompt` string: The genie's instructions
    - `description` string: Leave empty: Stacksync writes it from the instructions
    - `model` string: The LLM the genie runs on; empty for Stacksync's default
    - `interfaces` GenieInterfaceDocument[]
      - `id` string, required
      - `type` string, required: slack, teams or email
      - `details` string, required: For email: the address '<alias>@stacksync.email'
      - `connection_id` string: The Slack or Teams connection of the workspace; empty for email
      - `connection_resource_id` string: The resource id of that connection; empty for email
    - `skills` GenieSkillDocument[]
      - `id` string, required: The module id
      - `name` string, required
      - `description` string
      - `type` 'Module'
      - `enabled` boolean
      - `connection` string, nullable: The connection id the action runs with
      - `connection_resource_id` string, nullable: The resource id of that connection
      - `approval_policy` 'always_allow' | 'approval_required': approval_required pauses the genie until a person approves the action
    - `app_descriptions` object: Per skill app type: when and how the genie uses that app
    - `resources` GenieResourceDocument[]
      - `name` string, required
      - `type` 'connection' | 'variable' | 'secret', required
      - `value` string, required: The connection id or the variable id
      - `instructions` string
    - `teams` GenieTeamDocument[]
      - `id` string, required
      - `name` string, required
    - `contacts` GenieContactDocument[]
      - `id` string, required
      - `name` string, required
      - `email` string, required
    - `tools` GenieToolsDocument: The built-in tools the genie may use; all on by default, as in the web app
      - `web_search` boolean
      - `execute_browser` boolean
      - `api_call` boolean
      - `code_execution` boolean
      - `stacksync_ocr` boolean
      - `modify_scheduled_task` boolean
  - `knowledge_bases` GenieKnowledgeBaseDocument[], required
    - `knowledge_base_id` string, uuid, required: As answered by the knowledge base routes
    - `instructions` string
  - `created_time` string, date-time, nullable
  - `last_modified_time` string, date-time, nullable

## Other responses

- `204`: No Content
- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict

---

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