# Build an App with Ejento APIs

Welcome to **Ejento**!  
This guide provides a **comprehensive roadmap** for working with Ejento APIs, covering everything from setup to advanced features.  

Each API listed here comes with a direct link to its **detailed documentation**, where you can explore full request/response formats and advanced options.  
Please note that this guide highlights only the **key APIs** for getting started. In the **sidebar**, you’ll find all categories with their complete set of APIs, organized for deeper exploration.  

By following this guide, you can efficiently build and scale **AI-powered applications** with confidence and clarity.  

---

**Before You Start**  
To use Ejento APIs, you’ll need:  
- The **server base URL**  
- Your **API key** passed in the request headers
- Your **Authorization Bearer token** passed in the request headers  

For details, please refer to the [**API Overview**](https://api.ejento.ai/overview#api-base-url). Or you can directly go to the [**API key guide**](https://api.ejento.ai/guide/api-key) to get your keys, auth token, and server URL.
Once set up, you can return here and start using any API right away.  


---

## 1. Authentication & User Setup

Before anything else, secure your app with user authentication. Ejento provides flexible APIs for registration, login, tokens, and profiles.

- [**Register User**](https://api.ejento.ai/register-user) – Create a new user in your app.  
- [**Login (Exchange Credentials)**](https://api.ejento.ai/authenticate-user) – Validate credentials and issue access tokens.  
- [**Refresh Access Token**](https://api.ejento.ai/refresh-access-token) – Refresh tokens to maintain sessions securely.  
- [**Passwordless Authentication**](https://api.ejento.ai/request-passwordless-exchange-token) – Allow login without passwords (e.g., via magic links).  
- [**Get Authenticated User**](https://api.ejento.ai/get-authenticated-user) – Retrieve the profile of the logged-in user.  
- [**Get All Users**](https://api.ejento.ai/get-all-users) – Retrieve a list of all registered users in your organization.  
  Useful for admin dashboards, role management, or analytics, where you need visibility into the complete user base.


**Result:** Your users can now register, log in, and securely access your app.

---

## 2. Organizing Teams & Projects

Ejento lets you structure workspaces for your apps using **Teams** and **Projects**. 
Ejento uses a **hierarchical model**:

**Team → Project → Assistant**

- **Team**: A group of users (e.g., your company or department).  
- **Project**: A workspace inside a team for a specific app or use case.  
- **Assistant (Agent)**: An AI chatbot that lives inside a project.  

### Step 1: Create a Team  
- [**Create Team**](https://api.ejento.ai/create-a-team) – Start by creating a new team.  
- [**Add Users to Team**](https://api.ejento.ai/add-users-to-a-team) – Invite collaborators into the team.  

### Step 2: Create a Project within the Team  
- [**Create Project**](https://api.ejento.ai/create-a-project) – Set up a new project inside your team.  
- [**Add Users to Project**](https://api.ejento.ai/add-users-to-a-project) – Assign project-specific members.  

### Step 3: Prepare for Assistants  
Once your project is ready, you can move on to creating your **Assistants (Agents)** inside that project.

**Result:** You now have a properly organized environment where assistants can be created and managed within projects, and projects are grouped under teams.


---

## 3. Creating Your Assistant (Agent)

The heart of your app is an **Assistant (Agent)** – an AI entity that chats with users.

- [**Create Agent**](https://api.ejento.ai/create-agent) – Spin up a brand-new assistant.  
- [**Get Agent**](https://api.ejento.ai/get-agent) – Fetch full details of your agent.
- [**Add User to Agent**](https://api.ejento.ai/add-user-to-agent) – Assign users to a specific agent so they can start interacting with it.   
- [**Custom Instructions**](https://api.ejento.ai/create-custom-instruction-for-agent) – Personalize your assistant with instructions and behavior rules. 
- [**Link Agent to Tool**](https://api.ejento.ai/link-agent-to-tool) – Connect your assistant with a specific **tool** (e.g., web search, RAG, external APIs, or other custom tools you create). Once linked, the agent can **use that tool while generating responses**, enabling richer and more powerful conversations tailored to your use case.
 

**Result:** Your assistant is created and ready to be trained.

---

## 4. Knowledge Base (Corpus & Documents)

To make your assistant smart, you need to feed it knowledge.

- [**Create Corpus**](https://api.ejento.ai/create-corpus) – Set up a knowledge base for your app.  
- [**Upload Document**](https://api.ejento.ai/indexing/upload-document-to-corpus) – Add knowledge to your assistant by uploading files such as **PDFs, text files, Word docs, or other supported formats**.  
  This API takes your document, processes its content, and stores it inside the selected **Corpus**. Once uploaded, the assistant can **reference the document in conversations**, giving users precise, context-aware answers.  
- [**Get All Documents for Corpus**](https://api.ejento.ai/get-all-documents-for-corpus) – Retrieve a list of all documents added to a corpus, making it easier to manage and verify uploaded knowledge sources.  
- [**Agent–Corpus Connection**](https://api.ejento.ai/create-agent-corpus-connection) – Link your agent with a corpus so it can answer using your data.  


**Result:** Your assistant now has access to your **organization’s knowledge base**.  
It can read from your uploaded documents and use that content to provide **accurate, contextual, and domain-specific answers**. This means your assistant goes beyond generic responses and becomes a true expert on your company’s data.

---

## 5. Conversations & Chat Threads

Now, let’s enable **real user conversations**.

- [**Create Chat Thread**](https://api.ejento.ai/create-chat-thread-for-agent) – Start a new conversation thread with your agent.  
- [**Agent Response (Send Message)**](https://api.ejento.ai/generate-agent-response) – Post a message and receive the agent’s reply.  
- [**Get Agent Response**](https://api.ejento.ai/get-agent-response) – Retrieve specific agent replies by ID.  
- [**Get Chat Logs**](https://api.ejento.ai/get-chatlogs-for-chat-thread) – Access full history of a chat session.  

**Result:** Your users can chat with the assistant, and you can store complete conversations.

---

## 6. Feedback & Ratings

Collect insights to improve your assistant’s performance.

- [**Update Agent Rating**](https://api.ejento.ai/update-agent-rating) – Let users **upvote or downvote** your agent based on their experience. This helps track satisfaction and gather quick feedback on performance.
 
- [**Feedback on Response**](https://api.ejento.ai/create-feedback-for-agent-response) – Attach comments or thumbs-up/down to responses.  

**Result:** You can track user satisfaction and refine your assistant.

---

## 7. Notifications & Engagement

Keep users informed and engaged with push-style notifications.

- [**Create Notification**](https://api.ejento.ai/create-a-new-notification) – Generate a new notification for users.  
- [**Get Notifications**](https://api.ejento.ai/get-all-notifications) – Retrieve the list of user notifications.  

**Result:** Your app can actively engage with its users.

---

## 8. Analytics & Monitoring

Measure, monitor, and optimize your app with Ejento’s analytics.

- [**Agent Summary Statistics**](https://api.ejento.ai/get-agent-summary-statistics) – Overview of usage and performance.  
- [**Query Count Data**](https://api.ejento.ai/get-agent-query-count-data) – Track how many queries your agent is handling.  
- [**Cost & Token Usage**](https://api.ejento.ai/get-agent-cost-data) – Monitor consumption and associated costs.  

**Result:** You understand performance and costs at a glance.

---

## 9. Advanced Features (Optional)

Enhance your assistant with advanced capabilities.

- [**Guardrails**](https://api.ejento.ai/get-available-guardrail-types-for-agent) – Apply safety filters to control agent behavior.  
- [**Image Generation**](https://api.ejento.ai/generate-image-for-agent-based-on-description) – Generate AI-powered images based on prompts.  
- [**Workflows**](https://api.ejento.ai/create-workflow) – Automate multi-step tasks and connect multiple APIs together.  

**Result:** Your assistant becomes smarter, safer, and more versatile.

---

# Complete Flow Summary

Here’s the **big picture flow** for building a chatbot assistant app:

1. **User Auth** → Register and log in users securely with authentication APIs.  
2. **Teams** → Create teams to manage groups of users and collaborate within shared spaces.  
3. **Projects** → Organize work inside teams by creating projects for different apps or use cases.  
4. **Assistants** → Spin up your chatbot assistant inside a project and customize its behavior.  
5. **Knowledge Base** → Add documents and data sources (PDFs, text, Word files, etc.) so your assistant can answer with real knowledge.  
6. **Conversations** → Enable chat threads and responses, allowing real-time interactions with users.  
7. **Feedback** → Collect upvotes, downvotes, reviews, and comments to improve assistant quality.  
8. **Notifications** → Keep users engaged with in-app alerts and updates.  
9. **Analytics** → Monitor usage, costs, activity, and performance metrics to optimize your app.  
10. **Advanced Features** → Add guardrails for safety, enable image generation, or automate tasks with workflows.  

---

# Conclusion

By following this roadmap, you can build a **fully functional app** in just a few steps.  
Ejento APIs are designed to be **modular, flexible, and developer-friendly** so you can pick what you need and scale as your app grows.  
