> 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). Agents can also search and read this documentation through its [MCP server](https://docs.usepylon.com/pylon-docs/~gitbook/mcp).

# Accounts

## Get a list of accounts

> Returns a paginated list of accounts for the organization.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetAccountsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountsResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetAccountsResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/Account"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"Account":{"properties":{"associated_account_ids":{"description":"The IDs of accounts associated with this partner that the caller can read. Present only for partner accounts; an empty array indicates no visible associated accounts.","items":{"type":"string"},"type":"array"},"channels":{"description":"Channels associated with the account.","items":{"$ref":"#/components/schemas/Channel"},"nullable":true,"type":"array"},"created_at":{"description":"The creation time of the account.","format":"date-time","type":"string"},"crm_settings":{"$ref":"#/components/schemas/CRMSettings"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom fields associated with the account.","nullable":true,"type":"object"},"domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"domains":{"description":"The list of domains associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"nullable":true,"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"},"latest_vendor_activity_time":{"description":"The time of the latest vendor activity.","type":"string"},"logo_url":{"description":"The logo URL of the account.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner":{"allOf":[{"$ref":"#/components/schemas/MiniUser"}],"nullable":true},"parent_account_id":{"description":"The ID of this account's parent account, or null if it has no parent.","nullable":true,"type":"string"},"primary_domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"subaccount_ids":{"description":"The IDs of the subaccounts belonging to this account.","items":{"type":"string"},"nullable":true,"type":"array"},"tags":{"description":"Tags associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"type":{"description":"The type of the account.\n\nKnown values: `customer`, `internal`, `community`, `partner`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"The time the account was last updated.","format":"date-time","type":"string"}},"required":["created_at","id","is_disabled","latest_customer_activity_time","latest_vendor_activity_time","logo_url","name","type","updated_at"],"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. On account create or update, it is saved only for channels from a custom issue source and ignored for all other sources.","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 channel source. This can be any supported integration source, or a custom issue source's slug or ID. A custom issue source ID is stored and returned as the source's slug.","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 channel source. This can be any supported integration source.","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"}},"required":["id","source"],"type":"object"},"CustomFieldValue":{"description":"A custom field value to set. Custom fields not listed in a write request are left unchanged.","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. If the custom field is a date or datetime field, the value must be an RFC3339 timestamp, such as 2026-01-31T00:00:00Z.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). Replaces the full selection; it does not add to or remove from the existing values. 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"}},"title":"CustomFieldValue","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"}},"required":["id"],"type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts":{"get":{"description":"Returns a paginated list of accounts for the organization.\n\n**Rate limit:** 300 requests per minute","operationId":"GetAccounts","parameters":[{"description":"The cursor to use for pagination.","in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The number of accounts to fetch. Defaults to 100. Must be greater than 0 and less than 1000.","in":"query","name":"limit","schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"$ref":"#/components/responses/GetAccountsResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get a list of accounts","tags":["accounts"]}}}}
```

## Create a new account

> Creates a new account with the specified name and optional metadata.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"CreateAccountRequest":{"properties":{"account_type":{"default":"customer","description":"The type of the account. Must be one of \"customer\", \"internal\", \"community\", or \"partner\". Defaults to \"customer\" if not specified.","enum":["customer","internal","community","partner"],"type":"string"},"channels":{"description":"An array of channels to be linked to this account.","items":{"$ref":"#/components/schemas/Channel"},"type":"array"},"custom_fields":{"description":"An array of custom fields to be used on this account.","items":{"$ref":"#/components/schemas/CustomFieldValue"},"type":"array"},"domain":{"description":"Deprecated. Please use Domains and PrimaryDomain instead.","type":"string"},"domains":{"description":"The domains of the account, without any leading scheme, for example stripe.com. Must specify one domain as primary.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"An array of external IDs to be used on this account. If provided, the account's external IDs will be updated to the given external IDs.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"logo_url":{"description":"The logo URL of the account. Must be a square .png, .jpg or .jpeg.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner_id":{"description":"The ID of the owner of the account.","type":"string"},"primary_domain":{"description":"Must be in the list of domains. If there are any domains, there must be exactly one primary domain.","type":"string"},"subaccount_ids":{"description":"An array of account IDs to be added as subaccounts to this account. For normal accounts, these represent subaccounts. For partner accounts, these represent associated accounts.","items":{"type":"string"},"type":"array"},"tags":{"description":"An array of strings to use as tags on this account. If provided, the accounts tags will be updated to the given tags.","items":{"type":"string"},"type":"array"}},"required":["name"],"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. On account create or update, it is saved only for channels from a custom issue source and ignored for all other sources.","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 channel source. This can be any supported integration source, or a custom issue source's slug or ID. A custom issue source ID is stored and returned as the source's slug.","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 channel source. This can be any supported integration source.","type":"string"}},"type":"object"},"CustomFieldValue":{"description":"A custom field value to set. Custom fields not listed in a write request are left unchanged.","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. If the custom field is a date or datetime field, the value must be an RFC3339 timestamp, such as 2026-01-31T00:00:00Z.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). Replaces the full selection; it does not add to or remove from the existing values. 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"}},"title":"CustomFieldValue","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"},"CreateAccountResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Account"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"Account":{"properties":{"associated_account_ids":{"description":"The IDs of accounts associated with this partner that the caller can read. Present only for partner accounts; an empty array indicates no visible associated accounts.","items":{"type":"string"},"type":"array"},"channels":{"description":"Channels associated with the account.","items":{"$ref":"#/components/schemas/Channel"},"nullable":true,"type":"array"},"created_at":{"description":"The creation time of the account.","format":"date-time","type":"string"},"crm_settings":{"$ref":"#/components/schemas/CRMSettings"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom fields associated with the account.","nullable":true,"type":"object"},"domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"domains":{"description":"The list of domains associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"nullable":true,"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"},"latest_vendor_activity_time":{"description":"The time of the latest vendor activity.","type":"string"},"logo_url":{"description":"The logo URL of the account.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner":{"allOf":[{"$ref":"#/components/schemas/MiniUser"}],"nullable":true},"parent_account_id":{"description":"The ID of this account's parent account, or null if it has no parent.","nullable":true,"type":"string"},"primary_domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"subaccount_ids":{"description":"The IDs of the subaccounts belonging to this account.","items":{"type":"string"},"nullable":true,"type":"array"},"tags":{"description":"Tags associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"type":{"description":"The type of the account.\n\nKnown values: `customer`, `internal`, `community`, `partner`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"The time the account was last updated.","format":"date-time","type":"string"}},"required":["created_at","id","is_disabled","latest_customer_activity_time","latest_vendor_activity_time","logo_url","name","type","updated_at"],"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"}},"required":["id","source"],"type":"object"},"MiniUser":{"properties":{"email":{"description":"The email of the user.","type":"string"},"id":{"description":"The ID of the user.","type":"string"}},"required":["id"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"CreateAccountResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/accounts":{"post":{"description":"Creates a new account with the specified name and optional metadata.\n\n**Rate limit:** 300 requests per minute","operationId":"CreateAccount","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/CreateAccountResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Create a new account","tags":["accounts"]}}}}
```

## Update multiple accounts

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

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.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\".","enum":["customer","partner"],"type":"string"},"custom_fields":{"description":"An array of custom fields to be updated on the accounts.","items":{"$ref":"#/components/schemas/CustomFieldValue"},"type":"array"},"is_disabled":{"description":"Whether the accounts are disabled.","type":"boolean"},"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":{"default":"replace","description":"The mode for applying tags. Valid values: \"append_only\", \"remove_only\", \"replace\". Defaults to \"replace\".","enum":["append_only","remove_only","replace"],"type":"string"}},"required":["account_ids"],"type":"object"},"CustomFieldValue":{"description":"A custom field value to set. Custom fields not listed in a write request are left unchanged.","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. If the custom field is a date or datetime field, the value must be an RFC3339 timestamp, such as 2026-01-31T00:00:00Z.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). Replaces the full selection; it does not add to or remove from the existing values. 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"}},"title":"CustomFieldValue","type":"object"},"UpdateAccountsResponseBody":{"properties":{"request_id":{"description":"The request ID for tracking.","type":"string"},"success":{"description":"Whether the update was successfully initiated.","type":"boolean"}},"required":["request_id","success"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"UpdateAccountsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountsResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/accounts":{"patch":{"description":"Updates multiple accounts in a single request. Only provided fields are modified.\n\n**Rate limit:** 120 requests per minute","operationId":"UpdateAccounts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/UpdateAccountsResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Update multiple accounts","tags":["accounts"]}}}}
```

## Get an account by its ID or external ID

> Returns a single account by ID or external ID.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetAccountResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetAccountResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Account"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"Account":{"properties":{"associated_account_ids":{"description":"The IDs of accounts associated with this partner that the caller can read. Present only for partner accounts; an empty array indicates no visible associated accounts.","items":{"type":"string"},"type":"array"},"channels":{"description":"Channels associated with the account.","items":{"$ref":"#/components/schemas/Channel"},"nullable":true,"type":"array"},"created_at":{"description":"The creation time of the account.","format":"date-time","type":"string"},"crm_settings":{"$ref":"#/components/schemas/CRMSettings"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom fields associated with the account.","nullable":true,"type":"object"},"domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"domains":{"description":"The list of domains associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"nullable":true,"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"},"latest_vendor_activity_time":{"description":"The time of the latest vendor activity.","type":"string"},"logo_url":{"description":"The logo URL of the account.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner":{"allOf":[{"$ref":"#/components/schemas/MiniUser"}],"nullable":true},"parent_account_id":{"description":"The ID of this account's parent account, or null if it has no parent.","nullable":true,"type":"string"},"primary_domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"subaccount_ids":{"description":"The IDs of the subaccounts belonging to this account.","items":{"type":"string"},"nullable":true,"type":"array"},"tags":{"description":"Tags associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"type":{"description":"The type of the account.\n\nKnown values: `customer`, `internal`, `community`, `partner`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"The time the account was last updated.","format":"date-time","type":"string"}},"required":["created_at","id","is_disabled","latest_customer_activity_time","latest_vendor_activity_time","logo_url","name","type","updated_at"],"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. On account create or update, it is saved only for channels from a custom issue source and ignored for all other sources.","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 channel source. This can be any supported integration source, or a custom issue source's slug or ID. A custom issue source ID is stored and returned as the source's slug.","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 channel source. This can be any supported integration source.","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"}},"required":["id","source"],"type":"object"},"CustomFieldValue":{"description":"A custom field value to set. Custom fields not listed in a write request are left unchanged.","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. If the custom field is a date or datetime field, the value must be an RFC3339 timestamp, such as 2026-01-31T00:00:00Z.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). Replaces the full selection; it does not add to or remove from the existing values. 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"}},"title":"CustomFieldValue","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"}},"required":["id"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts/{id}":{"get":{"description":"Returns a single account by ID or external ID.\n\n**Rate limit:** 300 requests per minute","operationId":"GetAccount","parameters":[{"description":"The ID or external ID of the account to fetch.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/GetAccountResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get an account by its ID or external ID","tags":["accounts"]}}}}
```

## Update an existing account

> Updates an existing account by ID or external ID. Only provided fields are modified.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"UpdateAccountRequestBody":{"properties":{"account_type":{"description":"The type of the account. Can only be changed to \"customer\" or \"partner\".","enum":["customer","partner"],"type":"string"},"channels":{"description":"An array of channels to be linked to this account. If provided, replaces the account's linked channels; channels you leave out are unlinked.","items":{"$ref":"#/components/schemas/Channel"},"type":"array"},"custom_fields":{"description":"An array of custom fields to be used on this account.","items":{"$ref":"#/components/schemas/CustomFieldValue"},"type":"array"},"domains":{"description":"Domains of the account. Replaces the account's domains. Must specify one domain as primary.","items":{"type":"string"},"type":"array"},"external_ids":{"description":"An array of external IDs to be used on this account. If provided, the account's external IDs will be updated to the given external IDs.","items":{"$ref":"#/components/schemas/ExternalID"},"type":"array"},"is_disabled":{"description":"Whether the account is disabled.","type":"boolean"},"logo_url":{"description":"Logo URL of the account.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner_id":{"description":"The ID of the owner of the account. If empty string is passed in, the owner will be removed.","type":"string"},"primary_domain":{"description":"Must be in the list of domains. If there are any domains, there must be exactly one primary domain.","type":"string"},"subaccount_ids":{"description":"An array of account IDs to set as this account's subaccounts. If provided, the account's subaccounts become exactly this list; accounts you leave out are detached.","items":{"type":"string"},"type":"array"},"tags":{"description":"An array of strings to use as tags on this account, applied according to tags_apply_mode. By default the account's tags will be updated to the given tags.","items":{"type":"string"},"type":"array"},"tags_apply_mode":{"default":"replace","description":"The mode for applying tags. Valid values: \"append_only\", \"remove_only\", \"replace\". Defaults to \"replace\".","enum":["append_only","remove_only","replace"],"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. On account create or update, it is saved only for channels from a custom issue source and ignored for all other sources.","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 channel source. This can be any supported integration source, or a custom issue source's slug or ID. A custom issue source ID is stored and returned as the source's slug.","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 channel source. This can be any supported integration source.","type":"string"}},"type":"object"},"CustomFieldValue":{"description":"A custom field value to set. Custom fields not listed in a write request are left unchanged.","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. If the custom field is a date or datetime field, the value must be an RFC3339 timestamp, such as 2026-01-31T00:00:00Z.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). Replaces the full selection; it does not add to or remove from the existing values. 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"}},"title":"CustomFieldValue","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"},"UpdateAccountResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Account"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"Account":{"properties":{"associated_account_ids":{"description":"The IDs of accounts associated with this partner that the caller can read. Present only for partner accounts; an empty array indicates no visible associated accounts.","items":{"type":"string"},"type":"array"},"channels":{"description":"Channels associated with the account.","items":{"$ref":"#/components/schemas/Channel"},"nullable":true,"type":"array"},"created_at":{"description":"The creation time of the account.","format":"date-time","type":"string"},"crm_settings":{"$ref":"#/components/schemas/CRMSettings"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom fields associated with the account.","nullable":true,"type":"object"},"domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"domains":{"description":"The list of domains associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"nullable":true,"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"},"latest_vendor_activity_time":{"description":"The time of the latest vendor activity.","type":"string"},"logo_url":{"description":"The logo URL of the account.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner":{"allOf":[{"$ref":"#/components/schemas/MiniUser"}],"nullable":true},"parent_account_id":{"description":"The ID of this account's parent account, or null if it has no parent.","nullable":true,"type":"string"},"primary_domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"subaccount_ids":{"description":"The IDs of the subaccounts belonging to this account.","items":{"type":"string"},"nullable":true,"type":"array"},"tags":{"description":"Tags associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"type":{"description":"The type of the account.\n\nKnown values: `customer`, `internal`, `community`, `partner`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"The time the account was last updated.","format":"date-time","type":"string"}},"required":["created_at","id","is_disabled","latest_customer_activity_time","latest_vendor_activity_time","logo_url","name","type","updated_at"],"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"}},"required":["id","source"],"type":"object"},"MiniUser":{"properties":{"email":{"description":"The email of the user.","type":"string"},"id":{"description":"The ID of the user.","type":"string"}},"required":["id"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"UpdateAccountResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/accounts/{id}":{"patch":{"description":"Updates an existing account by ID or external ID. Only provided fields are modified.\n\n**Rate limit:** 300 requests per minute","operationId":"UpdateAccount","parameters":[{"description":"The ID or external ID of the account to update.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountRequestBody"}}}},"responses":{"200":{"$ref":"#/components/responses/UpdateAccountResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Update an existing account","tags":["accounts"]}}}}
```

## Delete an existing account

> Permanently deletes an account by ID or external ID.\
> \
> \*\*Rate limit:\*\* 30 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"DeleteAccountResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountResponseBody"}}},"description":""},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"DeleteAccountResponseBody":{"properties":{"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts/{id}":{"delete":{"description":"Permanently deletes an account by ID or external ID.\n\n**Rate limit:** 30 requests per minute","operationId":"DeleteAccount","parameters":[{"description":"The ID or external ID of the account to delete.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/DeleteAccountResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Delete an existing account","tags":["accounts"]}}}}
```

## Search for accounts by a given filter

> Optionally pass \`search\_text\` for fuzzy matching. Results are intersected with any provided filter.\
> \
> Filterable fields and their allowed operators:\
> \
> Field | Allowed operators |\
> \--- | --- |\
> \`account\_id\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`is\_set\`, \`is\_unset\` |\
> \`created\_at\` | \`time\_is\_after\`, \`time\_is\_before\`, \`time\_range\`, \`time\_is\_in\_last\`, \`time\_is\_not\_in\_last\` |\
> \`domains\` | \`equals\`, \`contains\`, \`does\_not\_contain\`, \`in\`, \`not\_in\`, \`string\_contains\`, \`string\_does\_not\_contain\` |\
> \`external\_channel\_ids\` | \`equals\`, \`contains\`, \`does\_not\_contain\`, \`in\`, \`not\_in\` |\
> \`external\_channel\_type\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`is\_set\`, \`is\_unset\` |\
> \`external\_ids\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`is\_set\`, \`is\_unset\` |\
> \`internal\_channel\_ids\` | \`equals\`, \`contains\`, \`does\_not\_contain\`, \`in\`, \`not\_in\` |\
> \`internal\_slack\_channel\_id\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`string\_contains\`, \`string\_does\_not\_contain\` |\
> \`internal\_slack\_channel\_name\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`string\_contains\`, \`string\_does\_not\_contain\` |\
> \`issue\_count\_last\_90\_days\` | \`equals\` |\
> \`last\_broadcast\_sent\_at\` | \`time\_is\_after\`, \`time\_is\_before\`, \`time\_range\`, \`time\_is\_in\_last\`, \`time\_is\_not\_in\_last\` |\
> \`last\_customer\_activity\_at\` | \`time\_is\_after\`, \`time\_is\_before\`, \`time\_range\`, \`time\_is\_in\_last\`, \`time\_is\_not\_in\_last\` |\
> \`last\_vendor\_activity\_at\` | \`time\_is\_after\`, \`time\_is\_before\`, \`time\_range\`, \`time\_is\_in\_last\`, \`time\_is\_not\_in\_last\` |\
> \`name\` | \`equals\`, \`in\`, \`not\_in\`, \`string\_contains\`, \`contains\`, \`does\_not\_contain\` |\
> \`number\_of\_users\_in\_channel\` | \`equals\` |\
> \`owner\_id\` | \`equals\`, \`in\`, \`not\_in\`, \`is\_set\`, \`is\_unset\`, \`belongs\_to\`, \`not\_belongs\_to\`, \`does\_not\_contain\` |\
> \`parent\_account\_id\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`is\_set\`, \`is\_unset\` |\
> \`partner\_account\_id\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`is\_set\`, \`is\_unset\` |\
> \`primary\_channel\_id\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\` |\
> \`primary\_domain\` | \`equals\`, \`contains\`, \`does\_not\_contain\`, \`in\`, \`not\_in\`, \`string\_contains\`, \`string\_does\_not\_contain\`, \`is\_set\`, \`is\_unset\` |\
> \`slack\_channel\_id\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`string\_contains\`, \`string\_does\_not\_contain\` |\
> \`slack\_channel\_name\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\`, \`string\_contains\`, \`string\_does\_not\_contain\` |\
> \`source\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\` |\
> \`state\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\` |\
> \`tags\` | \`equals\`, \`contains\`, \`does\_not\_contain\`, \`in\`, \`not\_in\` |\
> \`type\` | \`equals\`, \`in\`, \`not\_in\`, \`does\_not\_contain\` |\
> \
> \### Filter syntax and operators\
> \
> See \[Search filters]\(<https://docs.usepylon.com/pylon-docs/developer/api/conventions#search-filters>) for filter structure and operator definitions. The table above lists the operators supported by each field.\
> \
> \### Filter values\
> \
> Timestamp values use RFC 3339 format, such as \`2026-10-01T00:00:00Z\`.\
> \
> Field | Values and behavior |\
> \--- | --- |\
> \`state\` | \`enabled\` or \`disabled\`. |\
> \`name\` | \`contains\` is an alias for \`string\_contains\`. |\
> \`account\_id\` | \`id\` is also accepted as a field name. |\
> \`tags\` | A tag name or ID. |\
> \
> \### Custom fields\
> \
> Set \`field\` to the custom field's slug. If a custom field has the same slug as a built-in field, the custom field is matched instead, except for these fields:\
> \
> \- \`account\_id\`\
> \- \`domains\`\
> \- \`tags\`\
> \- \`name\`\
> \- \`external\_ids\`\
> \- \`owner\_id\`\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"SearchAccountsRequest":{"properties":{"cursor":{"description":"The cursor to use for pagination.","type":"string"},"filter":{"$ref":"#/components/schemas/Filter"},"limit":{"description":"The number of accounts to fetch. Defaults to 100. Must be between 1 and 1000.","format":"int64","type":"integer"},"search_text":{"description":"Fuzzy text search. Results are intersected with any provided filter.","type":"string"},"sort":{"description":"The order of results, as a list of sort keys. Only one sort key is supported right now. Omit for the default order. Send the same sort with every page of a cursor.","items":{"$ref":"#/components/schemas/SearchAccountsSort"},"maxItems":1,"type":"array"}},"type":"object"},"Filter":{"properties":{"field":{"description":"The field for this filter.  For allowed fields, see the documentation for\nthe specific endpoint you are using.\nFor non-compound filters (any operators other than \"and\", \"or\", or \"not\"),\nfield must be set, along with either value or values, depending on the operator.","type":"string"},"operator":{"description":"The operator for this filter. Required unless related_object is set.","enum":["equals","not_equals","contains","does_not_contain","in","not_in","and","or","not","time_is_after","time_is_before","time_range","string_contains","string_does_not_contain","is_set","is_unset","greater_than","less_than","greater_than_or_equals","less_than_or_equals","includes_all_of","starts_with","ends_with","time_is_in_last","time_is_not_in_last","time_is_in_next","time_is_not_in_next","includes_exactly","belongs_to","not_belongs_to"],"type":"string"},"related_object":{"$ref":"#/components/schemas/FilterRelatedObject"},"subfilters":{"description":"Sub-filters for this filter.  Valid only when operator is \"and\", \"or\", or \"not\"; \"not\"\ntakes exactly one subfilter.\nThe maximum allowed depth for a tree of filters is 5, counting the top-level filter.","items":{"$ref":"#/components/schemas/Filter"},"type":"array"},"value":{"description":"The value for this filter. Used by single-valued operators: \"equals\", \"not_equals\",\n\"contains\", \"does_not_contain\", \"string_contains\", \"string_does_not_contain\",\n\"starts_with\", \"ends_with\", \"time_is_after\", \"time_is_before\", \"time_is_in_last\",\n\"time_is_not_in_last\", \"time_is_in_next\", \"time_is_not_in_next\", \"greater_than\",\n\"less_than\", \"greater_than_or_equals\", and \"less_than_or_equals\".\nOn fields that hold user IDs, \"current_user\" means the API token's user; on fields that\nhold team IDs, \"my_teams\" means that user's teams. The same applies to values.","type":"string"},"values":{"description":"The values for this filter. Used by multi-valued operators: \"in\", \"not_in\", \"includes_all_of\",\n\"includes_exactly\", \"belongs_to\", and \"not_belongs_to\". For \"time_range\", set to [start, end].","items":{"type":"string"},"type":"array"}},"type":"object"},"FilterRelatedObject":{"properties":{"custom_field":{"description":"The slug of a relationship custom field to follow. Returned when reading stored filters,\nsuch as ticket form conditions; search filters don't accept it yet.","type":"string"},"filter":{"$ref":"#/components/schemas/Filter"},"relationship":{"description":"The built-in relationship to follow, such as \"account\". Each search endpoint lists the\nrelationships its filter accepts. Exactly one of relationship and custom_field is set.","type":"string"}},"required":["filter"],"type":"object"},"SearchAccountsSort":{"properties":{"field":{"description":"The field to sort by.","enum":["name","created_at","last_customer_activity_at","last_vendor_activity_at","issue_count_last_90_days"],"type":"string"},"order":{"description":"The sort direction. Defaults to desc.","enum":["asc","desc"],"type":"string"}},"required":["field"],"type":"object"},"SearchAccountsResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/Account"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"Account":{"properties":{"associated_account_ids":{"description":"The IDs of accounts associated with this partner that the caller can read. Present only for partner accounts; an empty array indicates no visible associated accounts.","items":{"type":"string"},"type":"array"},"channels":{"description":"Channels associated with the account.","items":{"$ref":"#/components/schemas/Channel"},"nullable":true,"type":"array"},"created_at":{"description":"The creation time of the account.","format":"date-time","type":"string"},"crm_settings":{"$ref":"#/components/schemas/CRMSettings"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom fields associated with the account.","nullable":true,"type":"object"},"domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"domains":{"description":"The list of domains associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"nullable":true,"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"},"latest_vendor_activity_time":{"description":"The time of the latest vendor activity.","type":"string"},"logo_url":{"description":"The logo URL of the account.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner":{"allOf":[{"$ref":"#/components/schemas/MiniUser"}],"nullable":true},"parent_account_id":{"description":"The ID of this account's parent account, or null if it has no parent.","nullable":true,"type":"string"},"primary_domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"subaccount_ids":{"description":"The IDs of the subaccounts belonging to this account.","items":{"type":"string"},"nullable":true,"type":"array"},"tags":{"description":"Tags associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"type":{"description":"The type of the account.\n\nKnown values: `customer`, `internal`, `community`, `partner`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"The time the account was last updated.","format":"date-time","type":"string"}},"required":["created_at","id","is_disabled","latest_customer_activity_time","latest_vendor_activity_time","logo_url","name","type","updated_at"],"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. On account create or update, it is saved only for channels from a custom issue source and ignored for all other sources.","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 channel source. This can be any supported integration source, or a custom issue source's slug or ID. A custom issue source ID is stored and returned as the source's slug.","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 channel source. This can be any supported integration source.","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"}},"required":["id","source"],"type":"object"},"CustomFieldValue":{"description":"A custom field value to set. Custom fields not listed in a write request are left unchanged.","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. If the custom field is a date or datetime field, the value must be an RFC3339 timestamp, such as 2026-01-31T00:00:00Z.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). Replaces the full selection; it does not add to or remove from the existing values. 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"}},"title":"CustomFieldValue","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"}},"required":["id"],"type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"SearchAccountsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchAccountsResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/accounts/search":{"post":{"description":"Optionally pass `search_text` for fuzzy matching. Results are intersected with any provided filter.\n\nFilterable fields and their allowed operators:\n\nField | Allowed operators |\n--- | --- |\n`account_id` | `equals`, `in`, `not_in`, `does_not_contain`, `is_set`, `is_unset` |\n`created_at` | `time_is_after`, `time_is_before`, `time_range`, `time_is_in_last`, `time_is_not_in_last` |\n`domains` | `equals`, `contains`, `does_not_contain`, `in`, `not_in`, `string_contains`, `string_does_not_contain` |\n`external_channel_ids` | `equals`, `contains`, `does_not_contain`, `in`, `not_in` |\n`external_channel_type` | `equals`, `in`, `not_in`, `does_not_contain`, `is_set`, `is_unset` |\n`external_ids` | `equals`, `in`, `not_in`, `does_not_contain`, `is_set`, `is_unset` |\n`internal_channel_ids` | `equals`, `contains`, `does_not_contain`, `in`, `not_in` |\n`internal_slack_channel_id` | `equals`, `in`, `not_in`, `does_not_contain`, `string_contains`, `string_does_not_contain` |\n`internal_slack_channel_name` | `equals`, `in`, `not_in`, `does_not_contain`, `string_contains`, `string_does_not_contain` |\n`issue_count_last_90_days` | `equals` |\n`last_broadcast_sent_at` | `time_is_after`, `time_is_before`, `time_range`, `time_is_in_last`, `time_is_not_in_last` |\n`last_customer_activity_at` | `time_is_after`, `time_is_before`, `time_range`, `time_is_in_last`, `time_is_not_in_last` |\n`last_vendor_activity_at` | `time_is_after`, `time_is_before`, `time_range`, `time_is_in_last`, `time_is_not_in_last` |\n`name` | `equals`, `in`, `not_in`, `string_contains`, `contains`, `does_not_contain` |\n`number_of_users_in_channel` | `equals` |\n`owner_id` | `equals`, `in`, `not_in`, `is_set`, `is_unset`, `belongs_to`, `not_belongs_to`, `does_not_contain` |\n`parent_account_id` | `equals`, `in`, `not_in`, `does_not_contain`, `is_set`, `is_unset` |\n`partner_account_id` | `equals`, `in`, `not_in`, `does_not_contain`, `is_set`, `is_unset` |\n`primary_channel_id` | `equals`, `in`, `not_in`, `does_not_contain` |\n`primary_domain` | `equals`, `contains`, `does_not_contain`, `in`, `not_in`, `string_contains`, `string_does_not_contain`, `is_set`, `is_unset` |\n`slack_channel_id` | `equals`, `in`, `not_in`, `does_not_contain`, `string_contains`, `string_does_not_contain` |\n`slack_channel_name` | `equals`, `in`, `not_in`, `does_not_contain`, `string_contains`, `string_does_not_contain` |\n`source` | `equals`, `in`, `not_in`, `does_not_contain` |\n`state` | `equals`, `in`, `not_in`, `does_not_contain` |\n`tags` | `equals`, `contains`, `does_not_contain`, `in`, `not_in` |\n`type` | `equals`, `in`, `not_in`, `does_not_contain` |\n\n### Filter syntax and operators\n\nSee [Search filters](https://docs.usepylon.com/pylon-docs/developer/api/conventions#search-filters) for filter structure and operator definitions. The table above lists the operators supported by each field.\n\n### Filter values\n\nTimestamp values use RFC 3339 format, such as `2026-10-01T00:00:00Z`.\n\nField | Values and behavior |\n--- | --- |\n`state` | `enabled` or `disabled`. |\n`name` | `contains` is an alias for `string_contains`. |\n`account_id` | `id` is also accepted as a field name. |\n`tags` | A tag name or ID. |\n\n### Custom fields\n\nSet `field` to the custom field's slug. If a custom field has the same slug as a built-in field, the custom field is matched instead, except for these fields:\n\n- `account_id`\n- `domains`\n- `tags`\n- `name`\n- `external_ids`\n- `owner_id`\n\n**Rate limit:** 120 requests per minute","operationId":"SearchAccounts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchAccountsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/SearchAccountsResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Search for accounts by a given filter","tags":["accounts"]}}}}
```

## 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:\*\* 30 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.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"}},"required":["data","request_id"],"type":"object"},"Account":{"properties":{"associated_account_ids":{"description":"The IDs of accounts associated with this partner that the caller can read. Present only for partner accounts; an empty array indicates no visible associated accounts.","items":{"type":"string"},"type":"array"},"channels":{"description":"Channels associated with the account.","items":{"$ref":"#/components/schemas/Channel"},"nullable":true,"type":"array"},"created_at":{"description":"The creation time of the account.","format":"date-time","type":"string"},"crm_settings":{"$ref":"#/components/schemas/CRMSettings"},"custom_fields":{"additionalProperties":{"$ref":"#/components/schemas/CustomFieldValue"},"description":"Custom fields associated with the account.","nullable":true,"type":"object"},"domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"domains":{"description":"The list of domains associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"external_ids":{"description":"External IDs associated with the account.","items":{"$ref":"#/components/schemas/ExternalID"},"nullable":true,"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"},"latest_vendor_activity_time":{"description":"The time of the latest vendor activity.","type":"string"},"logo_url":{"description":"The logo URL of the account.","type":"string"},"name":{"description":"The name of the account.","type":"string"},"owner":{"allOf":[{"$ref":"#/components/schemas/MiniUser"}],"nullable":true},"parent_account_id":{"description":"The ID of this account's parent account, or null if it has no parent.","nullable":true,"type":"string"},"primary_domain":{"description":"The primary domain of the account.","nullable":true,"type":"string"},"subaccount_ids":{"description":"The IDs of the subaccounts belonging to this account.","items":{"type":"string"},"nullable":true,"type":"array"},"tags":{"description":"Tags associated with the account.","items":{"type":"string"},"nullable":true,"type":"array"},"type":{"description":"The type of the account.\n\nKnown values: `customer`, `internal`, `community`, `partner`. This list is not exhaustive.","type":"string"},"updated_at":{"description":"The time the account was last updated.","format":"date-time","type":"string"}},"required":["created_at","id","is_disabled","latest_customer_activity_time","latest_vendor_activity_time","logo_url","name","type","updated_at"],"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. On account create or update, it is saved only for channels from a custom issue source and ignored for all other sources.","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 channel source. This can be any supported integration source, or a custom issue source's slug or ID. A custom issue source ID is stored and returned as the source's slug.","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 channel source. This can be any supported integration source.","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"}},"required":["id","source"],"type":"object"},"CustomFieldValue":{"description":"A custom field value to set. Custom fields not listed in a write request are left unchanged.","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. If the custom field is a date or datetime field, the value must be an RFC3339 timestamp, such as 2026-01-31T00:00:00Z.","type":"string"},"values":{"description":"The values of the custom field. Only to be used for multi-valued custom fields (ex. multiselect). Replaces the full selection; it does not add to or remove from the existing values. 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"}},"title":"CustomFieldValue","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"}},"required":["id"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"MergeAccountsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeAccountsResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"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:** 30 requests per minute","operationId":"MergeAccounts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeAccountsRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/MergeAccountsResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Merge accounts","tags":["accounts"]}}}}
```

## Get account relationships

> Returns the parent-child and partner-client relationships where the account is the child or client.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetAccountRelationshipsResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountRelationshipsResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetAccountRelationshipsResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/AccountRelationship"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"AccountRelationship":{"properties":{"child_account_id":{"description":"The ID of the account on the child or client side of the relationship.","type":"string"},"created_at":{"description":"The creation time of the relationship.","format":"date-time","type":"string"},"id":{"description":"The ID of the relationship.","type":"string"},"parent_account_id":{"description":"The ID of the account on the parent or partner side of the relationship.","type":"string"},"related_object_id":{"description":"The ID of the related parent or partner account.","type":"string"},"relationship_type":{"description":"The relationship type. One of \"parent_account\" or \"partner_account\".","type":"string"},"updated_at":{"description":"The time the relationship was last updated.","format":"date-time","type":"string"}},"required":["child_account_id","created_at","id","parent_account_id","related_object_id","relationship_type","updated_at"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts/{account_id}/relationships":{"get":{"description":"Returns the parent-child and partner-client relationships where the account is the child or client.\n\n**Rate limit:** 300 requests per minute","operationId":"GetAccountRelationships","parameters":[{"description":"The ID of the child or client account whose relationships should be returned.","in":"path","name":"account_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/GetAccountRelationshipsResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get account relationships","tags":["accounts"]}}}}
```

## Create an account relationship

> Creates a parent or partner relationship for the account in the URL.\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"CreateAccountRelationshipRequest":{"properties":{"related_object_id":{"description":"The ID of the related parent or partner account.","type":"string"},"relationship_type":{"description":"The relationship type. Must be \"parent_account\" or \"partner_account\".","type":"string"}},"required":["related_object_id","relationship_type"],"type":"object"},"CreateAccountRelationshipResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/AccountRelationship"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"AccountRelationship":{"properties":{"child_account_id":{"description":"The ID of the account on the child or client side of the relationship.","type":"string"},"created_at":{"description":"The creation time of the relationship.","format":"date-time","type":"string"},"id":{"description":"The ID of the relationship.","type":"string"},"parent_account_id":{"description":"The ID of the account on the parent or partner side of the relationship.","type":"string"},"related_object_id":{"description":"The ID of the related parent or partner account.","type":"string"},"relationship_type":{"description":"The relationship type. One of \"parent_account\" or \"partner_account\".","type":"string"},"updated_at":{"description":"The time the relationship was last updated.","format":"date-time","type":"string"}},"required":["child_account_id","created_at","id","parent_account_id","related_object_id","relationship_type","updated_at"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"CreateAccountRelationshipResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRelationshipResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/accounts/{account_id}/relationship":{"post":{"description":"Creates a parent or partner relationship for the account in the URL.\n\n**Rate limit:** 120 requests per minute","operationId":"CreateAccountRelationship","parameters":[{"description":"The ID of the child or client account.","in":"path","name":"account_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRelationshipRequest"}}}},"responses":{"200":{"$ref":"#/components/responses/CreateAccountRelationshipResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Create an account relationship","tags":["accounts"]}}}}
```

## Delete an account relationship

> Deletes an account relationship by ID.\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"DeleteAccountRelationshipResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRelationshipResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"DeleteAccountRelationshipResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/AccountRelationship"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"AccountRelationship":{"properties":{"child_account_id":{"description":"The ID of the account on the child or client side of the relationship.","type":"string"},"created_at":{"description":"The creation time of the relationship.","format":"date-time","type":"string"},"id":{"description":"The ID of the relationship.","type":"string"},"parent_account_id":{"description":"The ID of the account on the parent or partner side of the relationship.","type":"string"},"related_object_id":{"description":"The ID of the related parent or partner account.","type":"string"},"relationship_type":{"description":"The relationship type. One of \"parent_account\" or \"partner_account\".","type":"string"},"updated_at":{"description":"The time the relationship was last updated.","format":"date-time","type":"string"}},"required":["child_account_id","created_at","id","parent_account_id","related_object_id","relationship_type","updated_at"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts/{account_id}/relationships/{relationship_id}":{"delete":{"description":"Deletes an account relationship by ID.\n\n**Rate limit:** 120 requests per minute","operationId":"DeleteAccountRelationship","parameters":[{"description":"The ID of the child or client account.","in":"path","name":"account_id","required":true,"schema":{"type":"string"}},{"description":"The ID of the account relationship to delete.","in":"path","name":"relationship_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/DeleteAccountRelationshipResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Delete an account relationship","tags":["accounts"]}}}}
```

## Append a note to an account notebook block

> Creates a note in a specific Notes block in an account notebook.\
> \
> \*\*Rate limit:\*\* 120 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"schemas":{"CreateAccountNotebookNoteRequestBody":{"properties":{"content_html":{"description":"The note body as HTML.","type":"string"},"title":{"description":"An optional title for the note.","type":"string"}},"required":["content_html"],"type":"object"},"CreateAccountNotebookNoteResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/AccountNotebookNote"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"AccountNotebookNote":{"properties":{"account_id":{"description":"The ID of the account that the note belongs to.","type":"string"},"block_id":{"description":"The ID of the notebook block that contains the note.","type":"string"},"content_html":{"description":"The HTML content of the note.","type":"string"},"created_at":{"description":"The creation time of the note in RFC3339 format.","format":"date-time","type":"string"},"created_by_user_id":{"description":"The ID of the user who created the note, if available.","type":"string"},"id":{"description":"The ID of the note.","type":"string"},"title":{"description":"The optional title of the note.","type":"string"},"updated_at":{"description":"The last update time of the note in RFC3339 format.","format":"date-time","type":"string"}},"required":["account_id","block_id","content_html","created_at","id","updated_at"],"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}},"responses":{"CreateAccountNotebookNoteResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountNotebookNoteResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}}},"paths":{"/accounts/{account_id}/notebook-blocks/{block_id}/notes":{"post":{"description":"Creates a note in a specific Notes block in an account notebook.\n\n**Rate limit:** 120 requests per minute","operationId":"CreateAccountNotebookNote","parameters":[{"description":"The ID or external ID of the account.","in":"path","name":"account_id","required":true,"schema":{"type":"string"}},{"description":"The ID of the Notes block, copied from the notebook UI.","in":"path","name":"block_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountNotebookNoteRequestBody"}}}},"responses":{"200":{"$ref":"#/components/responses/CreateAccountNotebookNoteResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Append a note to an account notebook block","tags":["accounts"]}}}}
```

## Get notes from an account notebook block

> Returns notes from a specific Notes block in an account notebook.\
> \
> \*\*Rate limit:\*\* 300 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"tags":[],"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"GetAccountNotebookNotesResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAccountNotebookNotesResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"UnauthorizedApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request could not be authenticated for this API."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"ErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":""},"TooManyRequestsApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request exceeded the applicable rate limit.","headers":{"Retry-After":{"description":"Seconds until the next request to this endpoint is permitted.","schema":{"format":"int64","type":"integer"}},"X-Retry-After":{"description":"Seconds until the full per-minute allowance is restored. Capacity returns gradually before then.","schema":{"format":"int64","type":"integer"}}}},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"GetAccountNotebookNotesResponseBody":{"properties":{"data":{"description":"The data payload of the response.","items":{"$ref":"#/components/schemas/AccountNotebookNote"},"type":"array"},"pagination":{"$ref":"#/components/schemas/Pagination"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["data","request_id"],"type":"object"},"AccountNotebookNote":{"properties":{"account_id":{"description":"The ID of the account that the note belongs to.","type":"string"},"block_id":{"description":"The ID of the notebook block that contains the note.","type":"string"},"content_html":{"description":"The HTML content of the note.","type":"string"},"created_at":{"description":"The creation time of the note in RFC3339 format.","format":"date-time","type":"string"},"created_by_user_id":{"description":"The ID of the user who created the note, if available.","type":"string"},"id":{"description":"The ID of the note.","type":"string"},"title":{"description":"The optional title of the note.","type":"string"},"updated_at":{"description":"The last update time of the note in RFC3339 format.","format":"date-time","type":"string"}},"required":["account_id","block_id","content_html","created_at","id","updated_at"],"type":"object"},"Pagination":{"description":"Pagination information for list responses. Absent when there are no more results.","properties":{"cursor":{"description":"The cursor for the next page of results.","type":"string"},"has_next_page":{"description":"Indicates if there is a next page of results.","type":"boolean"}},"required":["cursor","has_next_page"],"title":"Pagination","type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.\n\nKnown values: `recipients_suppressed`, `email_bounced`, `internal_issue_reply_not_allowed`, `duplicate_object`, `invalid_authorization_header`, `invalid_api_token`, `invalid_oauth_token`, `wrong_region_token`, `organization_deactivated`, `organization_suspended`, `permission_denied`, `oauth_not_permitted`, `rate_limited`, `not_found`, `method_not_allowed`, `payload_too_large`, `invalid_request_body`, `internal_error`, `invalid_webhook_credentials`, `organization_inactive`, `invalid_filter`, `invalid_user_id`. This list is not exhaustive.","type":"string"},"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"},"filter_errors":{"description":"One entry per problem found in the request's filter. Present only when code is\n\"invalid_filter\"; errors carries the same messages as plain text.","items":{"$ref":"#/components/schemas/FilterError"},"type":"array"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"required":["request_id"],"type":"object"},"FilterError":{"properties":{"allowed":{"description":"What is accepted in place of the rejected field, operator, value, or relationship.\nLong lists are cut off after 100 entries.","items":{"type":"string"},"type":"array"},"code":{"description":"A stable machine-readable identifier for this problem.\n\nKnown values: `invalid_shape`, `too_deep`, `unknown_operator`, `unknown_field`, `operator_not_allowed`, `missing_value`, `unexpected_value`, `invalid_value`, `unknown_relationship`, `unsupported`. This list is not exhaustive.","type":"string"},"field":{"description":"The field of the filter at path, when it has one.","type":"string"},"message":{"description":"What is wrong and how to fix it.","type":"string"},"operator":{"description":"The operator of the filter at path, when it has one.","type":"string"},"path":{"description":"Where the problem is, as a JSONPath from the root of the filter, such as\n\"$.subfilters[1].related_object.filter\".","type":"string"},"suggestion":{"description":"The accepted entry closest to the rejected one, when one is close enough.","type":"string"}},"required":["code","message","path"],"type":"object"}}},"paths":{"/accounts/{account_id}/notebook-blocks/{block_id}/notes":{"get":{"description":"Returns notes from a specific Notes block in an account notebook.\n\n**Rate limit:** 300 requests per minute","operationId":"GetAccountNotebookNotes","parameters":[{"description":"The ID or external ID of the account.","in":"path","name":"account_id","required":true,"schema":{"type":"string"}},{"description":"The ID of the Notes block, copied from the notebook UI.","in":"path","name":"block_id","required":true,"schema":{"type":"string"}},{"description":"The cursor to use for pagination.","in":"query","name":"cursor","schema":{"type":"string"}},{"description":"The number of notes to fetch. Defaults to 20. Must be greater than 0 and less than or equal to 20.","in":"query","name":"limit","schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"$ref":"#/components/responses/GetAccountNotebookNotesResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"401":{"$ref":"#/components/responses/UnauthorizedApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"404":{"$ref":"#/components/responses/ErrorApiResponse"},"429":{"$ref":"#/components/responses/TooManyRequestsApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Get notes from an account notebook block","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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
