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

# Analyze Brief Discovery

> Analyze a project brief to detect ambiguities and generate clarifying questions.

**Required scope:** `read`

This is the "Brief Discovery" step: before generating requirements, call this
endpoint to identify gaps in the brief and get targeted questions to ask the client.

Returns:
- `briefQualityScore` (1-10): overall quality of the brief
- `questions`: clarifying questions with priority and category
- `ambiguities`: ambiguous parts of the brief with suggestions
- `summary`: brief summary



## OpenAPI

````yaml /openapi/openapi-external.json post /ai/analyze-brief-discovery
openapi: 3.1.0
info:
  title: Quikly.ai External API
  version: 1.0.0
  description: >-
    REST API for external integrations with Quikly.ai. Authenticate using an API
    key passed in the X-API-Key header. Use these endpoints from n8n, Zapier,
    custom scripts, or any HTTP client.
servers: []
security:
  - ApiKeyAuth: []
tags:
  - name: Proposals
    description: Create, read, update, and manage client proposals.
  - name: Profile
    description: Read and update the authenticated user's profile.
  - name: Templates
    description: Manage reusable proposal templates.
  - name: AI Services
    description: >-
      AI-powered analysis: rate recommendations, brief analysis,
      differentiators.
  - name: Public API
  - name: Usage
    description: Query API usage and quota information.
  - name: Webhooks
    description: Manage webhook subscriptions for real-time events.
  - name: Agent
    description: Interact with the AI agent for automated workflows.
  - name: Lead Sessions
    description: Track and manage lead capture sessions.
paths:
  /ai/analyze-brief-discovery:
    post:
      tags:
        - AI Services
      summary: Analyze Brief Discovery
      description: >-
        Analyze a project brief to detect ambiguities and generate clarifying
        questions.


        **Required scope:** `read`


        This is the "Brief Discovery" step: before generating requirements, call
        this

        endpoint to identify gaps in the brief and get targeted questions to ask
        the client.


        Returns:

        - `briefQualityScore` (1-10): overall quality of the brief

        - `questions`: clarifying questions with priority and category

        - `ambiguities`: ambiguous parts of the brief with suggestions

        - `summary`: brief summary
      operationId: analyze_brief_discovery_api_external_v1_ai_analyze_brief_discovery_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BriefDiscoveryRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BriefDiscoveryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    BriefDiscoveryRequest:
      properties:
        brief:
          type: string
          maxLength: 50000
          minLength: 10
          title: Brief
        language:
          type: string
          enum:
            - es
            - en
          title: Language
          default: en
        apiKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Apikey
        aiProvider:
          anyOf:
            - type: string
              enum:
                - gemini
                - openai
                - anthropic
            - type: 'null'
          title: Aiprovider
          default: gemini
        openaiApiKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Openaiapikey
        anthropicApiKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Anthropicapikey
        projectName:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Projectname
        clientName:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Clientname
        proposalType:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Proposaltype
        clarifyingAnswers:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Clarifyinganswers
        projectStartDate:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Projectstartdate
        projectDeadline:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Projectdeadline
        teamMembers:
          anyOf:
            - items:
                $ref: '#/components/schemas/BriefDiscoveryTeamMember'
              type: array
            - type: 'null'
          title: Teammembers
        userProfile:
          anyOf:
            - $ref: '#/components/schemas/BriefDiscoveryUserProfile'
            - type: 'null'
        clientBudget:
          anyOf:
            - type: number
            - type: 'null'
          title: Clientbudget
        clientBudgetType:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Clientbudgettype
        availableProviders:
          anyOf:
            - items:
                $ref: '#/components/schemas/BriefDiscoveryProvider'
              type: array
            - type: 'null'
          title: Availableproviders
      type: object
      required:
        - brief
      title: BriefDiscoveryRequest
      description: Schema for brief discovery analysis request (IN-25).
    BriefDiscoveryResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        questions:
          items:
            $ref: '#/components/schemas/ClarifyingQuestion'
          type: array
          title: Questions
          default: []
        ambiguities:
          items:
            $ref: '#/components/schemas/BriefAmbiguity'
          type: array
          title: Ambiguities
          default: []
        briefQualityScore:
          type: integer
          maximum: 10
          minimum: 1
          title: Briefqualityscore
          default: 5
        summary:
          type: string
          title: Summary
          default: ''
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        inputType:
          anyOf:
            - type: string
            - type: 'null'
          title: Inputtype
        entities:
          anyOf:
            - $ref: '#/components/schemas/ExtractedEntities'
            - type: 'null'
        estimationImpact:
          anyOf:
            - $ref: '#/components/schemas/EstimationImpact'
            - type: 'null'
        teamAssessment:
          anyOf:
            - $ref: '#/components/schemas/TeamAssessment'
            - type: 'null'
        resourceAssessment:
          anyOf:
            - $ref: '#/components/schemas/ResourceAssessment'
            - type: 'null'
        typeRecommendations:
          anyOf:
            - $ref: '#/components/schemas/TypeRecommendations'
            - type: 'null'
      type: object
      title: BriefDiscoveryResponse
      description: Schema for brief discovery response (multi-agent pipeline).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BriefDiscoveryTeamMember:
      properties:
        roleName:
          type: string
          title: Rolename
        seniority:
          type: string
          title: Seniority
          default: Junior
        allocation:
          type: integer
          title: Allocation
          default: 100
        availability:
          anyOf:
            - type: integer
            - type: 'null'
          title: Availability
      type: object
      required:
        - roleName
      title: BriefDiscoveryTeamMember
      description: Lightweight team member snapshot sent for discovery assessment.
    BriefDiscoveryUserProfile:
      properties:
        providerType:
          type: string
          title: Providertype
        role:
          anyOf:
            - type: string
            - type: 'null'
          title: Role
        seniority:
          anyOf:
            - type: string
            - type: 'null'
          title: Seniority
        skills:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Skills
        workAreas:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Workareas
        weeklyHours:
          anyOf:
            - type: integer
            - type: 'null'
          title: Weeklyhours
        yearsOfExperience:
          anyOf:
            - type: integer
            - type: 'null'
          title: Yearsofexperience
        aiReadinessLevel:
          anyOf:
            - type: integer
              maximum: 4
              minimum: 1
            - type: 'null'
          title: Aireadinesslevel
      type: object
      required:
        - providerType
      title: BriefDiscoveryUserProfile
      description: Lightweight profile snapshot for freelancer/team competency assessment.
    BriefDiscoveryProvider:
      properties:
        roleName:
          type: string
          title: Rolename
        category:
          type: string
          title: Category
          default: team
        costType:
          type: string
          title: Costtype
          default: hourly
        rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Rate
        fixedCost:
          anyOf:
            - type: number
            - type: 'null'
          title: Fixedcost
      type: object
      required:
        - roleName
      title: BriefDiscoveryProvider
      description: Provider/tool from the agency roster sent for resource assessment.
    ClarifyingQuestion:
      properties:
        id:
          type: string
          title: Id
        question:
          type: string
          title: Question
        reason:
          type: string
          title: Reason
        category:
          type: string
          enum:
            - scope
            - technical
            - business
            - timeline
            - budget
            - users
            - integrations
            - other
          title: Category
        priority:
          type: string
          enum:
            - high
            - medium
            - low
          title: Priority
        exampleAnswer:
          anyOf:
            - type: string
            - type: 'null'
          title: Exampleanswer
      type: object
      required:
        - id
        - question
        - reason
        - category
        - priority
      title: ClarifyingQuestion
      description: A clarifying question generated from brief analysis.
    BriefAmbiguity:
      properties:
        text:
          type: string
          title: Text
        issue:
          type: string
          title: Issue
        suggestion:
          type: string
          title: Suggestion
      type: object
      required:
        - text
        - issue
        - suggestion
      title: BriefAmbiguity
      description: A detected ambiguity in the brief.
    ExtractedEntities:
      properties:
        projectType:
          type: string
          title: Projecttype
          default: ''
        platforms:
          items:
            type: string
          type: array
          title: Platforms
          default: []
        features:
          items:
            type: string
          type: array
          title: Features
          default: []
        techStack:
          items:
            type: string
          type: array
          title: Techstack
        userTypes:
          items:
            type: string
          type: array
          title: Usertypes
        integrations:
          items:
            type: string
          type: array
          title: Integrations
          default: []
        clientContext:
          type: string
          title: Clientcontext
          default: ''
      type: object
      title: ExtractedEntities
      description: >-
        Structured entities extracted from the user's input by the Scope
        Analyst.
    EstimationImpact:
      properties:
        missingHighImpact:
          items:
            type: string
          type: array
          title: Missinghighimpact
        missingMediumImpact:
          items:
            type: string
          type: array
          title: Missingmediumimpact
        wellDefined:
          items:
            type: string
          type: array
          title: Welldefined
      type: object
      title: EstimationImpact
      description: How gaps affect the accuracy of the estimate.
    TeamAssessment:
      properties:
        fitLevel:
          type: string
          enum:
            - sufficient
            - stretched
            - insufficient
            - no_team
          title: Fitlevel
          default: no_team
        capacityWarnings:
          items:
            type: string
          type: array
          title: Capacitywarnings
        roleGaps:
          items:
            $ref: '#/components/schemas/TeamAssessmentSuggestedRole'
          type: array
          title: Rolegaps
        strengths:
          items:
            type: string
          type: array
          title: Strengths
        recommendation:
          type: string
          title: Recommendation
          default: ''
      type: object
      title: TeamAssessment
      description: Quimy's assessment of team fitness for the project.
    ResourceAssessment:
      properties:
        suggestedLineItems:
          items:
            $ref: '#/components/schemas/ResourceSuggestedLineItem'
          type: array
          title: Suggestedlineitems
        missingResources:
          items:
            $ref: '#/components/schemas/ResourceMissing'
          type: array
          title: Missingresources
        toolsAndInfra:
          items:
            $ref: '#/components/schemas/ResourceToolInfra'
          type: array
          title: Toolsandinfra
      type: object
      title: ResourceAssessment
      description: Quimy's resource/provider assessment for the project.
    TypeRecommendations:
      properties:
        proposalType:
          type: string
          title: Proposaltype
        suggestedTerms:
          anyOf:
            - type: object
            - type: 'null'
          title: Suggestedterms
        reasoning:
          type: string
          title: Reasoning
          default: ''
      type: object
      required:
        - proposalType
      title: TypeRecommendations
      description: Type-specific commercial recommendations from gap_detective.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TeamAssessmentSuggestedRole:
      properties:
        roleName:
          type: string
          title: Rolename
        seniority:
          type: string
          title: Seniority
          default: Mid
        reason:
          type: string
          title: Reason
          default: ''
      type: object
      required:
        - roleName
      title: TeamAssessmentSuggestedRole
      description: A role Quimy suggests adding to the team.
    ResourceSuggestedLineItem:
      properties:
        label:
          type: string
          title: Label
        amount:
          type: number
          title: Amount
          default: 0
        frequency:
          type: string
          title: Frequency
          default: one_time
        reason:
          type: string
          title: Reason
          default: ''
        fromRoster:
          type: boolean
          title: Fromroster
          default: false
      type: object
      required:
        - label
      title: ResourceSuggestedLineItem
      description: A cost line item suggested by Quimy based on the roster.
    ResourceMissing:
      properties:
        roleName:
          type: string
          title: Rolename
        reason:
          type: string
          title: Reason
          default: ''
        estimatedCostRange:
          type: string
          title: Estimatedcostrange
          default: ''
        priority:
          type: string
          title: Priority
          default: medium
      type: object
      required:
        - roleName
      title: ResourceMissing
      description: A missing resource flagged by Quimy.
    ResourceToolInfra:
      properties:
        name:
          type: string
          title: Name
        reason:
          type: string
          title: Reason
          default: ''
        estimatedMonthlyCost:
          type: string
          title: Estimatedmonthlycost
          default: ''
      type: object
      required:
        - name
      title: ResourceToolInfra
      description: A tool or infrastructure need identified by Quimy.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from Quikly.ai Settings → API Keys.
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````