Skip to content
Docs

List User Events

GEThttps://api.vercel.com/v3/events
Retrieves 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

limitnumberOptional
Maximum number of items which may be returned.
sincestringOptional
Timestamp to only include items created since then.
untilstringOptional
Timestamp to only include items created until then.
typesstringOptional
Comma-delimited list of event "types" to filter the results by.
userIdstringOptional
Deprecated. Use principalId instead. If principalId and userId both exist, principalId will be used.
principalIdstringOptional
When retrieving events for a Team, the principalId parameter may be specified to filter events generated by a specific principal.
projectIdsstringOptional
Comma-delimited list of project IDs to filter the results by.
entityIdstringOptional
Filters events to those associated with a specific entity (matched against payload.id). For example, a connector ID.
withPayloadstringOptional
When set to true, the response will include the payload field for each event.
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Successful response.
eventsarrayRequired
Array of events generated by the User.
400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
410Error