---
title: "Rename a competitor"
method: PATCH
path: "/api/admin/brand-competitors/{id}"
tags: ["Brand Competitors"]
---

# Rename a competitor

`PATCH /api/admin/brand-competitors/{id}`

## Request

- Base URL: `https://api.sponsorunited.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sponsorunited.com/api/admin/brand-competitors/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/sponsorunited/apis/sponsorunited-api/docs/api/admin/brand-competitors/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Changes the competitor name and keeps its decision. For a linked competitor the synonym written for the old name is removed (unless another competitor still links that name to the same brand, or the synonym was added by hand or by another pipeline), the new name is written as a synonym unless another brand already has it, and unlinked rows with the new name are removed. Renaming a scraped competitor marks it admin-added, so a re-scrape never removes it, and keeps the old name on record as removed by an admin, so a re-scrape does not add the old name back. Requires approve-company permission.

## Path parameters

- `id` integer, required

## Request body

- UpdateBrandCompetitorRequest
  - `raw_name` string, required: New competitor name.

## Response `200`

Competitor renamed.

- object
  - `data` BrandCompetitorResource
    - `id` integer
    - `source_brand_id` integer
    - `raw_name` string, nullable
    - `normalized_name` string, nullable
    - `raw_name_from_target_brand` boolean: True when raw_name was copied from the target brand name because the scraped name was not kept.
    - `linked` boolean: True when the competitor is linked to a SponsorUnited brand.
    - `target_brand` object, nullable
      - `id` integer
      - `name` string
      - `logo` string, nullable
    - `decision_source` 'auto_linked' | 'approved' | 'admin_added' | 'unlinked': admin_added: added by an admin. unlinked: scraped, no SponsorUnited brand. approved: scraped and linked, confirmed by an admin. auto_linked: scraped and linked by the matcher, not yet confirmed (a rejected link is listed here too).
    - `origin` 'scraped' | 'admin'
    - `decision` 'auto_linked' | 'approved' | 'rejected', nullable
    - `match_source` 'ems' | 'meilisearch' | 'brand_synonym' | 'none', nullable
    - `linked_by_parent_brand` boolean: True when the competitor is linked to a brand that owns it rather than to its own SponsorUnited brand (for example Apple for Apple Watch): either the scrape named a parent brand for a competitor with no brand of its own, or the matched brand's name is only part of the competitor's name. No synonym is written for such a link. A later scrape that matches the competitor to its own brand replaces the link, unless an admin has confirmed the link, renamed the competitor, or removed it. An admin who links or re-points the competitor clears this flag.
    - `score_at_decision` integer, nullable
    - `decided_at` string, date-time, nullable
    - `decided_by` object, nullable
      - `id` integer
      - `name` string, nullable
      - `email` string, nullable
    - `last_seen_at` string, date-time
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable

## Other responses

- `401`: Unauthenticated
- `403`: Forbidden
- `404`: Competitor not found, or removed
- `422`: Validation error: name without letters or digits, name longer than 255 characters once letters such as ß are spelled out, already linked to another brand, or already an unlinked competitor.

---

[API](https://skmtc.dev/sponsorunited/apis/sponsorunited-api.md) - [All operations](https://skmtc.dev/sponsorunited/apis/sponsorunited-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sponsorunited/apis/sponsorunited-api/revisions/cbf1ca5bff8f?raw)
