Skip to main content
Glama
create-chatbot.ts1.03 kB
import { HttpMethod } from '@activepieces/pieces-common'; import { createAction, Property } from '@activepieces/pieces-framework'; import { chatlingAuth } from '../../index'; import { makeRequest } from '../common'; import { templateIdDropdown } from '../common/props'; export const createChatbot = createAction({ auth: chatlingAuth, name: 'create_chatbot', displayName: 'Create Chatbot', description: 'Create a new chatbot using a template or from scratch.', props: { name: Property.ShortText({ displayName: 'Name', description: 'The name of the chatbot', required: true, }), template_id: templateIdDropdown, }, async run(context) { const { name, template_id } = context.propsValue; const apiKey = context.auth.secret_text; const body: Record<string, unknown> = { name }; if (template_id) body['template_id'] = template_id; const response = await makeRequest( apiKey, HttpMethod.POST, '/chatbots', body ); return response; }, });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server