## List packet capture requests `client.magicTransit.pcaps.list(PCAPListParamsparams, RequestOptionsoptions?): SinglePage` **get** `/accounts/{account_id}/pcaps` Lists all packet capture requests for an account. ### Parameters - `params: PCAPListParams` - `account_id: string` Identifier. ### Returns - `PCAPListResponse = PCAP | MagicVisibilityPCAPsPCAPsResponseFull` - `PCAP` - `id?: string` The ID for the packet capture. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `destination_address?: string` The destination IP address of the packet. - `destination_port?: number` The destination port of the packet. - `protocol?: number` The protocol number of the packet. - `source_address?: string` The source IP address of the packet. - `source_port?: number` The source port of the packet. - `offset_time?: string` The RFC 3339 offset timestamp from which to query backwards for packets. Must be within the last 24h. When this field is empty, defaults to time of request. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` - `MagicVisibilityPCAPsPCAPsResponseFull` - `id?: string` The ID for the packet capture. - `byte_limit?: number` The maximum number of bytes to capture. This field only applies to `full` packet captures. - `colo_name?: string` The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. - `destination_conf?: string` The full URI for the bucket. This field only applies to `full` packet captures. - `error_message?: string` An error message that describes why the packet capture failed. This field only applies to `full` packet captures. - `filter_v1?: PCAPFilter` The packet capture filter. When this field is empty, all packets are captured. - `packets_captured?: number` The number of packets captured. - `status?: "unknown" | "success" | "pending" | 5 more` The status of the packet capture request. - `"unknown"` - `"success"` - `"pending"` - `"running"` - `"conversion_pending"` - `"conversion_running"` - `"complete"` - `"failed"` - `stop_requested?: string` The RFC 3339 timestamp when stopping the packet capture was requested. This field only applies to `full` packet captures. - `submitted?: string` The RFC 3339 timestamp when the packet capture was created. - `system?: "magic-transit"` The system used to collect packet captures. - `"magic-transit"` - `time_limit?: number` The packet capture duration in seconds. - `type?: "simple" | "full"` The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - `"simple"` - `"full"` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const pcapListResponse of client.magicTransit.pcaps.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(pcapListResponse); } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": [ { "id": "66802ca5668e47a2b82c2e6746e45037", "filter_v1": { "destination_address": "1.2.3.4", "destination_port": 80, "protocol": 6, "source_address": "1.2.3.4", "source_port": 123 }, "offset_time": "2020-01-01T08:00:00Z", "status": "success", "submitted": "2020-01-01T08:00:00Z", "system": "magic-transit", "time_limit": 300, "type": "simple" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ```