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

# Modify Strategy

> Kick off strategy modification (Pillar 5 PR D — queue-offloaded).

Persists a ``StrategyBriefHistory`` row synchronously (brief + the
modification instructions, ``strategy_snapshot.status='generating'``)
so a Railway restart between enqueue and the LLM call cannot lose
the user's instructions. The Strategy Briefs page reads this table;
the worker UPDATEs the same row when the LLM completes (filling in
``strategy_file_id`` and a completion snapshot). Dedup on
``brief_history_id`` mirrors ``strategy_generation`` so a re-click
while the worker is mid-run is suppressed.

Returns ``{job_id, status:"queued"}``; client polls
``GET /api/v1/jobs/{job_id}`` for completion.



## OpenAPI

````yaml /openapi.json post /api/v1/teams/{team_id}/strategy/modify
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/teams/{team_id}/strategy/modify:
    post:
      tags:
        - Teams
      summary: Modify Strategy
      description: |-
        Kick off strategy modification (Pillar 5 PR D — queue-offloaded).

        Persists a ``StrategyBriefHistory`` row synchronously (brief + the
        modification instructions, ``strategy_snapshot.status='generating'``)
        so a Railway restart between enqueue and the LLM call cannot lose
        the user's instructions. The Strategy Briefs page reads this table;
        the worker UPDATEs the same row when the LLM completes (filling in
        ``strategy_file_id`` and a completion snapshot). Dedup on
        ``brief_history_id`` mirrors ``strategy_generation`` so a re-click
        while the worker is mid-run is suppressed.

        Returns ``{job_id, status:"queued"}``; client polls
        ``GET /api/v1/jobs/{job_id}`` for completion.
      operationId: modify_strategy_api_v1_teams__team_id__strategy_modify_post
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StrategyModifyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    StrategyModifyRequest:
      properties:
        brief:
          type: string
          maxLength: 5000
          minLength: 10
          title: Brief
        instructions:
          type: string
          maxLength: 3000
          minLength: 5
          title: Instructions
          description: What to change
      type: object
      required:
        - brief
        - instructions
      title: StrategyModifyRequest
      description: Request to modify an existing strategy with specific instructions.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````