> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/caf-api/connect/available-resources/joint-resolution-6/suspected-fraud-query.md).

# Suspected Fraud Query

{% hint style="info" %}
**Authentication Requirements:**

* Regular endpoints use `OAuth2` authentication with base URL: `https://api.us.prd.caf.io`
* For enhanced security, some endpoints may also support `mTLS` authentication with base URL: `https://mtls.us.prd.caf.io`
* For information on implementing `mTLS`, access [Using mTLS](/caf-api/connect/authentication/using-mtls.md)
  {% endhint %}

The suspected fraud query retrieves the suspected frauds by a conditional search.

{% openapi src="/files/J8iqm5NWDI0JBS28CSBQ" path="/query" method="post" %}
[fraud.yaml](https://3218940882-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVxCOSyBojfSIE5fcpfH%2Fuploads%2Fgit-blob-7b42fd65b33da931b840d79ad43455b53ca5b59b%2Ffraud.yaml?alt=media)
{% endopenapi %}

## Options

As demonstrated in the example request you can set the above properties to the search/query the suspected frauds:

* The `identifier` object is used to query suspected fraud occurrences, is composed by `data` (a string representing the document number) and by `type` (must be `CPF` or `CNPJ`). It's a **required** property;
* The `queryMode` property indicates how the query is be performed, it's an optional field and your default value is `DEFAULT`. The possible values are:
  * **DEFAULT**: It's the conventional mode, propagates the query to All.Id Network and to all available hubs of the consortium network;
  * **LOCAL**: Indicates that the query will be executed locally on the Peer, without propagating the query to the network. A unique identifier per `SuspectedFraud` is returned, a UUID named `token`;
  * **INTERNAL**: Indicates that the query will be executed internally in the All.Id Network, not propagating to the consortium network;
  * **DELETED**: Similar to **LOCAL** mode, the query will be executed locally but returning `SuspectedFraud's` marked as deleted.
* The `startDate` and `endDate` properties must be strings representing a date-time ISO format. Those properties must be optional.
* The `page` property should only be used for queries with paginated responses due to the excessive size of the data. It is an optional integer field. If not specified, a standard query is executed; if specified, it retrieves the requested page.

## Paginated Responses

Paginated responses are used to handle the large volume of aggregated data returned. Each page contains up to **5,000 entries** and is ordered by occurrence date, with the most recent entries appearing first.

Pages are valid for **1 hour**. After this period, any attempt to access these pages will result in an error. Similarly, attempting to retrieve pages for non-paginated queries will also result in an error.

Pagination uses 0-based indexing — ensure this is followed when requesting subsequent pages.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.caf.io/caf-api/connect/available-resources/joint-resolution-6/suspected-fraud-query.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
