Skip to content

Keyword automations

Create a keyword-triggered automation draft.

Create keyword automation

POST/v1/automations/keyword/
automations:writeIdempotency-Key required

Parameters

NameInTypeNotes
Idempotency-Keyrequiredheaderstring (uuid)UUID4 identifying one intended write. Reuse it only when retrying that same write.

Request body

FieldTypeNotes
active_hoursobject | null—
active_hours.windowsrequiredobject[]max 14 items
active_hours.windows[].dayrequiredstringone of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
active_hours.windows[].endrequiredstringmax length 5
active_hours.windows[].startrequiredstringmax length 5
assigned_member_idinteger | null—
comment_typestringone of ANY_POST, SPECIFIC_POST
future_post_slotsinteger—
is_activerequiredboolean—
keywordsstring[]max 20 items
match_modestringone of contains, is_exactly
media_idsstring[]max 50 items
namerequiredstringmax length 255
once_per_leadboolean—
override_existing_assignmentboolean—
repliesrequiredobject[]max 20 items
replies[].ai_promptstringmax length 2000
replies[].ask_email_timeout_secondsinteger—
replies[].delayinteger—
replies[].file_idstring (uuid) | null—
replies[].media_kindstringone of IMAGE, VIDEO, AUDIO
replies[].reply_typestringone of DM, COMMENT, ASK_EMAIL, MEDIA
replies[].textstringmax length 1000
replies[].variant_pairingstringone of INDEPENDENT, FOLLOW_PREVIOUS
replies[].variantsobject[]max 10 items
replies[].variants[].buttonsobject[]max 3 items
replies[].variants[].buttons[].button_typestringone of URL, POSTBACK
replies[].variants[].buttons[].namerequiredstringmax length 20
replies[].variants[].buttons[].payloadstring | nullmax length 1000
replies[].variants[].buttons[].urlstring | nullmax length 2000
replies[].variants[].file_idstring (uuid) | null—
replies[].variants[].media_kindstringone of IMAGE, VIDEO, AUDIO
replies[].variants[].textstringmax length 1000
replies[].variants[].traffic_percentageinteger—
set_stagestring | nullone of NEW, IN_CONTACT, QUALIFIED, UNQUALIFIED, BOOKED_CALL, DEPOSIT, WON, LOST, NO_SHOW
tagsstring[]max 50 items
tags_to_removestring[]max 50 items
triggersobject[]max 10 items
triggers[].comment_typestring | nullone of ANY_POST, SPECIFIC_POST
triggers[].future_post_slotsinteger—
triggers[].keywordsrequiredstring[]max 20 items
triggers[].lead_filterobject | null—
triggers[].match_modestringone of contains, is_exactly
triggers[].media_idsstring[]—
triggers[].trigger_typerequiredstringone of DM, COMMENT, STORY
Response fields (201)
FieldTypeNotes
active_hoursobjectread-only
active_hours.windowsobject[]read-only
active_hours.windows[].daystringread-only
active_hours.windows[].endstringread-only
active_hours.windows[].startstringread-only
comment_typestringread-only
created_atstring (date-time)read-only
idstringread-only
is_activebooleanread-only
namestringread-only
once_per_leadbooleanread-only
reply_countintegerread-only
set_stagestring | nullread-only
trigger_countintegerread-only
trigger_typestringread-only

Responses

  • 201Success
  • 400The request is invalid.
  • 401Authentication is missing, invalid, or revoked.
  • 403The authenticated identity lacks the required scope or capability.
  • 404The resource is unavailable or not visible to this organization.
  • 409The write conflicts with current state or an identical request is still running.
  • 422The write contains fields outside its closed input schema.
  • 429The request-rate budget is exhausted.

Example request

curl
curl -X POST "https://api.themochi.app/v1/automations/keyword/" \
  -H "Authorization: Bearer $MOCHI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
  -H "Content-Type: application/json" \
  -d '{"is_active":true,"name":"string","replies":[{"ai_prompt":"string","ask_email_timeout_seconds":1,"delay":1,"file_id":"00000000-0000-4000-8000-000000000000","media_kind":"IMAGE","reply_type":"DM","text":"string","variant_pairing":"INDEPENDENT","variants":[{}]}]}'