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

# Update a brand (PATCH)

> Same as `PUT /brands/{id}`. Needs a key with the `write` scope.



## OpenAPI

````yaml /api/openapi.json patch /brands/{id}
openapi: 3.1.0
info:
  title: ZeroRank REST API
  version: 1.0.0
  description: >-
    The public ZeroRank REST API. Every request uses a workspace API key (Bearer
    `zr_live_…`) and only ever sees that one workspace. Use it to read your
    results and manage your prompts, brands, tags, and topics from your own
    scripts and tools.
servers:
  - url: https://api.zerorank.ai/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Workspace
    description: The workspace, plan, and key behind your request.
  - name: Prompts
    description: The questions ZeroRank asks AI engines for you.
  - name: Brands
    description: The brands you track, including competitors.
  - name: Tags
    description: Labels you put on prompts.
  - name: Topics
    description: Groups you sort prompts into.
  - name: Analytics
    description: 'Read-only results: sources, chats, and rankings.'
paths:
  /brands/{id}:
    parameters:
      - $ref: '#/components/parameters/IdPath'
    patch:
      tags:
        - Brands
      summary: Update a brand (PATCH)
      description: Same as `PUT /brands/{id}`. Needs a key with the `write` scope.
      operationId: patchBrand
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrandUpdate'
      responses:
        '200':
          $ref: '#/components/responses/BrandOk'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    IdPath:
      name: id
      in: path
      required: true
      description: The numeric id of the item.
      schema:
        type: integer
  schemas:
    BrandUpdate:
      type: object
      description: Send only the fields you want to change.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
        trackedNames:
          type:
            - array
            - 'null'
          items:
            type: string
            minLength: 1
            maxLength: 255
          maxItems: 50
        nameRegex:
          type:
            - string
            - 'null'
          maxLength: 500
        useRegex:
          type: boolean
        domains:
          type:
            - array
            - 'null'
          items:
            type: string
            minLength: 1
            maxLength: 255
          maxItems: 20
        status:
          type: string
          enum:
            - active
            - hidden
        type:
          type: string
          enum:
            - own
            - competitor
        color:
          type:
            - string
            - 'null'
          pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
    Brand:
      type: object
      properties:
        id:
          type: integer
          example: 12
        name:
          type: string
          example: Acme
        trackedNames:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Other names that count as this brand.
        nameRegex:
          type:
            - string
            - 'null'
          description: Advanced matching pattern.
        useRegex:
          type: boolean
          example: false
        domains:
          type:
            - array
            - 'null'
          items:
            type: string
          example:
            - acme.com
        domain:
          type:
            - string
            - 'null'
          description: The first domain.
          example: acme.com
        logoUrl:
          type:
            - string
            - 'null'
        industry:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - active
            - hidden
          example: active
        type:
          type: string
          enum:
            - own
            - competitor
          description: '`own` is your brand; `competitor` is a rival.'
          example: own
        color:
          type:
            - string
            - 'null'
          example: '#FF4D00'
        relevancyScore:
          type: number
          example: 87
        relevancyCalculatedAt:
          type:
            - string
            - 'null'
          format: date-time
        workspaceId:
          type: integer
          example: 7
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: A human-readable explanation.
        code:
          type: string
          description: A short error code, when one applies.
        errors:
          description: Field-level details, on validation errors.
  responses:
    BrandOk:
      description: A brand.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: true
              data:
                $ref: '#/components/schemas/Brand'
              message:
                type: string
                example: Brand retrieved successfully
    Unauthorized:
      description: The API key is missing, invalid, revoked, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Invalid, revoked, or expired API key
            code: API_KEY_INVALID
    InsufficientScope:
      description: This key is read-only. A key with the `write` scope is required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: >-
              This API key is read-only; a key with the "write" scope is
              required
            code: INSUFFICIENT_SCOPE
    NotFound:
      description: The item was not found in your workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Prompt not found
    ValidationError:
      description: The request body did not pass validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: Validation failed
            errors:
              - field: text
                message: The text field is required
    RateLimited:
      description: >-
        Too many requests. Slow down and retry after the time in the
        `Retry-After` header.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Your per-minute limit.
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests left in this window.
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix time when the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            message: API rate limit exceeded. Please slow down.
            code: RATE_LIMIT_EXCEEDED
            retryAfter: 30
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your workspace API key as `Authorization: Bearer zr_live_…`.'

````