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

# Update Ranking

> Replaces a ranking. The ranking `id` is taken from the URL path.



## OpenAPI

````yaml /openapi/search-tools.json put /api/rankings/{rankingId}
openapi: 3.1.0
info:
  title: Cludo Search Tools API
  version: 4.0.0
  description: >-
    Manage search experience tools: banners, rankings, quicklinks, and synonym
    groups for Cludo search engines.
servers:
  - url: https://api.cludo.com
    description: EU region (Customer IDs below 10,000,000)
  - url: https://api-us1.cludo.com
    description: US region (Customer IDs 10,000,000 and above)
security:
  - BasicAuth: []
paths:
  /api/rankings/{rankingId}:
    put:
      summary: Update Ranking
      description: Replaces a ranking. The ranking `id` is taken from the URL path.
      operationId: updateRanking
      parameters:
        - $ref: '#/components/parameters/rankingId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RankingUpdate'
      responses:
        '200':
          description: Ranking updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ranking'
        '400':
          description: >-
            The request body failed validation. Each key in the response is the
            JSON path of the offending field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Ranking not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BasicAuth: []
components:
  parameters:
    rankingId:
      name: rankingId
      in: path
      required: true
      description: Numeric id of an existing ranking rule set.
      schema:
        type: integer
  schemas:
    RankingUpdate:
      type: object
      description: >-
        Ranking update payload. The ranking `id` is taken from the URL path; any
        `id` in the body is ignored.
      required:
        - name
        - WebsiteId
      properties:
        name:
          type: string
          description: Display name for the ranking set.
        WebsiteId:
          type: integer
          description: Search engine ID this ranking belongs to.
        pages:
          type: array
          items:
            $ref: '#/components/schemas/RankingPage'
          description: >-
            Replace the ranking's full page list with this array. Pages not
            included are removed.
        rankingterms:
          type: array
          items:
            $ref: '#/components/schemas/RankingTerm'
          description: >-
            Replace the ranking's full trigger term list with this array. Terms
            not included are removed.
        audiences:
          type:
            - array
            - 'null'
          items: true
          description: >-
            Audience targeting configuration. Omit the field entirely (or send
            `null`) when the ranking is not audience-targeted.
    Ranking:
      type: object
      required:
        - name
        - WebsiteId
      properties:
        id:
          type: integer
          description: Ranking ID (assigned by server on create).
        name:
          type: string
          description: Label for this ranking group in the dashboard.
        pages:
          type: array
          items:
            $ref: '#/components/schemas/RankingPage'
          description: URLs and weights for pinned or boosted results.
        rankingterms:
          type: array
          items:
            $ref: '#/components/schemas/RankingTerm'
          description: Terms that activate this ranking configuration.
        WebsiteId:
          type: integer
          description: Search engine ID.
        brokenLinksFoundAt:
          type:
            - string
            - 'null'
          description: Managed by the Cludo backend; informational only.
        audiences:
          type:
            - array
            - 'null'
          items: {}
          description: >-
            Audience targeting configuration. Omit the field entirely (or send
            `null`) when the ranking is not audience-targeted.
    ValidationErrorResponse:
      type: object
      description: >-
        Per-field validation errors. Each key is the JSON path of the offending
        property (using the controller parameter name as the root) and the value
        is an array of error messages for that field. May also include a
        `general` key for non-field-specific messages.
      additionalProperties:
        type: array
        items:
          type: string
      example:
        viewModel.pages[0]:
          - The Url field is required.
    ErrorResponse:
      type: object
      description: Error response returned when a request fails.
      properties:
        message:
          type: string
          description: A message describing what went wrong.
    RankingPage:
      type: object
      required:
        - rank
        - showpage
        - page
      properties:
        rank:
          type: integer
          example: 1
          description: >-
            Position the page should appear in for matching searches. `1` pins
            it to the top.
        showpage:
          type: boolean
          description: >-
            When false, the page is hidden from results that trigger this
            ranking instead of boosted.
        websiteid:
          type: integer
          description: Engine ID (must match the parent ranking's `WebsiteId`).
        page:
          $ref: '#/components/schemas/Page'
          description: The page being ranked.
    RankingTerm:
      type: object
      required:
        - name
      additionalProperties: false
      properties:
        name:
          type: string
          description: >-
            Search term that activates this ranking when the user's query
            matches.
    UnauthorizedError:
      type: object
      description: Returned when authentication fails.
      properties:
        message:
          type: string
          description: Authentication failure reason.
    ServerError:
      type: object
      description: Returned when an unexpected server error occurs.
      properties:
        status:
          type: string
          description: HTTP status name.
        code:
          type: integer
          description: HTTP status code.
        messages:
          type: array
          items:
            type: string
          description: Error details, usually including a support reference id.
    Page:
      type: object
      required:
        - name
        - pageid
        - pageurl
      properties:
        name:
          type: string
          description: Title to display for the page in search results.
        pageid:
          type: string
          description: Stable identifier for the page; typically the canonical URL.
        pageurl:
          type: string
          description: Full URL the user is sent to when they click the result.
        searchable:
          type: boolean
          description: Whether the page is indexed and discoverable in search.
        websiteid:
          type: integer
          description: >-
            Engine ID the page belongs to (must match the parent ranking's
            `WebsiteId`).
  responses:
    Unauthorized:
      description: >-
        Authentication failed. The Authorization header is missing or contains
        invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedError'
          example:
            message: unauthorized
    InternalServerError:
      description: >-
        An unexpected server error occurred. If this persists, contact
        support@cludo.com.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
          example:
            status: InternalServerError
            code: 500
            messages:
              - >-
                Error occur. Please contact support with error ID:
                a1b2c3d4-e5f6-7890-abcd-ef1234567890
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication. Use your Customer ID as the username and API Key
        as the password. Example header: `Authorization: Basic
        MTIzNDU2NzpteS1hcGkta2V5`.

````