# Fini

> Build AI-powered knowledge bases and get instant answers. Create, update, and query knowledge items to power customer support and internal documentation.

Source: https://cotera.co/docs/reference/tools/individual-tools/fini

---

**Authentication Type:** Bearer Token

**Description:** Build AI-powered knowledge bases and get instant answers. Create, update, and query knowledge items to power customer support and internal documentation.

> **Beta Tool:** Please contact support to get this Beta tool added to your account.

***

## Authentication

To authenticate, you'll need a Fini API key from [Fini](https://docs.usefini.com/api-reference/authentication).

1. Navigate to the setup tab and create a new bot
2. Go to the deploy tab and click "Get API keys"
3. Each bot has a unique key - create separate keys for multiple bots

Use the `Authorization: Bearer <api_key>` header for authentication.

***

## Knowledge Items

### Create Knowledge Item

Create a new knowledge item in your bot's knowledge base.

**Operation Type:** Mutation (Write)

**Parameters:**

* **botIds** `array of strings` (required): List of bot IDs to associate with this item
* **status** `string` (required): Status of the item (LIVE, IN\_REVIEW, DRAFT)
* **question** `string` (required): The main question this knowledge item addresses
* **answer** `string` (required): The answer to the question
* **instruction** `string` (required): Instruction for bot training or human review
* **similarQs** `array of strings` (required): Similar question variations
* **keywords** `array of strings` (required): Keywords for search and categorization
* **categories** `array of strings` (required): Top-level categories
* **subcategories** `array of strings` (required): Subcategories
* **escalation** `boolean` (required): Whether to mark for escalation

**Returns:**

* **id** `string`: Unique knowledge item identifier
* **knowledgeNumber** `number`: Auto-generated item number
* **createdAt** `string`: Creation timestamp (ISO 8601)
* **updatedAt** `string`: Last update timestamp (ISO 8601)
* All input fields echoed back

**Example Usage:**

```json
{
  "botIds": ["bot_abc123"],
  "status": "LIVE",
  "question": "How do I reset my password?",
  "answer": "To reset your password, click 'Forgot Password' on the login page and follow the email instructions.",
  "instruction": "Direct users to self-service reset first",
  "similarQs": ["I forgot my password", "Can't log in", "Password not working"],
  "keywords": ["password", "reset", "login", "forgot"],
  "categories": ["Account"],
  "subcategories": ["Security"],
  "escalation": false
}
```

### Update Knowledge Item

Update an existing knowledge item.

**Operation Type:** Mutation (Write)

**Parameters:**

Same as Create Knowledge Item, plus:

* **id** `string` (required): Knowledge item ID to update

**Returns:**

Updated knowledge item object.

### List Knowledge Items

List all knowledge items with optional filtering.

**Operation Type:** Query (Read)

**Parameters:**

* **botId** `string` (optional): Filter by bot ID
* **status** `string` (optional): Filter by status
* **page** `number` (optional): Page number for pagination
* **limit** `number` (optional): Items per page

**Returns:**

* **items** `array`: List of knowledge items
* **total** `number`: Total count
* **page** `number`: Current page
* **pages** `number`: Total pages

***

## Answers

### Get Answer

Retrieve an AI-generated answer from your bot's knowledge base.

**Operation Type:** Query (Read)

**Parameters:**

* **question** `string` (required): User query to answer
* **messageHistory** `array` (required): Conversation history with role and content
* **instruction** `string` (optional): Custom prompt override
* **stream** `boolean` (optional, default: false): Enable streaming response
* **temperature** `number` (optional, default: 0.4): Sampling temperature (0-2)
* **stop** `string` (optional): Stop generation token
* **categories** `array` (optional): Filter by categories
* **user\_attributes** `object` (optional): User metadata for personalization
* **functions** `array` (optional): Function definitions for tool use
* **function\_call** `string/object` (optional): Function calling control

**Returns:**

* **answer** `string`: AI-generated answer
* **answer\_uuid** `string`: Unique answer identifier
* **based\_on** `array`: Source knowledge items used
  * **source\_id** `string`: Knowledge item ID
  * **source\_type** `string`: Type of source
  * **score** `number`: Relevance score
  * **answer** `string`: Source answer text
* **categories** `array`: Matched categories
* **messages** `array`: Updated conversation history

**Example Usage:**

```json
{
  "question": "How do I upgrade my plan?",
  "messageHistory": [
    { "role": "user", "content": "I want to change my subscription" },
    { "role": "assistant", "content": "I can help you with that. What would you like to do?" }
  ],
  "temperature": 0.3
}
```

***

## Common Use Cases

**Customer Support:**

* Build self-service knowledge bases for common questions
* Provide instant answers to customer inquiries
* Reduce support ticket volume with AI-powered responses

**Internal Documentation:**

* Create searchable internal knowledge bases
* Answer employee questions about policies and procedures
* Maintain up-to-date documentation with easy updates

**Product Help:**

* Power in-app help widgets with contextual answers
* Provide product guidance and troubleshooting
* Scale support without increasing headcount

