Files
netbird-docs/docs/api/list-all-events.api.mdx
2023-04-26 15:06:59 +02:00

54 lines
8.8 KiB
Plaintext

---
id: list-all-events
title: "List all Events"
description: "Returns a list of all events"
sidebar_label: "List all Events"
hide_title: true
hide_table_of_contents: true
api: {"description":"Returns a list of all events","tags":["Events"],"security":[{"BearerAuth":[]},{"TokenAuth":[]}],"responses":{"200":{"description":"A JSON Array of Events","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"description":"Event unique identifier","type":"string"},"timestamp":{"description":"The date and time when the event occurred","type":"string","format":"date-time"},"activity":{"description":"The activity that occurred during the event","type":"string"},"activity_code":{"description":"The string code of the activity that occurred during the event","type":"string","enum":["user.peer.delete","user.join","user.invite","user.peer.add","user.group.add","user.group.delete","user.role.update","setupkey.peer.add","setupkey.add","setupkey.update","setupkey.revoke","setupkey.overuse","setupkey.group.delete","setupkey.group.add","rule.add","rule.delete","rule.update","policy.add","policy.delete","policy.update","group.add","group.update","dns.setting.disabled.management.group.add","dns.setting.disabled.management.group.delete","account.create","account.setting.peer.login.expiration.update","account.setting.peer.login.expiration.disable","account.setting.peer.login.expiration.enable","route.add","route.delete","route.update","nameserver.group.add","nameserver.group.delete","nameserver.group.update","peer.ssh.disable","peer.ssh.enable","peer.rename","peer.login.expiration.disable","peer.login.expiration.enable"]},"initiator_id":{"description":"The ID of the initiator of the event. E.g., an ID of a user that triggered the event.","type":"string"},"target_id":{"description":"The ID of the target of the event. E.g., an ID of the peer that a user removed.","type":"string"},"meta":{"description":"The metadata of the event","type":"object","additionalProperties":{"type":"string"}}},"required":["id","timestamp","activity","activity_code","initiator_id","target_id","meta"],"title":"Event"}}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Requires authentication","content":{}},"403":{"description":"Forbidden","content":{}},"500":{"description":"Internal Server Error","content":{}}},"method":"get","path":"/api/events","servers":[{"url":"https://netbird.io","description":"Default server"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"TokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Prefix the value with \\\"Token\\\" to indicate the custom authorization type"}},"info":{"title":"NetBird REST API","description":"API to manipulate groups, rules, policies and retrieve information about peers and users","version":"0.0.1"},"postman":{"name":"List all Events","description":{"content":"Returns a list of all events","type":"text/plain"},"url":{"path":["api","events"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET","auth":{"type":"bearer","bearer":[{"type":"any","value":"<Bearer Token>","key":"token"}]}}}
sidebar_class_name: "get api-method"
info_path: api/netbird-rest-api
custom_edit_url: null
---
import ApiTabs from "@theme/ApiTabs";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import TabItem from "@theme/TabItem";
## List all Events
Returns a list of all events
<div><ApiTabs><TabItem label={"200"} value={"200"}><div>
A JSON Array of Events
</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Event unique identifier","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"timestamp"} required={true} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"The date and time when the event occurred","type":"string","format":"date-time"}}></SchemaItem><SchemaItem collapsible={false} name={"activity"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The activity that occurred during the event","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"activity_code"} required={true} schemaName={"string"} qualifierMessage={"**Possible values:** [`user.peer.delete`, `user.join`, `user.invite`, `user.peer.add`, `user.group.add`, `user.group.delete`, `user.role.update`, `setupkey.peer.add`, `setupkey.add`, `setupkey.update`, `setupkey.revoke`, `setupkey.overuse`, `setupkey.group.delete`, `setupkey.group.add`, `rule.add`, `rule.delete`, `rule.update`, `policy.add`, `policy.delete`, `policy.update`, `group.add`, `group.update`, `dns.setting.disabled.management.group.add`, `dns.setting.disabled.management.group.delete`, `account.create`, `account.setting.peer.login.expiration.update`, `account.setting.peer.login.expiration.disable`, `account.setting.peer.login.expiration.enable`, `route.add`, `route.delete`, `route.update`, `nameserver.group.add`, `nameserver.group.delete`, `nameserver.group.update`, `peer.ssh.disable`, `peer.ssh.enable`, `peer.rename`, `peer.login.expiration.disable`, `peer.login.expiration.enable`]"} schema={{"description":"The string code of the activity that occurred during the event","type":"string","enum":["user.peer.delete","user.join","user.invite","user.peer.add","user.group.add","user.group.delete","user.role.update","setupkey.peer.add","setupkey.add","setupkey.update","setupkey.revoke","setupkey.overuse","setupkey.group.delete","setupkey.group.add","rule.add","rule.delete","rule.update","policy.add","policy.delete","policy.update","group.add","group.update","dns.setting.disabled.management.group.add","dns.setting.disabled.management.group.delete","account.create","account.setting.peer.login.expiration.update","account.setting.peer.login.expiration.disable","account.setting.peer.login.expiration.enable","route.add","route.delete","route.update","nameserver.group.add","nameserver.group.delete","nameserver.group.update","peer.ssh.disable","peer.ssh.enable","peer.rename","peer.login.expiration.disable","peer.login.expiration.enable"]}}></SchemaItem><SchemaItem collapsible={false} name={"initiator_id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The ID of the initiator of the event. E.g., an ID of a user that triggered the event.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"target_id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The ID of the target of the event. E.g., an ID of the peer that a user removed.","type":"string"}}></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}}><summary style={{}}><strong>meta</strong><span style={{"opacity":"0.6"}}> object</span><strong style={{"fontSize":"var(--ifm-code-font-size)","color":"var(--openapi-required)"}}> required</strong></summary><div style={{"marginLeft":"1rem"}}><div style={{"marginTop":".5rem","marginBottom":".5rem"}}>
The metadata of the event
</div><li><div><code>property name*</code><span style={{"opacity":"0.6"}}> string</span></div></li></div></details></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"[\n {\n \"id\": \"string\",\n \"timestamp\": \"2023-04-26T12:12:56.650Z\",\n \"activity\": \"string\",\n \"activity_code\": \"user.peer.delete\",\n \"initiator_id\": \"string\",\n \"target_id\": \"string\",\n \"meta\": {}\n }\n]"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
Bad Request
</div><div></div></TabItem><TabItem label={"401"} value={"401"}><div>
Requires authentication
</div><div></div></TabItem><TabItem label={"403"} value={"403"}><div>
Forbidden
</div><div></div></TabItem><TabItem label={"500"} value={"500"}><div>
Internal Server Error
</div><div></div></TabItem></ApiTabs></div>