> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peec.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Brand Perception Attribute Clusters

> Rename, delete and reassign the project's brand-perception attribute clusters — the same edits the Manage attributes screen makes. The whole call is one transaction: if any edit is rejected nothing is applied, so a cluster can be emptied by reassignments and deleted in the same request. Edits apply in the order reassign, rename, delete regardless of how they are listed. Scores re-aggregate on the next read, so no new scraping run is needed. Naming one attribute or cluster twice in a call is rejected, since the two edits would race. Errors: 400 when a target is repeated, 404 when a cluster or attribute does not exist, 409 when a new label collides with another cluster or a deleted cluster still holds attributes.



## OpenAPI

````yaml https://api.peec.ai/customer/v1/openapi/json post /brand-perception/attribute-clusters/edit
openapi: 3.0.3
info:
  title: Peec AI Customer API
  description: Development documentation
  version: 1.0.0
  contact:
    name: Peec AI Team
    email: support@peec.ai
servers:
  - url: https://api.peec.ai/customer/v1
security: []
paths:
  /brand-perception/attribute-clusters/edit:
    post:
      tags:
        - Brand Perception
      summary: Edit Brand Perception Attribute Clusters
      description: >-
        Rename, delete and reassign the project's brand-perception attribute
        clusters — the same edits the Manage attributes screen makes. The whole
        call is one transaction: if any edit is rejected nothing is applied, so
        a cluster can be emptied by reassignments and deleted in the same
        request. Edits apply in the order reassign, rename, delete regardless of
        how they are listed. Scores re-aggregate on the next read, so no new
        scraping run is needed. Naming one attribute or cluster twice in a call
        is rejected, since the two edits would race. Errors: 400 when a target
        is repeated, 404 when a cluster or attribute does not exist, 409 when a
        new label collides with another cluster or a deleted cluster still holds
        attributes.
      operationId: postBrand-perceptionAttribute-clustersEdit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                renames:
                  description: Clusters to relabel.
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      cluster_id:
                        type: string
                        example: 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                        description: >-
                          Cluster to rename, from the attribute-clusters
                          listing.
                      name:
                        type: string
                        minLength: 1
                        maxLength: 120
                        example: Racing Heritage
                        description: >-
                          New label. Must be unique within the project,
                          case-insensitively.
                    required:
                      - cluster_id
                      - name
                delete_cluster_ids:
                  example:
                    - 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                  description: >-
                    Clusters to remove. A cluster must hold no attributes when
                    it is deleted — move them out in the same call.
                  maxItems: 50
                  type: array
                  items:
                    type: string
                reassignments:
                  description: Attributes to move into a different cluster.
                  maxItems: 200
                  type: array
                  items:
                    type: object
                    properties:
                      attribute:
                        type: string
                        minLength: 1
                        example: hand-built
                        description: >-
                          Extracted attribute to move, spelled exactly as the
                          listing returns it (in `members` or `unassigned`).
                      cluster_id:
                        type: string
                        example: 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                        description: Cluster the attribute moves into.
                    required:
                      - attribute
                      - cluster_id
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                renames:
                  description: Clusters to relabel.
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      cluster_id:
                        type: string
                        example: 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                        description: >-
                          Cluster to rename, from the attribute-clusters
                          listing.
                      name:
                        type: string
                        minLength: 1
                        maxLength: 120
                        example: Racing Heritage
                        description: >-
                          New label. Must be unique within the project,
                          case-insensitively.
                    required:
                      - cluster_id
                      - name
                delete_cluster_ids:
                  example:
                    - 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                  description: >-
                    Clusters to remove. A cluster must hold no attributes when
                    it is deleted — move them out in the same call.
                  maxItems: 50
                  type: array
                  items:
                    type: string
                reassignments:
                  description: Attributes to move into a different cluster.
                  maxItems: 200
                  type: array
                  items:
                    type: object
                    properties:
                      attribute:
                        type: string
                        minLength: 1
                        example: hand-built
                        description: >-
                          Extracted attribute to move, spelled exactly as the
                          listing returns it (in `members` or `unassigned`).
                      cluster_id:
                        type: string
                        example: 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                        description: Cluster the attribute moves into.
                    required:
                      - attribute
                      - cluster_id
          multipart/form-data:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                renames:
                  description: Clusters to relabel.
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      cluster_id:
                        type: string
                        example: 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                        description: >-
                          Cluster to rename, from the attribute-clusters
                          listing.
                      name:
                        type: string
                        minLength: 1
                        maxLength: 120
                        example: Racing Heritage
                        description: >-
                          New label. Must be unique within the project,
                          case-insensitively.
                    required:
                      - cluster_id
                      - name
                delete_cluster_ids:
                  example:
                    - 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                  description: >-
                    Clusters to remove. A cluster must hold no attributes when
                    it is deleted — move them out in the same call.
                  maxItems: 50
                  type: array
                  items:
                    type: string
                reassignments:
                  description: Attributes to move into a different cluster.
                  maxItems: 200
                  type: array
                  items:
                    type: object
                    properties:
                      attribute:
                        type: string
                        minLength: 1
                        example: hand-built
                        description: >-
                          Extracted attribute to move, spelled exactly as the
                          listing returns it (in `members` or `unassigned`).
                      cluster_id:
                        type: string
                        example: 0199a4c1-9f3e-7c21-9f0f-2c0a5d3b1e42
                        description: Cluster the attribute moves into.
                    required:
                      - attribute
                      - cluster_id
      responses:
        '200':
          description: >-
            Success — every edit in the call was applied. Counts echo what was
            requested.
          content:
            application/json:
              schema:
                type: object
                properties:
                  renamed_count:
                    type: number
                    example: 1
                  deleted_count:
                    type: number
                    example: 1
                  reassigned_count:
                    type: number
                    example: 3
                required:
                  - renamed_count
                  - deleted_count
                  - reassigned_count
                description: >-
                  Success — every edit in the call was applied. Counts echo what
                  was requested.
      security:
        - APIKeyHeader: []
        - APIKeyQuery: []
        - BearerAuth: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````