Skip to content
Docs

Record an artifacts cache usage event

POSThttps://api.vercel.com/v8/artifacts/events
Records an artifacts cache usage event. The body of this request is an array of cache usage events. The supported event types are HIT and MISS. The source is either LOCAL the cache event was on the users filesystem cache or REMOTE if the cache event is for a remote cache. When the event is a HIT the request also accepts a number duration which is the time taken to generate the artifact in the cache.
Request
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: "REMOTE",
event: "MISS",
hash: "12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
duration: 400,
},
],
});
}
run();
Response
{}
AuthorizationbearerToken

Default authentication mechanism

teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
x-artifact-client-cistringOptional
The continuous integration or delivery environment where this artifact is downloaded.
x-artifact-client-interactiveintegerOptional
1 if the client is an interactive shell. Otherwise 0
200Success. Event recorded.
400One of the provided values in the request body is invalid. One of the provided values in the headers is invalid
401The request is not authorized.
402The account is missing a payment so payment method must be updated
403The customer has reached their spend cap limit and has been paused. An owner can disable the cap or raise the limit in settings. The Remote Caching usage limit has been reached for this account for this billing cycle. Remote Caching has been disabled for this team or user. An owner can enable it in the billing settings. You do not have permission to access this resource.
410Error