AppDirect AI API (1.0)
Download OpenAPI specification:Download
Create New AI
Creates a new AI specified by the given identifier.
Authorizations:
Request Body schema: application/jsonrequired
src required | string Url of the avatar image. |
name required | string Display name of the AI |
introduction | string Text the AI uses as the greeting |
description required | string Short description of the AI |
instructions required | string Instructions that define the AI. |
seed | string A sample conversation between a human and the AI. |
modelId | string Identifier of the LLM to use for this AI. |
visibility | string (AIVisibility) Enum: "PRIVATE" "GROUP" "ORGANIZATION" "ANYONE_WITH_LINK" Visibility level controlling who can access the AI |
listInOrgCatalog | boolean Whether to list this AI in the organization's catalog |
generateCitations | boolean Whether the AI should generate citations for its responses |
chatLogsVisible | boolean Whether chat logs should be visible to company admins. |
intermediateStepsVisible | boolean Whether intermediate reasoning steps should be visible during chat. |
object (AIModelOptions) Configuration options for the AI model's behavior | |
object (AIProfile) |
Responses
Request samples
- Payload
{- "src": "string",
- "name": "string",
- "introduction": "string",
- "description": "string",
- "instructions": "string",
- "seed": "string",
- "modelId": "string",
- "visibility": "PRIVATE",
- "listInOrgCatalog": true,
- "generateCitations": true,
- "chatLogsVisible": true,
- "intermediateStepsVisible": true,
- "options": {
- "temperature": [
- 0
], - "topP": [
- 0
], - "topK": [
- 0
], - "maxTokens": [
- 0
], - "maxInputTokens": [
- 0
], - "frequencyPenalty": [
- 0
], - "presencePenalty": [
- 0
]
}, - "profile": {
- "headline": "string",
- "description": "string",
- "features": [
- {
- "title": "string",
- "description": "string"
}
], - "showCharacter": true,
- "showTraining": true,
- "showPersonality": true
}
}
Response samples
- 200
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "src": "string",
- "profile": {
- "headline": "string",
- "description": "string",
- "features": [
- {
- "title": "string",
- "description": "string"
}
], - "showCharacter": true,
- "showTraining": true,
- "showPersonality": true
}, - "userName": "string",
- "categoryId": "string",
- "messageCount": 0,
- "rating": 0,
- "ratingCount": 0
}
Get AI Details
Retrieves details of the AI specified by the given identifier.
Authorizations:
path Parameters
aiId required | string The identifier of the AI whose details are to be retrieved. |
Responses
Response samples
- 200
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "src": "string",
- "profile": {
- "headline": "string",
- "description": "string",
- "features": [
- {
- "title": "string",
- "description": "string"
}
], - "showCharacter": true,
- "showTraining": true,
- "showPersonality": true
}, - "userName": "string",
- "categoryId": "string",
- "messageCount": 0,
- "rating": 0,
- "ratingCount": 0
}
Get all chats for the AI
Retrieves a list of all chat sessions associated with the given AI identifier.
Authorizations:
path Parameters
aiId required | string The identifier of the AI whose chats are to be retrieved. |
Responses
Response samples
- 200
{- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "userId": "string",
- "pinPosition": 0,
- "ai": {
- "id": "string",
- "name": "string",
- "src": "string",
- "description": "string",
- "userId": "string",
- "userName": "string"
}
}
]
}
Create a new chat session for the AI
Creates a new chat session associated with the given AI identifier and returns the created chat session data.
Authorizations:
path Parameters
aiId required | string The identifier of the AI with which the chat session is to be associated. |
Responses
Response samples
- 201
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "userId": "string",
- "pinPosition": 0,
- "ai": {
- "id": "string",
- "name": "string",
- "src": "string",
- "description": "string",
- "userId": "string",
- "userName": "string"
}
}
List data sources for the AI
Retrieves a list of data sources associated with the given AI identifier.
Authorizations:
path Parameters
aiId required | string The identifier of the AI whose data sources are to be retrieved. |
Responses
Response samples
- 200
{- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "lastIndexedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "type": "API",
- "refreshPeriod": "NEVER",
- "indexStatus": "INITIALIZED",
- "indexPercentage": "string"
}
]
}
Add an existing data source to the specified AI
Associates an existing data source with the specified AI.
Authorizations:
path Parameters
aiId required | string The unique identifier for the AI to which the data source is to be added. |
Request Body schema: application/jsonrequired
dataSourceId required | string The unique identifier of the existing data source to be added. |
Responses
Request samples
- Payload
{- "dataSourceId": "string"
}
Response samples
- 200
{- "aiId": "string",
- "dataSource": {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "lastIndexedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "type": "API",
- "refreshPeriod": "NEVER",
- "indexStatus": "INITIALIZED",
- "indexPercentage": "string"
}
}
Create a new API data source for the specified AI
Adds a new API data source with a specified name and JSON payload for the given AI.
Authorizations:
path Parameters
aiId required | string The unique identifier for the AI. |
Request Body schema: application/jsonrequired
name required | string Name of the data source. |
data required | object The JSON payload to be used as the data source's knowledge. |
Responses
Request samples
- Payload
{- "name": "string",
- "data": { }
}
Response samples
- 201
- 400
- 404
{- "aiId": "string",
- "dataSourceId": "string"
}
Adds a file upload data source for the specified AI. Max file size: 4.5Mb.
Authorizations:
path Parameters
aiId required | string The unique identifier for the AI. |
Request Body schema: multipart/form-data
file | string <binary> |
Responses
Response samples
- 200
- 400
- 404
{- "aiId": "string",
- "dataSourceId": "string"
}
Get a chat session
Retrieves the chat session with the specified ID.
Authorizations:
path Parameters
chatId required | string The unique identifier of the chat session to retrieve. |
Responses
Response samples
- 200
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "userId": "string",
- "pinPosition": 0,
- "ai": {
- "id": "string",
- "name": "string",
- "src": "string",
- "description": "string",
- "userId": "string",
- "userName": "string"
}, - "messages": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "content": "string",
- "role": "string"
}
]
}
Message a chat session
Send a message to a chat session with an AI.
Authorizations:
path Parameters
chatId required | string The unique identifier of the chat session. |
Request Body schema: application/jsonrequired
date required | string <date-time> The date and time of the chat from the perspective of the user. This may be different from the server time for the AI. |
prompt required | string Message to send to the AI. |
Responses
Request samples
- Payload
{- "date": "2019-08-24T14:15:22Z",
- "prompt": "string"
}
Duplicate a chat session
Creates a duplicate of the chat session with the specified ID.
Authorizations:
path Parameters
chatId required | string The unique identifier of the chat session to duplicate. |
Responses
Response samples
- 200
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "userId": "string",
- "pinPosition": 0,
- "ai": {
- "id": "string",
- "name": "string",
- "src": "string",
- "description": "string",
- "userId": "string",
- "userName": "string"
}, - "messages": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "content": "string",
- "role": "string"
}
]
}
Reset a chat session
Resets the chat session with the specified ID, clearing its current state or content.
Authorizations:
path Parameters
chatId required | string The unique identifier of the chat session to reset. |
Responses
Response samples
- 200
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "userId": "string",
- "pinPosition": 0,
- "ai": {
- "id": "string",
- "name": "string",
- "src": "string",
- "description": "string",
- "userId": "string",
- "userName": "string"
}, - "messages": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "content": "string",
- "role": "string"
}
]
}
List all data sources
Retrieves a list of data sources associated which the user has access to.
Authorizations:
query Parameters
name | string The name of the data source. |
type | string Enum: "WEB_URL" "GOOGLE_DRIVE" "ONEDRIVE" "FILE_UPLOAD" "API" The type of the data source. One of: WEB_URL, GOOGLE_DRIVE, ONEDRIVE, FILE_UPLOAD, API. |
orderBy | string^[+-](createdAt|lastIndexedAt|usageCount)$ Order by field and direction. Prefix field name with '+' for ascending or '-' for descending order. Allowed fields: createdAt, lastIndexedAt, usageCount. |
Responses
Response samples
- 200
{- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "lastIndexedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "type": "API",
- "refreshPeriod": "NEVER",
- "indexStatus": "INITIALIZED",
- "indexPercentage": "string"
}
]
}
Refresh a Data Source
This endpoint refreshes the specified data source.
Authorizations:
path Parameters
dataSourceId required | string The unique identifier of the data source to be refreshed. |
query Parameters
forceRefresh | boolean Indicates if the data source should be refreshed even if the content has not been updated |
Responses
Create a new group
Creates a new group with the specified details.
Request Body schema: application/jsonrequired
name required | string Name of the group. |
availability required | string (GroupAvailability) Enum: "EVERYONE" "RESTRICTED" Availability status of the group. |
memberEmails required | string A comma-separated list of emails of users who should be added to the group. |
Responses
Request samples
- Payload
{- "name": "string",
- "availability": "EVERYONE",
- "memberEmails": "string"
}
Response samples
- 200
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "orgId": "string",
- "ownerUserId": "string",
- "name": "string",
- "availability": "EVERYONE",
- "users": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userId": "string",
- "email": "string"
}
]
}
Update a group
Updates the details of a specific group and manages its member list.
path Parameters
groupId required | string The unique identifier of the group to update. |
Request Body schema: application/jsonrequired
name | string Name of the group. |
availability | string (GroupAvailability) Enum: "EVERYONE" "RESTRICTED" Availability status of the group. |
memberEmailsToAdd | string A comma-separated list of emails of users to be added to the group. |
memberEmailsToRemove | Array of strings A comma-separated list of emails of users to be removed from the group. |
Responses
Request samples
- Payload
{- "name": "string",
- "availability": "EVERYONE",
- "memberEmailsToAdd": "string",
- "memberEmailsToRemove": [
- "string"
]
}
Response samples
- 200
{- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "orgId": "string",
- "ownerUserId": "string",
- "name": "string",
- "availability": "EVERYONE",
- "users": [
- {
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "userId": "string",
- "email": "string"
}
]
}
List AIs
query Parameters
scope | string (ListAIsRequestScope) Enum: "PRIVATE" "OWNED" "GROUP" "SHARED" "ORGANIZATION" "PUBLIC" "ALL" The scope to filter results by |
groupId | string The id of a group to filter results by |
categoryId | string The id of a category to filter results by |
approvedByOrg | boolean Filter results by whether the AI has been approved by the organization. |
search | string Search term |
Responses
Response samples
- 200
{- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "description": "string",
- "src": "string",
- "profile": {
- "headline": "string",
- "description": "string",
- "features": [
- {
- "title": "string",
- "description": "string"
}
], - "showCharacter": true,
- "showTraining": true,
- "showPersonality": true
}, - "userName": "string",
- "categoryId": "string",
- "messageCount": 0,
- "rating": 0,
- "ratingCount": 0
}
]
}
Get all chats for the User
Retrieves a list of all chat sessions associated with the current user
Authorizations:
Responses
Response samples
- 200
{- "data": [
- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "string",
- "userId": "string",
- "pinPosition": 0,
- "ai": {
- "id": "string",
- "name": "string",
- "src": "string",
- "description": "string",
- "userId": "string",
- "userName": "string"
}
}
]
}
Get groups of the current user
Retrieves a list of groups associated with the current user.
Responses
Response samples
- 200
[- {
- "id": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "orgId": "string",
- "ownerUserId": "string",
- "name": "string",
- "availability": "EVERYONE"
}
]
Get organization usage metrics by AI
Returns the usage metrics of the organization broken down by AI.
Responses
Response samples
- 200
{- "orgUsage": {
- "orgId": "string",
- "dataTokensUsed": 0,
- "dataUsageTokenLimit": 0,
- "apiTokensUsed": 0,
- "apiUsageTokenLimit": 0
}, - "aiUsages": [
- {
- "aiId": "string",
- "aiDataTokensUsed": 0,
- "aiApiTokensUsed": 0
}
]
}