Lead
Read one lead, update its stage, assignment, contact details and tags.
GET
/v1/leads/{lead_id}/Get leadPATCH/v1/leads/{lead_id}/Update leadPUT/v1/leads/{lead_id}/assignment/Assign a leadPATCH/v1/leads/{lead_id}/contact/Update lead contactGET/v1/leads/{lead_id}/intelligence/Get lead intelligenceGET/v1/leads/{lead_id}/signals/Get lead signalsPOST/v1/leads/{lead_id}/tags/Add tags to a leadDELETE/v1/leads/{lead_id}/tags/{tag_id}/Remove a tag from a leadGet lead
GET
leads:read/v1/leads/{lead_id}/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
ad_title | string | read-only |
archived | boolean | read-only |
channels | string[] | read-only |
closer | object | read-only |
closer.member_id | string | read-only |
closer.name | string | read-only |
conversation_id | string | null | read-only |
conversations | object[] | read-only |
conversations[].channel | string | read-only |
conversations[].id | string | read-only |
created_at | string (date-time) | read-only |
display_name | string | read-only |
has_email | boolean | read-only |
has_phone | boolean | read-only |
id | string | read-only |
inbox_url | string | null | read-only |
instagram_name | string | null | read-only |
instagram_username | string | null | read-only |
is_ad_lead | boolean | read-only |
is_excluded | boolean | read-only |
is_reachable | boolean | read-only |
is_spam | boolean | read-only |
location | object | null | read-only |
location.city | string | null | read-only |
location.country | string | read-only |
setter | object | read-only |
setter.member_id | string | read-only |
setter.name | string | read-only |
source | string | read-only |
source_media_type | string | read-only |
stage | string | null | read-only |
stage_key | string | read-only |
stage_name | string | read-only |
tags | object[] | read-only |
tags[].applied_by | string | read-only |
tags[].id | string | read-only |
tags[].name | string | read-only |
unlocked_at | string (date-time) | read-only |
unqualification_reason | string | read-only |
updated_at | string (date-time) | read-only |
Responses
200Success400The 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.429The request-rate budget is exhausted.
Example request
curl
curl -X GET "https://api.themochi.app/v1/leads/<lead_id>/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Update lead
PATCH
leads:writeIdempotency-Key required/v1/leads/{lead_id}/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
archived | boolean | — |
stage | string | one of NEW, IN_CONTACT, QUALIFIED, UNQUALIFIED, BOOKED_CALL, DEPOSIT, WON, LOST, NO_SHOW |
stage_key | string | max length 32 |
unqualification_reason | string | one of underaged, time_waster, no_money, language_barrier, ghosted, unclear, no_reason |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
ad_title | string | read-only |
archived | boolean | read-only |
channels | string[] | read-only |
closer | object | read-only |
closer.member_id | string | read-only |
closer.name | string | read-only |
conversation_id | string | null | read-only |
conversations | object[] | read-only |
conversations[].channel | string | read-only |
conversations[].id | string | read-only |
created_at | string (date-time) | read-only |
display_name | string | read-only |
has_email | boolean | read-only |
has_phone | boolean | read-only |
id | string | read-only |
inbox_url | string | null | read-only |
instagram_name | string | null | read-only |
instagram_username | string | null | read-only |
is_ad_lead | boolean | read-only |
is_excluded | boolean | read-only |
is_reachable | boolean | read-only |
is_spam | boolean | read-only |
location | object | null | read-only |
location.city | string | null | read-only |
location.country | string | read-only |
setter | object | read-only |
setter.member_id | string | read-only |
setter.name | string | read-only |
source | string | read-only |
source_media_type | string | read-only |
stage | string | null | read-only |
stage_key | string | read-only |
stage_name | string | read-only |
tags | object[] | read-only |
tags[].applied_by | string | read-only |
tags[].id | string | read-only |
tags[].name | string | read-only |
unlocked_at | string (date-time) | read-only |
unqualification_reason | string | read-only |
updated_at | string (date-time) | read-only |
Responses
200Success400The 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 PATCH "https://api.themochi.app/v1/leads/<lead_id>/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"archived":true,"stage":"NEW","stage_key":"string","unqualification_reason":"underaged"}'Assign a lead
PUT
leads:writeIdempotency-Key required/v1/leads/{lead_id}/assignment/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
closer_id | integer | null | — |
setter_id | integer | null | — |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
ad_title | string | read-only |
archived | boolean | read-only |
channels | string[] | read-only |
closer | object | read-only |
closer.member_id | string | read-only |
closer.name | string | read-only |
conversation_id | string | null | read-only |
conversations | object[] | read-only |
conversations[].channel | string | read-only |
conversations[].id | string | read-only |
created_at | string (date-time) | read-only |
display_name | string | read-only |
has_email | boolean | read-only |
has_phone | boolean | read-only |
id | string | read-only |
inbox_url | string | null | read-only |
instagram_name | string | null | read-only |
instagram_username | string | null | read-only |
is_ad_lead | boolean | read-only |
is_excluded | boolean | read-only |
is_reachable | boolean | read-only |
is_spam | boolean | read-only |
location | object | null | read-only |
location.city | string | null | read-only |
location.country | string | read-only |
setter | object | read-only |
setter.member_id | string | read-only |
setter.name | string | read-only |
source | string | read-only |
source_media_type | string | read-only |
stage | string | null | read-only |
stage_key | string | read-only |
stage_name | string | read-only |
tags | object[] | read-only |
tags[].applied_by | string | read-only |
tags[].id | string | read-only |
tags[].name | string | read-only |
unlocked_at | string (date-time) | read-only |
unqualification_reason | string | read-only |
updated_at | string (date-time) | read-only |
Responses
200Success400The 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 PUT "https://api.themochi.app/v1/leads/<lead_id>/assignment/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"closer_id":1,"setter_id":1}'Update lead contact
PATCH
leads:writeIdempotency-Key required/v1/leads/{lead_id}/contact/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
email | string (email) | max length 254 |
overwrite | boolean | — |
phone_number | string | max length 255 |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
ad_title | string | read-only |
archived | boolean | read-only |
channels | string[] | read-only |
closer | object | read-only |
closer.member_id | string | read-only |
closer.name | string | read-only |
conversation_id | string | null | read-only |
conversations | object[] | read-only |
conversations[].channel | string | read-only |
conversations[].id | string | read-only |
created_at | string (date-time) | read-only |
display_name | string | read-only |
has_email | boolean | read-only |
has_phone | boolean | read-only |
id | string | read-only |
inbox_url | string | null | read-only |
instagram_name | string | null | read-only |
instagram_username | string | null | read-only |
is_ad_lead | boolean | read-only |
is_excluded | boolean | read-only |
is_reachable | boolean | read-only |
is_spam | boolean | read-only |
location | object | null | read-only |
location.city | string | null | read-only |
location.country | string | read-only |
setter | object | read-only |
setter.member_id | string | read-only |
setter.name | string | read-only |
source | string | read-only |
source_media_type | string | read-only |
stage | string | null | read-only |
stage_key | string | read-only |
stage_name | string | read-only |
tags | object[] | read-only |
tags[].applied_by | string | read-only |
tags[].id | string | read-only |
tags[].name | string | read-only |
unlocked_at | string (date-time) | read-only |
unqualification_reason | string | read-only |
updated_at | string (date-time) | read-only |
Responses
200Success400The 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 PATCH "https://api.themochi.app/v1/leads/<lead_id>/contact/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"email":"string","overwrite":true,"phone_number":"string"}'Get lead intelligence
GET
leads:readsignals:read/v1/leads/{lead_id}/intelligence/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
ai_mode | object | read-only |
ai_mode.enabled | boolean | read-only |
ai_mode.status | string | read-only |
conversation_stage | object | read-only |
conversation_stage.entered_at | string (date-time) | read-only |
conversation_stage.value | string | read-only |
engagement | object | read-only |
engagement.avg_score | number | read-only |
engagement.computed_at | string (date-time) | read-only |
engagement.max_score | number | read-only |
engagement.question_count | integer | read-only |
engagement.trend | string | read-only |
last_lead_message_at | string (date-time) | read-only |
last_org_message_at | string (date-time) | read-only |
objection | object | read-only |
objection.present | boolean | read-only |
objection.type | string | read-only |
outcome | object | read-only |
outcome.computed_at | string (date-time) | read-only |
outcome.confidence | number | read-only |
outcome.value | string | read-only |
sentiment | object | read-only |
sentiment.computed_at | string (date-time) | read-only |
sentiment.confidence | number | read-only |
sentiment.value | string | read-only |
window | object | read-only |
window.expires_at | string (date-time) | read-only |
window.status | string | read-only |
Responses
200Success400The 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.429The request-rate budget is exhausted.
Example request
curl
curl -X GET "https://api.themochi.app/v1/leads/<lead_id>/intelligence/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Get lead signals
GET
signals:read/v1/leads/{lead_id}/signals/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
signal_type | query | string | one of BOOKING_LINK, PAYMENT_LINK, QUALIFIER_LINK, NURTURE_LINK, CALL_CONFIRMED, PRICE_DISCUSSED, OBJECTION_RAISED, OBJECTION_OVERCOME, HIGH_ENGAGEMENT, WENT_COLD, GHOSTED, SCHEDULING_PROPOSED, SCHEDULING_CONFIRMED, CONTACT_EXCHANGED |
lead_id | query | integer | min 1 |
detected_since | query | string (date-time) | — |
updated_since | query | string (date-time) | — |
min_confidence | query | number | min 0 · max 1 |
cursor | query | string | — |
page_size | query | integer | min 1 · max 100 |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
datarequired | object[] | — |
data[].confidence | number | read-only |
data[].detected_at | string (date-time) | read-only |
data[].id | string | read-only |
data[].lead_id | string | read-only |
data[].signal_type | string | read-only |
next_cursorrequired | string | null | — |
Responses
200Success400The 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.429The request-rate budget is exhausted.
Example request
curl
curl -X GET "https://api.themochi.app/v1/leads/<lead_id>/signals/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Add tags to a lead
POST
leads:writeIdempotency-Key required/v1/leads/{lead_id}/tags/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
tag_idrequired | integer | — |
Response fields (201)
| Field | Type | Notes |
|---|---|---|
ad_title | string | read-only |
archived | boolean | read-only |
channels | string[] | read-only |
closer | object | read-only |
closer.member_id | string | read-only |
closer.name | string | read-only |
conversation_id | string | null | read-only |
conversations | object[] | read-only |
conversations[].channel | string | read-only |
conversations[].id | string | read-only |
created_at | string (date-time) | read-only |
display_name | string | read-only |
has_email | boolean | read-only |
has_phone | boolean | read-only |
id | string | read-only |
inbox_url | string | null | read-only |
instagram_name | string | null | read-only |
instagram_username | string | null | read-only |
is_ad_lead | boolean | read-only |
is_excluded | boolean | read-only |
is_reachable | boolean | read-only |
is_spam | boolean | read-only |
location | object | null | read-only |
location.city | string | null | read-only |
location.country | string | read-only |
setter | object | read-only |
setter.member_id | string | read-only |
setter.name | string | read-only |
source | string | read-only |
source_media_type | string | read-only |
stage | string | null | read-only |
stage_key | string | read-only |
stage_name | string | read-only |
tags | object[] | read-only |
tags[].applied_by | string | read-only |
tags[].id | string | read-only |
tags[].name | string | read-only |
unlocked_at | string (date-time) | read-only |
unqualification_reason | string | read-only |
updated_at | string (date-time) | read-only |
Responses
201Success400The 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/leads/<lead_id>/tags/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"tag_id":1}'Remove a tag from a lead
DELETE
leads:writeIdempotency-Key required/v1/leads/{lead_id}/tags/{tag_id}/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
lead_idrequired | path | integer | — |
tag_idrequired | path | integer | — |
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
suppress | boolean | — |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
ad_title | string | read-only |
archived | boolean | read-only |
channels | string[] | read-only |
closer | object | read-only |
closer.member_id | string | read-only |
closer.name | string | read-only |
conversation_id | string | null | read-only |
conversations | object[] | read-only |
conversations[].channel | string | read-only |
conversations[].id | string | read-only |
created_at | string (date-time) | read-only |
display_name | string | read-only |
has_email | boolean | read-only |
has_phone | boolean | read-only |
id | string | read-only |
inbox_url | string | null | read-only |
instagram_name | string | null | read-only |
instagram_username | string | null | read-only |
is_ad_lead | boolean | read-only |
is_excluded | boolean | read-only |
is_reachable | boolean | read-only |
is_spam | boolean | read-only |
location | object | null | read-only |
location.city | string | null | read-only |
location.country | string | read-only |
setter | object | read-only |
setter.member_id | string | read-only |
setter.name | string | read-only |
source | string | read-only |
source_media_type | string | read-only |
stage | string | null | read-only |
stage_key | string | read-only |
stage_name | string | read-only |
tags | object[] | read-only |
tags[].applied_by | string | read-only |
tags[].id | string | read-only |
tags[].name | string | read-only |
unlocked_at | string (date-time) | read-only |
unqualification_reason | string | read-only |
updated_at | string (date-time) | read-only |
Responses
200Success400The 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 DELETE "https://api.themochi.app/v1/leads/<lead_id>/tags/<tag_id>/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"suppress":true}'