> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspace Settings SDK Reference

> SDK reference for the Workspace Settings API, available in Node.js and Python.

## Workspace Settings

### Retrieve a Workspace Setting

Returns the current settings for the authenticated workspace: its read-only key/slug, display name, the enforce-enabled-models flag, and the workspace-default PII redaction plugin configuration.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.workspace_settings.get()

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.workspaceSettings.get();

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "settings": {
            "key": str,
            "display_name": str,
            "enforce_enabled_models": bool,
            "pii_redaction": {  # optional
                "enabled": bool,
                "config": {  # optional
                    "language": Optional[str],
                    "entities": List[str],  # optional
                    "on_failure": Optional[str],
                    "threshold": Optional[float],
                },
            },
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      settings: {
        key: string;
        displayName: string;
        enforceEnabledModels: boolean;
        piiRedaction?: {
          enabled: boolean;
          config?: {
            language?: string;
            entities?: string[];
            onFailure?: string;
            threshold?: number;
          };
        };
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Update a Workspace Setting

Partially updates workspace settings. Every field is optional; an omitted field is left unchanged. Provide `display_name` to rename the workspace, `enforce_enabled_models` to toggle model enforcement, or `pii_redaction` to replace the workspace-default PII redaction plugin configuration.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.workspace_settings.update()

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.workspaceSettings.update({});

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "display_name": Optional[str],
        "enforce_enabled_models": Optional[bool],
        "pii_redaction": {  # optional
            "enabled": bool,  # required
            "config": {  # optional
                "language": Optional[str],
                "entities": List[str],  # optional
                "on_failure": Optional[str],
                "threshold": Optional[float],
            },
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      displayName?: string;
      enforceEnabledModels?: boolean;
      piiRedaction?: {
        enabled: boolean;  // required
        config?: {
          language?: string;
          entities?: string[];
          onFailure?: string;
          threshold?: number;
        };
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "settings": {
            "key": str,
            "display_name": str,
            "enforce_enabled_models": bool,
            "pii_redaction": {  # optional
                "enabled": bool,
                "config": {  # optional
                    "language": Optional[str],
                    "entities": List[str],  # optional
                    "on_failure": Optional[str],
                    "threshold": Optional[float],
                },
            },
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      settings: {
        key: string;
        displayName: string;
        enforceEnabledModels: boolean;
        piiRedaction?: {
          enabled: boolean;
          config?: {
            language?: string;
            entities?: string[];
            onFailure?: string;
            threshold?: number;
          };
        };
      };
    }
    ```
  </CodeGroup>
</Expandable>
