Skip to main content

Introduction


title: Introduction


Introduction

Welcome to the AI12Z Management API Documentation!

The AI12Z Management API allows developers to integrate with the AI12Z platform programmatically, providing a comprehensive set of endpoints to manage projects, documents, AI settings, and more. Whether you're building custom applications or automating workflows, this API gives you the flexibility to perform common operations efficiently.

Overview

The AI12Z Management API is a RESTful API designed to be simple and intuitive to use. It supports common HTTP methods such as GET, POST, PUT, and DELETE to perform CRUD (Create, Read, Update, Delete) operations on resources.

Key Features:

  • Document Management: Retrieve, upload, and delete documents associated with projects, with support for pagination and sorting.
  • Project Management: Create, update, and delete projects, and manage associated resources.
  • AI Configuration: Customize AI settings, prompts, and models for your projects.
  • Analytics and Logging: Access analytics data and logs to monitor your projects.
  • Knowledge Base: Manage a knowledge base of questions and answers.
  • Agents and Connectors: Integrate agents and connectors to enhance functionality.
  • Settings Management: Configure project-specific settings, including API keys, categories, connectors, embeddings, project information, and word replacements.

Getting Started

To start using the API, follow these steps:

  1. Obtain an API Key: All API requests require authentication using an API key.
    • Log in to the AI12Z portal.
    • Navigate to your profile by clicking on the user navigation at the top right and selecting Profile. User Navigation
    • In the profile page, scroll down to the Manage API Key section. Generate Key
      tip

      A single key per user is allowed. Clicking the Regenerate API Key button will replace the existing key, and you should update your code to use the new key.

  2. Explore the Endpoints: Use the provided endpoints to manage projects, documents, AI settings, and more.
  3. Handle Responses: Parse the JSON responses to integrate the data into your application.

For detailed instructions, refer to the Authentication section.

Authentication

All API requests must be authenticated. Include your API key in the Authorization header of every request:

Authorization: Bearer <YOUR_KEY>

Base URL

All API endpoints are accessible via the base URL:

https://app.ai12z.net/api

Content Types

Set the Content-Type header appropriately based on the request body:

  • application/json for JSON payloads.
  • multipart/form-data for file uploads.

Making API Requests

Here's a basic example of making an API request to retrieve documents for a project:

curl --location 'https://app.ai12z.net/api/projects/{projectId}/documents' \
--header 'Authorization: Bearer <YOUR_KEY>'

Common Parameters

  • Pagination: Use page and limit query parameters to paginate through results.
  • Sorting: Use the sort query parameter to sort results by a specific field.
  • Search: Use the searchTerm query parameter to filter results based on a search term.

Response Format

All responses are in JSON format. A typical successful response looks like:

{
"data": [ ... ],
"meta": {
"total": 100,
"page": 1,
"limit": 10
}
}

Error Handling

The API returns standard HTTP response codes to indicate the success or failure of a request. In case of failure, detailed error messages are provided to help troubleshoot issues.

Standard HTTP status codes used:

  • 200 OK: The request was successful.
  • 400 Bad Request: The request was invalid or cannot be served.
  • 401 Unauthorized: Authentication failed; invalid API key.
  • 403 Forbidden: You do not have permission to access the resource.
  • 404 Not Found: The requested resource does not exist.
  • 500 Internal Server Error: An error occurred on the server.

Error responses include a message explaining the error:

{
"error": "Invalid API key."
}

Resources

The API provides endpoints for the following resources:

  • Projects: Manage your projects.
  • Documents: Retrieve, upload, and delete documents associated with projects.
    • Retrieve Documents: Fetch a list of documents associated with a specific project, with support for pagination and sorting.
    • Upload Documents: Upload various types of documents (PDF, DOCX, etc.) and attach them to a project, complete with metadata such as description.
    • Delete Documents: Remove a document from a project, ensuring that old or irrelevant files are properly managed.
  • Agents: Configure and manage agents.
  • AI Settings: Customize AI behavior for your projects.
  • Analytics: Retrieve analytics data for monitoring and reporting.
  • Bot Configuration: Manage bot settings and configurations.
  • Connectors: Integrate with external services and data sources.
  • Data: Access and manage user queries and AI responses.
  • Forms: Create and manage forms within projects.
  • Knowledge Base: Maintain a knowledge base of Q&A pairs.
  • Logs: Access logs for troubleshooting and auditing.
  • Prompts: Fine-tune AI prompts and interaction settings.
  • Copilot QA Tests: Perform QA tests on your AI agents.
  • Test Drive: Test your AI agents in a sandbox environment.
  • Settings: Manage project-specific settings.
    • API Keys: Retrieve, create, update, and delete API keys for a project.
    • Categories: Manage categories within a project, including creating, updating, and deleting.
    • Connectors: Retrieve and manage connectors configured for a project.
    • Embeddings: Retrieve and update embedding settings for a project.
    • Project Information: Retrieve and update project-specific information.
    • Replace Words: Manage word replacements within project content, including retrieving, creating, updating, and deleting.

Each resource has its own set of endpoints and documentation, which you can find in the respective sections.

Support and Feedback

If you need assistance or have feedback, please reach out to our support team at support@ai12z.com.