> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/api-reference/accounts.md).

# Accounts

{% openapi src="<https://static.usepylon.com/openapi.json>" path="/accounts" method="get" %}
<https://static.usepylon.com/openapi.json>
{% endopenapi %}

{% openapi src="<https://static.usepylon.com/openapi.json>" path="/accounts" method="post" %}
<https://static.usepylon.com/openapi.json>
{% endopenapi %}

## Update multiple accounts

> Updates multiple accounts in a single request. Only provided fields are modified.\
> \
> \*\*Rate limit:\*\* 20 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"UpdateAccountsRequest":{"properties":{"account_ids":{"description":"The account IDs to update. The number of accounts to update must be between 1 and 100.","items":{"type":"string"},"type":"array"},"account_type":{"description":"The type of the account. Can only be changed to \"customer\" or \"partner\".","type":"string"},"custom_fields":{"description":"An array of custom fields to be updated on the accounts.","items":{"$ref":"#/components/schemas/CustomFieldValue"},"type":"array"},"owner_id":{"description":"The ID of the new owner. If empty string is passed in, the owner will be removed.","type":"string"},"tags":{"description":"An array of tags to be updated on the accounts.","items":{"type":"string"},"type":"array"},"tags_apply_mode":{"description":"The mode for applying tags. Valid values: \"append_only\", \"remove_only\", \"replace\". Defaults to \"replace\".","type":"string"}},"required":["account_ids"],"type":"object"},"CustomFieldValue":{"properties":{"slug":{"description":"The slug of the custom field.","type":"string"},"value":{"description":"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.","type":"string"},"values":{"description":"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.","items":{"type":"string"},"type":"array"}},"type":"object"},"UpdateAccountsResponseBody":{"properties":{"request_id":{"description":"The request ID for tracking.","type":"string"},"success":{"description":"Whether the update was successfully initiated.","type":"boolean"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}},"responses":{"UpdateAccountsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountsResponseBody"}}},"description":""},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""}}},"paths":{"/accounts":{"patch":{"description":"Updates multiple accounts in a single request. Only provided fields are modified.\n\n**Rate limit:** 20 requests per minute","operationId":"UpdateAccounts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/UpdateAccountsResponse"},"400":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/ErrorApiResponse"}},"summary":"Update multiple accounts","tags":["accounts"]}}}}
```

{% openapi src="<https://static.usepylon.com/openapi.json>" path="/accounts/{id}" method="get" %}
<https://static.usepylon.com/openapi.json>
{% endopenapi %}

{% openapi src="<https://static.usepylon.com/openapi.json>" path="/accounts/{id}" method="patch" %}
<https://static.usepylon.com/openapi.json>
{% endopenapi %}

{% openapi src="<https://static.usepylon.com/openapi.json>" path="/accounts/{id}" method="delete" %}
<https://static.usepylon.com/openapi.json>
{% endopenapi %}

{% openapi src="<https://static.usepylon.com/openapi.json>" path="/accounts/search" method="post" %}
<https://static.usepylon.com/openapi.json>
{% endopenapi %}

## Merge accounts

> Merges one or more accounts into a surviving account. Issues, contacts, opportunities, domains, channels, external IDs, and other associated data are transferred to the surviving account. Tags and custom field values of the merged accounts are not transferred. The merged accounts are permanently deleted. This cannot be undone. Accounts are merged sequentially, each in its own transaction; if a merge fails partway through, accounts already merged are not restored.\
> \
> \*\*Rate limit:\*\* 10 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"url":"https://api.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"MergeAccountsRequest":{"properties":{"merge_account_ids":{"description":"The IDs of the accounts to merge into the surviving account. These accounts are permanently deleted after their data is transferred. The number of accounts to merge must be between 1 and 100.","items":{"type":"string"},"type":"array"},"merge_into_account_id":{"description":"The ID of the account that will survive the merge and receive the merged data.","type":"string"}},"required":["merge_into_account_id","merge_account_ids"],"type":"object"},"MergeAccountsResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Account"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"Account":{"properties":{"channels":{"description":"Channels associated with the account.","items":{"$ref":"#/components/schemas/Channel"},"type":"array"},"created_at":{"description":"The creation time of the account.","type":"string"},"crm_settings":{"$ref":"#/components/schemas/CRMSettings"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom fields associated with the account.","type":"object"},"domain":{"description":"The primary domain of the account.","type":"string"},"domains":{"description":"The list of domains associated with the account.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"id":{"description":"The ID of the account.","type":"string"},"is_disabled":{"description":"Whether the account is disabled.","type":"boolean"},"latest_customer_activity_time":{"description":"The time of the latest customer activity.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner":{"$ref":"#/components/schemas/MiniUser"},"primary_domain":{"description":"The primary domain of the account.","type":"string"},"tags":{"description":"Tags associated with the account.","items":{"type":"string"},"type":"array"},"type":{"description":"The type of the account.","type":"string"},"updated_at":{"description":"The time the account was last updated.","type":"string"}},"type":"object"},"Channel":{"properties":{"channel_id":{"description":"The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.","type":"string"},"channel_name":{"description":"The human-readable name of the channel.","type":"string"},"channel_url":{"description":"The direct URL to the channel in its source app, if available.","type":"string"},"is_internal":{"description":"Whether this is an internal channel (e.g., a triage channel) as opposed to a customer-facing channel.","type":"boolean"},"is_primary":{"description":"Whether this channel is the primary channel for the account.","type":"boolean"},"mirror_to":{"$ref":"#/components/schemas/MirrorChannel"},"source":{"description":"The source, which can be one of `[\"slack\", \"microsoft_teams\", \"discord\"]`.","type":"string"}},"type":"object"},"MirrorChannel":{"properties":{"channel_id":{"description":"The ID of the channel. If this is a Microsoft Teams channel, the ID must be in the format of `{team_id}|{channel_id}`.","type":"string"},"source":{"description":"The source, which can be one of `[\"slack\", \"microsoft_teams\", \"discord\"]`.","type":"string"}},"type":"object"},"CRMSettings":{"properties":{"details":{"description":"List of all CRM details for the account.","items":{"$ref":"#/components/schemas/CRMDetails"},"type":"array"}},"type":"object"},"CRMDetails":{"properties":{"id":{"description":"The ID of the CRM for that source.","type":"string"},"source":{"description":"The source of the CRM.","type":"string"}},"type":"object"},"CustomFieldValue":{"properties":{"slug":{"description":"The slug of the custom field.","type":"string"},"value":{"description":"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.","type":"string"},"values":{"description":"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.","items":{"type":"string"},"type":"array"}},"type":"object"},"ExternalID":{"properties":{"external_id":{"description":"The external ID. Must be unique per object type (ex. account).","type":"string"},"label":{"description":"The label of the external ID. Must be unique per object.","type":"string"}},"type":"object"},"MiniUser":{"properties":{"email":{"description":"The email of the user.","type":"string"},"id":{"description":"The ID of the user.","type":"string"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}},"responses":{"MergeAccountsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeAccountsResponseBody"}}},"description":""},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""}}},"paths":{"/accounts/merge":{"post":{"description":"Merges one or more accounts into a surviving account. Issues, contacts, opportunities, domains, channels, external IDs, and other associated data are transferred to the surviving account. Tags and custom field values of the merged accounts are not transferred. The merged accounts are permanently deleted. This cannot be undone. Accounts are merged sequentially, each in its own transaction; if a merge fails partway through, accounts already merged are not restored.\n\n**Rate limit:** 10 requests per minute","operationId":"MergeAccounts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeAccountsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/MergeAccountsResponse"},"400":{"$ref":"#/components/responses/ErrorApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"500":{"$ref":"#/components/responses/ErrorApiResponse"}},"summary":"Merge accounts","tags":["accounts"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.usepylon.com/pylon-docs/developer/api/api-reference/accounts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
