# Beta.Observability.Campaigns ## Overview ### Available Operations * [create](#create) - Create and start a new campaign * [list](#list) - Get all campaigns * [fetch](#fetch) - Get campaign by id * [delete](#delete) - Delete a campaign * [fetchStatus](#fetchstatus) - Get campaign status by campaign id * [listEvents](#listevents) - Get event ids that were selected by the given campaign ## create Create and start a new campaign ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.beta.observability.campaigns.create({ searchParams: { filters: { field: "", op: "lt", value: "", }, }, judgeId: "9b501b9f-3525-44a7-a51a-5352679be9ed", name: "", description: "shakily triangular scotch requirement whether once oh", maxNbEvents: 232889, }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaObservabilityCampaignsCreate } from "@mistralai/mistralai/funcs/betaObservabilityCampaignsCreate.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaObservabilityCampaignsCreate(mistral, { searchParams: { filters: { field: "", op: "lt", value: "", }, }, judgeId: "9b501b9f-3525-44a7-a51a-5352679be9ed", name: "", description: "shakily triangular scotch requirement whether once oh", maxNbEvents: 232889, }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaObservabilityCampaignsCreate failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [components.CreateCampaignRequest](../../models/components/createcampaignrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.Campaign](../../models/components/campaign.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## list Get all campaigns ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.beta.observability.campaigns.list({}); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaObservabilityCampaignsList } from "@mistralai/mistralai/funcs/betaObservabilityCampaignsList.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaObservabilityCampaignsList(mistral, {}); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaObservabilityCampaignsList failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetCampaignsV1ObservabilityCampaignsGetRequest](../../models/operations/getcampaignsv1observabilitycampaignsgetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.ListCampaignsResponse](../../models/components/listcampaignsresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## fetch Get campaign by id ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.beta.observability.campaigns.fetch({ campaignId: "fd7945d6-00e2-4852-9054-bcbb968d7f98", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaObservabilityCampaignsFetch } from "@mistralai/mistralai/funcs/betaObservabilityCampaignsFetch.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaObservabilityCampaignsFetch(mistral, { campaignId: "fd7945d6-00e2-4852-9054-bcbb968d7f98", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaObservabilityCampaignsFetch failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetCampaignByIdV1ObservabilityCampaignsCampaignIdGetRequest](../../models/operations/getcampaignbyidv1observabilitycampaignscampaignidgetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.Campaign](../../models/components/campaign.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## delete Delete a campaign ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { await mistral.beta.observability.campaigns.delete({ campaignId: "90e07b45-8cf7-4081-8558-a786779e039d", }); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaObservabilityCampaignsDelete } from "@mistralai/mistralai/funcs/betaObservabilityCampaignsDelete.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaObservabilityCampaignsDelete(mistral, { campaignId: "90e07b45-8cf7-4081-8558-a786779e039d", }); if (res.ok) { const { value: result } = res; } else { console.log("betaObservabilityCampaignsDelete failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.DeleteCampaignV1ObservabilityCampaignsCampaignIdDeleteRequest](../../models/operations/deletecampaignv1observabilitycampaignscampaigniddeleterequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## fetchStatus Get campaign status by campaign id ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.beta.observability.campaigns.fetchStatus({ campaignId: "4b1dd9a5-8dc9-48e1-bd11-29443e959902", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaObservabilityCampaignsFetchStatus } from "@mistralai/mistralai/funcs/betaObservabilityCampaignsFetchStatus.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaObservabilityCampaignsFetchStatus(mistral, { campaignId: "4b1dd9a5-8dc9-48e1-bd11-29443e959902", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaObservabilityCampaignsFetchStatus failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `request` | [operations.GetCampaignStatusByIdV1ObservabilityCampaignsCampaignIdStatusGetRequest](../../models/operations/getcampaignstatusbyidv1observabilitycampaignscampaignidstatusgetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.FetchCampaignStatusResponse](../../models/components/fetchcampaignstatusresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | ## listEvents Get event ids that were selected by the given campaign ### Example Usage ```typescript import { Mistral } from "@mistralai/mistralai"; const mistral = new Mistral({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const result = await mistral.beta.observability.campaigns.listEvents({ campaignId: "305b5e46-a650-4d8a-8b5b-d23ef90ec831", }); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { MistralCore } from "@mistralai/mistralai/core.js"; import { betaObservabilityCampaignsListEvents } from "@mistralai/mistralai/funcs/betaObservabilityCampaignsListEvents.js"; // Use `MistralCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const mistral = new MistralCore({ apiKey: process.env["MISTRAL_API_KEY"] ?? "", }); async function run() { const res = await betaObservabilityCampaignsListEvents(mistral, { campaignId: "305b5e46-a650-4d8a-8b5b-d23ef90ec831", }); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("betaObservabilityCampaignsListEvents failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `request` | [operations.GetCampaignSelectedEventsV1ObservabilityCampaignsCampaignIdSelectedEventsGetRequest](../../models/operations/getcampaignselectedeventsv1observabilitycampaignscampaignidselectedeventsgetrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.ListCampaignSelectedEventsResponse](../../models/components/listcampaignselectedeventsresponse.md)\>** ### Errors | Error Type | Status Code | Content Type | | ------------------------- | ------------------------- | ------------------------- | | errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* |