# Partners and QSA in the API

> Get each company's QSA and each partner's companies via the API, search people by name, CPF or CNPJ and follow ownership chains up to the controlling parties.

> **Tip:** Concepts on this page: [Partners and administrators board](https://cnpja.com/en-us/docs/data/partners-and-qsa), [Person types](https://cnpja.com/en-us/docs/data/partners-and-qsa#person-types), [Masked CPF](https://cnpja.com/en-us/docs/data/partners-and-qsa#masked-cpf), [Current participations](https://cnpja.com/en-us/docs/data/partners-and-qsa#current-only) and [Ownership chains](https://cnpja.com/en-us/docs/data/partners-and-qsa#chains).

The API returns each company's current [QSA](https://cnpja.com/en-us/docs/glossary#qsa) and treats each member as a [person](https://cnpja.com/en-us/docs/glossary#pessoa--person), with its own `id` and the list of companies it participates in. This makes it possible to navigate in both directions: from a company to its partners, and from a person to their companies. The board is also returned by [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d), available through [public access](https://cnpja.com/en-us/docs/api/public-access); the people and company operations require an [API key](https://cnpja.com/en-us/docs/api/first-request).

## Request

The board of partners and people appear in five operations:

| Operation | Input | Returns | Freshness |
|---|---|---|---|
| [Lookup CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d) | CNPJ | `company.partners`, along with the establishment's registration data | Live query or cached data, according to `maxAge` |
| [Lookup company](https://cnpja.com/en-us/docs/api/reference#tag/companies/GET/v2/companies/%7bid%7d) | [CNPJ root](https://cnpja.com/en-us/docs/glossary#cnpj-raiz--cnpj-root) | `partners`, with the company data and a summary of each establishment | Cached data only |
| [Search CNPJ](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments) | Filters | `company.partners` in every record | Cached data only |
| [Lookup person](https://cnpja.com/en-us/docs/api/reference#tag/people/GET/v2/people/%7bid%7d) | Person `id` | The person and all current participations | Cached data only |
| [Search people](https://cnpja.com/en-us/docs/api/reference#tag/people/GET/v2/people) | Filters | Pages of people, each with their current participations | Cached data only |

Lookup CNPJ, described in [CNPJ lookup](https://cnpja.com/en-us/docs/api/cnpj-lookup), is the only one of these operations that makes live queries and accepts public access. The others require an API key.

The examples on this page use a fictitious company and partner: EXEMPLO TECNOLOGIA LTDA, of CNPJ `EXEMPLO0000154`, and FULANA EXEMPLO.

### Lookup company

Lookup company takes the CNPJ root in the path, in `id`: the first 8 characters, with no punctuation and in uppercase. The response carries the full board in `partners`.

```http
GET /v2/companies/EXEMPLO0 HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

The full CNPJ and an 8-character ID with lowercase letters or punctuation are rejected with `400` `REQUEST_VALIDATION_FAILED`, with no charge.

### Lookup person

Lookup person takes the person's `id` in the path, a UUID obtained from `person.id`, `legalRepresentative.person.id` or Search people. The response carries the person with all current participations, with no paging.

```http
GET /v2/people/0f8e7d6c-5b4a-4c3d-9e2f-1a0b9c8d7e6f HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

### Search people

Search people finds people by name, CPF or CNPJ when the `id` is not known. Each record has the same content as Lookup person, participations included.

| Parameter | Selects |
|---|---|
| `search` | People whose name or CPF/CNPJ contains the term, in free text |
| `type.code.in` | Person types, comma-separated, such as `INDIVIDUAL,ESTABLISHMENT` |
| `legalName.in` and `legalName.nin` | Full names to include or exclude, comma-separated |
| `taxId.in` | CPFs or CNPJs, comma-separated |
| `ageGroup.in` | Age groups, such as `21-30,31-40` |
| `domicileCountry.code.in` and `domicileCountry.code.nin` | Alpha-2 codes of the countries of domicile to include or exclude, in uppercase, such as `AR,CL` |
| `participations.gte` and `participations.lte` | Number of current participations, as a minimum or maximum |
| `sort` and `order` | Field used to sort records, `relevance` (default), `legalName` or `participations`, and the direction, `ASC` or `DESC`, in uppercase |
| `limit` and `cursor` | Records per page, from `1` to `1000`, default `10`, and the cursor of the next page, sent with no other parameters |

```http
GET /v2/people?search=FULANA%20EXEMPLO&type.code.in=INDIVIDUAL HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

- A full CPF in `search` or `taxId.in` is compared by the visible digits of the [masked CPF](https://cnpja.com/en-us/docs/data/partners-and-qsa#masked-cpf) only and therefore also matches other people with the same digits. To narrow the result, send the CPF and the name in the same `search`, replacing `FULL_CPF` with the 11 digits, with no punctuation:

```http
GET /v2/people?search=FULL_CPF%20FULANA%20EXEMPLO HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

- `UNKNOWN` people do not appear in the search, so `type.code.in=UNKNOWN` returns no records. They are still available in Lookup person.
- When `order` is omitted, `relevance` and `participations` start from the highest value, and `legalName` from the lowest. `legalName` is compared by character code, without ignoring case or accents: uppercase letters come before lowercase ones, and accented letters come after both. With any `sort`, ties follow ascending `legalName`, then ascending `id`.
- With the default `sort=relevance`, records come in ascending order of `legalName` when there is no `search` or it has a single word. With more than one word, exact matches come first, then records containing the exact phrase, then the rest, each group in that same order.
- Operators, text matching and paging follow the same rules as [CNPJ search](https://cnpja.com/en-us/docs/api/cnpj-search). The page format, with `records`, `total`, `limit` and `nextCursor`, is described in [Response format](https://cnpja.com/en-us/docs/api/responses).
- A search with no results returns `200` with empty `records`, not `404`.

## Response fields

Excerpt of Lookup company, trimmed to the board of partners:

```json
{
  "updatedAt": "2026-01-27T03:00:00.000Z",
  "id": "EXEMPLO0",
  "legalName": "EXEMPLO TECNOLOGIA LTDA",
  "partners": [
    {
      "role": { "code": "49", "label": "Sócio-Administrador" },
      "admissionDate": "2026-01-01",
      "person": {
        "id": "0f8e7d6c-5b4a-4c3d-9e2f-1a0b9c8d7e6f",
        "type": { "code": "INDIVIDUAL", "label": "Pessoa Física" },
        "legalName": "FULANA EXEMPLO",
        "taxId": "***456789**",
        "domicileCountry": { "code": "BR", "label": "Brasil" },
        "ageGroup": "31-40"
      }
    }
  ]
}
```

Each item of `partners`, and of `participations`, carries:

| Field | Content |
|---|---|
| `role` | Partner role, with a 2-character `code` and a `label` |
| `admissionDate` | Date the partner joined the company, in `YYYY-MM-DD` format, or `null` |
| `legalRepresentative` | Legal representative, with `person` and `role`. Present only when the partner is represented |
| `person` | The partner person, in `partners` |
| `company` | Company summary, in `participations` |

Excerpt of Lookup person:

```json
{
  "updatedAt": "2026-01-27T03:00:00.000Z",
  "id": "0f8e7d6c-5b4a-4c3d-9e2f-1a0b9c8d7e6f",
  "type": { "code": "INDIVIDUAL", "label": "Pessoa Física" },
  "legalName": "FULANA EXEMPLO",
  "taxId": "***456789**",
  "domicileCountry": { "code": "BR", "label": "Brasil" },
  "ageGroup": "31-40",
  "participations": [
    {
      "role": { "code": "49", "label": "Sócio-Administrador" },
      "admissionDate": "2026-01-01",
      "company": {
        "updatedAt": "2026-01-27T03:00:00.000Z",
        "id": "EXEMPLO0",
        "legalName": "EXEMPLO TECNOLOGIA LTDA",
        "shareCapital": 99999.99,
        "legalNature": { "code": "2062", "label": "Sociedade Empresária Limitada" },
        "size": { "code": "SMALL", "label": "Empresa de Pequeno Porte" }
      }
    }
  ]
}
```

Person fields, in `person`, in `legalRepresentative.person` and at the root of Lookup person and Search people:

| Field | Content |
|---|---|
| `id` | Unique person identifier, a stable UUID, the same across operations, which can be stored |
| `type` | Person type, with `code` and `label` |
| `legalName` | Person's name, as registered with the official source |
| `taxId` | CNPJ, masked CPF or `null`, depending on the type |
| `domicileCountry` | Country of domicile, with the alpha-2 code in `code` and the name in `label` |
| `ageGroup` | Age group. Present only for `INDIVIDUAL` people |
| `updatedAt` | Last update from the Receita Federal. Only in Lookup person and Search people |
| `participations` | Current participations. Only in Lookup person and Search people |

The content of `taxId` and `ageGroup` depends on `type.code`:

| `type.code` | `taxId` | `ageGroup` |
|---|---|---|
| `INDIVIDUAL` | Masked CPF, as in `***456789**` | Age group |
| `ESTABLISHMENT` | Full CNPJ of the establishment registered as the partner | Not applicable |
| `FOREIGNER` | `null`, with the country abroad in `domicileCountry` | Not applicable |
| `UNKNOWN` | `null` | Not applicable |

- `participations[].company` carries the CNPJ root in `id`, the legal name, the [share capital](https://cnpja.com/en-us/docs/glossary#capital-social--share-capital), the [legal nature](https://cnpja.com/en-us/docs/glossary#natureza-jurídica--legal-nature), the [company size](https://cnpja.com/en-us/docs/glossary#porte--company-size), `updatedAt` and, when the legal nature belongs to the public administration, `federativeEntity`.
- A company with no registered partners returns an empty `partners`, and a person with no current participations returns an empty `participations`.

## Ownership chains

When a partner is another company (`ESTABLISHMENT`), the ownership chain can be followed in both directions with chained calls, up to the controlling parties or down to the controlled companies. The concept, with where a chain ends and its cycles, is in [Ownership chains](https://cnpja.com/en-us/docs/data/partners-and-qsa#chains).

### Controlling parties of a company

1. Look up the company with Lookup company.
2. For each `ESTABLISHMENT` partner, take the first 8 characters of `person.taxId` and look up that company.
3. Repeat until only `INDIVIDUAL`, `FOREIGNER` or `UNKNOWN` partners remain, which end the chain.

### Holdings of a company

1. In Search people, send the CNPJ in `taxId.in`. If you do not know which of the company's CNPJs is registered as the partner, send all of the `establishments[].taxId` values returned by Lookup company.
2. The `ESTABLISHMENT` person returned lists in `participations` the companies where that CNPJ is a partner.
3. Follow `participations[].company.id` with Lookup company and repeat.

If the company already appeared as a partner on another board, its `person.id` leads straight to Lookup person.

- Keep track of the roots already visited: cross participations can form cycles, and each step consumes queries.
- Both directions show only the current board and participations, and `participations` can lag behind `partners`, as explained in [Current participations](https://cnpja.com/en-us/docs/data/partners-and-qsa#current-only).

## Codes and values

- `role.code`: 2-character code from the Receita Federal table of roles, also used in `legalRepresentative.role`. The most common codes, such as `49` (Managing Partner) and `22` (Partner), are in [Qualifications and legal representative](https://cnpja.com/en-us/docs/data/partners-and-qsa#qualifications-and-legal-representative).
- `type.code`: `INDIVIDUAL`, `ESTABLISHMENT`, `FOREIGNER` or `UNKNOWN`, described in [Person types](https://cnpja.com/en-us/docs/data/partners-and-qsa#person-types).
- `ageGroup`: `0-12`, `13-20`, `21-30`, `31-40`, `41-50`, `51-60`, `61-70`, `71-80` or `81+`, in years.
- `domicileCountry.code`: alpha-2 country code, such as `BR`.
- Base your logic on `code`. The `label` is for display only and changes with the language, as explained in [Response format](https://cnpja.com/en-us/docs/api/responses). Person names and legal names are returned as registered, regardless of the response language.

## Sources and updates

The sources of each person type are in [Sources and freshness](https://cnpja.com/en-us/docs/data/partners-and-qsa#sources-and-freshness). In the API:

- Lookup CNPJ makes a live query of the Receita Federal CNPJ registry when the cached data is older than `maxAge`, which defaults to `45d`, or, in requests with an API key, does not include the CNPJ yet. The general rules are in [Max age and partial success](https://cnpja.com/en-us/docs/api/max-age).
- Lookup company, Lookup person and the searches deliver cached data only. To refresh a company's board, or add the company to cached data, look up one of its CNPJs with Lookup CNPJ: the live query also updates `partners`, and people's `participations` can take until the next open data release to reflect the change.
- A live query can add `UNKNOWN` people to the board, known only by name.

## Certificate

The `RFB_PARTNERS` certificate, issued by [Issue CNPJ dossier](https://cnpja.com/en-us/docs/api/reference#tag/establishments/GET/v2/establishments/%7btaxId%7d/dossier), carries as a PDF the board of partners and administrators as it stood in the Receita Federal CNPJ registry at the live query that produced it. Whether the PDF is the source's original or a reproduction generated by CNPJá, and what a certificate is not, is in [CNPJ card and other certificates](https://cnpja.com/en-us/docs/data/certificates#what-it-is).

```http
GET /v2/establishments/EXEMPLO0000154/dossier?certificates=RFB_PARTNERS HTTP/1.1
Host: api.cnpja.com
Authorization: YOUR_API_KEY
```

- `RFB_PARTNERS` comes from the same live query of the CNPJ registry that produces the `RFB_REGISTRATION` registration certificate, and both can be requested together, as in `certificates=RFB_REGISTRATION,RFB_PARTNERS`.
- The certificate is updated only by live queries, not by the open data. It can therefore require a live query even when Lookup CNPJ would answer from cached data.
- A company with no partners in the Receita Federal registry gets the certificate with a notice in place of the board, as explained in [Omitted certificates](https://cnpja.com/en-us/docs/data/certificates#omitted).

The other certificates and the dossier rules are in [Certificates](https://cnpja.com/en-us/docs/api/certificates).

## Billing

Lookup company, Lookup person and Search people consume cached queries, and partners add no usage to Lookup CNPJ or Search CNPJ. The usage of each operation is in the [Metering Rules](https://cnpja.com/en-us/legal/metering#api), that of `404` responses under [What is charged even without a useful result](https://cnpja.com/en-us/legal/metering#charged-without-result), and the certificate under [Issue certificates](https://cnpja.com/en-us/legal/metering#api-certificates).

## Frequent errors

| Status | Code | Cause | Action |
|---|---|---|---|
| `400` | `REQUEST_VALIDATION_FAILED` | In Lookup company, an `id` that is not 8 characters long, or that has lowercase letters or punctuation, such as the full CNPJ; in Lookup person, an `id` that is not a UUID; in Search people, an unknown filter, a value in the wrong format, an invalid `sort` or `order` value or `cursor` combined with another parameter | Fix what `errors` points to |
| `400` | `PAGE_CURSOR_INVALID` | In Search people, an expired or unknown `cursor` | Run the search again from the first page |
| `401` | `API_KEY_MISSING` | Request without a key to Lookup company, Lookup person or Search people, or a public request to Lookup CNPJ with parameters | Send the API key, as explained in [Public access](https://cnpja.com/en-us/docs/api/public-access) |
| `404` | `COMPANY_NOT_FOUND` | The root is not in cached data | Look up one of the company's CNPJs with Lookup CNPJ, which adds it, and try again |
| `404` | `PERSON_NOT_FOUND` | No person has the given `id` | Get the `id` from `partners` or from Search people |
| `404` | `ESTABLISHMENT_NOT_FOUND` | In Lookup CNPJ, the CNPJ is not in the Receita Federal registry or, without a key, is not in cached data yet | Check the CNPJ before repeating; without a key, send one. With a key, the `404` is charged |

The other errors are in [Limits and errors](https://cnpja.com/en-us/docs/api/limits-and-errors).

## Use cases

- **Customer and supplier onboarding:** Lookup CNPJ already includes `company.partners`. Use the partners and administrators to support verification before approving the registration, and keep the `RFB_PARTNERS` certificate when you need to record the board as it stood in the Receita Federal registry.
- **A person's holdings:** search by name and CPF with Search people and read `participations`.
- **Corporate groups:** follow `ESTABLISHMENT` partners up to the controlling companies, and use `taxId.in` to find the companies a company holds stakes in.
- **Related parties:** compare the `person.id` of the partners of two companies. The same `id` means the same person.
- **Tracking the board:** look up the CNPJ periodically, with a suitable `maxAge`, and compare `company.partners` with your previous copy to detect partners joining and leaving. You are the controller of this data and need your own legal basis and retention period (LGPD).

## In the app

On the platform, the board appears in the **Partners and administrators** section of the CNPJ record, and people in the **Partners** app, which searches people and opens each one's record with their participations. See [Search partners by name, CPF or CNPJ](https://cnpja.com/en-us/docs/partners/search) and [Partner record](https://cnpja.com/en-us/docs/partners/record).

## Notes

- What the board does not include, such as each partner's share of the capital and the full CPF, is in [What is not available](https://cnpja.com/en-us/docs/data/partners-and-qsa#what-is-not-available).
- A masked CPF cannot be used in [Lookup CPF](https://cnpja.com/en-us/docs/api/reference#tag/individuals/GET/v2/individuals/%7btaxId%7d), which covers a different resource, the [individual](https://cnpja.com/en-us/docs/glossary#indivíduo--individual), with state and SUFRAMA registrations. See [State registrations](https://cnpja.com/en-us/docs/api/state-registrations) and [SUFRAMA](https://cnpja.com/en-us/docs/api/suframa).
- To find companies without knowing the root, use the `company.*` filters of [CNPJ search](https://cnpja.com/en-us/docs/api/cnpj-search).
- For the remaining company data, such as the tax regime and establishments, see [CNPJ lookup](https://cnpja.com/en-us/docs/api/cnpj-lookup) and [Tax regime](https://cnpja.com/en-us/docs/api/tax-regime).
