POST
/
v8
/
artifacts
/
events
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  await vercel.artifacts.recordEvents({
    xArtifactClientCi: "VERCEL",
    xArtifactClientInteractive: 0,
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: [
      {
        sessionId: "<id>",
        source: "LOCAL",
        event: "HIT",
        hash: "12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
        duration: 400,
      },
    ],
  });


}

run();
This response does not have an example.

Authorizations

Authorization
string
header
required

Default authentication mechanism

Headers

x-artifact-client-ci
string

The continuous integration or delivery environment where this artifact is downloaded.

Maximum length: 50
Example:

"VERCEL"

x-artifact-client-interactive
integer

1 if the client is an interactive shell. Otherwise 0

Required range: 0 <= x <= 1
Example:

0

Query Parameters

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"

Body

application/json · object[]
sessionId
string
required

A UUID (universally unique identifer) for the session that generated this event.

source
enum<string>
required

One of LOCAL or REMOTE. LOCAL specifies that the cache event was from the user's filesystem cache. REMOTE specifies that the cache event is from a remote cache.

Available options:
LOCAL,
REMOTE
event
enum<string>
required

One of HIT or MISS. HIT specifies that a cached artifact for hash was found in the cache. MISS specifies that a cached artifact with hash was not found.

Available options:
HIT,
MISS
hash
string
required

The artifact hash

Example:

"12HKQaOmR5t5Uy6vdcQsNIiZgHGB"

duration
number

The time taken to generate the artifact. This should be sent as a body parameter on HIT events.

Example:

400

Response

200
_mintlify/placeholder

Success. Event recorded.