Skip to main content
GET
/
api
/
v1
/
clientes
/
search
Search Clients
curl --request GET \
  --url https://api.example.com/api/v1/clientes/search
{
  "[]": [
    {
      "id": 123,
      "dni": "<string>",
      "nombreCompleto": "<string>",
      "correo": "<string>",
      "telefono": "<string>"
    }
  ]
}

Endpoint

GET /api/v1/clientes/search
Search for clients across all fields (DNI, name, email, and phone number) using a keyword.

Query Parameters

keyword
string
default:""
Search keyword to match against client fields (case-insensitive)
If no keyword is provided (empty string), this endpoint returns all clients.

Response

Returns an array of matching client objects:
[]
array
Array of client objects that match the search criteria
id
number
Unique client identifier
dni
string
National ID number (DNI)
nombreCompleto
string
Client’s full name
correo
string
Client’s email address
telefono
string
Client’s phone number

Example Requests

Search by name

curl -X GET "http://localhost:8080/api/v1/clientes/search?keyword=garcia"

Search by DNI

curl -X GET "http://localhost:8080/api/v1/clientes/search?keyword=12345678"

Search by email

curl -X GET "http://localhost:8080/api/v1/clientes/search?keyword=maria"

Search by phone

curl -X GET "http://localhost:8080/api/v1/clientes/search?keyword=987"

Example Response

[
  {
    "id": 1,
    "dni": "12345678",
    "nombreCompleto": "María García",
    "correo": "[email protected]",
    "telefono": "987654321"
  },
  {
    "id": 5,
    "dni": "99887766",
    "nombreCompleto": "María Torres",
    "correo": "[email protected]",
    "telefono": "912345678"
  }
]

Search Behavior

The search performs a partial, case-insensitive match across:
  • DNI (national ID)
  • Full name
  • Email address
  • Phone number
The search is optimized for autocomplete and typeahead implementations. Results are returned as soon as any field contains the keyword.

Use Cases

  • Client lookup in shipment creation forms
  • Autocomplete/typeahead client selectors
  • Administrative client search interfaces
  • Customer service lookups
  • Duplicate client detection

Build docs developers (and LLMs) love