Knowledge

Knowledge is the foundation of AI-powered content generation in Waldium - it provides the context and expertise that makes your AI-generated posts relevant and accurate. On this page, we will dive into the different knowledge endpoints you can use to manage your knowledge base programmatically. We will look at how to upload files and delete knowledge items.


POST/v1/knowledge

Create a knowledge item

This endpoint allows you to upload files to your knowledge base. This creates high-quality, contextual content based on your uploaded knowledge that will be used by the AI to generate more relevant blog posts.

Required attributes

  • Name
    file
    Type
    file
    Description

    The file to upload (PDF, text, markdown, CSV, Word docs). Must be sent as multipart/form-data.

Supported file types

  • Name
    Text Files
    Type
    string
    Description

    .txt, .md files up to 10MB - Plain text and Markdown files.

  • Name
    PDF Documents
    Type
    string
    Description

    .pdf files up to 10MB - Research papers, reports, whitepapers.

  • Name
    Word Documents
    Type
    string
    Description

    .doc, .docx files up to 10MB - Articles, guides, documentation.

  • Name
    CSV Files
    Type
    string
    Description

    .csv files up to 10MB - Data tables, research data.

Request

POST
/v1/knowledge
curl -X POST https://api.blogwald.com/api/v1/knowledge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@research-paper.pdf"

Response

{
  "success": true,
  "data": {
    "message": "Knowledge item created successfully",
    "knowledge": {
      "id": "9c166d00-0921-406c-9b68-8409710223e2",
      "name": "seo-best-practices.pdf",
      "type": "application/pdf",
      "status": "uploaded",
      "size": "2.5 MB",
      "lastUpdated": "2024-01-15T10:30:00.000Z",
      "s3Key": "site-id/knowledge/9c166d00-0921-406c-9b68-8409710223e2.pdf"
    },
    "site": {
      "id": "cmdogfirw001sxq6gcjc4p6fc",
      "name": "My Blog"
    }
  }
}

DELETE/v1/knowledge/:id

Delete a knowledge item

This endpoint allows you to remove a knowledge item from your knowledge base. This action is permanent and cannot be undone. The file will be deleted from both the database and cloud storage.

Request

DELETE
/v1/knowledge/9c166d00-0921-406c-9b68-8409710223e2
curl -X DELETE https://api.blogwald.com/api/v1/knowledge/9c166d00-0921-406c-9b68-8409710223e2 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "message": "Knowledge item deleted successfully",
    "knowledgeId": "9c166d00-0921-406c-9b68-8409710223e2",
    "site": {
      "id": "cmdogfirw001sxq6gcjc4p6fc",
      "name": "My Blog"
    }
  }
}

Was this page helpful?