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

# Derive Spec

> Create a spec draft from a done ideation.



## OpenAPI

````yaml /openapi.json post /api/v1/ideations/{ideation_id}/derive-spec
openapi: 3.1.0
info:
  description: >-
    Okto Pulse REST API schema generated from okto-pulse-core 0.2.0 source for
    docs.oktolabs.ai.
  title: Okto Pulse
  version: 0.2.0
servers: []
security: []
paths:
  /api/v1/ideations/{ideation_id}/derive-spec:
    post:
      tags:
        - ideations
      summary: Derive Spec
      description: Create a spec draft from a done ideation.
      operationId: derive_spec_api_v1_ideations__ideation_id__derive_spec_post
      parameters:
        - in: path
          name: ideation_id
          required: true
          schema:
            title: Ideation Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpecResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    SpecResponse:
      description: Schema for full spec response.
      properties:
        acceptance_criteria:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Acceptance Criteria
        api_contracts:
          anyOf:
            - items:
                $ref: '#/components/schemas/ApiContract'
              type: array
            - type: 'null'
          title: Api Contracts
        architecture_designs:
          default: []
          items:
            $ref: '#/components/schemas/ArchitectureDesignSummary'
          title: Architecture Designs
          type: array
        archived:
          default: false
          title: Archived
          type: boolean
        assignee_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee Id
        board_id:
          title: Board Id
          type: string
        business_rules:
          anyOf:
            - items:
                $ref: '#/components/schemas/BusinessRule'
              type: array
            - type: 'null'
          title: Business Rules
        cards:
          default: []
          items:
            $ref: '#/components/schemas/CardSummaryForSpec'
          title: Cards
          type: array
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
        created_at:
          format: date-time
          title: Created At
          type: string
        created_by:
          title: Created By
          type: string
        decisions:
          anyOf:
            - items:
                $ref: '#/components/schemas/Decision'
              type: array
            - type: 'null'
          title: Decisions
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        functional_requirements:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Functional Requirements
        id:
          title: Id
          type: string
        ideation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Ideation Id
        knowledge_bases:
          default: []
          items:
            $ref: '#/components/schemas/SpecKnowledgeSummary'
          title: Knowledge Bases
          type: array
        labels:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Labels
        pre_archive_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Pre Archive Status
        qa_items:
          default: []
          items:
            $ref: '#/components/schemas/SpecQAResponse'
          title: Qa Items
          type: array
        refinement_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Refinement Id
        screen_mockups:
          anyOf:
            - items:
                $ref: '#/components/schemas/ScreenMockup'
              type: array
            - type: 'null'
          title: Screen Mockups
        skip_contract_coverage:
          default: false
          title: Skip Contract Coverage
          type: boolean
        skip_decisions_coverage:
          default: false
          title: Skip Decisions Coverage
          type: boolean
        skip_rules_coverage:
          default: false
          title: Skip Rules Coverage
          type: boolean
        skip_test_coverage:
          default: false
          title: Skip Test Coverage
          type: boolean
        skip_trs_coverage:
          default: false
          title: Skip Trs Coverage
          type: boolean
        status:
          $ref: '#/components/schemas/SpecStatus'
        technical_requirements:
          anyOf:
            - items:
                anyOf:
                  - type: string
                  - additionalProperties: true
                    type: object
              type: array
            - type: 'null'
          title: Technical Requirements
        test_scenarios:
          anyOf:
            - items:
                $ref: '#/components/schemas/TestScenario'
              type: array
            - type: 'null'
          title: Test Scenarios
        title:
          title: Title
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
        version:
          title: Version
          type: integer
      required:
        - id
        - board_id
        - title
        - description
        - context
        - functional_requirements
        - technical_requirements
        - acceptance_criteria
        - status
        - version
        - assignee_id
        - created_by
        - created_at
        - updated_at
        - labels
      title: SpecResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ApiContract:
      description: An API contract describing an endpoint or interaction.
      properties:
        description:
          default: ''
          title: Description
          type: string
        id:
          title: Id
          type: string
        linked_requirements:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Requirements
        linked_rules:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Rules
        linked_task_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Task Ids
        method:
          title: Method
          type: string
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        path:
          title: Path
          type: string
        request_body:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Request Body
        response_errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Response Errors
        response_success:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Response Success
      required:
        - id
        - method
        - path
      title: ApiContract
      type: object
    ArchitectureDesignSummary:
      description: Lightweight architecture design summary without heavy diagram payloads.
      properties:
        adapter_payload_refs:
          items:
            type: string
          title: Adapter Payload Refs
          type: array
        board_id:
          title: Board Id
          type: string
        breaking_change_flag:
          default: false
          title: Breaking Change Flag
          type: boolean
        created_at:
          format: date-time
          title: Created At
          type: string
        diagrams_count:
          default: 0
          title: Diagrams Count
          type: integer
        id:
          title: Id
          type: string
        parent_id:
          title: Parent Id
          type: string
        parent_type:
          enum:
            - ideation
            - refinement
            - spec
            - card
          title: Parent Type
          type: string
        requires_arch_review:
          default: false
          title: Requires Arch Review
          type: boolean
        source_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Ref
        source_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Source Version
        stale:
          default: false
          title: Stale
          type: boolean
        title:
          title: Title
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
        version:
          title: Version
          type: integer
      required:
        - id
        - board_id
        - parent_type
        - parent_id
        - title
        - version
        - created_at
        - updated_at
      title: ArchitectureDesignSummary
      type: object
    BusinessRule:
      description: A business rule that governs system behavior.
      properties:
        id:
          title: Id
          type: string
        linked_requirements:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Requirements
        linked_task_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Task Ids
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        rule:
          title: Rule
          type: string
        then:
          title: Then
          type: string
        title:
          title: Title
          type: string
        when:
          title: When
          type: string
      required:
        - id
        - title
        - rule
        - when
        - then
      title: BusinessRule
      type: object
    CardSummaryForSpec:
      description: Minimal card summary used inside spec responses.
      properties:
        assignee_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee Id
        id:
          title: Id
          type: string
        priority:
          $ref: '#/components/schemas/CardPriority'
        sprint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Sprint Id
        status:
          $ref: '#/components/schemas/CardStatus'
        title:
          title: Title
          type: string
      required:
        - id
        - title
        - status
        - priority
        - assignee_id
      title: CardSummaryForSpec
      type: object
    Decision:
      description: |-
        A decision formalized on a spec — causal/contextual choice.

        Different from BusinessRule (which is prescriptive, "system DEVE do X"):
        a Decision records *why* a choice was made, with alternatives and
        supersedence. Formalized so the spec carries full traceability and the
        validation gate can optionally require linked tasks.
      properties:
        alternatives_considered:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Alternatives Considered
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
        id:
          title: Id
          type: string
        linked_requirements:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Requirements
        linked_task_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Task Ids
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        rationale:
          title: Rationale
          type: string
        status:
          default: active
          enum:
            - active
            - superseded
            - revoked
          title: Status
          type: string
        supersedes_decision_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Supersedes Decision Id
        title:
          title: Title
          type: string
      required:
        - id
        - title
        - rationale
      title: Decision
      type: object
    SpecKnowledgeSummary:
      description: Lightweight KB summary (without content).
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        id:
          title: Id
          type: string
        mime_type:
          title: Mime Type
          type: string
        spec_id:
          title: Spec Id
          type: string
        title:
          title: Title
          type: string
      required:
        - id
        - spec_id
        - title
        - description
        - mime_type
        - created_at
      title: SpecKnowledgeSummary
      type: object
    SpecQAResponse:
      description: Schema for spec Q&A response.
      properties:
        allow_free_text:
          default: false
          title: Allow Free Text
          type: boolean
        answer:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer
        answered_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Answered At
        answered_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Answered By
        asked_by:
          title: Asked By
          type: string
        choices:
          anyOf:
            - items:
                $ref: '#/components/schemas/SpecQAChoiceOption'
              type: array
            - type: 'null'
          title: Choices
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        question:
          title: Question
          type: string
        question_type:
          default: text
          title: Question Type
          type: string
        selected:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Selected
        spec_id:
          title: Spec Id
          type: string
      required:
        - id
        - spec_id
        - question
        - answer
        - asked_by
        - answered_by
        - created_at
        - answered_at
      title: SpecQAResponse
      type: object
    ScreenMockup:
      description: A single screen/view in the mockup set. Contains HTML+Tailwind content.
      properties:
        annotations:
          anyOf:
            - items:
                $ref: '#/components/schemas/MockupAnnotation'
              type: array
            - type: 'null'
          title: Annotations
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        html_content:
          default: ''
          title: Html Content
          type: string
        id:
          title: Id
          type: string
        order:
          default: 0
          title: Order
          type: integer
        screen_type:
          default: page
          title: Screen Type
          type: string
        title:
          title: Title
          type: string
      required:
        - id
        - title
      title: ScreenMockup
      type: object
    SpecStatus:
      description: Spec lifecycle status.
      enum:
        - draft
        - review
        - approved
        - validated
        - in_progress
        - done
        - cancelled
      title: SpecStatus
      type: string
    TestScenario:
      description: A test scenario linked to acceptance criteria and optionally to tasks.
      properties:
        given:
          default: ''
          title: Given
          type: string
        id:
          title: Id
          type: string
        linked_criteria:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Criteria
        linked_task_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Linked Task Ids
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        scenario_type:
          default: integration
          title: Scenario Type
          type: string
        status:
          default: draft
          title: Status
          type: string
        then:
          default: ''
          title: Then
          type: string
        title:
          title: Title
          type: string
        when:
          default: ''
          title: When
          type: string
      required:
        - id
        - title
      title: TestScenario
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    CardPriority:
      description: Card priority levels.
      enum:
        - critical
        - very_high
        - high
        - medium
        - low
        - none
      title: CardPriority
      type: string
    CardStatus:
      description: Card status enum matching Kanban columns.
      enum:
        - not_started
        - started
        - in_progress
        - validation
        - on_hold
        - done
        - cancelled
      title: CardStatus
      type: string
    SpecQAChoiceOption:
      description: A single option in a spec Q&A choice question.
      properties:
        id:
          title: Id
          type: string
        label:
          title: Label
          type: string
      required:
        - id
        - label
      title: SpecQAChoiceOption
      type: object
    MockupAnnotation:
      description: A design note attached to a screen.
      properties:
        author_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Id
        id:
          title: Id
          type: string
        text:
          title: Text
          type: string
      required:
        - id
        - text
      title: MockupAnnotation
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````