AI workflows and conversational agents, connectedSee how it works
Tarang AIWorkflows + agents

Developer docs

API Reference

Tarangai REST API. Base URL: https://tarangai.co. All protected routes are under /api/v1/.

Authentication

Generate an API key from Settings → Developer. Pass it on every request:

curl https://tarangai.co/api/v1/tenants/me \
  -H "X-API-Key: jlb_xxxx_..."

Keys follow the format jlb_<prefix>_<secret>. The full key is only shown once at creation time.

Quick start

# 1. Verify your key
curl https://tarangai.co/api/v1/tenants/me \
  -H "X-API-Key: jlb_xxxx_..."

# 2. List contacts
curl https://tarangai.co/api/v1/contacts \
  -H "X-API-Key: jlb_xxxx_..."

# 3. Send a message in a conversation
curl -X POST https://tarangai.co/api/v1/conversations/CONV_ID/messages \
  -H "X-API-Key: jlb_xxxx_..." \
  -H "Content-Type: application/json" \
  -d '{"body": "Hello from the API"}'

Endpoints

Auth & workspace

GET/api/v1/tenants/meReturn current workspace details (id, name, slug, plan).
PATCH/api/v1/tenants/meUpdate workspace name, plan, or settings.
GET/api/v1/api-keysList all issued API keys (prefix only, never full key).
POST/api/v1/api-keysCreate a new API key. Full key returned once at creation.
DELETE/api/v1/api-keys/:idRevoke and permanently delete an API key.

Contacts

GET/api/v1/contactsList contacts. Supports search, tag, and segment filters.
POST/api/v1/contactsCreate a contact. Requires phone number.
POST/api/v1/contacts/importBulk import contacts from a CSV payload.
GET/api/v1/contacts/:idGet a single contact by ID.
PATCH/api/v1/contacts/:idUpdate contact name, tags, custom fields.
DELETE/api/v1/contacts/:idPermanently delete a contact (workspace owner/admin only).
POST/api/v1/contacts/:id/opt-outOpt a contact out of all messaging.
POST/api/v1/contacts/:id/opt-inRe-opt a contact in after opt-out.
GET/api/v1/contacts/:id/conversationsList all conversations for a contact.
POST/api/v1/contacts/:id/conversationsStart a new conversation with a contact.

Conversations & messaging

GET/api/v1/conversationsList conversations. Filter by status, channel, assignee.
GET/api/v1/conversations/:idGet conversation metadata.
GET/api/v1/conversations/:id/messagesGet all messages in a conversation.
POST/api/v1/conversations/:id/messagesSend a message in a conversation.
POST/api/v1/conversations/:id/readMark conversation as read.
PATCH/api/v1/conversations/:id/statusUpdate conversation status (open, resolved, pending).
PATCH/api/v1/conversations/:id/assignAssign conversation to a team member.
POST/api/v1/conversations/:id/ai-draftGenerate an AI draft reply for the conversation.
GET/api/v1/inbox/summaryGet unread counts and inbox summary.

Templates

GET/api/v1/templatesList all WhatsApp message templates.
POST/api/v1/templatesCreate a new template.
GET/api/v1/templates/:idGet a template by ID.
POST/api/v1/templates/:id/sendSend a template message to a contact.
POST/api/v1/templates/:id/submitSubmit template for Meta approval.
DELETE/api/v1/templates/:idDelete a template.

Campaigns

GET/api/v1/campaignsList campaigns.
POST/api/v1/campaignsCreate a campaign.
GET/api/v1/campaigns/:idGet campaign details.
POST/api/v1/campaigns/:id/executeExecute a campaign immediately.
POST/api/v1/campaigns/:id/pausePause a running campaign.
POST/api/v1/campaigns/:id/resumeResume a paused campaign.
GET/api/v1/campaigns/:id/insightsGet delivery and engagement analytics.

AI agents

GET/api/v1/agentsList all AI agents in the workspace.
POST/api/v1/agentsCreate a new AI agent.
GET/api/v1/agents/:idGet agent configuration.
PATCH/api/v1/agents/:idUpdate agent name, prompt, or settings.
POST/api/v1/agents/:id/testSend a test message through the agent.
DELETE/api/v1/agents/:idDelete an agent.

Channels

GET/api/v1/channelsList connected channels (WhatsApp, Instagram, etc).
GET/api/v1/channels/:idGet channel details including phone number ID.
GET/api/v1/channels/:id/healthCheck channel health and connection status.

Segments

GET/api/v1/segmentsList all contact segments.
POST/api/v1/segmentsCreate a segment with filter rules.
GET/api/v1/segments/:idGet a segment and its filter definition.
POST/api/v1/contacts/segment-previewPreview which contacts match a set of filters.

Analytics

GET/api/v1/analytics/overviewOverall message volume, delivery, and open rates.
GET/api/v1/analytics/campaignsCampaign-level rollup stats.
GET/api/v1/analytics/conversationsConversation volume and resolution stats.
GET/api/v1/analytics/usageAPI and message usage against plan limits.

Webhooks

Replace :slug with your workspace slug (found in Settings → Developer).

WhatsApphttps://tarangai.co/webhook/:slug/whatsapp
Instagramhttps://tarangai.co/webhook/:slug/instagram
Facebook / Messengerhttps://tarangai.co/webhook/:slug/facebook
Shopifyhttps://tarangai.co/webhook/:slug/shopify
Workflowhttps://tarangai.co/webhook/:slug/workflows/:workflow_id/:secret

Machine-readable version available at tarangai.co/llms.txt.