Ir al contenido

Find a contact by user id or phone

POST
/v2/clients/{client_id}/contacts/search
curl --request POST \
--url https://api-agent.manoflow.com/v2/clients/4e2a8c3d-1b9f-4e6a-8c7d-9f0a1b2c3d4e/contacts/search \
--header 'Content-Type: application/json' \
--header 'x-kyto-key: <x-kyto-key>' \
--data '{ "user_id": "10000000042", "platform": "whatsapp" }'

Give user_id (the contact’s id on its channel, with or without +) or phone (digits, optionally with + and separators); user_id wins when both are sent. platform is optional here: with telegram or any platform other than whatsapp the id is looked up as sent and never as a phone. The phone travels in the body, never in a URL. A contact is found by id in any stored form, by WhatsApp id, or by phone or WhatsApp number.

No contact is 404 with code: "contact_not_found": that, and only that, means “new contact”. A 401, 403, 404 not_found (a wrong route) or 5xx is a failure, not a new contact. Read contact.id for the sub-reads.

client_id
required
string

The client the key belongs to (any other client is 403)

Example

4e2a8c3d-1b9f-4e6a-8c7d-9f0a1b2c3d4e

user_id or phone; platform optional. Any other field is 422.

Media typeapplication/json
SearchIn

Find one contact by user_id or by phone (user_id wins when both are sent).

object
user_id
User Id
Any of:
string
phone
Phone
Any of:
string
platform
Platform
Any of:
string

Example

{
"user_id": "10000000042",
"platform": "whatsapp"
}

Found

Media typeapplication/json

Example

{
"contact": {
"id": "0c6f7a52-3d64-4b58-a1cd-5f0d1e2b9a10",
"user_id": "+10000000042",
"name": "Cliente Prueba",
"first_name": "Cliente",
"whatsapp_name": null,
"phone": "+10000000042",
"email": null,
"language": "es",
"lead_score": 10,
"lead_stage": "Lead Nuevo",
"lead_stage_order": 1,
"reachout_step": 1,
"last_reachout_at": null,
"last_conversation_at": "2026-09-01T10:00:00.000Z",
"last_conversation_summary": "Pregunta por apartamentos de 2 habitaciones.",
"conversation_count": 3,
"attributes": {
"orders_count": 2
},
"created_at": "2026-08-20T15:00:00.000Z",
"updated_at": "2026-09-01T10:05:00.000Z"
},
"match_count": 1
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The body is not valid JSON, or not a JSON object

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/invalid-json",
"title": "The body is not valid JSON",
"status": 400,
"code": "invalid_json",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Missing, malformed, unknown or revoked key (one answer for all)

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/unauthorized",
"title": "Missing, malformed, unknown or revoked key",
"status": 401,
"code": "unauthorized",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The key belongs to another client, or the client does not exist

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/forbidden",
"title": "The key does not belong to this client",
"status": 403,
"code": "forbidden",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

No contact matches: a new contact

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/contact-not-found",
"title": "Contact not found",
"status": 404,
"code": "contact_not_found",
"detail": "No contact matches the user_id or phone sent: it is a new contact.",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The body is over 1 MiB

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/payload-too-large",
"title": "The body is too large",
"status": 413,
"code": "payload_too_large",
"detail": "The limit is 1 MiB.",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

A write needs Content-Type: application/json

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/unsupported-media-type",
"title": "Content-Type must be application/json",
"status": 415,
"code": "unsupported_media_type",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Neither user_id nor phone, a phone that is not one, or an unknown field

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/validation-failed",
"title": "The request has invalid fields",
"status": 422,
"code": "validation_failed",
"detail": "1 field is invalid",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W",
"errors": [
{
"pointer": "",
"code": "missing_key",
"message": "user_id or phone is required"
}
]
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The key made too many requests this minute (only when a limit is set); wait the Retry-After seconds

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/rate-limited",
"title": "Too many requests",
"status": 429,
"code": "rate_limited",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Unexpected error: quote the request_id

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/internal-error",
"title": "Internal error",
"status": 500,
"code": "internal_error",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.