List User Events
GET
https://api.vercel.com/v3/eventsRetrieves a list of "events" generated by the User on Vercel. Events are generated when the User performs a particular action, such as logging in, creating a deployment, and joining a Team (just to name a few). When the
teamId parameter is supplied, then the events that are returned will be in relation to the Team that was specified.Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.user.listUserEvents({ limit: 20, since: "2019-12-08T10:00:38.976Z", until: "2019-12-09T23:00:38.976Z", types: "login,team-member-join,domain-buy", userId: "aeIInYVk59zbFF2SxfyxxmuO", principalId: "aeIInYVk59zbFF2SxfyxxmuO", projectIds: "aeIInYVk59zbFF2SxfyxxmuO", entityId: "scl_123", withPayload: "true", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
{ "events": [ { "categories": [], "createdAt": "1632859321020", "entities": [ { "end": "3", "start": "0", "type": "author" } ], "id": "uev_bfmMjiMnXfnPbT97dGdpJbCN", "payload": "value", "principal": { "avatar": "string", "email": "user@example.com", "slug": "string", "type": "user", "uid": "example_id", "username": "string" }, "principalId": "example_id", "requestId": "example_id", "sessionId": "example_id", "text": "You logged in via GitHub", "tokenId": "example_id", "type": "login", "user": { "avatar": "string", "email": "user@example.com", "slug": "string", "uid": "example_id", "username": "string" }, "userId": "zTuNVUXEAvvnNN3IaqinkyMw", "via": [ { "avatar": "string", "email": "user@example.com", "slug": "string", "type": "user", "uid": "example_id", "username": "string" } ], "viaIds": [] } ]}AuthorizationbearerToken
Default authentication mechanism
Deprecated. Use
principalId instead. If principalId and userId both exist, principalId will be used.When retrieving events for a Team, the
principalId parameter may be specified to filter events generated by a specific principal.Filters events to those associated with a specific entity (matched against
payload.id). For example, a connector ID.When set to
true, the response will include the payload field for each event.