# Reset the company file
Source: https://www.desktopaccountingapi.com/docs/api/reference/operations/endusersresetcompanyfile/

`POST https://api.desktopaccountingapi.com/v1/end-users/{id}/reset-company-file`

Operation ID: `endUsers.resetCompanyFile`. Tag: End users.

Re-binds the connection after the company file was moved or renamed (`mode: path`) or the company itself was renamed (`mode: identity`), which otherwise leaves the connection in `company_file_mismatch` or `QBD_COMPANY_FILE_NOT_FOUND`. Ask the end user to open the correct company file in QuickBooks first. The connection checks the file at the next Web Connector check-in. Queued requests stay queued.

Authentication: `Authorization: Bearer <secret key>`.

## Path parameters

- `id` (string, required): Unique identifier for the end user. example `eu_01j9x4m6v4c8k2t7q0r5s3w1zb`.

## Headers

- `Idempotency-Key` (string): Makes a write safe to retry. Repeating a key with the same request attaches to or replays the original instead of creating a second one. 1–255 printable ASCII characters, retained 7 days. Reusing a key with a different request returns `422 IDEMPOTENCY_KEY_REUSED`. 1–255 characters; example `6f1c2a0e-1f7e-4c55-9a7a-0b2d2c9e3a10`.

## Request body (application/json, required)

- `mode` (string, required): `path`: forget the stored company file location (the file was moved or renamed on disk); the next session uses the file open in QuickBooks. `identity`: also forget the company identity (the company was renamed, or the end user deliberately switched to another file); the next session that QuickBooks answers becomes the connected company file. one of `path`, `identity` (open: accept unknown values).
- `confirm` (string, required): Must be `reset_company_file`. Confirms you checked with the end user which company file is correct: with `identity`, whatever file is open next is accepted. one of `reset_company_file`.

Minimal example:

```json
{
  "mode": "path",
  "confirm": "reset_company_file"
}
```

## Responses

### 200

The end user with its connection status.

Body (application/json): object (EndUser).

- `id` (string, required): Unique identifier for the end user. example `eu_01j9x4m6v4c8k2t7q0r5s3w1zb`.
- `objectType` (string, required): Always `end_user`. one of `end_user`.
- `createdAt` (string (date-time), required): When the end user was created. UTC, ISO 8601 with milliseconds. example `2026-10-05T16:03:59.002Z`.
- `companyName` (string, required): The end user's company name, shown in the setup flow. example `Acme Supply`.
- `sourceId` (string, required): Your identifier for this end user. Unique within the project. example `cust_8812`.
- `email` (string, required): Contact email, for your identification only. We never email end users. example `ops@acme.example`.
- `integrationConnections` (array of object (IntegrationConnection), required): QuickBooks Desktop connections. Empty until the first auth session is created; at most one in v1.
  - `id` (string, required): Unique identifier for the connection. example `conn_01j9x4m6v4c8k2t7q0r5s3w1zc`.
  - `objectType` (string, required): Always `integration_connection`. one of `integration_connection`.
  - `createdAt` (string (date-time), required): When the connection was created. UTC, ISO 8601 with milliseconds. example `2026-10-05T16:03:59.002Z`.
  - `integrationSlug` (string, required): The integration this connection uses. one of `quickbooks_desktop`.
  - `status` (string, required): Derived connection status. `pending_setup`: no Web Connector has finished setup. `online`: the Web Connector checked in recently and the last QuickBooks session opened. `quickbooks_unavailable`: the Web Connector checks in but QuickBooks could not be opened (`statusReason` holds the error code). `company_file_mismatch`: a different company file is open. `offline`: no recent check-in. `disabled`: turned off by the developer. one of `pending_setup`, `online`, `quickbooks_unavailable`, `company_file_mismatch`, `offline`, `disabled` (open: accept unknown values).
  - `statusReason` (string, nullable, required): Code explaining a non-online status, when known: an error code (for example `QBD_ACCESS_NOT_GRANTED`), `QBD_QUICKBOOKS_NOT_RESPONDING` (the Web Connector checks in but QuickBooks does not answer, usually because a dialog is open) or `WEB_CONNECTOR_SCHEDULE_CHANGED`. example `QBD_QUICKBOOKS_NOT_RESPONDING`.
  - `lastRequestAt` (string, nullable, required): When the last request for this connection was made. UTC, ISO 8601.
  - `lastSuccessfulRequestAt` (string, nullable, required): When the last request succeeded. UTC, ISO 8601.
  - `lastHeartbeatAt` (string, nullable, required): When the Web Connector last checked in. UTC, ISO 8601.
  - `companyFile` (object, nullable, required): The connected company file, once a session has opened.
    - `companyName` (string, nullable, required): Company name reported by QuickBooks.
    - `product` (string, nullable, required): QuickBooks product and version reported by QuickBooks. example `QuickBooks Enterprise Solutions: General Business 24.0`.
    - `qbxmlVersion` (string, nullable, required): qbXML version used with this company file. example `16.0`.
    - `country` (string, nullable, required): QuickBooks edition country. example `US`.

### Errors

Every error body is the error object described at https://www.desktopaccountingapi.com/docs/errors/.

- `400`: The request is invalid. Codes: `UNKNOWN_HEADER`, `INVALID_JSON`, `INVALID_PARAMETER`, `UNKNOWN_PARAMETER`, `IDEMPOTENCY_KEY_INVALID`.
- `401`: The API key is missing or invalid. Codes: `API_KEY_MISSING`, `API_KEY_INVALID`.
- `403`: The operation is not permitted. Codes: `API_KEY_READ_ONLY`.
- `404`: The object does not exist in this project. Codes: `RESOURCE_MISSING`.
- `409`: The request conflicts with the current state. Codes: `INTEGRATION_CONNECTION_NOT_SET_UP`.
- `422`: The request is well formed but cannot be processed. Codes: `IDEMPOTENCY_KEY_REUSED`.
- `429`: Too many requests. Codes: `RATE_LIMITED`.
- `500`: Unexpected server error. Codes: `INTERNAL_ERROR`.
- `503`: QuickBooks Desktop or the service is not available. Codes: `SERVICE_UNAVAILABLE`.
