> ## 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.

# Wikis SDK Reference

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

## Wikis

### List Wikis

<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.wikis.list(factory_id="<factory_id>")

      # 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.wikis.list({ factoryId: "<factory_id>" });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
        "repository_key": Optional[str],
        "branch": Optional[str],
        "factory_id": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
      repositoryKey?: string;
      branch?: string;
      factoryId?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "data": [{  # optional
            "wiki_id": Optional[str],
            "workspace_id": Optional[str],
            "created_by_id": Optional[str],
            "display_name": Optional[str],
            "repository_key": Optional[str],
            "repository": {  # optional
                "provider": Optional[str],
                "owner": Optional[str],
                "name": Optional[str],
                "url": Optional[str],
                "default_branch": Optional[str],
            },
            "branch": Optional[str],
            "scm_connection_id": Optional[str],
            "settings": {  # optional
                "model": Optional[str],
                "computer_template": Optional[str],
                "depth": Optional[str],
                "refresh_cadence": Optional[str],
                "publish_to_repository": Optional[bool],
            },
            "loop_id": Optional[str],
            "status": Optional[str],
            "current_run_id": Optional[str],
            "last_generated_commit": Optional[str],
            "last_generated_at": str,  # optional
            "page_count": Optional[int],
            "created_at": str,  # optional
            "updated_at": str,  # optional
            "factory_id": Optional[str],
        }],
        "has_more": Optional[bool],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      data?: {
        wikiId?: string;
        workspaceId?: string;
        createdById?: string;
        displayName?: string;
        repositoryKey?: string;
        repository?: {
          provider?: string;
          owner?: string;
          name?: string;
          url?: string;
          defaultBranch?: string;
        };
        branch?: string;
        scmConnectionId?: string;
        settings?: {
          model?: string;
          computerTemplate?: string;
          depth?: string;
          refreshCadence?: string;
          publishToRepository?: boolean;
        };
        loopId?: string;
        status?: string;
        currentRunId?: string;
        lastGeneratedCommit?: string;
        lastGeneratedAt?: Date;
        pageCount?: number;
        createdAt?: Date;
        updatedAt?: Date;
        factoryId?: string;
      }[];
      hasMore?: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Create a Wiki

<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.wikis.create(display_name="Product handbook", factory_id="<factory_id>", repository={"url": "https://github.com/orq-ai/orq-cookbooks"}, branch="main", scm_connection_id="<id>")

      # 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.wikis.create({
      displayName: "Product handbook",
      factoryId: "<factory_id>",
      repository: { url: "https://github.com/orq-ai/orq-cookbooks" },
      branch: "main",
      scmConnectionId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "display_name": Optional[str],
        "repository": {  # optional
            "provider": Optional[str],
            "owner": Optional[str],
            "name": Optional[str],
            "url": Optional[str],
            "default_branch": Optional[str],
        },
        "branch": Optional[str],
        "scm_connection_id": Optional[str],
        "settings": {  # optional
            "model": Optional[str],
            "computer_template": Optional[str],
            "depth": Optional[str],
            "refresh_cadence": Optional[str],
            "publish_to_repository": Optional[bool],
        },
        "import_existing": Optional[bool],
        "factory_id": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      displayName?: string;
      repository?: {
        provider?: string;
        owner?: string;
        name?: string;
        url?: string;
        defaultBranch?: string;
      };
      branch?: string;
      scmConnectionId?: string;
      settings?: {
        model?: string;
        computerTemplate?: string;
        depth?: string;
        refreshCadence?: string;
        publishToRepository?: boolean;
      };
      importExisting?: boolean;
      factoryId?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki": {  # optional
            "wiki_id": Optional[str],
            "workspace_id": Optional[str],
            "created_by_id": Optional[str],
            "display_name": Optional[str],
            "repository_key": Optional[str],
            "repository": {  # optional
                "provider": Optional[str],
                "owner": Optional[str],
                "name": Optional[str],
                "url": Optional[str],
                "default_branch": Optional[str],
            },
            "branch": Optional[str],
            "scm_connection_id": Optional[str],
            "settings": {  # optional
                "model": Optional[str],
                "computer_template": Optional[str],
                "depth": Optional[str],
                "refresh_cadence": Optional[str],
                "publish_to_repository": Optional[bool],
            },
            "loop_id": Optional[str],
            "status": Optional[str],
            "current_run_id": Optional[str],
            "last_generated_commit": Optional[str],
            "last_generated_at": str,  # optional
            "page_count": Optional[int],
            "created_at": str,  # optional
            "updated_at": str,  # optional
            "factory_id": Optional[str],
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wiki?: {
        wikiId?: string;
        workspaceId?: string;
        createdById?: string;
        displayName?: string;
        repositoryKey?: string;
        repository?: {
          provider?: string;
          owner?: string;
          name?: string;
          url?: string;
          defaultBranch?: string;
        };
        branch?: string;
        scmConnectionId?: string;
        settings?: {
          model?: string;
          computerTemplate?: string;
          depth?: string;
          refreshCadence?: string;
          publishToRepository?: boolean;
        };
        loopId?: string;
        status?: string;
        currentRunId?: string;
        lastGeneratedCommit?: string;
        lastGeneratedAt?: Date;
        pageCount?: number;
        createdAt?: Date;
        updatedAt?: Date;
        factoryId?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Inspect Repository

<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.wikis.inspect_repository(scm_connection_id="<id>", repository_url="https://github.com/orq-ai/orq-cookbooks", branch="main")

      # 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.wikis.inspectRepository({
      scmConnectionId: "<id>",
      repositoryUrl: "https://github.com/orq-ai/orq-cookbooks",
      branch: "main",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "scm_connection_id": Optional[str],
        "repository_url": Optional[str],
        "branch": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      scmConnectionId?: string;
      repositoryUrl?: string;
      branch?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "available": Optional[bool],
        "page_count": Optional[int],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      available?: boolean;
      pageCount?: number;
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve a Wiki

<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.wikis.get(wiki_id="<id>")

      # 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.wikis.get({
      wikiId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki": {  # optional
            "wiki_id": Optional[str],
            "workspace_id": Optional[str],
            "created_by_id": Optional[str],
            "display_name": Optional[str],
            "repository_key": Optional[str],
            "repository": {  # optional
                "provider": Optional[str],
                "owner": Optional[str],
                "name": Optional[str],
                "url": Optional[str],
                "default_branch": Optional[str],
            },
            "branch": Optional[str],
            "scm_connection_id": Optional[str],
            "settings": {  # optional
                "model": Optional[str],
                "computer_template": Optional[str],
                "depth": Optional[str],
                "refresh_cadence": Optional[str],
                "publish_to_repository": Optional[bool],
            },
            "loop_id": Optional[str],
            "status": Optional[str],
            "current_run_id": Optional[str],
            "last_generated_commit": Optional[str],
            "last_generated_at": str,  # optional
            "page_count": Optional[int],
            "created_at": str,  # optional
            "updated_at": str,  # optional
            "factory_id": Optional[str],
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wiki?: {
        wikiId?: string;
        workspaceId?: string;
        createdById?: string;
        displayName?: string;
        repositoryKey?: string;
        repository?: {
          provider?: string;
          owner?: string;
          name?: string;
          url?: string;
          defaultBranch?: string;
        };
        branch?: string;
        scmConnectionId?: string;
        settings?: {
          model?: string;
          computerTemplate?: string;
          depth?: string;
          refreshCadence?: string;
          publishToRepository?: boolean;
        };
        loopId?: string;
        status?: string;
        currentRunId?: string;
        lastGeneratedCommit?: string;
        lastGeneratedAt?: Date;
        pageCount?: number;
        createdAt?: Date;
        updatedAt?: Date;
        factoryId?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Delete a Wiki

<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.wikis.delete(wiki_id="<id>")

      # 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.wikis.delete({
      wikiId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

### Update a Wiki

<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.wikis.update(wiki_id="<id>", display_name="Product handbook")

      # 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.wikis.update({
      wikiId: "<id>",
      updateWikiRequest: {
        displayName: "Product handbook",
      },
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
        "display_name": Optional[str],
        "scm_connection_id": Optional[str],
        "settings": {  # optional
            "model": Optional[str],
            "computer_template": Optional[str],
            "depth": Optional[str],
            "refresh_cadence": Optional[str],
            "publish_to_repository": Optional[bool],
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
      updateWikiRequest: {  // required
        displayName?: string;
        scmConnectionId?: string;
        settings?: {
          model?: string;
          computerTemplate?: string;
          depth?: string;
          refreshCadence?: string;
          publishToRepository?: boolean;
        };
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki": {  # optional
            "wiki_id": Optional[str],
            "workspace_id": Optional[str],
            "created_by_id": Optional[str],
            "display_name": Optional[str],
            "repository_key": Optional[str],
            "repository": {  # optional
                "provider": Optional[str],
                "owner": Optional[str],
                "name": Optional[str],
                "url": Optional[str],
                "default_branch": Optional[str],
            },
            "branch": Optional[str],
            "scm_connection_id": Optional[str],
            "settings": {  # optional
                "model": Optional[str],
                "computer_template": Optional[str],
                "depth": Optional[str],
                "refresh_cadence": Optional[str],
                "publish_to_repository": Optional[bool],
            },
            "loop_id": Optional[str],
            "status": Optional[str],
            "current_run_id": Optional[str],
            "last_generated_commit": Optional[str],
            "last_generated_at": str,  # optional
            "page_count": Optional[int],
            "created_at": str,  # optional
            "updated_at": str,  # optional
            "factory_id": Optional[str],
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wiki?: {
        wikiId?: string;
        workspaceId?: string;
        createdById?: string;
        displayName?: string;
        repositoryKey?: string;
        repository?: {
          provider?: string;
          owner?: string;
          name?: string;
          url?: string;
          defaultBranch?: string;
        };
        branch?: string;
        scmConnectionId?: string;
        settings?: {
          model?: string;
          computerTemplate?: string;
          depth?: string;
          refreshCadence?: string;
          publishToRepository?: boolean;
        };
        loopId?: string;
        status?: string;
        currentRunId?: string;
        lastGeneratedCommit?: string;
        lastGeneratedAt?: Date;
        pageCount?: number;
        createdAt?: Date;
        updatedAt?: Date;
        factoryId?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Get Page

<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.wikis.get_page(wiki_id="<id>", path="docs/index.md")

      # 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.wikis.getPage({
      wikiId: "<id>",
      path: "docs/index.md",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
        "path": Optional[str],
        "run_id": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
      path?: string;
      runId?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "page": {  # optional
            "path": Optional[str],
            "title": Optional[str],
            "section": Optional[str],
            "order": Optional[int],
            "content_hash": Optional[str],
            "edited_by_id": Optional[str],
            "markdown": Optional[str],
            "run_id": Optional[str],
            "links": List[str],  # optional
            "edited_at": str,  # optional
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      page?: {
        path?: string;
        title?: string;
        section?: string;
        order?: number;
        contentHash?: string;
        editedById?: string;
        markdown?: string;
        runId?: string;
        links?: string[];
        editedAt?: Date;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Update Page

<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.wikis.update_page(wiki_id="<id>", path="docs/index.md", markdown="# Overview", expected_content_hash="<hash>")

      # 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.wikis.updatePage({
      wikiId: "<id>",
      updateWikiPageRequest: {
        path: "docs/index.md",
        markdown: "# Overview",
        expectedContentHash: "<hash>",
      },
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
        "path": Optional[str],
        "markdown": Optional[str],
        "expected_content_hash": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
      updateWikiPageRequest: {  // required
        path?: string;
        markdown?: string;
        expectedContentHash?: string;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "page": {  # optional
            "path": Optional[str],
            "title": Optional[str],
            "section": Optional[str],
            "order": Optional[int],
            "content_hash": Optional[str],
            "edited_by_id": Optional[str],
            "markdown": Optional[str],
            "run_id": Optional[str],
            "links": List[str],  # optional
            "edited_at": str,  # optional
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      page?: {
        path?: string;
        title?: string;
        section?: string;
        order?: number;
        contentHash?: string;
        editedById?: string;
        markdown?: string;
        runId?: string;
        links?: string[];
        editedAt?: Date;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Refresh a Wiki

<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.wikis.refresh(wiki_id="<id>", full=False)

      # 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.wikis.refresh({
      wikiId: "<id>",
      refreshWikiRequest: {
        full: false,
      },
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
        "full": Optional[bool],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
      refreshWikiRequest: {  // required
        full?: boolean;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "run": {  # optional
            "run_id": Optional[str],
            "workspace_id": Optional[str],
            "wiki_id": Optional[str],
            "agent_session_id": Optional[str],
            "agent_session_run_id": Optional[str],
            "kind": Optional[str],
            "trigger": Optional[str],
            "pull_request_url": Optional[str],
            "base_commit": Optional[str],
            "head_commit": Optional[str],
            "status": Optional[str],
            "error": Optional[str],
            "stats": {  # optional
                "page_count": Optional[int],
                "section_count": Optional[int],
                "mermaid_count": Optional[int],
                "bytes_": Optional[str],
            },
            "started": str,  # optional
            "finished": str,  # optional
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      run?: {
        runId?: string;
        workspaceId?: string;
        wikiId?: string;
        agentSessionId?: string;
        agentSessionRunId?: string;
        kind?: string;
        trigger?: string;
        pullRequestUrl?: string;
        baseCommit?: string;
        headCommit?: string;
        status?: string;
        error?: string;
        stats?: {
          pageCount?: number;
          sectionCount?: number;
          mermaidCount?: number;
          bytes?: string;
        };
        started?: Date;
        finished?: Date;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### List Runs

<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.wikis.list_runs(wiki_id="<id>")

      # 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.wikis.listRuns({
      wikiId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
        "limit": Optional[int],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
      limit?: number;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "data": [{  # optional
            "run_id": Optional[str],
            "workspace_id": Optional[str],
            "wiki_id": Optional[str],
            "agent_session_id": Optional[str],
            "agent_session_run_id": Optional[str],
            "kind": Optional[str],
            "trigger": Optional[str],
            "pull_request_url": Optional[str],
            "base_commit": Optional[str],
            "head_commit": Optional[str],
            "status": Optional[str],
            "error": Optional[str],
            "stats": {  # optional
                "page_count": Optional[int],
                "section_count": Optional[int],
                "mermaid_count": Optional[int],
                "bytes_": Optional[str],
            },
            "started": str,  # optional
            "finished": str,  # optional
        }],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      data?: {
        runId?: string;
        workspaceId?: string;
        wikiId?: string;
        agentSessionId?: string;
        agentSessionRunId?: string;
        kind?: string;
        trigger?: string;
        pullRequestUrl?: string;
        baseCommit?: string;
        headCommit?: string;
        status?: string;
        error?: string;
        stats?: {
          pageCount?: number;
          sectionCount?: number;
          mermaidCount?: number;
          bytes?: string;
        };
        started?: Date;
        finished?: Date;
      }[];
    }
    ```
  </CodeGroup>
</Expandable>

### Search Wikis

<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.wikis.search(wiki_id="<id>", query="reset my password")

      # 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.wikis.search({
      wikiId: "<id>",
      query: "reset my password",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
        "query": Optional[str],
        "limit": Optional[int],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
      query?: string;
      limit?: number;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "hits": [{  # optional
            "path": Optional[str],
            "page_title": Optional[str],
            "heading_path": Optional[str],
            "anchor": Optional[str],
            "snippet": Optional[str],
        }],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      hits?: {
        path?: string;
        pageTitle?: string;
        headingPath?: string;
        anchor?: string;
        snippet?: string;
      }[];
    }
    ```
  </CodeGroup>
</Expandable>

### Get Tree

<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.wikis.get_tree(wiki_id="<id>")

      # 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.wikis.getTree({
      wikiId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "wiki_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      wikiId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "pages": [{  # optional
            "path": Optional[str],
            "title": Optional[str],
            "section": Optional[str],
            "order": Optional[int],
            "content_hash": Optional[str],
            "edited_by_id": Optional[str],
        }],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      pages?: {
        path?: string;
        title?: string;
        section?: string;
        order?: number;
        contentHash?: string;
        editedById?: string;
      }[];
    }
    ```
  </CodeGroup>
</Expandable>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.