Skip to content
Start here

List Events

client.magicTransit.connectors.events.list(stringconnectorId, EventListParams { account_id, from, to, 3 more } params, RequestOptionsoptions?): EventListResponse { count, items, cursor }
GET/accounts/{account_id}/magic/connectors/{connector_id}/telemetry/events

List Events

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Magic WAN WriteMagic WAN Read
ParametersExpand Collapse
connectorId: string
params: EventListParams { account_id, from, to, 3 more }
account_id: string

Path param: Account identifier

maxLength32
from: number

Query param

to: number

Query param

cursor?: string

Query param

k?: string

Query param: Filter by event kind

limit?: number

Query param

ReturnsExpand Collapse
EventListResponse { count, items, cursor }
count: number
items: Array<Item>
a: number

Time the Event was collected (seconds since the Unix epoch)

k: string

Kind

n: number

Sequence number, used to order events with the same timestamp

t: number

Time the Event was recorded (seconds since the Unix epoch)

cursor?: string

List Events

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const events = await client.magicTransit.connectors.events.list('connector_id', {
  account_id: '023e105f4ecef8ad9ca31a8372d0c353',
  from: 0,
  to: 0,
});

console.log(events.count);
{
  "result": {
    "count": 0,
    "items": [
      {
        "a": 0,
        "k": "k",
        "n": 0,
        "t": 0
      }
    ],
    "cursor": "cursor"
  },
  "success": true,
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ]
}
Returns Examples
{
  "result": {
    "count": 0,
    "items": [
      {
        "a": 0,
        "k": "k",
        "n": 0,
        "t": 0
      }
    ],
    "cursor": "cursor"
  },
  "success": true,
  "errors": [
    {
      "code": 0,
      "message": "message"
    }
  ],
  "messages": [
    {
      "code": 0,
      "message": "message"
    }
  ]
}