# List Companies

Find the organization to work in: every organization your API key can act in, searchable with q=acme (any part of the name, or the exact id), with how the key reaches it. Pass its id in X-Company-Id on every call. An organization marked approvalRequired is restricted for MindCloud staff: request access in the app first. One marked staffLimited works only for the parts of MindCloud in staffApprovedApps.

`GET https://connect.mindcloud.co/v2/companies`

Permissions: `company:view`.

## Parameters

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. A key can also act in its child organizations, and, with "Use this key across all of your organizations" on, in every organization its creator can open in the app. List them with GET /v2/companies. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Query

- `q` (string): Part of the organization name, or its id.
  Search text: organizations whose name contains it, ignoring case, or whose id is exactly it. * is a wildcard.

## Example request

```bash
curl --request GET \
  --url 'https://connect.mindcloud.co/v2/companies?q=acme' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `id` (string): Unique id of the company.
- `name` (string): The company's name.
- `description` (string): The company's description.
- `timezone` (string): The company's timezone key, an abbreviation such as EDT or PST rather than an IANA zone name.
- `plan` (string): Your plan: Basic, Professional, or Enterprise.
- `memberCount` (number): How many people are in the company.
- `isPersonal` (boolean): True for personal workspaces rather than team companies.
- `isDeleted` (boolean): True after the company was deleted.
- `subscriptionIsLegacy` (boolean): True while the company is on a legacy plan.
- `subscriptionUpdatedOn` (date): When the subscription last changed.
- `createdOn` (date): When the company was created.
- `updatedOn` (date): When it was last changed.
- `access` (string): How this API key reaches the organization, and so where X-Company-Id may name it: own on every endpoint; child and staff on every endpoint that acts in other organizations except the member-only ones (API keys, audit events, child organizations, link requests, leaving a parent) and Embedded end users; member on all of those but Embedded end users; staffLimited like staff, on endpoints of the parts of MindCloud in staffApprovedApps and on endpoints shared by both parts (they accept either approval); approvalRequired on none.
  Allowed values:
    - `own`: The API key's own organization.
    - `child`: A child organization of the key's organization.
    - `member`: The key's creator belongs to it with a role ("Use this key across all of your organizations" on).
    - `staff`: The key's creator opens it as MindCloud staff on every route ("Use this key across all of your organizations" on).
    - `staffLimited`: Restricted for MindCloud staff, and the creator is approved for only some parts of MindCloud there (staffApprovedApps): endpoints of an approved part work, endpoints shared by both parts accept either approval and so work too, and endpoints of the other part answer ORG_ACCESS_RESTRICTED.
    - `approvalRequired`: Restricted for MindCloud staff, and the creator is approved for no part of MindCloud there: request access in the app first.
- `staffApprovedApps` (array of string): For an organization the key reaches through MindCloud staff access (staff, staffLimited, approvalRequired): the parts of MindCloud it is open in. all when it is not restricted (or the creator may enter every restricted organization); otherwise gravity and/or cirra, the parts the creator is approved for; empty when approvalRequired. Null for every other organization.
