---
title: "Update an existing account"
method: PATCH
path: "/accounts/{id}"
tags: ["accounts"]
---

# Update an existing account

`PATCH /accounts/{id}`

Updates an existing account by ID or external ID. Only provided fields are modified.

**Rate limit:** 60 requests per minute

## Path parameters

- `id` string, required

## Request body

- UpdateAccountRequestBody
  - `account_type` string — The type of the account. Can only be changed to "customer" or "partner".
  - `channels` Channel[] — An array of channels to be linked to this account.
    - `channel_id` string — The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.
    - `channel_name` string — The human-readable name of the channel.
    - `channel_url` string — The direct URL to the channel in its source app, if available.
    - `is_internal` boolean — Whether this is an internal channel (e.g., a triage channel) as opposed to a customer-facing channel.
    - `is_primary` boolean — Whether this channel is the primary channel for the account.
    - `mirror_to` MirrorChannel
      - `channel_id` string — The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.
      - `source` string — The source, which can be one of `["slack", "microsoft_teams", "discord"]`.
    - `source` string — The source, which can be one of `["slack", "microsoft_teams", "discord"]`.
  - `custom_fields` CustomFieldValue[] — An array of custom fields to be used on this account.
    - `slug` string — The slug of the custom field.
    - `value` string — The value of the custom field. Only to be used for single-valued custom fields. If unset, the custom field will be unset. If the custom field is a select field, the value must be the select option slug, which you can find from the GET /custom-fields endpoint. If the custom field is a relationship field, the value must be the related object ID.
    - `values` string[] — The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). If unset, the custom field will be unset. If the custom field is a multiselect field, the values must be the select option slugs which you can find from the GET /custom-fields endpoint.
  - `domains` string[] — Domains of the account. Must specify one domain as primary.
  - `external_ids` ExternalID[] — An array of external IDs to be used on this account. If provided, the accounts external IDs will be updated to the given external IDs.
    - `external_id` string — The external ID. Must be unique per object type (ex. account).
    - `label` string — The label of the external ID. Must be unique per object.
  - `is_disabled` boolean — Whether the account is disabled.
  - `logo_url` string — Logo URL of the account.
  - `name` string — The name of the account.
  - `owner_id` string — The ID of the owner of the account. If empty string is passed in, the owner will be removed.
  - `primary_domain` string — Must be in the list of domains. If there are any domains, there must be exactly one primary domain.
  - `subaccount_ids` string[] — An array of account IDs to be added as subaccounts to this account.
  - `tags` string[] — An array of strings to use as tags on this account. If provided, the accounts tags will be updated to the given tags.

## Response `200`

- UpdateAccountResponseBody
  - `data` Account
    - `channels` Channel[] — Channels associated with the account.
      - `channel_id` string — The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.
      - `channel_name` string — The human-readable name of the channel.
      - `channel_url` string — The direct URL to the channel in its source app, if available.
      - `is_internal` boolean — Whether this is an internal channel (e.g., a triage channel) as opposed to a customer-facing channel.
      - `is_primary` boolean — Whether this channel is the primary channel for the account.
      - `mirror_to` MirrorChannel
        - `channel_id` string — The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.
        - `source` string — The source, which can be one of `["slack", "microsoft_teams", "discord"]`.
      - `source` string — The source, which can be one of `["slack", "microsoft_teams", "discord"]`.
    - `created_at` string — The creation time of the account.
    - `crm_settings` CRMSettings
      - `details` CRMDetails[] — List of all CRM details for the account.
        - `id` string — The ID of the CRM for that source.
        - `source` string — The source of the CRM.
    - `custom_fields` object — Custom fields associated with the account.
    - `domain` string — The primary domain of the account.
    - `domains` string[] — The list of domains associated with the account.
    - `external_ids` ExternalID[] — External IDs associated with the account.
      - `external_id` string — The external ID. Must be unique per object type (ex. account).
      - `label` string — The label of the external ID. Must be unique per object.
    - `id` string — The ID of the account.
    - `is_disabled` boolean — Whether the account is disabled.
    - `latest_customer_activity_time` string — The time of the latest customer activity.
    - `name` string — The name of the account.
    - `owner` MiniUser
      - `email` string — The email of the user.
      - `id` string — The ID of the user.
    - `primary_domain` string — The primary domain of the account.
    - `tags` string[] — Tags associated with the account.
    - `type` string — The type of the account.
    - `updated_at` string — The time the account was last updated.
  - `request_id` string — The request ID for tracking.

## Other responses

- `400` — The request was invalid or could not be completed.
- `404`
- `500` — An unexpected internal error occurred.

---

[API](https://skmtc.net/usepylon/apis/pylon-api.md) · [All operations](https://skmtc.net/usepylon/apis/pylon-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usepylon/pylon-api/versions/7b6ea6af992a/schema)
