Rawi

API reference · Settings

Update brand & competitors

put/settings/brand
AuthenticationCustomer token (Bearer)
AccessFree user · Pro user

Customer token (Bearer) — free and paid users

Saves name variants, extra domains and competitors (order = importance). A competitor change rebuilds only competitor/comparison questions.

Request body

FieldTypeDescription
name_variants*string | null[]max 10, each max 100
extra_domains*string | null[]max 5 valid hosts
competitors*object[]1–5
competitors[].idinteger | nullUnique ID.
competitors[].name*string
competitors[].domainstring | nullSite domain.
Examplejson
{
  "name_variants": [
    "Avand",
    "آوند حساب",
    "اوند"
  ],
  "extra_domains": [
    "blog.avand.example"
  ],
  "competitors": [
    {
      "id": 163,
      "name": "نیک‌حساب",
      "domain": "nikhesab.example"
    },
    {
      "id": 164,
      "name": "ترازنو",
      "domain": "taraznoo.example"
    },
    {
      "id": 165,
      "name": "دفتریار",
      "domain": "daftaryar.example"
    },
    {
      "id": 166,
      "name": "رایان‌دفتر",
      "domain": "rayandaftar.example"
    },
    {
      "id": 167,
      "name": "مهرگان‌سیستم",
      "domain": "mehregan.example"
    }
  ]
}

Responses

200 — same as GET

FieldTypeDescription
name*string | null
domain*string | nullSite domain.
name_variants*any[]
extra_domains*any[]
competitors*object[]
competitors[].id*integerUnique ID.
competitors[].name*string
competitors[].domain*string | nullSite domain.
competitors[].position*integer
competitors[].source*string
json
{
  "…": "GET /settings/brand body after saving"
}

401 — Missing/invalid token, or a token of the wrong owner (admin token on a user route or vice versa): {"message":"…","code":"unauthenticated"} (message in the request language)

FieldType
message*string
codestring
json
{
  "message": "Please sign in to continue; your session has ended or is not valid.",
  "code": "unauthenticated"
}

422 — Validation failed (extra_domains.N, competitors.N.name (is the brand / duplicate), competitors.N.domain)

FieldType
message*string
errors*object
json
{
  "message": "",
  "errors": {
    "email": [
      "ایمیل معتبر نیست."
    ]
  }
}

curl example

bash
curl -X PUT 'http://127.0.0.1:8010/api/settings/brand' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "name_variants": [
    "Avand",
    "آوند حساب",
    "اوند"
  ],
  "extra_domains": [
    "blog.avand.example"
  ],
  "competitors": [
    {
      "id": 163,
      "name": "نیک‌حساب",
      "domain": "nikhesab.example"
    },
    {
      "id": 164,
      "name": "ترازنو",
      "domain": "taraznoo.example"
    },
    {
      "id": 165,
      "name": "دفتریار",
      "domain": "daftaryar.example"
    },
    {
      "id": 166,
      "name": "رایان‌دفتر",
      "domain": "rayandaftar.example"
    },
    {
      "id": 167,
      "name": "مهرگان‌سیستم",
      "domain": "mehregan.example"
    }
  ]
}'

Try it in the console