# Update Company

Change your company name, description, timezone, or logo, or turn domain discovery on or off.

`PUT https://connect.mindcloud.co/v2/companies/:companyId`

Permissions: `company:edit`.

## Parameters

### Path

- `companyId` (string, required): The company id, from Who Am I? or List Companies. It has to be the company the request acts on: your key's company, or the child organization X-Company-Id names.

### 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).

### Body

- `name` (string): A new name, up to 128 characters. Names are unique across MindCloud.
- `description` (string): A new description, up to 2048 characters.
- `timezone` (string): An abbreviation, not an IANA zone name, so America/New_York is refused and EDT is accepted. One of: ACST, ADT, AEST, AKDT, AST, BST, CAST, CBST, CCST, CDT, CEDT, CPST, CST, CVST, DST, EAST, EDT, EEDT, ESAST, EST, FDT, FST, GDT, GET, GMT, GST, HST, IDT, IST, JDT, JST, KDT, KST, LST, MDT, MEDT, MPST, MSK, MST, NAEST, NAST, NCAST, NDT, NST, NZST, PDT, PKT, PSST, PST, PYT, RDT, SAMT, SAST, SDT, SEST, SLST, SPST, SST, SWST, TDT, TST, U, UCST, UEDT, UMST, UST, UTC, VST, WAST, WCAST, WEDT, WPST, YEKT, YST.
- `logo` (string): An https URL of the logo image, up to 512 characters, or null to remove it.
- `domainDiscovery` (object): Whether people who sign up with an email at one of the company domains can find and join it.
  - `isEnabled` (boolean, required): true lets people who sign up with an email at a company domain find and join it; false turns that off.

## Example request

```bash
curl --request PUT \
  --url 'https://connect.mindcloud.co/v2/companies/Cp5nB8mGh3Kw' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Acme Logistics",
  "description": "Freight automation team",
  "timezone": "EDT",
  "logo": "https://cdn.acme.com/logo.png",
  "domainDiscovery": {
    "isEnabled": true
  }
}'
```

## 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.
- `region` (string): Where the company keeps its data: us-west-1 (United States), eu-north-1 (European Union) or sa-east-1 (Brazil).
  Allowed values:
    - `us-west-1`
    - `eu-north-1`
    - `sa-east-1`
- `isPersonal` (boolean): True for personal workspaces rather than team companies.
- `logo` (string): The company's logo URL.
- `parent` (object): The parent organization, or null when the company has none. Its API keys can act in this company.
  - `id` (string): The parent's company id.
  - `name` (string): The parent's name.
  - `origin` (string): created when the parent created this company, linked when this company accepted the parent.
    Allowed values:
      - `created`
      - `linked`
  - `linkedOn` (date): When the link started.
- `memberCount` (number): Members of the company, including people whose invite is pending.
- `roleCount` (number): Roles you can assign: the built-in roles plus your custom roles (List Roles).
- `domainDiscovery` (object): Whether people who sign up with an email at one of these domains can find and join the company.
  - `isEnabled` (boolean): True when domain discovery is on.
  - `domains` (array): The email domains it applies to.
- `embedded` (object): MindCloud Embedded for the company.
  - `isEnabled` (boolean): True when Embedded is enabled, so end users can connect their own accounts.
- `isDeleted` (boolean): True after the company was deleted.
- `createdOn` (date): When the company was created.
- `updatedOn` (date): When it was last changed.

## Errors

- 400 Bad request (INVALID_QUERY, NO_FIELDS_TO_UPDATE, INVALID_TIMEZONE): `VALIDATION_FAILED` / `NO_FIELDS_TO_UPDATE` "Provide at least one of "name", "description", "timezone", "logo", or "domainDiscovery"."
- 403 Access denied (API_KEY_PERMISSION_DENIED, COMPANY_SCOPE_MISMATCH): `FORBIDDEN` / `COMPANY_SCOPE_MISMATCH` "The path names company "Kd2mR7pXq9Lw", but this request acts on company "Cp5nB8mGh3Kw": the API key's company, or the one X-Company-Id names."
- 404 Company not found: `NOT_FOUND` "Company "Cp5nB8mGh3Kw" was not found."
- 409 Duplicate company name: `CONFLICT` / `DUPLICATE_COMPANY_NAME` "A company named "Acme Logistics" already exists."
