Beta.Observability.Campaigns

March 9, 2026 ยท View on GitHub

Overview

Available Operations

  • create - Create and start a new campaign
  • list - Get all campaigns
  • fetch - Get campaign by id
  • delete - Delete a campaign
  • fetch_status - Get campaign status by campaign id
  • list_events - Get event ids that were selected by the given campaign

create

Create and start a new campaign

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.campaigns.create(search_params={
        "filters": {
            "field": "<value>",
            "op": "lt",
            "value": "<value>",
        },
    }, judge_id="9b501b9f-3525-44a7-a51a-5352679be9ed", name="<value>", description="shakily triangular scotch requirement whether once oh", max_nb_events=232889)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
search_paramsmodels.FilterPayload:heavy_check_mark:N/A
judge_idstr:heavy_check_mark:N/A
namestr:heavy_check_mark:N/A
descriptionstr:heavy_check_mark:N/A
max_nb_eventsint:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.Campaign

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

list

Get all campaigns

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.campaigns.list(page_size=50, page=1)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
page_sizeOptional[int]:heavy_minus_sign:N/A
pageOptional[int]:heavy_minus_sign:N/A
qOptionalNullable[str]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.ListCampaignsResponse

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

fetch

Get campaign by id

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.campaigns.fetch(campaign_id="fd7945d6-00e2-4852-9054-bcbb968d7f98")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
campaign_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.Campaign

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

delete

Delete a campaign

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    mistral.beta.observability.campaigns.delete(campaign_id="90e07b45-8cf7-4081-8558-a786779e039d")

    # Use the SDK ...

Parameters

ParameterTypeRequiredDescription
campaign_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

fetch_status

Get campaign status by campaign id

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.campaigns.fetch_status(campaign_id="4b1dd9a5-8dc9-48e1-bd11-29443e959902")

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
campaign_idstr:heavy_check_mark:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.FetchCampaignStatusResponse

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*

list_events

Get event ids that were selected by the given campaign

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.campaigns.list_events(campaign_id="305b5e46-a650-4d8a-8b5b-d23ef90ec831", page_size=50, page=1)

    # Handle response
    print(res)

Parameters

ParameterTypeRequiredDescription
campaign_idstr:heavy_check_mark:N/A
page_sizeOptional[int]:heavy_minus_sign:N/A
pageOptional[int]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.ListCampaignSelectedEventsResponse

Errors

Error TypeStatus CodeContent Type
errors.ObservabilityError400, 404, 408, 409, 422application/json
errors.SDKError4XX, 5XX*/*