---
title: "Fetch success rate for an entity"
method: POST
path: "/success_rate.SuccessRateCalculator/FetchSuccessRate"
tags: ["Success Rate"]
---

# Fetch success rate for an entity

`POST /success_rate.SuccessRateCalculator/FetchSuccessRate`

Calculates success rate for an entity based on provided parameters and labels

## Headers

- `x-tenant-id` string, required
- `x-profile-id` string, required
- `x-api-key` string, required

## Request body

- CalSuccessRateRequest
  - `id` string, required — Entity identifier
  - `params` string, required — Parameters on which success rate scores has to be maintained
  - `labels` string[], required — Labels for which to calculate success rates
  - `config` CalSuccessRateConfig
    - `min_aggregates_size` integer, required
    - `default_success_rate` number, double, required
    - `specificity_level` 'ENTITY' | 'GLOBAL' — Defines the specificity level to be used for calculating the success rate.

## Response `200`

Success rate calculated successfully

- CalSuccessRateResponse
  - `labels_with_score` LabelWithScore[] — List of labels with their calculated success rates
    - LabelWithScoreList[]
      - `score` number, double, required — Calculated success rate score
      - `label` string, required — Label identifier
  - `routing_approach` 'EXPLORATION' | 'EXPLOITATION' — Defines the routing approach based on the success rate calculation.

## Other responses

- `400` — Invalid request parameters
- `500` — Internal server error

---

[API](https://skmtc.net/hyperswitch/apis/dynamic-routing-openapi-3-0.md) · [All operations](https://skmtc.net/hyperswitch/apis/dynamic-routing-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hyperswitch/dynamic-routing-openapi-3-0/revisions/8fbf69ab2597/schema)
