## Update a Dataset `client.aiGateway.datasets.update(stringgatewayId, stringid, DatasetUpdateParamsparams, RequestOptionsoptions?): DatasetUpdateResponse` **put** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/datasets/{id}` Updates an existing AI Gateway dataset. ### Parameters - `gatewayId: string` gateway id - `id: string` - `params: DatasetUpdateParams` - `account_id: string` Path param - `enable: boolean` Body param - `filters: Array` Body param - `key: "created_at" | "request_content_type" | "response_content_type" | 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" | "contains" | "lt" | "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: Array` - `string` - `number` - `boolean` - `name: string` Body param ### Returns - `DatasetUpdateResponse` - `id: string` - `created_at: string` - `enable: boolean` - `filters: Array` - `key: "created_at" | "request_content_type" | "response_content_type" | 10 more` - `"created_at"` - `"request_content_type"` - `"response_content_type"` - `"success"` - `"cached"` - `"provider"` - `"model"` - `"cost"` - `"tokens"` - `"tokens_in"` - `"tokens_out"` - `"duration"` - `"feedback"` - `operator: "eq" | "contains" | "lt" | "gt"` - `"eq"` - `"contains"` - `"lt"` - `"gt"` - `value: Array` - `string` - `number` - `boolean` - `gateway_id: string` gateway id - `modified_at: string` - `name: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const dataset = await client.aiGateway.datasets.update('my-gateway', 'id', { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', enable: true, filters: [ { key: 'created_at', operator: 'eq', value: ['string'], }, ], name: 'name', }); console.log(dataset.id); ``` #### Response ```json { "result": { "id": "id", "created_at": "2019-12-27T18:11:19.117Z", "enable": true, "filters": [ { "key": "created_at", "operator": "eq", "value": [ "string" ] } ], "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name" }, "success": true } ```