Maya is a persona within the Alchemyst AI platform designed to assist with sales development, campaign management, chat automation, lead augmentation, integrations, and email workflows. This guide provides comprehensive instructions, API references, and usage examples on how to interact with Maya using the Alchemyst AI API.
Many Maya endpoints require authentication using JWT Bearer tokens. Authenticate via OAuth providers (Google, Atlassian, Zoho) or API key, as described in the /api/auth/google, /api/auth/atlassian, and /api/auth/zoho endpoints. Include the token in the Authorization header:
``` Authorization: Bearer <your_token> ```
Maya responds to chat prompts via the /api/v1/chat endpoint.
/api/v1/chatchat_history: Array of user/assistant messages. Required.persona: Set to "maya" to use the Maya persona.```json { "chat_history": [ { "role": "user", "content": "Hello Maya, can you help me draft a sales email?" } ], "persona": "maya" } ```
```json { "result": { "message": "Sure! Here is a draft sales email...", "persona": "maya" }, "metadata": { "timeTaken": 150 } } ```
/api/v1/chat/generate/stream for streaming chat responses with real-time thinking steps./api/v1/chat/new to save new chat histories./api/v1/chat/history and /api/v1/chat/fetch/{chatId}.Retrieve all campaigns filtered by persona (default: maya):
/api/v1/campaigns/list?persona=mayaGenerate or rephrase emails/social content for a campaign:
/api/v1/campaigns/generate/{campaignId}action, campaignId, template, type (e.g., email), leads info, current content, campaign history, and (optionally) context.```json { "action": "create", "campaignId": "campaign123", "template": "Intro Email", "type": "email", "leads": [ { "name": "John Doe", "email": "john@example.com" } ], "currentContent": {}, "campaignHistory": [] } ```
Use persona-specific email generation:
/api/v1/maya/generate/content/emailschat_history: Array of chat messages in Langchain format.scope: [Optional] Defaults to "internal".```json { "chat_history": [ { "role": "user", "content": "Write an engaging email introduction." } ], "scope": "internal" } ```
Maya supports integrations with platforms such as Telegram, WhatsApp, Twilio, and Zoho for multi-channel automation and communication. These endpoints are organized under /api/v1/maya/integrations/{integrationName} and related routes.
/api/v1/maya/integrations – List configured integrations for Maya persona./api/v1/maya/integrations/marketplace – List available integrations to configure for Maya./api/v1/maya/integrations/telegram/initphoneNumber, profileHandle, apiKey./api/v1/maya/integrations/whatsapp/init```json { "code": "zohoOauthCode", "clientId": "yourZohoClientId", "clientSecret": "yourZohoSecret", "userId": "user123", "apiKey": "alchemystApiKey", "organizationId": "org456", "persona": "maya" } ```
You can retrieve or set custom instructions for how Maya behaves in chats:
/api/v1/instructions?persona=maya – Get current instructions/api/v1/instructions – Set or update instructions (requires authentication and admin rights)/api/v1/leads/augment/webuserPrompt, dataForSearchQuery/api/v1/context/add – Add resources or instructions as context/api/v1/context/search – Query previously provided context/api/v1/campaigns/generate/{campaignId} with persona set to "maya"./api/v1/batch/emails/schedule or /api/v1/emails/send/batch.security: bearerAuth.