# Update an end user
Source: https://www.desktopaccountingapi.com/docs/api/reference/operations/endusersupdate/

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

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

Updates `companyName`, `sourceId` or `email`. Omitted fields are unchanged.

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)

- `companyName` (string): The end user's company name, shown in the setup flow. 1–255 characters. 1–255 characters; example `Acme Supply`.
- `sourceId` (string): Your identifier for this end user, unique within the project. 1–255 characters. 1–255 characters; example `cust_8812`.
- `email` (string (email)): Contact email for your identification. We never email end users. max 320 characters; example `ops@acme.example`.

Minimal example:

```json
{}
```

## Responses

### 200

The updated end user.

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`.
- `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`.
