---
title: "Create Qa Session"
method: POST
path: "/api/v1/intelligence/qa/sessions"
tags: ["intelligence-ddd", "Intelligence"]
---

# Create Qa Session

`POST /api/v1/intelligence/qa/sessions`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/intelligence/qa/sessions`
- Auth: none declared

Create a new Q&A session.

TECH-570: Now supports two session scopes:
- asset: Traditional single-database Q&A (asset_id required)
- company: Cross-database Q&A across all company databases (asset_id must be None)

Args:
    asset_id: Asset UUID from query parameter (required for asset scope)
    request: Session creation details including scope
    current_user: Authenticated user from dependency
    qa_service: Q&A service instance

Returns:
    StandardResponse with created session data

## Query parameters

- `asset_id` string, uuid, nullable: Asset UUID for asset-scoped sessions (required unless scope=company)

## Headers

- `Authorization` string

## Request body

- QASessionCreateRequest: Request to create a Q&A session. TECH-570: Added scope parameter for company-scoped sessions.
  - `title` string, nullable: Session title
  - `visibility` 'private' | 'team' | 'public': Session visibility options.
  - `team_id` integer, nullable: Team ID for team sessions
  - `scope` 'asset' | 'company': Session scope options. TECH-570: Controls whether Q&A searches single asset or all company assets.

## Response `201`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
