---
title: "Add one source the Hive AI may answer from. It arrives unapproved, and only an owner or admin can approve it."
method: POST
path: "/api/v1/tools/create_ai_knowledge"
---

# Add one source the Hive AI may answer from. It arrives unapproved, and only an owner or admin can approve it.

`POST /api/v1/tools/create_ai_knowledge`

## Request

- Base URL: `https://hivepublish.com`
- URL: `https://hivepublish.com/api/v1/tools/create_ai_knowledge`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `title` string, required: What to call this source.
  - `sourceType` 'text' | 'url' | 'file' | 'faq', required: Where the words come from.
  - `sourceUrl` string: The address, for a url source.
  - `storagePath` string: The stored file, for a file source.
  - `approvedContent` string: The exact words the AI may use.
  - `scope` 'workspace' | 'flow' | 'inbox': Where it may be used.
  - `freshnessDays` integer: How many days before it counts as stale.

## Response `200`

Tool result

- ToolResult
  - `data` unknown, required
  - `meta` object, required
    - `tool` string
    - `workspaceId` string, uuid

## Other responses

- `400`: Invalid input
- `401`: Missing or invalid credential
- `403`: Missing workspace scope, role permission, or plan entitlement
- `409`: Idempotency conflict, replay, or request still in progress
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/hivepublish/apis/hive-developer-api.md) · [All operations](https://skmtc.dev/hivepublish/apis/hive-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hivepublish/apis/hive-developer-api/revisions/b440c763583e?raw)
