### GET /botMetric/localleaderboard Source: https://developers.closebot.com/api-reference/botmetric/get-local-leaderboard Retrieves the local leaderboard data based on specified metrics and date ranges. It allows filtering by metric type, start and end dates, and the number of surrounding agencies to include. ```APIDOC ## GET /botMetric/localleaderboard ### Description Retrieves the local leaderboard data based on specified metrics and date ranges. It allows filtering by metric type, start and end dates, and the number of surrounding agencies to include. ### Method GET ### Endpoint /botMetric/localleaderboard ### Parameters #### Query Parameters - **metric** (string) - Optional - The metric to get. Valid options: responses, bookings, contacts. - **start** (string) - Optional - The start date (format: date-time). - **end** (string) - Optional - The end date (format: date-time). - **numSurroundingAgencies** (integer) - Optional - The number of surrounding agencies to return. ### Request Example ```json { "example": "GET /botMetric/localleaderboard?metric=responses&start=2023-01-01T00:00:00Z&end=2023-12-31T23:59:59Z&numSurroundingAgencies=5" } ``` ### Response #### Success Response (200) - **agencyName** (string) - The name of the agency. - **count** (integer) - The number of the metric. #### Response Example ```json { "example": [ { "agencyName": "Example Agency", "count": 150 } ] } ``` ``` -------------------------------- ### Get Bot Builder Templates (OpenAPI) Source: https://developers.closebot.com/api-reference/bot/get-bot-builder-builder-templates This OpenAPI specification defines the endpoint for retrieving bot builder templates. It details the request method (GET), the path (/bot/bbb/templates), and the possible successful responses (200 OK) which can return an array of strings in plain text, JSON, or text/json formats. Authentication is handled via an API key in the header. ```yaml openapi: 3.0.1 info: title: CloseBot API version: v1 servers: - url: https://api.closebot.com description: CloseBot API Endpoint security: - Key: [] paths: /bot/bbb/templates: get: tags: - Bot summary: Get bot builder builder templates responses: '200': description: Success content: text/plain: schema: type: array items: type: string application/json: schema: type: array items: type: string text/json: schema: type: array items: type: string components: securitySchemes: Key: type: apiKey description: CloseBot API Key Authorization name: X-CB-KEY in: header ``` -------------------------------- ### GET /bot/{id} Source: https://developers.closebot.com/api-reference/bot/get-a-bot Retrieves detailed information about a specific bot using its unique ID. ```APIDOC ## GET /bot/{id} ### Description Retrieves detailed information about a specific bot using its unique ID. ### Method GET ### Endpoint /bot/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The bot ID. ### Request Example ```json { "example": "No request body needed for GET request" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the bot. - **name** (string) - The name of the bot. - **modifiedAt** (string) - The timestamp when the bot was last modified. - **modifiedBy** (string) - The identifier of the user who last modified the bot. - **versions** (array) - A list of bot versions. - **sources** (array) - A list of data sources for the bot. - **personaIds** (array) - A list of persona IDs associated with the bot. - **favorited** (boolean) - Indicates if the bot is favorited. - **locked** (boolean) - Indicates if the bot is locked. - **reschedulingEnabled** (boolean) - Indicates if rescheduling is enabled for the bot. - **category** (string) - The category of the bot. - **folderId** (string) - The ID of the folder the bot belongs to. - **followUpActive** (boolean) - Indicates if follow-up actions are active. - **followUpSequences** (array) - A list of follow-up sequences. - **smartFollowUp** (boolean) - Indicates if smart follow-up is enabled. - **followUpRepeat** (boolean) - Indicates if follow-up actions can repeat. - **followUpVarianceMinutes** (integer) - The variance in minutes for follow-up actions. - **followUpExtraPrompt** (string) - An extra prompt for follow-up actions. - **tools** (array) - A list of tools used by the bot. #### Response Example ```json { "id": "string", "name": "string", "modifiedAt": "string", "modifiedBy": "string", "versions": [ { "version": "string", "name": "string", "published": true, "modifiedAt": "string", "modifiedBy": "string" } ], "sources": [ { "id": "string", "category": "string", "key": "string", "name": "string", "tags": [ { "name": "string", "approveDeny": true, "id": "string" } ], "channelList": [ "string" ], "personaNameOverride": "string", "enabled": true } ], "personaIds": [ "string" ], "favorited": true, "locked": true, "reschedulingEnabled": true, "category": "string", "folderId": "string", "followUpActive": true, "followUpSequences": [ { "order": 0, "duration": 0, "unit": "string" } ], "smartFollowUp": true, "followUpRepeat": true, "followUpVarianceMinutes": 0, "followUpExtraPrompt": "string", "tools": [ { "id": "string", "type": "string", "enabled": true, "options": {} } ] } ``` ``` -------------------------------- ### GET /bot/{id}/export Source: https://developers.closebot.com/api-reference/bot/export-a-bot Exports a specific bot by its ID. You can optionally specify a bot version to export. ```APIDOC ## GET /bot/{id}/export ### Description Exports a specific bot by its ID. You can optionally specify a bot version to export. ### Method GET ### Endpoint /bot/{id}/export ### Parameters #### Path Parameters - **id** (string) - Required - The bot ID. #### Query Parameters - **botVersion** (string) - Optional - The bot version (x.y.z). If not provided, the latest version is exported. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **id** (string) - The bot ID - **kdl** (string) - The KDL for the bot - **version** (string) - The version of the bot #### Response Example ```json { "id": "string", "kdl": "string", "version": "string" } ``` ``` -------------------------------- ### GET /agency/current Source: https://developers.closebot.com/api-reference/agency/get-agency Retrieve the current agency details. CloseBot accounts can only be part of one agency. ```APIDOC ## GET /agency/current ### Description Retrieve the current agency details. Currently, CloseBot accounts can only be part of one agency. ### Method GET ### Endpoint /agency/current ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **id** (string) - The unique identifier of the agency. - **name** (string) - The name of the agency. - **members** (array) - A list of agency members. ##### AgencyMemberDto - **accountId** (string) - The account ID of the member. - **role** (string) - The role of the member within the agency. - **authId** (string) - The authentication ID of the member. - **name** (string) - The name of the member. - **email** (string) - The email address of the member. - **status** (string) - The status of the member. #### Response Example ```json { "id": "string", "name": "string", "members": [ { "accountId": "string", "role": "string", "authId": "string", "name": "string", "email": "string", "status": "string" } ] } ``` ``` -------------------------------- ### GET /agency/usage Source: https://developers.closebot.com/api-reference/agency/get-usage Retrieves usage statistics for the agency, allowing filtering by specific scopes such as bots, storage, users, and responses. ```APIDOC ## GET /agency/usage ### Description Retrieves usage statistics for the agency. You can specify which usage data to fetch by providing a comma-separated list of scopes. ### Method GET ### Endpoint /agency/usage ### Parameters #### Query Parameters - **scopes** (string) - Optional - Comma-separated list of scopes to retrieve. Scopes are: bots, storage, users, responses. Defaults to 'bots,storage,users,responses'. ### Request Example ```json { "scopes": "bots,users" } ``` ### Response #### Success Response (200) - **bots** (object) - Usage details for bots. - **storage** (object) - Usage details for storage. - **users** (object) - Usage details for users. - **responses** (object) - Usage details for responses. #### Response Example ```json { "bots": { "current": 10, "limit": 50 }, "storage": { "current": 1024, "limit": 5120 }, "users": { "current": 5, "limit": 20 }, "responses": { "current": 1000, "limit": 5000 } } ``` ``` -------------------------------- ### GET /agency/source Source: https://developers.closebot.com/api-reference/source/list-sources Retrieves a paginated list of sources within the current agency. Supports filtering, sorting, and searching by name or category. ```APIDOC ## GET /agency/source ### Description Retrieves sources within the current agency. ### Method GET ### Endpoint /agency/source ### Parameters #### Query Parameters - **pageSize** (integer) - Optional - Size of each page (max 100). Defaults to 20. - **page** (integer) - Optional - The page number. For example, page 5 with page size of 20 would start at offset 100. Defaults to 0. - **query** (string) - Optional - Search by source name. - **category** (string) - Optional - Search by only specific categories (GHL, HubSpot, WebHook, etc). - **order** (string) - Optional - How results should be ordered. '+' or '-' prefix to specific ascending or descending. Defaults to '+id'. - **forceTokenRefresh** (boolean) - Optional - When true, access token for all returned sources are refreshed. Defaults to false. ### Response #### Success Response (200) - **total** (integer) - The total number of sources available. - **results** (array) - An array of SourceDto objects. - **page** (integer) - The current page number. - **pageSize** (integer) - The number of sources per page. #### Response Example ```json { "total": 100, "results": [ { "agencyId": "string", "sourceId": "string", "name": "string", "category": "string", "key": "string", "accessToken": "string", "address": "string", "connected": true, "autoShutoff": true, "gracefulGoodbye": true, "bots": [ { "id": "string", "botName": "string", "tags": [ { "id": "string", "name": "string" } ], "channels": [ "string" ], "personaNameOverride": "string", "enabled": true } ], "accountsWithAccess": [ "string" ], "isAvailabilityContactTimezone": true, "respondWindows": [ { "dayOfWeekUtc": "string", "startTimeUtc": "string" } ], "doNotRespondWindows": [ { "dayOfWeekUtc": "string", "startTimeUtc": "string" } ], "summarizeAttachments": true, "respondToReactions": true, "markConversationAsUnread": true, "webhookCallback": "string", "wallet": { "id": "string", "name": "string", "currency": "string", "balance": 0, "lastTransactionDate": "string" } } ], "page": 0, "pageSize": 20 } ``` ``` -------------------------------- ### GET /bot/nodeDescriptors Source: https://developers.closebot.com/api-reference/bot/get-the-node-descriptors Retrieves a list of node descriptors for the CloseBot. This information is crucial for understanding the available nodes, their properties, and how they can be connected within the bot's logic. ```APIDOC ## GET /bot/nodeDescriptors ### Description Retrieves the node descriptors for the CloseBot. This endpoint provides information about the different types of nodes available, their properties, and their configurations. ### Method GET ### Endpoint /bot/nodeDescriptors ### Parameters #### Query Parameters None #### Path Parameters None ### Request Body None ### Response #### Success Response (200) - **dataTypes** (array) - Information about data types used by nodes. - **atomicNodes** (array) - Details of atomic nodes available. - **groups** (array) - Groupings of nodes. - **tools** (array) - Information about available tools. #### Response Example ```json { "dataTypes": [ { "dataTypeName": "string", "properties": [ { "name": "string", "type": "string", "enumValues": [ "string" ], "displayName": "string", "defaultValue": "string", "group": "string", "conditions": [ { "conditionType": "string", "value": "string" } ] } ], "displayName": "string" } ], "atomicNodes": [ { "className": "string", "displayName": "string", "description": "string", "group": "string", "properties": [ { "name": "string", "type": "string", "enumValues": [ "string" ], "displayName": "string", "defaultValue": "string", "group": "string", "conditions": [ { "conditionType": "string", "value": "string" } ] } ], "outputs": [ { "name": "string", "displayName": "string" } ], "outputHandles": [ { "name": "string", "label": "string", "color": "string" } ], "dynamicHandles": [ { "linkedProperty": "string" } ], "hasInputHandle": true, "hasDynamicVariables": true, "helpUrl": "string", "requiresPaid": true, "order": 0 } ], "groups": [ { "name": "string", "order": 0 } ], "tools": [ { "className": "string", "displayName": "string", "description": "string", "properties": [ { "name": "string", "type": "string", "enumValues": [ "string" ], "displayName": "string", "defaultValue": "string", "group": "string", "conditions": [ { "conditionType": "string", "value": "string" } ] } ], "helpUrl": "string" } ] } ``` ``` -------------------------------- ### List Billed Usages Source: https://developers.closebot.com/api-reference/billing/list-billed-usages Retrieves a list of billed usages for the agency. This endpoint allows filtering by start and end times. ```APIDOC ## GET /agency/billing/usages ### Description Retrieves a list of billed usages for the agency. This endpoint allows filtering by start and end times. ### Method GET ### Endpoint /agency/billing/usages ### Parameters #### Query Parameters - **startTime** (string) - Optional - The start time. - **endTime** (string) - Optional - The end time. ### Request Example ```json { "example": "GET /agency/billing/usages?startTime=2023-01-01T00:00:00Z&endTime=2023-01-31T23:59:59Z" } ``` ### Response #### Success Response (200) - **startTime** (string) - The start time of the usage period. - **endTime** (string) - The end time of the usage period. - **responses** (integer) - The number of responses. - **libraryBytes** (integer) - The amount of library bytes used. - **users** (integer) - The number of users. - **responseCost** (integer) - The cost associated with responses. - **libraryCost** (integer) - The cost associated with library usage. - **userCost** (integer) - The cost associated with users. #### Response Example ```json { "example": [ { "startTime": "2023-01-01T00:00:00Z", "endTime": "2023-01-01T00:59:59Z", "responses": 100, "libraryBytes": 500000, "users": 10, "responseCost": 1000, "libraryCost": 500, "userCost": 200 } ] } ``` ``` -------------------------------- ### GET /bot/{id}/steps Source: https://developers.closebot.com/api-reference/bot/get-steps-for-a-version Retrieves the steps for a specific bot version. This endpoint allows you to fetch the sequence of actions or states associated with a particular bot and its version. ```APIDOC ## GET /bot/{id}/steps ### Description Retrieves the steps for a specific bot version. This endpoint allows you to fetch the sequence of actions or states associated with a particular bot and its version. ### Method GET ### Endpoint /bot/{id}/steps ### Parameters #### Path Parameters - **id** (string) - Required - The bot ID. #### Query Parameters - **botVersion** (string) - Optional - The bot version (x.y.z). ### Request Example ```json { "example": "No request body for GET request" } ``` ### Response #### Success Response (200) - **(object)** - Description of the response body structure is not provided in the source. #### Response Example ```json { "example": "Response body structure not detailed in the source." } ``` ``` -------------------------------- ### Get Global Leaderboard Source: https://developers.closebot.com/api-reference/botmetric/get-global-leaderboard Retrieves the global leaderboard data based on specified metrics and date ranges. Supports filtering by metric type, start and end dates, and the number of top leaders to display. ```APIDOC ## GET /botMetric/leaderboard ### Description Fetches the global leaderboard data. You can filter the results by a specific metric (responses, bookings, contacts), a date range (start and end dates), and the number of top leaders to include. ### Method GET ### Endpoint https://api.closebot.com/botMetric/leaderboard ### Parameters #### Query Parameters - **metric** (string) - Optional - The metric to retrieve data for. Valid options are 'responses', 'bookings', or 'contacts'. - **start** (string) - Optional - The start date for filtering the leaderboard data. Expected format is date-time. - **end** (string) - Optional - The end date for filtering the leaderboard data. Expected format is date-time. - **numTopLeaders** (integer) - Optional - The number of top leaders to return in the leaderboard. ### Request Example ```json { "example": "GET /botMetric/leaderboard?metric=responses&start=2023-01-01T00:00:00&end=2023-12-31T23:59:59&numTopLeaders=10" } ``` ### Response #### Success Response (200) - **agencyName** (string) - The name of the agency. - **count** (integer) - The count of the specified metric for the agency. #### Response Example ```json { "example": [ { "agencyName": "Example Agency 1", "count": 150 }, { "agencyName": "Example Agency 2", "count": 120 } ] } ``` ``` -------------------------------- ### POST /smart-faq Source: https://developers.closebot.com/api-reference/smartfaq/create-a-new-faq Creates a new FAQ entry. This endpoint allows you to programmatically add frequently asked questions and their corresponding answers to the CloseBot system. ```APIDOC ## POST /smart-faq ### Description Creates a new FAQ entry. This endpoint allows you to programmatically add frequently asked questions and their corresponding answers to the CloseBot system. ### Method POST ### Endpoint /smart-faq ### Parameters #### Request Body - **sourceId** (string) - Optional - The source ID of the FAQ - **question** (string) - Optional - The question of the FAQ - **answer** (string) - Optional - The answer of the FAQ ### Request Example ```json { "sourceId": "some_source_id", "question": "What is CloseBot?", "answer": "CloseBot is an AI-powered customer support tool." } ``` ### Response #### Success Response (201) - **(No specific fields defined in the provided OpenAPI spec for success response body)** #### Response Example (No example provided in the OpenAPI spec for success response body) ``` -------------------------------- ### Get Folder Hierarchy Source: https://developers.closebot.com/api-reference/hierarchy/get-a-folder Retrieves information about a specific folder in the hierarchy, including its contents and subfolders. ```APIDOC ## GET /hierarchy/{id} ### Description Retrieves details of a specific folder by its ID. ### Method GET ### Endpoint /hierarchy/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the folder to retrieve. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the folder. - **name** (string) - The name of the folder. - **bots** (array of strings) - The list of bots in the folder. - **personas** (array of strings) - The list of personas in the folder. - **children** (array of strings) - The list of child folders. #### Response Example ```json { "id": "folder-123", "name": "My Project Folder", "bots": ["bot-abc", "bot-def"], "personas": ["persona-xyz"], "children": ["subfolder-456"] } ``` #### Error Response (404) - **type** (string) - The type of the error. - **title** (string) - The title of the error. - **status** (integer) - The HTTP status code. - **detail** (string) - A detailed description of the error. - **instance** (string) - The instance of the error. #### Response Example ```json { "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4", "title": "Not Found", "status": 404, "detail": "The requested folder was not found.", "instance": "/hierarchy/non-existent-id" } ``` ``` -------------------------------- ### POST /bot/ai Source: https://developers.closebot.com/api-reference/bot/create-bot-with-ai Creates a new bot using AI with specified parameters. This endpoint allows for the creation of bots with custom names, descriptions, categories, and folder assignments. ```APIDOC ## POST /bot/ai ### Description Creates a new bot using AI with specified parameters. This endpoint allows for the creation of bots with custom names, descriptions, categories, and folder assignments. ### Method POST ### Endpoint /bot/ai ### Parameters #### Request Body - **name** (string) - Optional - The name of the new bot - **description** (string) - Optional - The prompt to use to create the new bot - **category** (string) - Optional - The source category of the new bot (GHL, WebHook, etc.) - **folderId** (string) - Optional - The folder/group to place the newly created bot ### Request Example ```json { "name": "My New AI Bot", "description": "This bot will answer customer queries about our products.", "category": "GHL", "folderId": "folder_123" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created bot - **name** (string) - The name of the bot - **modifiedAt** (string) - The timestamp when the bot was last modified - **modifiedBy** (string) - The user who last modified the bot - **versions** (array) - A list of bot versions - **sources** (array) - A list of bot sources - **personaIds** (array) - A list of persona IDs associated with the bot - **favorited** (boolean) - Indicates if the bot is favorited - **locked** (boolean) - Indicates if the bot is locked - **reschedulingEnabled** (boolean) - Indicates if rescheduling is enabled for the bot - **category** (string) - The category of the bot - **folderId** (string) - The folder ID where the bot is located - **followUpActive** (boolean) - Indicates if follow-up actions are active - **followUpSequences** (array) - A list of follow-up sequences - **smartFollowUp** (boolean) - Indicates if smart follow-up is enabled - **followUpRepeat** (boolean) - Indicates if follow-up repeats - **followUpVarianceMinutes** (integer) - The variance in minutes for follow-up actions - **followUpExtraPrompt** (string) - An extra prompt for follow-up actions - **tools** (array) - A list of tools associated with the bot #### Response Example ```json { "id": "bot_abc123", "name": "My New AI Bot", "modifiedAt": "2023-10-27T10:00:00Z", "modifiedBy": "user_xyz", "versions": [], "sources": [], "personaIds": [], "favorited": false, "locked": false, "reschedulingEnabled": false, "category": "GHL", "folderId": "folder_123", "followUpActive": false, "followUpSequences": [], "smartFollowUp": false, "followUpRepeat": false, "followUpVarianceMinutes": 0, "followUpExtraPrompt": null, "tools": [] } ``` ``` -------------------------------- ### POST /bot - Create a new bot Source: https://developers.closebot.com/api-reference/bot/create-a-new-bot This endpoint allows you to create a new bot within the CloseBot platform. You can specify various parameters such as the bot's name, template, import data, and category. ```APIDOC ## POST /bot ### Description Creates a new bot with the specified configuration. ### Method POST ### Endpoint https://api.closebot.com/bot ### Parameters #### Request Body - **name** (string) - Optional - The name of the new bot - **templateId** (string) - Optional - The template ID to use to create the new bot - **importKdl** (string) - Optional - The KDL template to import into the new bot - **folderId** (string) - Optional - The folder ID to place the new bot in - **category** (string) - Optional - The category of the new bot ### Request Example ```json { "name": "My New Bot", "templateId": "tpl_12345", "importKdl": "(conversation)", "folderId": "folder_abcde", "category": "Sales" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created bot - **name** (string) - The name of the bot - **modifiedAt** (string) - The timestamp when the bot was last modified - **modifiedBy** (string) - The user who last modified the bot - **versions** (array) - A list of bot versions - **sources** (array) - A list of bot data sources - **personaIds** (array) - A list of persona IDs associated with the bot - **favorited** (boolean) - Indicates if the bot is favorited - **locked** (boolean) - Indicates if the bot is locked - **reschedulingEnabled** (boolean) - Indicates if rescheduling is enabled for the bot - **category** (string) - The category of the bot - **folderId** (string) - The ID of the folder the bot belongs to - **followUpActive** (boolean) - Indicates if follow-up actions are active - **followUpSequences** (array) - A list of follow-up sequences - **smartFollowUp** (boolean) - Indicates if smart follow-up is enabled - **followUpRepeat** (boolean) - Indicates if follow-up actions repeat - **followUpVarianceMinutes** (integer) - The variance in minutes for follow-up actions - **followUpExtraPrompt** (string) - An extra prompt for follow-up actions - **tools** (array) - A list of tools associated with the bot #### Response Example ```json { "id": "bot_abcdef", "name": "My New Bot", "modifiedAt": "2023-10-27T10:00:00Z", "modifiedBy": "user_123", "versions": [], "sources": [], "personaIds": [], "favorited": false, "locked": false, "reschedulingEnabled": true, "category": "Sales", "folderId": "folder_abcde", "followUpActive": false, "followUpSequences": [], "smartFollowUp": false, "followUpRepeat": false, "followUpVarianceMinutes": 0, "followUpExtraPrompt": null, "tools": [] } ``` ``` -------------------------------- ### Get Scrape Pages for File - OpenAPI Specification Source: https://developers.closebot.com/api-reference/library/get-the-scrape-pages-for-a-file This OpenAPI 3.0.1 specification defines the GET endpoint /library/files/{fileId}/scrape-pages for the CloseBot API. It allows retrieving scrape pages for a specified fileId, returning a list of WebscrapePageDto objects. The endpoint requires an API key for authentication. ```yaml openapi: 3.0.1 info: title: CloseBot API version: v1 servers: - url: https://api.closebot.com description: CloseBot API Endpoint security: - Key: [] paths: /library/files/{fileId}/scrape-pages: get: tags: - Library summary: Get the scrape pages for a file parameters: - name: fileId in: path description: The ID of the file to get the scrape pages for. required: true style: simple schema: type: string responses: '200': description: Success content: text/plain: schema: type: array items: $ref: '#/components/schemas/WebscrapePageDto' application/json: schema: type: array items: $ref: '#/components/schemas/WebscrapePageDto' text/json: schema: type: array items: $ref: '#/components/schemas/WebscrapePageDto' components: schemas: WebscrapePageDto: type: object properties: url: type: string nullable: true enabled: type: boolean additionalProperties: false securitySchemes: Key: type: apiKey description: CloseBot API Key Authorization name: X-CB-KEY in: header ``` -------------------------------- ### Get Bot Actions OpenAPI Specification Source: https://developers.closebot.com/api-reference/botmetric/get-actions This OpenAPI 3.0.1 specification defines the `/botMetric/actions` GET endpoint for the CloseBot API. It allows fetching bot actions with optional filters for lead ID, source ID, bot ID, date range, and maximum count. The response includes a list of BotMetricAction objects. ```yaml openapi: 3.0.1 info: title: CloseBot API version: v1 servers: - url: https://api.closebot.com description: CloseBot API Endpoint security: - Key: [] paths: /botMetric/actions: get: tags: - BotMetric summary: Get actions parameters: - name: leadId in: query description: Optional lead ID. style: form schema: type: string - name: sourceId in: query description: Optional source ID. style: form schema: type: string - name: botId in: query description: Optional bot ID. style: form schema: type: string - name: start in: query description: Optional start date. style: form schema: type: string format: date-time - name: end in: query description: Optional end date. style: form schema: type: string format: date-time - name: maxCount in: query description: Optional maximum number of actions to return. style: form schema: type: integer format: int32 responses: '200': description: Success content: text/plain: schema: type: array items: $ref: '#/components/schemas/BotMetricAction' application/json: schema: type: array items: $ref: '#/components/schemas/BotMetricAction' text/json: schema: type: array items: $ref: '#/components/schemas/BotMetricAction' components: schemas: BotMetricAction: type: object properties: timestamp: type: string format: date-time actionId: type: string nullable: true leadId: type: string nullable: true sourceId: type: string nullable: true botId: type: string nullable: true nodeId: type: integer format: int32 frontendNodeId: type: string nullable: true additionalProperties: false securitySchemes: Key: type: apiKey description: CloseBot API Key Authorization name: X-CB-KEY in: header ``` -------------------------------- ### Bot Tool Options API Source: https://developers.closebot.com/api-reference/bot/create-bot-with-ai Defines the structure for bot tool options, allowing for additional properties to be configured. ```APIDOC ## Bot Tool Options Object Definition ### Description Defines the structure for bot tool options, which can include additional arbitrary properties. ### Method N/A (Schema Definition) ### Endpoint N/A (Schema Definition) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body This object allows for additional properties beyond the defined schema. ### Request Example ```json { "custom_option_1": "value1", "custom_option_2": 123 } ``` ### Response #### Success Response (200) This object allows for additional properties beyond the defined schema. #### Response Example ```json { "custom_option_1": "value1", "custom_option_2": 123 } ``` ``` -------------------------------- ### Get Folder Endpoint Specification (OpenAPI) Source: https://developers.closebot.com/api-reference/hierarchy/get-a-folder This OpenAPI specification defines the GET /hierarchy/{id} endpoint for the CloseBot API. It allows retrieval of folder details, including its ID, name, associated bots and personas, and child folders. The endpoint requires a folder ID as a path parameter and returns a ListHierarchyResult on success or ProblemDetails on failure. ```yaml openapi: 3.0.1 info: title: CloseBot API version: v1 servers: - url: https://api.closebot.com description: CloseBot API Endpoint security: - Key: [] paths: /hierarchy/{id}: get: tags: - Hierarchy summary: Get a folder parameters: - name: id in: path description: The ID of the folder to get. required: true style: simple schema: type: string responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/ListHierarchyResult' application/json: schema: $ref: '#/components/schemas/ListHierarchyResult' text/json: schema: $ref: '#/components/schemas/ListHierarchyResult' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' components: schemas: ListHierarchyResult: type: object properties: id: type: string description: The ID of the folder nullable: true name: type: string description: The name of the folder nullable: true bots: type: array items: type: string description: The list of bots in the folder nullable: true personas: type: array items: type: string description: The list of personas in the folder nullable: true children: type: array items: type: string description: The list of children folders nullable: true additionalProperties: false ProblemDetails: type: object properties: type: type: string nullable: true title: type: string nullable: true status: type: integer format: int32 nullable: true detail: type: string nullable: true instance: type: string nullable: true additionalProperties: {} securitySchemes: Key: type: apiKey description: CloseBot API Key Authorization name: X-CB-KEY in: header ``` -------------------------------- ### POST /bot/{id}/source/{sourceId} Source: https://developers.closebot.com/api-reference/bot/attach-a-source-to-a-bot Attaches a source to a specified bot. This operation allows associating external data sources with a bot, potentially enhancing its capabilities or knowledge base. It supports adding tags, specifying channels, overriding persona names, and enabling/disabling the association. ```APIDOC ## POST /bot/{id}/source/{sourceId} ### Description Attaches a source to a specified bot. This operation allows associating external data sources with a bot, potentially enhancing its capabilities or knowledge base. It supports adding tags, specifying channels, overriding persona names, and enabling/disabling the association. ### Method POST ### Endpoint /bot/{id}/source/{sourceId} ### Parameters #### Path Parameters - **id** (string) - Required - The bot ID. - **sourceId** (string) - Required - The source ID. #### Request Body - **tags** (array[object]) - Optional - A list of contact tags to associate with the source. - **name** (string) - Optional - The name of the tag. - **approveDeny** (boolean) - The approval/denial status of the tag. - **id** (string) - Optional - The ID of the tag. - **channels** (array[string]) - Optional - A list of channels to associate with the source. - **personaNameOverride** (string) - Optional - An override for the bot's persona name. - **enabled** (boolean) - Optional - Whether the source association is enabled. ### Request Example ```json { "tags": [ { "name": "example_tag", "approveDeny": true, "id": "tag_123" } ], "channels": ["channel1", "channel2"], "personaNameOverride": "Custom Persona", "enabled": true } ``` ### Response #### Success Response (200) - **Success** (string) - Indicates the operation was successful. #### Response Example ```json { "message": "Source attached successfully" } ``` ``` -------------------------------- ### GET /botMetric/actions Source: https://developers.closebot.com/api-reference/botmetric/get-actions Retrieves a list of bot actions. This endpoint allows filtering by lead ID, source ID, bot ID, date range, and a maximum count. ```APIDOC ## GET /botMetric/actions ### Description Retrieves a list of bot actions. This endpoint allows filtering by lead ID, source ID, bot ID, date range, and a maximum count. ### Method GET ### Endpoint /botMetric/actions ### Parameters #### Query Parameters - **leadId** (string) - Optional - Optional lead ID. - **sourceId** (string) - Optional - Optional source ID. - **botId** (string) - Optional - Optional bot ID. - **start** (string) - Optional - Optional start date (date-time format). - **end** (string) - Optional - Optional end date (date-time format). - **maxCount** (integer) - Optional - Optional maximum number of actions to return. ### Request Example ```json { "example": "GET /botMetric/actions?leadId=123&start=2023-01-01T00:00:00Z&end=2023-12-31T23:59:59Z&maxCount=100" } ``` ### Response #### Success Response (200) - **timestamp** (string) - The timestamp of the action. - **actionId** (string) - The ID of the action (nullable). - **leadId** (string) - The ID of the lead associated with the action (nullable). - **sourceId** (string) - The ID of the source associated with the action (nullable). - **botId** (string) - The ID of the bot associated with the action (nullable). - **nodeId** (integer) - The ID of the node in the bot flow. - **frontendNodeId** (string) - The frontend ID of the node (nullable). #### Response Example ```json { "example": [ { "timestamp": "2023-10-27T10:00:00Z", "actionId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "leadId": "lead-123", "sourceId": "source-abc", "botId": "bot-xyz", "nodeId": 1, "frontendNodeId": "node-1" } ] } ``` ``` -------------------------------- ### GET /library/files/{fileId}/scrape-pages Source: https://developers.closebot.com/api-reference/library/get-the-scrape-pages-for-a-file Retrieves a list of web scrape pages associated with a specific file. This endpoint allows you to fetch all scraped URLs and their enabled status for a given file ID. ```APIDOC ## GET /library/files/{fileId}/scrape-pages ### Description Retrieves a list of web scrape pages associated with a specific file. This endpoint allows you to fetch all scraped URLs and their enabled status for a given file ID. ### Method GET ### Endpoint /library/files/{fileId}/scrape-pages ### Parameters #### Path Parameters - **fileId** (string) - Required - The ID of the file to get the scrape pages for. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **url** (string) - The URL of the scraped page. - **enabled** (boolean) - Indicates if the scraped page is enabled. #### Response Example ```json [ { "url": "http://example.com/page1", "enabled": true }, { "url": "http://example.com/page2", "enabled": false } ] ``` ```