# snap_getBackgroundEvents

> Reference documentation for the `snap_getBackgroundEvents` method of the Snaps API.

<SnapsAPIReference method={{"name":"snap_getBackgroundEvents","description":"Get the scheduled background events for the Snap.","parameters":{"kind":"primitive","type":"null","description":"This method does not accept any parameters."},"result":{"kind":"array","type":"{ id: string; scheduledAt: string; snapId: SnapId; date: string; request: { method: string; jsonrpc?: \"2.0\" | null; id?: number | string | null; params?: JsonRpcParams } }[]","description":"An array of scheduled background events.","element":{"kind":"object","type":"{ id: string; scheduledAt: string; snapId: SnapId; date: string; request: { method: string; jsonrpc?: \"2.0\" | null; id?: number | string | null; params?: JsonRpcParams } }","description":"Background event type.\n\nNote: The date generated when scheduling an event with a duration will be\nrepresented in UTC.","required":false,"properties":[{"kind":"primitive","type":"string","description":"The unique ID representing the event.","name":"id"},{"kind":"primitive","type":"string","description":"The ISO 8601 timestamp of when the event was\nscheduled.","name":"scheduledAt"},{"kind":"primitive","type":"SnapId","description":"The ID of the Snap that scheduled the event.","name":"snapId"},{"kind":"primitive","type":"string","description":"The ISO 8601 date of when the event is scheduled for.","name":"date"},{"kind":"object","type":"{ method: string; jsonrpc?: \"2.0\" | null; id?: number | string | null; params?: JsonRpcParams }","description":"The request that is supplied to the `onCronjob` handler\nwhen the event is fired.","required":false,"properties":[{"kind":"primitive","type":"string","description":"The method to be called when the event is fired.","name":"method"},{"kind":"primitive","type":"\"2.0\" | null","description":"The optional JSON-RPC version for the request, which is always \"2.0\" if\nprovided.","name":"jsonrpc"},{"kind":"primitive","type":"number | string | null","description":"The optional ID for the request.","name":"id"},{"kind":"primitive","type":"JsonRpcParams","description":"The optional parameters for the request.","name":"params"}],"name":"request"}]}},"subjectTypes":["snap"],"examples":[{"examples":[{"language":"ts","content":"const events = await snap.request({\n  method: 'snap_getBackgroundEvents',\n})\nconsole.log(events)\n// [\n//   {\n//     id: 'event-1',\n//     scheduledAt: 1672531200000,\n//     snapId: 'npm:example-snap',\n//     date: 1672531200000,\n//     request: {\n//       method: 'example_method',\n//       params: { example: 'data' },\n//     },\n//   },\n//   ...,\n// ]\n"}]}],"restricted":false}}  />
