Cognition Labs Knowledge API

Organization knowledge entries and folders.

Documentation

📖
Documentation
https://docs.devin.ai/api-reference/overview
📖
APIReference
https://docs.devin.ai/api-reference/v1/sessions/create-a-new-devin-session
📖
APIReference
https://docs.devin.ai/api-reference/v1/sessions/send-a-message-to-an-existing-devin-session
📖
APIReference
https://docs.devin.ai/api-reference/v3/sessions/post-organizations-sessions-messages
📖
APIReference
https://docs.devin.ai/api-reference/v1/attachments/upload-files-for-devin-to-work-with
📖
APIReference
https://docs.devin.ai/api-reference/v1/attachments/download-attachment-files
📖
APIReference
https://docs.devin.ai/api-reference/v1/knowledge/list-knowledge
📖
APIReference
https://docs.devin.ai/api-reference/v1/knowledge/create-knowledge
📖
APIReference
https://docs.devin.ai/api-reference/v1/playbooks/list-playbooks
📖
APIReference
https://docs.devin.ai/api-reference/v1/playbooks/create-playbook
📖
APIReference
https://docs.devin.ai/api-reference/v1/secrets/list-secrets
📖
APIReference
https://docs.devin.ai/api-reference/v1/secrets/create-secret
📖
Documentation
https://docs.devin.ai/admin/security
📖
Documentation
https://docs.devin.ai/api-reference/v3/overview
📖
Documentation
https://docs.devin.ai/api-reference/getting-started/teams-quickstart
📖
APIReference
https://docs.devin.ai/api-reference/v3/users/members-users
📖
Documentation
https://docs.devin.ai/api-reference/getting-started/enterprise-quickstart
📖
APIReference
https://docs.devin.ai/api-reference/v2/organizations/list-organizations
📖
APIReference
https://docs.devin.ai/api-reference/v2/api-keys/list-enterprise-api-keys
📖
Documentation
https://docs.devin.ai/admin/billing/usage
📖
Documentation
https://docs.devin.ai/admin/billing/enterprise
📖
APIReference
https://docs.devin.ai/api-reference/v3/consumption/consumption-daily

Specifications

Other Resources

OpenAPI Specification

cognition-labs-knowledge-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Devin API (Cognition Labs) Attachments Knowledge API
  description: The Devin API lets you create and drive Devin, Cognition's autonomous AI software engineer, programmatically. This document models the legacy v1 surface (api.devin.ai/v1, still live and documented, authenticated with apk_user_*/apk_* keys) in full - sessions, messages, attachments, knowledge, playbooks, and secrets - plus representative endpoints from the current v3 organizations/enterprise surface (api.devin.ai/v3, authenticated with cog_ service-user or personal access tokens) and the v2/v3 consumption (ACU usage) endpoints. The v2/v3 enterprise surface has additional organization, member, and API-key management endpoints not exhaustively modeled here; see the humanURL/APIReference links in apis.yml for the full documented set. All endpoints are transcribed from Cognition's public documentation at https://docs.devin.ai and have not been exercised against production credentials, which require an active paid Devin plan or Enterprise contract.
  version: '1.0'
  contact:
    name: Cognition
    url: https://cognition.ai
  license:
    name: Proprietary
    url: https://docs.devin.ai/admin/security
servers:
- url: https://api.devin.ai/v1
  description: Legacy v1 API (apk_user_*/apk_* keys)
- url: https://api.devin.ai/v3
  description: Current v3 organizations/enterprise API (cog_ keys)
security:
- bearerAuth: []
tags:
- name: Knowledge
  description: Organization knowledge entries and folders.
paths:
  /knowledge:
    get:
      operationId: listKnowledge
      tags:
      - Knowledge
      summary: List all knowledge entries and folders
      responses:
        '200':
          description: Knowledge entries and folders for the organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  knowledge:
                    type: array
                    items:
                      $ref: '#/components/schemas/KnowledgeEntry'
                  folders:
                    type: array
                    items:
                      $ref: '#/components/schemas/KnowledgeFolder'
    post:
      operationId: createKnowledge
      tags:
      - Knowledge
      summary: Create a knowledge entry
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeInput'
      responses:
        '200':
          description: The created knowledge entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeEntry'
        '422':
          $ref: '#/components/responses/ValidationError'
  /knowledge/{knowledge_id}:
    parameters:
    - name: knowledge_id
      in: path
      required: true
      schema:
        type: string
    put:
      operationId: updateKnowledge
      tags:
      - Knowledge
      summary: Update a knowledge entry
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeInput'
      responses:
        '200':
          description: The updated knowledge entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeEntry'
        '422':
          $ref: '#/components/responses/ValidationError'
    delete:
      operationId: deleteKnowledge
      tags:
      - Knowledge
      summary: Delete a knowledge entry
      responses:
        '200':
          description: Deletion confirmation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    KnowledgeInput:
      type: object
      required:
      - name
      - body
      - trigger_description
      properties:
        name:
          type: string
        body:
          type: string
        trigger_description:
          type: string
          description: Describes when this knowledge entry should apply.
        macro:
          type: string
        parent_folder_id:
          type: string
        pinned_repo:
          type: string
    KnowledgeEntry:
      allOf:
      - $ref: '#/components/schemas/KnowledgeInput'
      - type: object
        properties:
          id:
            type: string
          created_at:
            type: string
            format: date-time
          created_by:
            type: object
            properties:
              full_name:
                type: string
              id:
                type: string
                nullable: true
              image_url:
                type: string
                nullable: true
    ValidationErrorBody:
      type: object
      properties:
        detail:
          type: array
          items:
            type: object
            properties:
              loc:
                type: array
                items:
                  type: string
              msg:
                type: string
              type:
                type: string
    KnowledgeFolder:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        created_at:
          type: string
          format: date-time
  responses:
    ValidationError:
      description: The request payload failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorBody'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'v1/v2 keys are prefixed apk_user_* (personal) or apk_* (service). The current v3 API uses service-user or personal access tokens prefixed cog_. Passed as `Authorization: Bearer YOUR_API_KEY`.'