Skip to main content

Search Person

POST /risks/legal-records/searches

Runs an initial legal records query based on a person's first name and/or last names.


Required Headers (HTTP Headers)​

HeaderTypeRequiredValue / Example
Content-TypestringYesapplication/json
Authentication

Authenticate with the method Blacktrust defined for your integration: the x-api-key header or Authorization: Bearer {accessToken} (one or the other, never both). See Authentication to find out which one applies to you.


Query Params​

NameTypeRequiredDefaultDescription
limitstringNo100Total records per page
pagestringNo1Page to retrieve
categoriesstringNo—List of categories. Comma-separated list: Amparo,Penal
statesstringNo—List of states. Comma-separated list: CDMX,Durango
clientIdstringConditional—Client identifier. Required if the account has multiple clients assigned. Maximum 64 characters.

Search Body Examples​

{
"name": "Armando",
"lastName": "Perez",
"secondLastName": "Gomez"
}

Property Reference​

ParameterTypeRequiredDescription
namestringYesFirst name(s) of the person to search.
lastNamestringConditionalPaternal last name of the person to search.
secondLastNamestringConditionalMaternal last name of the person to search.

Name Criteria Rules​

  • You must provide name together with at least one of the two last names (lastName or secondLastName).

  • Valid combinations are: name + lastName, name + secondLastName, or all three fields.

  • Important: If you do not have one of the last names, omit the property from the JSON. Do not send empty strings ("").


API Responses​

{
"isSuccess": true,
"statusCode": 200,
"message": "Búsqueda ejecutada",
"data": {
"searchId": "9f0c3b52-2f8f-4a2f-9a0e-7b1a0c3d4e5f",
"outcome": "SUCCESS",
"search_query": {
"name": "AGUSTIN",
"lastName": "TORRES",
"secondLastName": "MUNGUIA",
"full_name_searched": "AGUSTIN TORRES MUNGUIA"
},
"kpis": {
"total_matches": 130,
"top_categories": [{ "category": "Penal", "count": 139 }],
"top_states": [{ "state": "Federal", "count": 10 }]
},
"records": [
{
"uuid": "e9f54242-c097-4696-a28e-837f1c892304",
"name": "AGUSTIN TORRES MUNGUIA",
"count": 49,
"categories": ["LABORAL", "PENAL"],
"agreement_date": "10-01-2026",
"state": "CDMX"
}
],
"meta": {
"searchId": "9f0c3b52-2f8f-4a2f-9a0e-7b1a0c3d4e5f",
"outcome": "SUCCESS",
"cap": {
"max_matches": 300,
"total_records_in_source": 2137,
"truncated": true
},
"pagination": {
"total_records_found": 300,
"current_page": 1,
"limit": 10,
"total_pages": 30,
"has_next": true,
"has_previous": false
},
"unlocked_uuids": [],
"charged": true,
"recoverable_until": "2026-08-19T14:00:00.000Z",
"slow_response": false
}
}
}
UUID in Response

The UUID received in the response can later be used to check the status of the uploaded document and of each of the candidates it contained.

Field Types​

FieldTypeNote
meta.searchIdstringKey for the other 3 endpoints
meta.outcomeenumSUCCESS | EMPTY | FAILED
source.kpis.total_matchesnumberFull universe. Feeds the charts
source.pagination.*numberPagination from the source: it does not know about the 300 cap
meta.pagination.*numberReachable, with the cap applied. This is the one that feeds the paginator
meta.cap.total_records_in_sourcenumberActual total in the source
meta.cap.truncatedbooleantrue → show "refine your search"
source.records[].uuidstringKey for the detail and the CSV
source.records[].countnumberNumber of lawsuits. Absent if the source does not report it
source.records[].categoriesstring[]May be []
meta.unlocked_uuidsstring[]Unlocked uuids. Replaces records[].locked
meta.chargedbooleanAlways true on this endpoint
meta.recoverable_untilstringISO 8601
meta.slow_responsebooleantrue if the source took longer than the threshold

GET /risks/legal-records/searches/{searchId}

Gets additional pages of an existing search or applies secondary filters over the cached results without generating extra charges.


Path​

NameTypeRequiredDescription
searchIdstringYesUnique search identifier generated by the search service.

Query Params​

NameTypeRequiredDefaultDescription
limitstringNo100Total records per page
pagestringNo1Page to retrieve
categoriesstringNo—List of categories. Comma-separated list: Amparo,Penal
statesstringNo—List of states. Comma-separated list: CDMX,Durango
clientIdstringConditional—Client identifier. Required if the account has multiple clients assigned. Maximum 64 characters.

Filter Behavior​

Applying or changing the categories or states parameters on this endpoint re-evaluates the in-memory data and does not generate any additional cost (charged: false).

It is recommended to reset the query to the first page (page=1) when changing filters.