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