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

# Link Task To Scenario

> Link a task card to a test scenario (bidirectional).
Validates upfront that both scenario and card exist before mutating
either side, so a typo in card_id no longer leaves an orphan link.



## OpenAPI

````yaml /openapi.json post /api/v1/specs/{spec_id}/scenarios/{scenario_id}/link-task/{card_id}
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/specs/{spec_id}/scenarios/{scenario_id}/link-task/{card_id}:
    post:
      tags:
        - specs
      summary: Link Task To Scenario
      description: |-
        Link a task card to a test scenario (bidirectional).
        Validates upfront that both scenario and card exist before mutating
        either side, so a typo in card_id no longer leaves an orphan link.
      operationId: >-
        link_task_to_scenario_api_v1_specs__spec_id__scenarios__scenario_id__link_task__card_id__post
      parameters:
        - in: path
          name: spec_id
          required: true
          schema:
            title: Spec Id
            type: string
        - in: path
          name: scenario_id
          required: true
          schema:
            title: Scenario Id
            type: string
        - in: path
          name: card_id
          required: true
          schema:
            title: Card Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      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
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````