---
updatedAt: 2025-08-26T08:35:50.000Z
agentTools:
  projectIndex: https://docs.ducky.ai/llms.txt
---

# Create knowledge (internal)

Create knowledge from existing documents and manage shadow index creation

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "contact": {
      "email": "support@ducky.ai",
      "name": "Ducky Developer Support"
    },
    "description": "API for managing and retrieving data from Ducky.",
    "title": "Ducky API",
    "version": "1.0.1"
  },
  "servers": [
    {
      "url": "https://api.ducky.ai"
    }
  ],
  "security": [
    {
      "api_key": []
    }
  ],
  "paths": {
    "/internal/create-knowledge": {
      "post": {
        "description": "Create knowledge from existing documents and manage shadow index creation",
        "operationId": "createKnowledge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKnowledgeInternalRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Knowledge worker task processed successfully"
          },
          "400": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Invalid request (e.g., missing or invalid fields)"
          }
        },
        "security": [
          {
            "internal_api_key": []
          }
        ],
        "summary": "Create knowledge (internal)",
        "tags": [
          "internal"
        ]
      },
      "x-internal": true
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "example": {
          "error": "error"
        },
        "properties": {
          "error": {
            "description": "Error message explaining the issue",
            "title": "error",
            "type": "string"
          }
        },
        "title": "ErrorResponse",
        "type": "object"
      },
      "CreateKnowledgeInternalRequest": {
        "example": {
          "task_description": "task_description",
          "project_id": "project_id",
          "organization_id": "organization_id",
          "scope": "project",
          "source_index": "source_index"
        },
        "properties": {
          "organization_id": {
            "description": "The organization ID",
            "title": "organization_id",
            "type": "string"
          },
          "project_id": {
            "description": "The project ID",
            "title": "project_id",
            "type": "string"
          },
          "task_description": {
            "description": "Description of the knowledge work task",
            "title": "task_description",
            "type": "string"
          },
          "scope": {
            "description": "Whether to create project-level or index-level shadow index",
            "enum": [
              "project",
              "index"
            ],
            "title": "scope",
            "type": "string"
          },
          "source_index": {
            "description": "Source index name (required when scope is \"index\")",
            "title": "source_index",
            "type": "string"
          }
        },
        "required": [
          "organization_id",
          "project_id",
          "scope",
          "task_description"
        ],
        "title": "CreateKnowledgeInternalRequest",
        "type": "object"
      }
    },
    "securitySchemes": {
      "api_key": {
        "description": "API key providing access to a project.",
        "in": "header",
        "name": "x-api-key",
        "type": "apiKey"
      },
      "internal_api_key": {
        "description": "Internal API key",
        "in": "header",
        "name": "x-api-key",
        "type": "apiKey"
      }
    }
  },
  "x-google-backend": {
    "address": "api.ducky.ai"
  },
  "x-samples-languages": [
    "python",
    "shell"
  ]
}
```