Leads
List leads and tag several at once.
List leads
GET
leads:read/v1/leads/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
stage_key | query | string | — |
stage | query | string | one of NEW, IN_CONTACT, QUALIFIED, UNQUALIFIED, BOOKED_CALL, DEPOSIT, WON, LOST, NO_SHOW |
tag | query | integer | min 1 |
source | query | string | one of DM, COMMENT, STORY, OUTBOUND |
setter_id | query | integer | min 1 |
closer_id | query | integer | min 1 |
is_ad_lead | query | boolean | — |
archived | query | boolean | — |
updated_since | query | string (date-time) | — |
location | query | string[] | max 50 items |
cursor | query | string | — |
page_size | query | integer | min 1 · max 100 |
Response fields (200)
| Field | Type | Notes |
|---|---|---|
datarequired | object[] | — |
data[].ad_title | string | read-only |
data[].archived | boolean | read-only |
data[].channels | string[] | read-only |
data[].closer | object | read-only |
data[].closer.member_id | string | read-only |
data[].closer.name | string | read-only |
data[].conversation_id | string | null | read-only |
data[].conversations | object[] | read-only |
data[].conversations[].channel | string | read-only |
data[].conversations[].id | string | read-only |
data[].created_at | string (date-time) | read-only |
data[].display_name | string | read-only |
data[].has_email | boolean | read-only |
data[].has_phone | boolean | read-only |
data[].id | string | read-only |
data[].inbox_url | string | null | read-only |
data[].instagram_name | string | null | read-only |
data[].instagram_username | string | null | read-only |
data[].is_ad_lead | boolean | read-only |
data[].is_excluded | boolean | read-only |
data[].is_reachable | boolean | read-only |
data[].is_spam | boolean | read-only |
data[].location | object | null | read-only |
data[].location.city | string | null | read-only |
data[].location.country | string | read-only |
data[].setter | object | read-only |
data[].setter.member_id | string | read-only |
data[].setter.name | string | read-only |
data[].source | string | read-only |
data[].source_media_type | string | read-only |
data[].stage | string | null | read-only |
data[].stage_key | string | read-only |
data[].stage_name | string | read-only |
data[].tags | object[] | read-only |
data[].tags[].applied_by | string | read-only |
data[].tags[].id | string | read-only |
data[].tags[].name | string | read-only |
data[].unlocked_at | string (date-time) | read-only |
data[].unqualification_reason | string | read-only |
data[].updated_at | string (date-time) | 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/" \
-H "Authorization: Bearer $MOCHI_API_KEY"Tag leads in bulk
POST
leads:writeIdempotency-Key required/v1/leads/bulk/tags/Parameters
| Name | In | Type | Notes |
|---|---|---|---|
Idempotency-Keyrequired | header | string (uuid) | UUID4 identifying one intended write. Reuse it only when retrying that same write. |
Request body
| Field | Type | Notes |
|---|---|---|
lead_idsrequired | integer[] | max 100 items |
tag_idsrequired | integer[] | max 20 items |
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 POST "https://api.themochi.app/v1/leads/bulk/tags/" \
-H "Authorization: Bearer $MOCHI_API_KEY" \
-H "Idempotency-Key: $(uuidgen | tr A-Z a-z)" \
-H "Content-Type: application/json" \
-d '{"lead_ids":[1],"tag_ids":[1]}'