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

# Create Spec Knowledge

> Add a knowledge base item to a spec.



## OpenAPI

````yaml /openapi.json post /api/v1/specs/{spec_id}/knowledge
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}/knowledge:
    post:
      tags:
        - specs
      summary: Create Spec Knowledge
      description: Add a knowledge base item to a spec.
      operationId: create_spec_knowledge_api_v1_specs__spec_id__knowledge_post
      parameters:
        - in: path
          name: spec_id
          required: true
          schema:
            title: Spec Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpecKnowledgeCreate'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpecKnowledgeResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    SpecKnowledgeCreate:
      description: Schema for creating a knowledge base item.
      properties:
        content:
          minLength: 1
          title: Content
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        mime_type:
          default: text/markdown
          title: Mime Type
          type: string
        title:
          maxLength: 500
          minLength: 1
          title: Title
          type: string
      required:
        - title
        - content
      title: SpecKnowledgeCreate
      type: object
    SpecKnowledgeResponse:
      description: Full knowledge base item response.
      properties:
        content:
          title: Content
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        created_by:
          title: Created By
          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
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - spec_id
        - title
        - description
        - content
        - mime_type
        - created_by
        - created_at
        - updated_at
      title: SpecKnowledgeResponse
      type: object
    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

````