Launch Week 02 wrapped — explore all five launches

Update Collection

PUThttps://api.confident-ai.com/v1/metric-collections/{metricCollectionId}

Updates a metric collection. Only the fields you send are changed, and metricSettings replaces the whole list rather than merging into it.

PUT/v1/metric-collections/{metricCollectionId}
curl -X PUT "https://api.confident-ai.com/v1/metric-collections/{metricCollectionId}" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "New Collection Name"
}'
200
{
  "success": true,
  "data": {
    "id": "COLLECTION-ID",
    "metricCollection": {
      "id": "COLLECTION-ID",
      "name": "Collection Name",
      "multiTurn": false,
      "sampleRate": 1,
      "inputTransformerId": null,
      "outputTransformerId": null,
      "metricsSettings": [
        {
          "metric": {
            "name": "Answer Relevancy"
          },
          "activated": true,
          "threshold": 0.8,
          "includeReason": true,
          "strictMode": false,
          "sampleRate": 1,
          "evaluationModelProvider": null,
          "evaluationModelName": null
        }
      ]
    }
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • metricCollectionIdstringRequired

    The id of the metric collection you want to update.

Request body

  • namestring

    The name of the metric collection, which must be unique within your project.

  • metricSettingslist of objects

    Replaces every metric setting on the collection. Fetch the collection first and resend each metric it should keep.

    Show 8 propertiesHide 8 properties
    • metricobjectRequired

      This is a metric object, which contains the metric name.

      Show 1 propertyHide 1 property
      • namestringRequired

        This is the name of the metric.

    • activatedboolean

      This determines if the metric is activated. Only activated metrics are used for evaluations. Non-activated metrics are skipped.

    • thresholdnumber

      This determines the threshold for the metric which determines if the metric passes or fails depending on if the metric score is equal or greater than the threshold.

    • includeReasonboolean

      This determines if the reason for the metric score should be generated during evaluations.

    • strictModeboolean

      This determines if the metric is in strict mode. Metrics in strict mode output a binary score of 0 or 1, indicating pass or fail, as opposed to a continuous score from 0 to 1.

    • sampleRatenumber

      This determines the probability of the metric being ran for evaluation.

    • evaluationModelProviderenum

      Evaluates this metric with your own model instead of the project default.

      Show 18 enum valuesHide 18 enum values
      • OPEN_AI
      • CUSTOM
      • CONFIDENT_AI
      • BEDROCK
      • ANTHROPIC
      • GEMINI
      • X_AI
      • DEEPSEEK
      • MOONSHOT_AI
      • VERTEX_AI
      • AZURE
      • MISTRAL
      • PERPLEXITY
      • OPEN_ROUTER
      • PORTKEY
      • LITE_LLM
      • TRUE_FOUNDRY
      • HUGGING_FACE
    • evaluationModelNamestring

      The model to use, required whenever evaluationModelProvider is set to anything other than CONFIDENT_AI.

  • sampleRatenumber

    The share of eligible entities the whole collection is run against, between 0 and 1. Applied on top of each metric's own sampleRate.

  • inputTransformerIdstring

    A transformer that reshapes the payload before evaluation. Ids come from the transformers endpoint. Send null to unset it.

  • outputTransformerIdstring

    A transformer that reshapes the result after evaluation. Send null to unset it.

Response

The updated metric collection.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    The metric collection. Create and update also return its id alongside it.

    Show 1 propertyHide 1 property
    • metricCollectionobject

      A metric collection and the metrics configured inside it.

      Show 7 propertiesHide 7 properties
      • idstring

        This is the id of the metric collection.

      • namestring

        This is the name of the metric collection, which should be supplied to the evals API to run evaluations remotely.

      • multiTurnboolean

        This is true if the metric collection is a multi-turn collection, which only contains multi-turn metrics for multi-turn evaluations.

      • sampleRatenumber

        The share of eligible entities the collection is run against.

      • inputTransformerIdstring

        The transformer that reshapes the payload before evaluation, if one is set.

      • outputTransformerIdstring

        The transformer that reshapes the result after evaluation, if one is set.

      • metricsSettingslist of objects

        The settings for each metric in the collection, which can also be configured on Confident AI's metric collection page.

        Show 8 propertiesHide 8 properties
        • metricobject

          This is a metric object, which contains the metric name.

          Show 1 propertyHide 1 property
          • namestring

            This is the name of the metric.

        • activatedboolean

          This is true if the metric is activated. Only activated metrics are used for evaluations. Non-activated metrics are skipped.

        • thresholdnumber

          This is the threshold for the metric, which determines if the metric passes or fails depending on if the metric score is above or below the threshold.

        • includeReasonboolean

          This is true if the reason for the metric score is generated during evaluations.

        • strictModeboolean

          This is true if the metric is in strict mode. Metrics in strict mode output a binary score of 0 or 1, indicating pass or fail, as opposed to a continuous score from 0 to 1.

        • sampleRatenumber

          This is the probability of the metric being ran for evaluation.

        • evaluationModelProviderenum

          The provider of the model this metric is evaluated with, if it overrides the project default.

          Show 18 enum valuesHide 18 enum values
          • OPEN_AI
          • CUSTOM
          • CONFIDENT_AI
          • BEDROCK
          • ANTHROPIC
          • GEMINI
          • X_AI
          • DEEPSEEK
          • MOONSHOT_AI
          • VERTEX_AI
          • AZURE
          • MISTRAL
          • PERPLEXITY
          • OPEN_ROUTER
          • PORTKEY
          • LITE_LLM
          • TRUE_FOUNDRY
          • HUGGING_FACE
        • evaluationModelNamestring

          The model this metric is evaluated with, if it overrides the project default.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI