GET
/
v3
/
events
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",
    withPayload: "true",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  // Handle the result
  console.log(result);
}

run();
{
  "events": [
    {
      "id": "uev_bfmMjiMnXfnPbT97dGdpJbCN",
      "text": "You logged in via GitHub",
      "entities": [
        {
          "type": "author",
          "start": 0,
          "end": 3
        }
      ],
      "createdAt": 1632859321020,
      "user": {
        "avatar": "<string>",
        "email": "<string>",
        "username": "<string>",
        "slug": "<string>",
        "uid": "<string>"
      },
      "principal": {
        "type": "user",
        "avatar": "<string>",
        "email": "<string>",
        "slug": "<string>",
        "uid": "<string>",
        "username": "<string>"
      },
      "via": [
        {
          "type": "user",
          "avatar": "<string>",
          "email": "<string>",
          "slug": "<string>",
          "uid": "<string>",
          "username": "<string>"
        }
      ],
      "userId": "zTuNVUXEAvvnNN3IaqinkyMw",
      "principalId": "<string>",
      "viaIds": [
        "<string>"
      ],
      "payload": {}
    }
  ]
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

limit
number

Maximum number of items which may be returned.

Example:

20

since
string

Timestamp to only include items created since then.

Example:

"2019-12-08T10:00:38.976Z"

until
string

Timestamp to only include items created until then.

Example:

"2019-12-09T23:00:38.976Z"

types
string

Comma-delimited list of event "types" to filter the results by.

Example:

"login,team-member-join,domain-buy"

userId
string

Deprecated. Use principalId instead. If principalId and userId both exist, principalId will be used.

Example:

"aeIInYVk59zbFF2SxfyxxmuO"

principalId
string

When retrieving events for a Team, the principalId parameter may be specified to filter events generated by a specific principal.

Example:

"aeIInYVk59zbFF2SxfyxxmuO"

withPayload
string

When set to true, the response will include the payload field for each event.

Example:

"true"

teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Response

200
application/json

Successful response.

events
object[]
required

Array of events generated by the User.

Array of events generated by the User.