> 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-docs/quick-start-guides/company-search-through-api.md).

# Company Search through API

#### 1. Set up a query template

Access the Trust Platform and then Query Templates. Select the Query Template you want and proceed to create the workflow.

#### 2. Get company ID

The global context is dynamic and different countries use different ways of identifying companies. For this reason, you need to look up the identifier of the company you want to submit to workflow.

Using the **Core API** and the **Services** resource, make a request asking for the **`kybCompanySearch`** service and providing the information of the known company. You can find more details on how to make this request visiting [API Reference > Core API > Available Resources > Services](https://docs.caf.io/api/core-api/available-resources/services).

In response, two identifiers are expected: **`creditReportId`** and **`businessIdentityId`**.

{% hint style="info" %}
**Note:** not all identifiers will always be available. There are cases where only one or no bureau is compatible with the source information.
{% endhint %}

#### 3. Start a transaction

Once you have at least one identifier, you can start a transaction in the flow configured in the [1. Set up a query template](#set-up-a-query-template) step.

Using the **Core API** and the **Orchestrations** resource, make a request to create a transaction. In request’s body, enter at least one of the identifiers obtained in the [2. Get company ID](#get-company-id) step. You can find more details on how to make this request visiting [API Reference > Core API > Transaction Details](https://docs.caf.io/api/core-api/transaction-details).

{% hint style="info" %}
**Note:** keep the same attribute name.
{% endhint %}

If successful, the ID of the newly created transaction will be available in the body of the response, in an attribute named **`id`**.

#### 4. Check results

Finally, once you have the transaction ID, you can retrieve the information that was requested according to the Workflow configuration created in the [1. Set up a query template](#set-up-a-query-template) step.

{% hint style="info" %}
**Note:** you must wait for the transaction to be processed before the data is fully available.
{% endhint %}

**Alternative:** wait for a webhook update and only get the info when the transaction has an update. See more details [here](https://docs.caf.io/api/core-api/webhooks).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.caf.io/caf-docs/quick-start-guides/company-search-through-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
